diff --git a/libc/utils/gpu/loader/Loader.h b/libc/utils/gpu/loader/Loader.h index cffbaa673afd3..9338038370197 100644 --- a/libc/utils/gpu/loader/Loader.h +++ b/libc/utils/gpu/loader/Loader.h @@ -11,6 +11,7 @@ #include "utils/gpu/server/llvmlibc_rpc_server.h" +#include "llvm-libc-types/rpc_opcodes_t.h" #include "include/llvm-libc-types/test_rpc_opcodes_t.h" #include diff --git a/libc/utils/gpu/server/CMakeLists.txt b/libc/utils/gpu/server/CMakeLists.txt index 8712f24de84f7..10cfdb45a2c9d 100644 --- a/libc/utils/gpu/server/CMakeLists.txt +++ b/libc/utils/gpu/server/CMakeLists.txt @@ -24,6 +24,10 @@ endif() install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/llvmlibc_rpc_server.h DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} COMPONENT libc-headers) +install(FILES ${LIBC_SOURCE_DIR}/include/llvm-libc-types/rpc_opcodes_t.h + DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} + RENAME llvmlibc_rpc_opcodes.h + COMPONENT libc-headers) install(TARGETS llvmlibc_rpc_server ARCHIVE DESTINATION "lib${LLVM_LIBDIR_SUFFIX}" COMPONENT libc) diff --git a/libc/utils/gpu/server/llvmlibc_rpc_server.h b/libc/utils/gpu/server/llvmlibc_rpc_server.h index f1a8fe06281cb..b7f2a463b1f5c 100644 --- a/libc/utils/gpu/server/llvmlibc_rpc_server.h +++ b/libc/utils/gpu/server/llvmlibc_rpc_server.h @@ -11,8 +11,6 @@ #include -#include "llvm-libc-types/rpc_opcodes_t.h" - #ifdef __cplusplus extern "C" { #endif @@ -84,7 +82,7 @@ rpc_status_t rpc_handle_server(uint32_t device_id); /// Register a callback to handle an opcode from the RPC client. The associated /// data must remain accessible as long as the user intends to handle the server /// with this callback. -rpc_status_t rpc_register_callback(uint32_t device_id, rpc_opcode_t opcode, +rpc_status_t rpc_register_callback(uint32_t device_id, uint16_t opcode, rpc_opcode_callback_ty callback, void *data); /// Obtain a pointer to a local client buffer that can be copied directly to the diff --git a/libc/utils/gpu/server/rpc_server.cpp b/libc/utils/gpu/server/rpc_server.cpp index 2c8186c13ffac..90af1569c4c53 100644 --- a/libc/utils/gpu/server/rpc_server.cpp +++ b/libc/utils/gpu/server/rpc_server.cpp @@ -30,8 +30,8 @@ static_assert(RPC_MAXIMUM_PORT_COUNT == rpc::MAX_PORT_COUNT, template rpc_status_t handle_server_impl( rpc::Server &server, - const std::unordered_map &callbacks, - const std::unordered_map &callback_data, + const std::unordered_map &callbacks, + const std::unordered_map &callback_data, uint32_t &index) { auto port = server.try_open(lane_size, index); if (!port) @@ -239,8 +239,8 @@ struct Device { void *buffer; rpc::Server server; rpc::Client client; - std::unordered_map callbacks; - std::unordered_map callback_data; + std::unordered_map callbacks; + std::unordered_map callback_data; }; // A struct containing all the runtime state required to run the RPC server. @@ -335,7 +335,7 @@ rpc_status_t rpc_handle_server(uint32_t device_id) { } } -rpc_status_t rpc_register_callback(uint32_t device_id, rpc_opcode_t opcode, +rpc_status_t rpc_register_callback(uint32_t device_id, uint16_t opcode, rpc_opcode_callback_ty callback, void *data) { if (!state) diff --git a/openmp/libomptarget/plugins-nextgen/common/src/RPC.cpp b/openmp/libomptarget/plugins-nextgen/common/src/RPC.cpp index 05ae5acb01ddf..f46b27701b5b9 100644 --- a/openmp/libomptarget/plugins-nextgen/common/src/RPC.cpp +++ b/openmp/libomptarget/plugins-nextgen/common/src/RPC.cpp @@ -13,6 +13,7 @@ #include "PluginInterface.h" #if defined(LIBOMPTARGET_RPC_SUPPORT) +#include "llvm-libc-types/rpc_opcodes_t.h" #include "llvmlibc_rpc_server.h" #endif