aboutsummaryrefslogtreecommitdiff
path: root/libc/startup
diff options
context:
space:
mode:
authorJoseph Huber <35342157+jhuber6@users.noreply.github.com>2023-09-21 11:07:09 -0500
committerGitHub <noreply@github.com>2023-09-21 11:07:09 -0500
commit59896c168a5a2aaff12049bcb22d819c3d244f8f (patch)
treea86d0a25b9ec3a76168b13bab626d4acbdcf7a9b /libc/startup
parent88800f79e0b00dc72d27a25b59e437fe74c694ed (diff)
downloadllvm-59896c168a5a2aaff12049bcb22d819c3d244f8f.zip
llvm-59896c168a5a2aaff12049bcb22d819c3d244f8f.tar.gz
llvm-59896c168a5a2aaff12049bcb22d819c3d244f8f.tar.bz2
[libc] Remove the 'rpc_reset' routine from the RPC implementation (#66700)
Summary: This patch removes the `rpc_reset` function. This was previously used to initialize the RPC client on the device by setting up the pointers to communicate with the server. The purpose of this was to make it easier to initialize the device for testing. However, this prevented us from enforcing an invariant that the buffers are all read-only from the client side. The expected way to initialize the server is now to copy it from the host runtime. This will allow us to maintain that the RPC client is in the constant address space on the GPU, potentially through inference, and improving caching behaviour.
Diffstat (limited to 'libc/startup')
-rw-r--r--libc/startup/gpu/amdgpu/start.cpp7
-rw-r--r--libc/startup/gpu/nvptx/start.cpp7
2 files changed, 2 insertions, 12 deletions
diff --git a/libc/startup/gpu/amdgpu/start.cpp b/libc/startup/gpu/amdgpu/start.cpp
index b2adb1d..e6304ab 100644
--- a/libc/startup/gpu/amdgpu/start.cpp
+++ b/libc/startup/gpu/amdgpu/start.cpp
@@ -44,12 +44,7 @@ static void call_fini_array_callbacks() {
} // namespace __llvm_libc
extern "C" [[gnu::visibility("protected"), clang::amdgpu_kernel]] void
-_begin(int argc, char **argv, char **env, void *rpc_shared_buffer) {
- // We need to set up the RPC client first in case any of the constructors
- // require it.
- __llvm_libc::rpc::client.reset(__llvm_libc::rpc::MAX_PORT_COUNT,
- rpc_shared_buffer);
-
+_begin(int argc, char **argv, char **env) {
// We want the fini array callbacks to be run after other atexit
// callbacks are run. So, we register them before running the init
// array callbacks as they can potentially register their own atexit
diff --git a/libc/startup/gpu/nvptx/start.cpp b/libc/startup/gpu/nvptx/start.cpp
index cd44239..d5d3ad2 100644
--- a/libc/startup/gpu/nvptx/start.cpp
+++ b/libc/startup/gpu/nvptx/start.cpp
@@ -42,12 +42,7 @@ static void call_fini_array_callbacks() {
} // namespace __llvm_libc
extern "C" [[gnu::visibility("protected"), clang::nvptx_kernel]] void
-_begin(int argc, char **argv, char **env, void *rpc_shared_buffer) {
- // We need to set up the RPC client first in case any of the constructors
- // require it.
- __llvm_libc::rpc::client.reset(__llvm_libc::rpc::MAX_PORT_COUNT,
- rpc_shared_buffer);
-
+_begin(int argc, char **argv, char **env) {
// We want the fini array callbacks to be run after other atexit
// callbacks are run. So, we register them before running the init
// array callbacks as they can potentially register their own atexit