Skip to content

[Offload][NFC] Remove 'libomptarget' message helpers #92581

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
May 17, 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
6 changes: 2 additions & 4 deletions offload/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -118,9 +118,6 @@ else()
set(LIBOMPTARGET_INTDIR ${LLVM_LIBRARY_OUTPUT_INTDIR})
endif()

# Message utilities.
include(LibomptargetUtils)

# Get dependencies for the different components of the project.
include(LibomptargetGetDependencies)

Expand All @@ -146,7 +143,8 @@ set(LIBOMPTARGET_PLUGINS_TO_BUILD "all" CACHE STRING
if(LIBOMPTARGET_PLUGINS_TO_BUILD STREQUAL "all")
set(LIBOMPTARGET_PLUGINS_TO_BUILD ${LIBOMPTARGET_ALL_PLUGIN_TARGETS})
endif()
message("Building with support for ${LIBOMPTARGET_PLUGINS_TO_BUILD} plugins")
message(STATUS "Building the offload library with support for "
"the \"${LIBOMPTARGET_PLUGINS_TO_BUILD}\" plugins")

set(LIBOMPTARGET_ENUM_PLUGIN_TARGETS "")
foreach(plugin IN LISTS LIBOMPTARGET_PLUGINS_TO_BUILD)
Expand Down
12 changes: 6 additions & 6 deletions offload/DeviceRTL/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@ set(LIBOMPTARGET_BUILD_DEVICERTL_BCLIB TRUE CACHE BOOL
"Can be set to false to disable building this library.")

if (NOT LIBOMPTARGET_BUILD_DEVICERTL_BCLIB)
libomptarget_say("Not building DeviceRTL: Disabled by LIBOMPTARGET_BUILD_DEVICERTL_BCLIB")
message(STATUS "Not building DeviceRTL: Disabled by LIBOMPTARGET_BUILD_DEVICERTL_BCLIB")
return()
endif()

# Check to ensure the host system is a supported host architecture.
if(NOT ${CMAKE_SIZEOF_VOID_P} EQUAL "8")
libomptarget_say("Not building DeviceRTL: Runtime does not support 32-bit hosts")
message(STATUS "Not building DeviceRTL: Runtime does not support 32-bit hosts")
return()
endif()

Expand All @@ -20,10 +20,10 @@ if (LLVM_DIR)
find_program(LINK_TOOL llvm-link PATHS ${LLVM_TOOLS_BINARY_DIR} NO_DEFAULT_PATH)
find_program(OPT_TOOL opt PATHS ${LLVM_TOOLS_BINARY_DIR} NO_DEFAULT_PATH)
if ((NOT CLANG_TOOL) OR (NOT LINK_TOOL) OR (NOT OPT_TOOL) OR (NOT PACKAGER_TOOL))
libomptarget_say("Not building DeviceRTL. Missing clang: ${CLANG_TOOL}, llvm-link: ${LINK_TOOL}, opt: ${OPT_TOOL}, or clang-offload-packager: ${PACKAGER_TOOL}")
message(STATUS "Not building DeviceRTL. Missing clang: ${CLANG_TOOL}, llvm-link: ${LINK_TOOL}, opt: ${OPT_TOOL}, or clang-offload-packager: ${PACKAGER_TOOL}")
return()
else()
libomptarget_say("Building DeviceRTL. Using clang: ${CLANG_TOOL}, llvm-link: ${LINK_TOOL} and opt: ${OPT_TOOL}")
message(STATUS "Building DeviceRTL. Using clang: ${CLANG_TOOL}, llvm-link: ${LINK_TOOL} and opt: ${OPT_TOOL}")
endif()
elseif (LLVM_TOOL_CLANG_BUILD AND NOT CMAKE_CROSSCOMPILING AND NOT OPENMP_STANDALONE_BUILD)
# LLVM in-tree builds may use CMake target names to discover the tools.
Expand All @@ -32,9 +32,9 @@ elseif (LLVM_TOOL_CLANG_BUILD AND NOT CMAKE_CROSSCOMPILING AND NOT OPENMP_STANDA
set(PACKAGER_TOOL $<TARGET_FILE:clang-offload-packager>)
set(LINK_TOOL $<TARGET_FILE:llvm-link>)
set(OPT_TOOL $<TARGET_FILE:opt>)
libomptarget_say("Building DeviceRTL. Using clang from in-tree build")
message(STATUS "Building DeviceRTL. Using clang from in-tree build")
else()
libomptarget_say("Not building DeviceRTL. No appropriate clang found")
message(STATUS "Not building DeviceRTL. No appropriate clang found")
return()
endif()

Expand Down
17 changes: 0 additions & 17 deletions offload/cmake/Modules/LibomptargetUtils.cmake

This file was deleted.

8 changes: 4 additions & 4 deletions offload/plugins-nextgen/amdgpu/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
find_package(hsa-runtime64 QUIET 1.2.0 HINTS ${CMAKE_INSTALL_PREFIX} PATHS /opt/rocm)

if(NOT (CMAKE_SYSTEM_PROCESSOR MATCHES "(x86_64)|(ppc64le)|(aarch64)$" AND CMAKE_SYSTEM_NAME MATCHES "Linux"))
libomptarget_say("Not building AMDGPU NextGen plugin: only support AMDGPU in Linux x86_64, ppc64le, or aarch64 hosts")
message(STATUS "Not building AMDGPU NextGen plugin: only support AMDGPU in Linux x86_64, ppc64le, or aarch64 hosts")
return()
endif()

Expand All @@ -15,10 +15,10 @@ target_include_directories(omptarget.rtl.amdgpu PRIVATE

option(LIBOMPTARGET_FORCE_DLOPEN_LIBHSA "Build with dlopened libhsa" OFF)
if(hsa-runtime64_FOUND AND NOT LIBOMPTARGET_FORCE_DLOPEN_LIBHSA)
libomptarget_say("Building AMDGPU plugin linked against libhsa")
message(STATUS "Building AMDGPU plugin linked against libhsa")
target_link_libraries(omptarget.rtl.amdgpu PRIVATE hsa-runtime64::hsa-runtime64)
else()
libomptarget_say("Building AMDGPU plugin for dlopened libhsa")
message(STATUS "Building AMDGPU plugin for dlopened libhsa")
target_include_directories(omptarget.rtl.amdgpu PRIVATE dynamic_hsa)
target_sources(omptarget.rtl.amdgpu PRIVATE dynamic_hsa/hsa.cpp)
endif()
Expand All @@ -33,6 +33,6 @@ if (LIBOMPTARGET_FOUND_AMDGPU_GPU OR LIBOMPTARGET_FORCE_AMDGPU_TESTS)
list(APPEND LIBOMPTARGET_TESTED_PLUGINS "omptarget.rtl.amdgpu")
set(LIBOMPTARGET_TESTED_PLUGINS "${LIBOMPTARGET_TESTED_PLUGINS}" PARENT_SCOPE)
else()
libomptarget_say("Not generating AMDGPU tests, no supported devices detected."
message(STATUS "Not generating AMDGPU tests, no supported devices detected."
" Use 'LIBOMPTARGET_FORCE_AMDGPU_TESTS' to override.")
endif()
12 changes: 6 additions & 6 deletions offload/plugins-nextgen/cuda/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
if (NOT (CMAKE_SYSTEM_PROCESSOR MATCHES "(x86_64)|(ppc64le)|(aarch64)$" AND CMAKE_SYSTEM_NAME MATCHES "Linux"))
libomptarget_say("Not building CUDA NextGen offloading plugin: only support CUDA in Linux x86_64, ppc64le, or aarch64 hosts.")
message(STATUS "Not building CUDA NextGen offloading plugin: only support CUDA in Linux x86_64, ppc64le, or aarch64 hosts.")
return()
endif()

libomptarget_say("Building CUDA NextGen offloading plugin.")
message(STATUS "Building CUDA NextGen offloading plugin.")

# Create the library and add the default arguments.
add_target_library(omptarget.rtl.cuda CUDA)
Expand All @@ -12,10 +12,10 @@ target_sources(omptarget.rtl.cuda PRIVATE src/rtl.cpp)

option(LIBOMPTARGET_FORCE_DLOPEN_LIBCUDA "Build with dlopened libcuda" OFF)
if(LIBOMPTARGET_DEP_CUDA_FOUND AND NOT LIBOMPTARGET_FORCE_DLOPEN_LIBCUDA)
libomptarget_say("Building CUDA plugin linked against libcuda")
message(STATUS "Building CUDA plugin linked against libcuda")
target_link_libraries(omptarget.rtl.cuda PRIVATE CUDA::cuda_driver)
else()
libomptarget_say("Building CUDA plugin for dlopened libcuda")
message(STATUS "Building CUDA plugin for dlopened libcuda")
target_include_directories(omptarget.rtl.cuda PRIVATE dynamic_cuda)
target_sources(omptarget.rtl.cuda PRIVATE dynamic_cuda/cuda.cpp)
endif()
Expand All @@ -24,12 +24,12 @@ endif()
# functional NVIDIA GPU on the system, or if manually specifies by the user.
option(LIBOMPTARGET_FORCE_NVIDIA_TESTS "Build NVIDIA libomptarget tests" OFF)
if (LIBOMPTARGET_FOUND_NVIDIA_GPU OR LIBOMPTARGET_FORCE_NVIDIA_TESTS)
libomptarget_say("Enable tests using CUDA plugin")
message(STATUS "Enable tests using CUDA plugin")
set(LIBOMPTARGET_SYSTEM_TARGETS
"${LIBOMPTARGET_SYSTEM_TARGETS} nvptx64-nvidia-cuda nvptx64-nvidia-cuda-LTO" PARENT_SCOPE)
list(APPEND LIBOMPTARGET_TESTED_PLUGINS "omptarget.rtl.cuda")
set(LIBOMPTARGET_TESTED_PLUGINS "${LIBOMPTARGET_TESTED_PLUGINS}" PARENT_SCOPE)
else()
libomptarget_say("Not generating NVIDIA tests, no supported devices detected."
message(STATUS "Not generating NVIDIA tests, no supported devices detected."
" Use 'LIBOMPTARGET_FORCE_NVIDIA_TESTS' to override.")
endif()
8 changes: 4 additions & 4 deletions offload/plugins-nextgen/host/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ endif()

set(supported_targets x86_64 aarch64 ppc64 ppc64le s390x)
if(NOT ${CMAKE_SYSTEM_PROCESSOR} IN_LIST supported_targets)
libomptarget_say("Not building ${machine} NextGen offloading plugin")
message(STATUS "Not building ${machine} NextGen offloading plugin")
return()
endif()

Expand All @@ -19,14 +19,14 @@ add_target_library(omptarget.rtl.host ${machine})
target_sources(omptarget.rtl.host PRIVATE src/rtl.cpp)

if(LIBOMPTARGET_DEP_LIBFFI_FOUND)
libomptarget_say("Building ${machine} plugin linked with libffi")
message(STATUS "Building ${machine} plugin linked with libffi")
if(FFI_STATIC_LIBRARIES)
target_link_libraries(omptarget.rtl.host PRIVATE FFI::ffi_static)
else()
target_link_libraries(omptarget.rtl.host PRIVATE FFI::ffi)
endif()
else()
libomptarget_say("Building ${machine} plugin for dlopened libffi")
message(STATUS "Building ${machine} plugin for dlopened libffi")
target_sources(omptarget.rtl.host PRIVATE dynamic_ffi/ffi.cpp)
target_include_directories(omptarget.rtl.host PRIVATE dynamic_ffi)
endif()
Expand All @@ -39,7 +39,7 @@ if(LIBOMPTARGET_DEP_LIBFFI_FOUND)
set(LIBOMPTARGET_TESTED_PLUGINS
"${LIBOMPTARGET_TESTED_PLUGINS}" PARENT_SCOPE)
else()
libomptarget_say("Not generating ${tmachine_name} tests. LibFFI not found.")
message(STATUS "Not generating ${tmachine_name} tests. LibFFI not found.")
endif()

# Define the target specific triples and ELF machine values.
Expand Down
2 changes: 1 addition & 1 deletion offload/src/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
libomptarget_say("Building offloading runtime library libomptarget.")
message(STATUS "Building offloading runtime library libomptarget.")

if(LIBOMP_STANDALONE)
set(LIBOMP ${LIBOMP_STANDALONE})
Expand Down
2 changes: 1 addition & 1 deletion offload/test/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# CMakeLists.txt file for unit testing OpenMP offloading runtime library.
if(NOT CMAKE_CXX_COMPILER_ID STREQUAL "Clang" OR
CMAKE_CXX_COMPILER_VERSION VERSION_LESS 6.0.0)
libomptarget_say("Can only test with Clang compiler in version 6.0.0 or later.")
message(STATUS "Can only test with Clang compiler in version 6.0.0 or later.")
libomptarget_warning_say("The check-libomptarget target will not be available!")
return()
endif()
Expand Down
2 changes: 1 addition & 1 deletion offload/tools/deviceinfo/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
libomptarget_say("Building the llvm-omp-device-info tool")
message(STATUS "Building the llvm-omp-device-info tool")

add_openmp_tool(llvm-omp-device-info llvm-omp-device-info.cpp)

Expand Down
2 changes: 1 addition & 1 deletion offload/tools/kernelreplay/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
libomptarget_say("Building the llvm-omp-kernel-replay tool")
message(STATUS "Building the llvm-omp-kernel-replay tool")

add_openmp_tool(llvm-omp-kernel-replay llvm-omp-kernel-replay.cpp)

Expand Down
2 changes: 1 addition & 1 deletion offload/unittests/Plugins/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ set(PLUGINS_TEST_SOURCES NextgenPluginsTest.cpp)
set(PLUGINS_TEST_INCLUDE ${LIBOMPTARGET_INCLUDE_DIR})

foreach(PLUGIN IN LISTS LIBOMPTARGET_TESTED_PLUGINS)
libomptarget_say("Building plugin unit tests for ${PLUGIN}")
message(STATUS "Building plugin unit tests for ${PLUGIN}")
add_libompt_unittest("${PLUGIN}.unittests" ${PLUGINS_TEST_SOURCES})
add_dependencies("${PLUGIN}.unittests" ${PLUGINS_TEST_COMMON} ${PLUGIN})
target_link_libraries("${PLUGIN}.unittests" PRIVATE ${PLUGINS_TEST_COMMON} ${PLUGIN})
Expand Down
Loading