[libc-commits] [PATCH] D146681: [libc] Add a loader utility for NVPTX architectures for testing

Joseph Huber via Phabricator via libc-commits libc-commits at lists.llvm.org
Thu Mar 23 11:26:28 PDT 2023


jhuber6 added inline comments.


================
Comment at: libc/utils/gpu/loader/Loader.h:21
+/// Copy the system's argument vector to GPU memory allocated using \p alloc.
+template <typename Allocator>
+void *copy_argument_vector(int argc, char **argv, Allocator alloc) {
----------------
JonChesterfield wrote:
> I'd expect this to catch returning 0/null and propagate that from the interface. Shared memory feels more likely to run out than address space.
> 
> Might be worth rewriting this to a single alloc - on HSA each of those allocations will be rounded up to a multiple of 4k internally.
> 
> Doing both would mean we can return null on failure without have to pass a deallocator along for the failure path.
> 
> Not blocking at this time though, it's probably difficult to hit that exhaustion from libc startup.
That's a good point, we should be able to allocate a single big block which would be more efficient. But for testing purposes it's likely not to be an issue. We can adjust it later.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D146681/new/

https://reviews.llvm.org/D146681



More information about the libc-commits mailing list