Skip to content

[Libomptarget] Rename libomptarget.rtl.x86_64 to libomptarget.rtl.host #86868

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
Apr 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 20 additions & 20 deletions offload/plugins-nextgen/host/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,36 +14,36 @@ if(CMAKE_SYSTEM_PROCESSOR MATCHES "ppc64le$")
endif()

# Create the library and add the default arguments.
add_target_library(omptarget.rtl.${machine} ${machine})
add_target_library(omptarget.rtl.host ${machine})

target_sources(omptarget.rtl.${machine} PRIVATE src/rtl.cpp)
target_sources(omptarget.rtl.host PRIVATE src/rtl.cpp)

if(LIBOMPTARGET_DEP_LIBFFI_FOUND)
libomptarget_say("Building ${machine} plugin linked with libffi")
if(FFI_STATIC_LIBRARIES)
target_link_libraries(omptarget.rtl.${machine} PRIVATE FFI::ffi_static)
target_link_libraries(omptarget.rtl.host PRIVATE FFI::ffi_static)
else()
target_link_libraries(omptarget.rtl.${machine} PRIVATE FFI::ffi)
target_link_libraries(omptarget.rtl.host PRIVATE FFI::ffi)
endif()
else()
libomptarget_say("Building ${machine} plugin for dlopened libffi")
target_sources(omptarget.rtl.${machine} PRIVATE dynamic_ffi/ffi.cpp)
target_include_directories(omptarget.rtl.${machine} PRIVATE dynamic_ffi)
target_sources(omptarget.rtl.host PRIVATE dynamic_ffi/ffi.cpp)
target_include_directories(omptarget.rtl.host PRIVATE dynamic_ffi)
endif()

# Install plugin under the lib destination folder.
install(TARGETS omptarget.rtl.${machine}
install(TARGETS omptarget.rtl.host
LIBRARY DESTINATION "${OFFLOAD_INSTALL_LIBDIR}")
set_target_properties(omptarget.rtl.${machine} PROPERTIES
set_target_properties(omptarget.rtl.host PROPERTIES
INSTALL_RPATH "$ORIGIN" BUILD_RPATH "$ORIGIN:${CMAKE_CURRENT_BINARY_DIR}/.."
POSITION_INDEPENDENT_CODE ON
CXX_VISIBILITY_PRESET protected)

target_include_directories(omptarget.rtl.${machine} PRIVATE
target_include_directories(omptarget.rtl.host PRIVATE
${LIBOMPTARGET_INCLUDE_DIR})

if(LIBOMPTARGET_DEP_LIBFFI_FOUND)
list(APPEND LIBOMPTARGET_TESTED_PLUGINS omptarget.rtl.${machine})
list(APPEND LIBOMPTARGET_TESTED_PLUGINS omptarget.rtl.host)
set(LIBOMPTARGET_TESTED_PLUGINS
"${LIBOMPTARGET_TESTED_PLUGINS}" PARENT_SCOPE)
else()
Expand All @@ -52,36 +52,36 @@ endif()

# Define the target specific triples and ELF machine values.
if(CMAKE_SYSTEM_PROCESSOR MATCHES "ppc64le$")
target_compile_definitions(omptarget.rtl.${machine} PRIVATE TARGET_ELF_ID=EM_PPC64)
target_compile_definitions(omptarget.rtl.${machine} PRIVATE
target_compile_definitions(omptarget.rtl.host PRIVATE TARGET_ELF_ID=EM_PPC64)
target_compile_definitions(omptarget.rtl.host PRIVATE
LIBOMPTARGET_NEXTGEN_GENERIC_PLUGIN_TRIPLE="powerpc64le-ibm-linux-gnu")
list(APPEND LIBOMPTARGET_SYSTEM_TARGETS
"powerpc64le-ibm-linux-gnu" "powerpc64le-ibm-linux-gnu-LTO")
set(LIBOMPTARGET_SYSTEM_TARGETS "${LIBOMPTARGET_SYSTEM_TARGETS}" PARENT_SCOPE)
elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "ppc64$")
target_compile_definitions(omptarget.rtl.${machine} PRIVATE TARGET_ELF_ID=EM_PPC64)
target_compile_definitions(omptarget.rtl.${machine} PRIVATE
target_compile_definitions(omptarget.rtl.host PRIVATE TARGET_ELF_ID=EM_PPC64)
target_compile_definitions(omptarget.rtl.host PRIVATE
LIBOMPTARGET_NEXTGEN_GENERIC_PLUGIN_TRIPLE="powerpc64-ibm-linux-gnu")
list(APPEND LIBOMPTARGET_SYSTEM_TARGETS
"powerpc64-ibm-linux-gnu" "powerpc64-ibm-linux-gnu-LTO")
set(LIBOMPTARGET_SYSTEM_TARGETS "${LIBOMPTARGET_SYSTEM_TARGETS}" PARENT_SCOPE)
elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "x86_64$")
target_compile_definitions(omptarget.rtl.${machine} PRIVATE TARGET_ELF_ID=EM_X86_64)
target_compile_definitions(omptarget.rtl.${machine} PRIVATE
target_compile_definitions(omptarget.rtl.host PRIVATE TARGET_ELF_ID=EM_X86_64)
target_compile_definitions(omptarget.rtl.host PRIVATE
LIBOMPTARGET_NEXTGEN_GENERIC_PLUGIN_TRIPLE="x86_64-pc-linux-gnu")
list(APPEND LIBOMPTARGET_SYSTEM_TARGETS
"x86_64-pc-linux-gnu" "x86_64-pc-linux-gnu-LTO")
set(LIBOMPTARGET_SYSTEM_TARGETS "${LIBOMPTARGET_SYSTEM_TARGETS}" PARENT_SCOPE)
elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "aarch64$")
target_compile_definitions(omptarget.rtl.${machine} PRIVATE TARGET_ELF_ID=EM_AARCH64)
target_compile_definitions(omptarget.rtl.${machine} PRIVATE
target_compile_definitions(omptarget.rtl.host PRIVATE TARGET_ELF_ID=EM_AARCH64)
target_compile_definitions(omptarget.rtl.host PRIVATE
LIBOMPTARGET_NEXTGEN_GENERIC_PLUGIN_TRIPLE="aarch64-unknown-linux-gnu")
list(APPEND LIBOMPTARGET_SYSTEM_TARGETS
"aarch64-unknown-linux-gnu" "aarch64-unknown-linux-gnu-LTO")
set(LIBOMPTARGET_SYSTEM_TARGETS "${LIBOMPTARGET_SYSTEM_TARGETS}" PARENT_SCOPE)
elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "s390x$")
target_compile_definitions(omptarget.rtl.${machine} PRIVATE TARGET_ELF_ID=EM_S390)
target_compile_definitions(omptarget.rtl.${machine} PRIVATE
target_compile_definitions(omptarget.rtl.host PRIVATE TARGET_ELF_ID=EM_S390)
target_compile_definitions(omptarget.rtl.host PRIVATE
LIBOMPTARGET_NEXTGEN_GENERIC_PLUGIN_TRIPLE="s390x-ibm-linux-gnu")
list(APPEND LIBOMPTARGET_SYSTEM_TARGETS
"s390x-ibm-linux-gnu" "s390x-ibm-linux-gnu-LTO")
Expand Down
5 changes: 1 addition & 4 deletions offload/src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -74,12 +74,9 @@ endmacro()
set(LIBOMPTARGET_PLUGINS_TO_LOAD "" CACHE STRING
"Comma separated list of plugin names to look for at runtime")
if (NOT LIBOMPTARGET_PLUGINS_TO_LOAD)
check_plugin_target(ppc64)
check_plugin_target(x86_64)
check_plugin_target(cuda)
check_plugin_target(aarch64)
check_plugin_target(amdgpu)
check_plugin_target(s390x)
check_plugin_target(host)
endif()

list(TRANSFORM LIBOMPTARGET_PLUGINS_TO_LOAD PREPEND "\"libomptarget.rtl.")
Expand Down