[libc-commits] [PATCH] D153069: [libc][obvious] Actually return the value from `malloc` for NVPTX

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


jhuber6 created this revision.
Herald added subscribers: libc-commits, mattd, gchakrabarti, asavonic.
Herald added projects: libc-project, All.
jhuber6 requested review of this revision.

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.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D153069

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


Index: libc/utils/gpu/loader/nvptx/Loader.cpp
===================================================================
--- libc/utils/gpu/loader/nvptx/Loader.cpp
+++ libc/utils/gpu/loader/nvptx/Loader.cpp
@@ -190,6 +190,7 @@
           // 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);
       },


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D153069.531886.patch
Type: text/x-patch
Size: 507 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/libc-commits/attachments/20230615/a81e615d/attachment.bin>


More information about the libc-commits mailing list