[libc-commits] [PATCH] D149581: [libc] Change GPU startup and loader to use multiple kernels

Jon Chesterfield via Phabricator via libc-commits libc-commits at lists.llvm.org
Wed May 3 17:44:47 PDT 2023


JonChesterfield added a comment.

Splitting into three kernels seems better. These implementations are very heavily copy&pasted between amdgpu and nvptx though. A bunch of stuff is inherently target specific, notably the kernel launch machinery, but things like the kernel argument structs are very easily factored into a header, and I think start.cpp are ~ a hundred lines of fairly subtle code that is identical on nvptx&amdgpu except for the spelling of kernel calling convention. I think that would be worth cleaning up - it's likely to be quicker to deduplicate than to review the duplication



================
Comment at: libc/startup/gpu/nvptx/start.cpp:71
+  // To finis the execution we invoke all the callbacks registered via 'atexit'
+  // and then exit with the appropriate return value.
+  __llvm_libc::exit(retval);
----------------
Is there a missing call to libc::finalize() here?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D149581



More information about the libc-commits mailing list