Skip to content

Commit f8fb701

Browse files
committed
[Libomptarget] Rename libomptarget.rtl.x86_64 to libomptarget.rtl.host
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 abc270a commit f8fb701

File tree

2 files changed

+19
-22
lines changed

2 files changed

+19
-22
lines changed

openmp/libomptarget/plugins-nextgen/host/CMakeLists.txt

Lines changed: 18 additions & 18 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 "${OPENMP_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()
@@ -53,29 +53,29 @@ endif()
5353
# Define the target specific triples and ELF machine values.
5454
if(CMAKE_SYSTEM_PROCESSOR MATCHES "ppc64le$" OR
5555
CMAKE_SYSTEM_PROCESSOR MATCHES "ppc64$")
56-
target_compile_definitions(omptarget.rtl.${machine} PRIVATE TARGET_ELF_ID=EM_PPC64)
57-
target_compile_definitions(omptarget.rtl.${machine} PRIVATE
56+
target_compile_definitions(omptarget.rtl.host PRIVATE TARGET_ELF_ID=EM_PPC64)
57+
target_compile_definitions(omptarget.rtl.host PRIVATE
5858
LIBOMPTARGET_NEXTGEN_GENERIC_PLUGIN_TRIPLE="powerpc64-ibm-linux-gnu")
5959
list(APPEND LIBOMPTARGET_SYSTEM_TARGETS
6060
"powerpc64-ibm-linux-gnu" "powerpc64-ibm-linux-gnu-LTO")
6161
set(LIBOMPTARGET_SYSTEM_TARGETS "${LIBOMPTARGET_SYSTEM_TARGETS}" PARENT_SCOPE)
6262
elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "x86_64$")
63-
target_compile_definitions(omptarget.rtl.${machine} PRIVATE TARGET_ELF_ID=EM_X86_64)
64-
target_compile_definitions(omptarget.rtl.${machine} PRIVATE
63+
target_compile_definitions(omptarget.rtl.host PRIVATE TARGET_ELF_ID=EM_X86_64)
64+
target_compile_definitions(omptarget.rtl.host PRIVATE
6565
LIBOMPTARGET_NEXTGEN_GENERIC_PLUGIN_TRIPLE="x86_64-pc-linux-gnu")
6666
list(APPEND LIBOMPTARGET_SYSTEM_TARGETS
6767
"x86_64-pc-linux-gnu" "x86_64-pc-linux-gnu-LTO")
6868
set(LIBOMPTARGET_SYSTEM_TARGETS "${LIBOMPTARGET_SYSTEM_TARGETS}" PARENT_SCOPE)
6969
elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "aarch64$")
70-
target_compile_definitions(omptarget.rtl.${machine} PRIVATE TARGET_ELF_ID=EM_AARCH64)
71-
target_compile_definitions(omptarget.rtl.${machine} PRIVATE
70+
target_compile_definitions(omptarget.rtl.host PRIVATE TARGET_ELF_ID=EM_AARCH64)
71+
target_compile_definitions(omptarget.rtl.host PRIVATE
7272
LIBOMPTARGET_NEXTGEN_GENERIC_PLUGIN_TRIPLE="aarch64-unknown-linux-gnu")
7373
list(APPEND LIBOMPTARGET_SYSTEM_TARGETS
7474
"aarch64-unknown-linux-gnu" "aarch64-unknown-linux-gnu-LTO")
7575
set(LIBOMPTARGET_SYSTEM_TARGETS "${LIBOMPTARGET_SYSTEM_TARGETS}" PARENT_SCOPE)
7676
elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "s390x$")
77-
target_compile_definitions(omptarget.rtl.${machine} PRIVATE TARGET_ELF_ID=EM_S390)
78-
target_compile_definitions(omptarget.rtl.${machine} PRIVATE
77+
target_compile_definitions(omptarget.rtl.host PRIVATE TARGET_ELF_ID=EM_S390)
78+
target_compile_definitions(omptarget.rtl.host PRIVATE
7979
LIBOMPTARGET_NEXTGEN_GENERIC_PLUGIN_TRIPLE="s390x-ibm-linux-gnu")
8080
list(APPEND LIBOMPTARGET_SYSTEM_TARGETS
8181
"s390x-ibm-linux-gnu" "s390x-ibm-linux-gnu-LTO")

openmp/libomptarget/src/CMakeLists.txt

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -68,12 +68,9 @@ endmacro()
6868
set(LIBOMPTARGET_PLUGINS_TO_LOAD "" CACHE STRING
6969
"Comma separated list of plugin names to look for at runtime")
7070
if (NOT LIBOMPTARGET_PLUGINS_TO_LOAD)
71-
check_plugin_target(ppc64)
72-
check_plugin_target(x86_64)
7371
check_plugin_target(cuda)
74-
check_plugin_target(aarch64)
7572
check_plugin_target(amdgpu)
76-
check_plugin_target(s390x)
73+
check_plugin_target(host)
7774
endif()
7875

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

0 commit comments

Comments
 (0)