[libc][obvious] Actually return the value from `malloc` for NVPTX
authorJoseph Huber <jhuber6@vols.utk.edu>
Thu, 15 Jun 2023 20:12:10 +0000 (15:12 -0500)
committerJoseph Huber <jhuber6@vols.utk.edu>
Thu, 15 Jun 2023 20:13:11 +0000 (15:13 -0500)
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

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

index 7526381d0622f1bd3126b1d6e4a0be1f660ca8d1..2cf4d66938ed3f38976169a443209072249266e7 100644 (file)
@@ -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);
       },