Skip to content

Commit 72b0c11

Browse files
authored
[Libomptarget] Rename libomptarget.rtl.x86_64 to libomptarget.rtl.host (#86868)
Summary: All of these are functionally the same code, just compiled for separate architectures. We currently do not expose a way to execute these on separate architectures as the host plugin works using `dlopen` into the same process, and therefore cannot possibly be an incompatible architecture. (This could work with a remote plugin, but this is not supported yet). This patch simply renames all of these to the same thing so we no longer need to check around for its varying definitions.
1 parent 266a927 commit 72b0c11

File tree

2 files changed

+21
-24
lines changed

2 files changed

+21
-24
lines changed

offload/plugins-nextgen/host/CMakeLists.txt

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -14,36 +14,36 @@ if(CMAKE_SYSTEM_PROCESSOR MATCHES "ppc64le$")
1414
endif()
1515

1616
# Create the library and add the default arguments.
17-
add_target_library(omptarget.rtl.${machine} ${machine})
17+
add_target_library(omptarget.rtl.host ${machine})
1818

19-
target_sources(omptarget.rtl.${machine} PRIVATE src/rtl.cpp)
19+
target_sources(omptarget.rtl.host PRIVATE src/rtl.cpp)
2020

2121
if(LIBOMPTARGET_DEP_LIBFFI_FOUND)
2222
libomptarget_say("Building ${machine} plugin linked with libffi")
2323
if(FFI_STATIC_LIBRARIES)
24-
target_link_libraries(omptarget.rtl.${machine} PRIVATE FFI::ffi_static)
24+
target_link_libraries(omptarget.rtl.host PRIVATE FFI::ffi_static)
2525
else()
26-
target_link_libraries(omptarget.rtl.${machine} PRIVATE FFI::ffi)
26+
target_link_libraries(omptarget.rtl.host PRIVATE FFI::ffi)
2727
endif()
2828
else()
2929
libomptarget_say("Building ${machine} plugin for dlopened libffi")
30-
target_sources(omptarget.rtl.${machine} PRIVATE dynamic_ffi/ffi.cpp)
31-
target_include_directories(omptarget.rtl.${machine} PRIVATE dynamic_ffi)
30+
target_sources(omptarget.rtl.host PRIVATE dynamic_ffi/ffi.cpp)
31+
target_include_directories(omptarget.rtl.host PRIVATE dynamic_ffi)
3232
endif()
3333

3434
# Install plugin under the lib destination folder.
35-
install(TARGETS omptarget.rtl.${machine}
35+
install(TARGETS omptarget.rtl.host
3636
LIBRARY DESTINATION "${OFFLOAD_INSTALL_LIBDIR}")
37-
set_target_properties(omptarget.rtl.${machine} PROPERTIES
37+
set_target_properties(omptarget.rtl.host PROPERTIES
3838
INSTALL_RPATH "$ORIGIN" BUILD_RPATH "$ORIGIN:${CMAKE_CURRENT_BINARY_DIR}/.."
3939
POSITION_INDEPENDENT_CODE ON
4040
CXX_VISIBILITY_PRESET protected)
4141

42-
target_include_directories(omptarget.rtl.${machine} PRIVATE
42+
target_include_directories(omptarget.rtl.host PRIVATE
4343
${LIBOMPTARGET_INCLUDE_DIR})
4444

4545
if(LIBOMPTARGET_DEP_LIBFFI_FOUND)
46-
list(APPEND LIBOMPTARGET_TESTED_PLUGINS omptarget.rtl.${machine})
46+
list(APPEND LIBOMPTARGET_TESTED_PLUGINS omptarget.rtl.host)
4747
set(LIBOMPTARGET_TESTED_PLUGINS
4848
"${LIBOMPTARGET_TESTED_PLUGINS}" PARENT_SCOPE)
4949
else()
@@ -52,36 +52,36 @@ endif()
5252

5353
# Define the target specific triples and ELF machine values.
5454
if(CMAKE_SYSTEM_PROCESSOR MATCHES "ppc64le$")
55-
target_compile_definitions(omptarget.rtl.${machine} PRIVATE TARGET_ELF_ID=EM_PPC64)
56-
target_compile_definitions(omptarget.rtl.${machine} PRIVATE
55+
target_compile_definitions(omptarget.rtl.host PRIVATE TARGET_ELF_ID=EM_PPC64)
56+
target_compile_definitions(omptarget.rtl.host PRIVATE
5757
LIBOMPTARGET_NEXTGEN_GENERIC_PLUGIN_TRIPLE="powerpc64le-ibm-linux-gnu")
5858
list(APPEND LIBOMPTARGET_SYSTEM_TARGETS
5959
"powerpc64le-ibm-linux-gnu" "powerpc64le-ibm-linux-gnu-LTO")
6060
set(LIBOMPTARGET_SYSTEM_TARGETS "${LIBOMPTARGET_SYSTEM_TARGETS}" PARENT_SCOPE)
6161
elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "ppc64$")
62-
target_compile_definitions(omptarget.rtl.${machine} PRIVATE TARGET_ELF_ID=EM_PPC64)
63-
target_compile_definitions(omptarget.rtl.${machine} PRIVATE
62+
target_compile_definitions(omptarget.rtl.host PRIVATE TARGET_ELF_ID=EM_PPC64)
63+
target_compile_definitions(omptarget.rtl.host PRIVATE
6464
LIBOMPTARGET_NEXTGEN_GENERIC_PLUGIN_TRIPLE="powerpc64-ibm-linux-gnu")
6565
list(APPEND LIBOMPTARGET_SYSTEM_TARGETS
6666
"powerpc64-ibm-linux-gnu" "powerpc64-ibm-linux-gnu-LTO")
6767
set(LIBOMPTARGET_SYSTEM_TARGETS "${LIBOMPTARGET_SYSTEM_TARGETS}" PARENT_SCOPE)
6868
elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "x86_64$")
69-
target_compile_definitions(omptarget.rtl.${machine} PRIVATE TARGET_ELF_ID=EM_X86_64)
70-
target_compile_definitions(omptarget.rtl.${machine} PRIVATE
69+
target_compile_definitions(omptarget.rtl.host PRIVATE TARGET_ELF_ID=EM_X86_64)
70+
target_compile_definitions(omptarget.rtl.host PRIVATE
7171
LIBOMPTARGET_NEXTGEN_GENERIC_PLUGIN_TRIPLE="x86_64-pc-linux-gnu")
7272
list(APPEND LIBOMPTARGET_SYSTEM_TARGETS
7373
"x86_64-pc-linux-gnu" "x86_64-pc-linux-gnu-LTO")
7474
set(LIBOMPTARGET_SYSTEM_TARGETS "${LIBOMPTARGET_SYSTEM_TARGETS}" PARENT_SCOPE)
7575
elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "aarch64$")
76-
target_compile_definitions(omptarget.rtl.${machine} PRIVATE TARGET_ELF_ID=EM_AARCH64)
77-
target_compile_definitions(omptarget.rtl.${machine} PRIVATE
76+
target_compile_definitions(omptarget.rtl.host PRIVATE TARGET_ELF_ID=EM_AARCH64)
77+
target_compile_definitions(omptarget.rtl.host PRIVATE
7878
LIBOMPTARGET_NEXTGEN_GENERIC_PLUGIN_TRIPLE="aarch64-unknown-linux-gnu")
7979
list(APPEND LIBOMPTARGET_SYSTEM_TARGETS
8080
"aarch64-unknown-linux-gnu" "aarch64-unknown-linux-gnu-LTO")
8181
set(LIBOMPTARGET_SYSTEM_TARGETS "${LIBOMPTARGET_SYSTEM_TARGETS}" PARENT_SCOPE)
8282
elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "s390x$")
83-
target_compile_definitions(omptarget.rtl.${machine} PRIVATE TARGET_ELF_ID=EM_S390)
84-
target_compile_definitions(omptarget.rtl.${machine} PRIVATE
83+
target_compile_definitions(omptarget.rtl.host PRIVATE TARGET_ELF_ID=EM_S390)
84+
target_compile_definitions(omptarget.rtl.host PRIVATE
8585
LIBOMPTARGET_NEXTGEN_GENERIC_PLUGIN_TRIPLE="s390x-ibm-linux-gnu")
8686
list(APPEND LIBOMPTARGET_SYSTEM_TARGETS
8787
"s390x-ibm-linux-gnu" "s390x-ibm-linux-gnu-LTO")

offload/src/CMakeLists.txt

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -74,12 +74,9 @@ endmacro()
7474
set(LIBOMPTARGET_PLUGINS_TO_LOAD "" CACHE STRING
7575
"Comma separated list of plugin names to look for at runtime")
7676
if (NOT LIBOMPTARGET_PLUGINS_TO_LOAD)
77-
check_plugin_target(ppc64)
78-
check_plugin_target(x86_64)
7977
check_plugin_target(cuda)
80-
check_plugin_target(aarch64)
8178
check_plugin_target(amdgpu)
82-
check_plugin_target(s390x)
79+
check_plugin_target(host)
8380
endif()
8481

8582
list(TRANSFORM LIBOMPTARGET_PLUGINS_TO_LOAD PREPEND "\"libomptarget.rtl.")

0 commit comments

Comments
 (0)