[libc-commits] [libc] 490958b - [libc][obvious] Actually return the value from `malloc` for NVPTX

Joseph Huber via libc-commits libc-commits at lists.llvm.org
Thu Jun 15 13:13:20 PDT 2023


Author: Joseph Huber
Date: 2023-06-15T15:13:11-05:00
New Revision: 490958b9eabc8e345fd2d88742e832984dd8643a

URL: https://github.com/llvm/llvm-project/commit/490958b9eabc8e345fd2d88742e832984dd8643a
DIFF: https://github.com/llvm/llvm-project/commit/490958b9eabc8e345fd2d88742e832984dd8643a.diff

LOG: [libc][obvious] Actually return the value from `malloc` for NVPTX

Switching to this interface we neglected to actually write the output
from the malloc call to the RPC buffer. Fix this so the tests pass
again.

Differential Revision: https://reviews.llvm.org/D153069

Added: 
    

Modified: 
    libc/utils/gpu/loader/nvptx/Loader.cpp

Removed: 
    


################################################################################
diff  --git a/libc/utils/gpu/loader/nvptx/Loader.cpp b/libc/utils/gpu/loader/nvptx/Loader.cpp
index 7526381d0622f..2cf4d66938ed3 100644
--- a/libc/utils/gpu/loader/nvptx/Loader.cpp
+++ b/libc/utils/gpu/loader/nvptx/Loader.cpp
@@ -190,6 +190,7 @@ CUresult launch_kernel(CUmodule binary, CUstream stream,
           // Wait until the memory allocation is complete.
           while (cuStreamQuery(memory_stream) == CUDA_ERROR_NOT_READY)
             ;
+          buffer->data[0] = static_cast<uintptr_t>(dev_ptr);
         };
         rpc_recv_and_send(port, malloc_handler, data);
       },


        


More information about the libc-commits mailing list