summaryrefslogtreecommitdiffstats
path: root/Modules/Compiler/NVIDIA-HIP.cmake
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2023-09-22 13:19:44 (GMT)
committerKitware Robot <kwrobot@kitware.com>2023-09-22 13:19:52 (GMT)
commit122ec98dcfa273d17c2ae7ccacbaf3a47d14152c (patch)
tree653a0a27d732a38b49657ff36fb44a81303e9c2c /Modules/Compiler/NVIDIA-HIP.cmake
parentd2655c59dc914ec24f2bca142a748612caeb9e3d (diff)
parent6546aa2a2a2f695237a2f14745d18fc8a52b1fcf (diff)
downloadCMake-122ec98dcfa273d17c2ae7ccacbaf3a47d14152c.zip
CMake-122ec98dcfa273d17c2ae7ccacbaf3a47d14152c.tar.gz
CMake-122ec98dcfa273d17c2ae7ccacbaf3a47d14152c.tar.bz2
Merge topic 'hip-nvidia'
6546aa2a2a ci: Add HIP job using CUDA on NVIDIA GPUs 18158bf81c HIP: Add support for NVIDIA GPUs 127b6fa06b HIP: Add CMAKE_HIP_PLATFORM variable to specify GPU platform 90e23f40ee Tests/HIP/WithDefs: Clean up test case 9ebdf3281f Tests/HIP/ArchitectureOff: Cover HIP_ARCHITECTURES initialization cfec29196e ci: Add CUDA 11.8 to HIP 5.5 image 26470eb987 ci: Put HIP GPU platform in CMake_TEST_HIP Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !8817
Diffstat (limited to 'Modules/Compiler/NVIDIA-HIP.cmake')
-rw-r--r--Modules/Compiler/NVIDIA-HIP.cmake16
1 files changed, 16 insertions, 0 deletions
diff --git a/Modules/Compiler/NVIDIA-HIP.cmake b/Modules/Compiler/NVIDIA-HIP.cmake
new file mode 100644
index 0000000..e144ff8
--- /dev/null
+++ b/Modules/Compiler/NVIDIA-HIP.cmake
@@ -0,0 +1,16 @@
+include(Compiler/NVIDIA)
+__compiler_nvidia_cxx_standards(HIP)
+__compiler_nvidia_cuda_flags(HIP)
+
+# The ROCm hip-lang package does not work for nvcc,
+# so provide a minimal one ourselves.
+add_library(hip-lang::device INTERFACE IMPORTED)
+set(_CMAKE_HIP_DEVICE_RUNTIME_TARGET hip-lang::device)
+
+set(CMAKE_HIP_STANDARD_INCLUDE_DIRECTORIES "${CMAKE_HIP_COMPILER_ROCM_ROOT}/include")
+
+set(CMAKE_HIP_LINK_EXECUTABLE
+ "<CMAKE_HIP_HOST_LINK_LAUNCHER> <LINK_FLAGS> <OBJECTS> -o <TARGET> <LINK_LIBRARIES>${__IMPLICIT_LINKS}")
+set(CMAKE_HIP_CREATE_SHARED_LIBRARY
+ "<CMAKE_HIP_HOST_LINK_LAUNCHER> <CMAKE_SHARED_LIBRARY_HIP_FLAGS> <LINK_FLAGS> <CMAKE_SHARED_LIBRARY_CREATE_HIP_FLAGS> <SONAME_FLAG><TARGET_SONAME> -o <TARGET> <OBJECTS> <LINK_LIBRARIES>${__IMPLICIT_LINKS}")
+set(CMAKE_HIP_CREATE_SHARED_MODULE "${CMAKE_HIP_CREATE_SHARED_LIBRARY}")