Skip to content

[libc] Remove 'llvm-gpu-none' directory from build #82816

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 23, 2024

Conversation

jhuber6
Copy link
Contributor

@jhuber6 jhuber6 commented Feb 23, 2024

Summary:
This directory is leftover from when we handled both AMDGPU and NVPTX in
the same build and merged them into a pseudo triple. Now the only thing
it contains is the RPC server header. This gets rid of it, but now that
it's in the base install directory we should make it clear that it's an
LLVM libc header.

@llvmbot
Copy link
Member

llvmbot commented Feb 23, 2024

@llvm/pr-subscribers-libc

Author: Joseph Huber (jhuber6)

Changes

Summary:
This directory is leftover from when we handled both AMDGPU and NVPTX in
the same build and merged them into a pseudo triple. Now the only thing
it contains is the RPC server header. This gets rid of it, but now that
it's in the base install directory we should make it clear that it's an
LLVM libc header.


Full diff: https://github.com/llvm/llvm-project/pull/82816.diff

6 Files Affected:

  • (modified) libc/docs/gpu/rpc.rst (+2-2)
  • (modified) libc/utils/gpu/loader/Loader.h (+1-1)
  • (modified) libc/utils/gpu/server/CMakeLists.txt (+2-2)
  • (renamed) libc/utils/gpu/server/llvmlibc_rpc_server.h ()
  • (modified) libc/utils/gpu/server/rpc_server.cpp (+1-1)
  • (modified) openmp/libomptarget/plugins-nextgen/common/src/RPC.cpp (+2-8)
diff --git a/libc/docs/gpu/rpc.rst b/libc/docs/gpu/rpc.rst
index 78ae778671881a..a9f9d658d9f710 100644
--- a/libc/docs/gpu/rpc.rst
+++ b/libc/docs/gpu/rpc.rst
@@ -104,7 +104,7 @@ Some operations are too divergent to provide generic implementations for, such
 as allocating device accessible memory. For these cases, we provide a callback 
 registration scheme to add a custom handler for any given opcode through the 
 port API. More information can be found in the installed header 
-``<install>/include/gpu-none-llvm/rpc_server.h``.
+``<install>/include/llvmlibc_rpc_server.h``.
 
 Client Example
 --------------
@@ -194,7 +194,7 @@ but the following example shows how it can be used by a standard user.
   #include <cstdlib>
   #include <cuda_runtime.h>
   
-  #include <gpu-none-llvm/rpc_server.h>
+  #include <gpu-none-llvm/llvmlibc_rpc_server.h>
   
   [[noreturn]] void handle_error(cudaError_t err) {
     fprintf(stderr, "CUDA error: %s\n", cudaGetErrorString(err));
diff --git a/libc/utils/gpu/loader/Loader.h b/libc/utils/gpu/loader/Loader.h
index d2b2ee5baebedb..e2aabb08c11dac 100644
--- a/libc/utils/gpu/loader/Loader.h
+++ b/libc/utils/gpu/loader/Loader.h
@@ -9,7 +9,7 @@
 #ifndef LLVM_LIBC_UTILS_GPU_LOADER_LOADER_H
 #define LLVM_LIBC_UTILS_GPU_LOADER_LOADER_H
 
-#include "utils/gpu/server/rpc_server.h"
+#include "utils/gpu/server/llvmlibc_rpc_server.h"
 
 #include "include/llvm-libc-types/test_rpc_opcodes_t.h"
 
diff --git a/libc/utils/gpu/server/CMakeLists.txt b/libc/utils/gpu/server/CMakeLists.txt
index 94cdfe5bf6521a..745a248d9b63d2 100644
--- a/libc/utils/gpu/server/CMakeLists.txt
+++ b/libc/utils/gpu/server/CMakeLists.txt
@@ -21,8 +21,8 @@ if(LLVM_RUNTIMES_TARGET OR LIBC_TARGET_TRIPLE)
 endif()
 
 # Install the server and associated header.
-install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/rpc_server.h
-        DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/gpu-none-llvm/
+install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/llvmlibc_rpc_server.h
+        DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
         COMPONENT libc-headers)
 install(TARGETS llvmlibc_rpc_server
         ARCHIVE DESTINATION "lib${LLVM_LIBDIR_SUFFIX}"
diff --git a/libc/utils/gpu/server/rpc_server.h b/libc/utils/gpu/server/llvmlibc_rpc_server.h
similarity index 100%
rename from libc/utils/gpu/server/rpc_server.h
rename to libc/utils/gpu/server/llvmlibc_rpc_server.h
diff --git a/libc/utils/gpu/server/rpc_server.cpp b/libc/utils/gpu/server/rpc_server.cpp
index 4e535a294a19e4..707807a5cbaf7d 100644
--- a/libc/utils/gpu/server/rpc_server.cpp
+++ b/libc/utils/gpu/server/rpc_server.cpp
@@ -6,7 +6,7 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include "rpc_server.h"
+#include "llvmlibc_rpc_server.h"
 
 #include "src/__support/RPC/rpc.h"
 #include "src/stdio/gpu/file.h"
diff --git a/openmp/libomptarget/plugins-nextgen/common/src/RPC.cpp b/openmp/libomptarget/plugins-nextgen/common/src/RPC.cpp
index cb6a5086bc4dd0..05ae5acb01ddfc 100644
--- a/openmp/libomptarget/plugins-nextgen/common/src/RPC.cpp
+++ b/openmp/libomptarget/plugins-nextgen/common/src/RPC.cpp
@@ -12,14 +12,8 @@
 
 #include "PluginInterface.h"
 
-// This header file may be present in-tree or from an LLVM installation. The
-// installed version lives alongside the GPU headers so we do not want to
-// include it directly.
-#if __has_include(<gpu-none-llvm/rpc_server.h>)
-#include <gpu-none-llvm/rpc_server.h>
-#elif defined(LIBOMPTARGET_RPC_SUPPORT)
-// Just pull this out of the source if available.
-#include "rpc_server.h"
+#if defined(LIBOMPTARGET_RPC_SUPPORT)
+#include "llvmlibc_rpc_server.h"
 #endif
 
 using namespace llvm;

Summary:
This directory is leftover from when we handled both AMDGPU and NVPTX in
the same build and merged them into a pseudo triple. Now the only thing
it contains is the RPC server header. This gets rid of it, but now that
it's in the base install directory we should make it clear that it's an
LLVM libc header.
@jhuber6 jhuber6 merged commit 1a2ecbb into llvm:main Feb 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
libc openmp:libomptarget OpenMP offload runtime
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants