Skip to content

Commit

Permalink
[libc] Remove 'llvm-gpu-none' directory from build (#82816)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
jhuber6 committed Feb 23, 2024
1 parent a3a316e commit 1a2ecbb
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 14 deletions.
4 changes: 2 additions & 2 deletions libc/docs/gpu/rpc.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
--------------
Expand Down Expand Up @@ -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 <llvmlibc_rpc_server.h>
[[noreturn]] void handle_error(cudaError_t err) {
fprintf(stderr, "CUDA error: %s\n", cudaGetErrorString(err));
Expand Down
2 changes: 1 addition & 1 deletion libc/utils/gpu/loader/Loader.h
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down
4 changes: 2 additions & 2 deletions libc/utils/gpu/server/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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}"
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion libc/utils/gpu/server/rpc_server.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
10 changes: 2 additions & 8 deletions openmp/libomptarget/plugins-nextgen/common/src/RPC.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 1a2ecbb

Please sign in to comment.