Skip to content

[Offload] Fix stray libomptarget message helper calls #106837

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
Aug 31, 2024

Conversation

xen0n
Copy link
Contributor

@xen0n xen0n commented Aug 31, 2024

In #92581 the LibomptargetUitls.cmake helpers have been removed, but only uses of libomptarget_say were migrated. Migrate the remaining few warning and error messages so the check-offload target would not fail due to missing libomptarget_warning_say.

While at it, update the check-offload unavailability message to say check-offload instead of check-libomptarget.

Fixes #92581

In llvm#92581 the `LibomptargetUitls.cmake` helpers have been removed, but
only uses of `libomptarget_say` were migrated. Migrate the remaining
few warning and error messages so the `check-offload` target would not
fail due to missing `libomptarget_warning_say`.

While at it, update the `check-offload` unavailability message to say
`check-offload` instead of `check-libomptarget`.

Fixes llvm#92581
@llvmbot
Copy link
Member

llvmbot commented Aug 31, 2024

@llvm/pr-subscribers-offload

Author: WÁNG Xuěruì (xen0n)

Changes

In #92581 the LibomptargetUitls.cmake helpers have been removed, but only uses of libomptarget_say were migrated. Migrate the remaining few warning and error messages so the check-offload target would not fail due to missing libomptarget_warning_say.

While at it, update the check-offload unavailability message to say check-offload instead of check-libomptarget.

Fixes #92581


Full diff: https://github.com/llvm/llvm-project/pull/106837.diff

2 Files Affected:

  • (modified) offload/DeviceRTL/CMakeLists.txt (+3-3)
  • (modified) offload/test/CMakeLists.txt (+1-1)
diff --git a/offload/DeviceRTL/CMakeLists.txt b/offload/DeviceRTL/CMakeLists.txt
index f30afd9674a072..ad465f0ccbd614 100644
--- a/offload/DeviceRTL/CMakeLists.txt
+++ b/offload/DeviceRTL/CMakeLists.txt
@@ -60,10 +60,10 @@ if(LIBOMPTARGET_DEVICE_ARCHITECTURES STREQUAL "all")
 elseif(LIBOMPTARGET_DEVICE_ARCHITECTURES STREQUAL "auto" OR
        LIBOMPTARGET_DEVICE_ARCHITECTURES STREQUAL "native")
   if(NOT LIBOMPTARGET_NVPTX_ARCH AND NOT LIBOMPTARGET_AMDGPU_ARCH)
-    libomptarget_error_say(
+    message(FATAL_ERROR
       "Could not find 'amdgpu-arch' and 'nvptx-arch' tools required for 'auto'")
   elseif(NOT LIBOMPTARGET_FOUND_NVIDIA_GPU AND NOT LIBOMPTARGET_FOUND_AMDGPU_GPU)
-    libomptarget_error_say("No AMD or NVIDIA GPU found on the system when using 'auto'")
+    message(FATAL_ERROR "No AMD or NVIDIA GPU found on the system when using 'auto'")
   endif()
   set(LIBOMPTARGET_DEVICE_ARCHITECTURES
       "${LIBOMPTARGET_NVPTX_DETECTED_ARCH_LIST};${LIBOMPTARGET_AMDGPU_DETECTED_ARCH_LIST}")
@@ -291,7 +291,7 @@ foreach(gpu_arch ${LIBOMPTARGET_DEVICE_ARCHITECTURES})
   elseif("${gpu_arch}" IN_LIST all_nvptx_architectures)
     compileDeviceRTLLibrary(${gpu_arch} nvptx nvptx64-nvidia-cuda --cuda-feature=+ptx63)
   else()
-    libomptarget_error_say("Unknown GPU architecture '${gpu_arch}'")
+    message(FATAL_ERROR "Unknown GPU architecture '${gpu_arch}'")
   endif()
 endforeach()
 
diff --git a/offload/test/CMakeLists.txt b/offload/test/CMakeLists.txt
index 495d1ef62226e7..5a6f637b57fa7b 100644
--- a/offload/test/CMakeLists.txt
+++ b/offload/test/CMakeLists.txt
@@ -2,7 +2,7 @@
 if(NOT CMAKE_CXX_COMPILER_ID STREQUAL "Clang" OR
    CMAKE_CXX_COMPILER_VERSION VERSION_LESS 6.0.0)
   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!")
+  message(WARNING "The check-offload target will not be available!")
   return()
 endif()
 

@jhuber6 jhuber6 merged commit 9adf811 into llvm:main Aug 31, 2024
8 checks passed
@xen0n xen0n deleted the fix-offload-cmake-messages branch August 31, 2024 13:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants