Skip to content

Commit d2bd60f

Browse files
committed
GPU HIP Cmake: Get rid of hipcc, use Clang --cuda-device-only instead
1 parent ccb2619 commit d2bd60f

File tree

5 files changed

+7
-9
lines changed

5 files changed

+7
-9
lines changed

GPU/GPUTracking/Base/cuda/GPUReconstructionCUDA.cu

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
#ifndef __HIPCC__ // CUDA
2929
#define PER_KERNEL_OBJECT_EXT _fatbin
3030
#else // HIP
31-
#define PER_KERNEL_OBJECT_EXT _hip_cxx_o
31+
#define PER_KERNEL_OBJECT_EXT _hip_o
3232
#endif
3333
#define GPUCA_KRNL(x_class, ...) QGET_LD_BINARY_SYMBOLS(GPUCA_M_CAT3(cuda_kernel_module_fatbin_krnl_, GPUCA_M_KRNL_NAME(x_class), PER_KERNEL_OBJECT_EXT))
3434
#include "GPUReconstructionKernelList.h"

GPU/GPUTracking/Base/hip/CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ add_custom_target(${MODULE}_HIP_SRC_CHK ALL DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/
122122

123123
add_custom_command(
124124
OUTPUT ${GPU_RTC_BIN}.command
125-
COMMAND echo -n "${hip_HIPCC_EXECUTABLE} ${GPU_RTC_FLAGS_SEPARATED} ${GPU_RTC_DEFINES} --genco" > ${GPU_RTC_BIN}.command
125+
COMMAND echo -n "${CMAKE_HIP_COMPILER} ${GPU_RTC_FLAGS_SEPARATED} ${GPU_RTC_DEFINES} -x hip --cuda-device-only" > ${GPU_RTC_BIN}.command
126126
COMMAND_EXPAND_LISTS
127127
VERBATIM
128128
COMMENT "Preparing HIP RTC command file ${GPU_RTC_BIN}.command"
@@ -159,7 +159,7 @@ if(ALIGPU_BUILD_TYPE STREQUAL "O2")
159159
install(FILES ${HDRS} DESTINATION include/GPU)
160160

161161
# o2_add_test(GPUsortHIP NAME test_GPUsortHIP
162-
# SOURCES test/testGPUsortHIP.hip.cxx
162+
# SOURCES test/testGPUsortHIP.hip
163163
# PUBLIC_LINK_LIBRARIES O2::GPUCommon hip::host hip::device hip::hipcub roc::rocthrust
164164
# COMPONENT_NAME GPU
165165
# LABELS gpu)

GPU/GPUTracking/Base/hip/per_kernel/CMakeLists.txt

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,5 @@
99
# granted to it by virtue of its status as an Intergovernmental Organization
1010
# or submit itself to any jurisdiction.
1111

12-
add_library(GPUTrackingHIPKernels OBJECT $<JOIN:$<LIST:TRANSFORM,$<LIST:TRANSFORM,$<LIST:TRANSFORM,$<TARGET_PROPERTY:O2_GPU_KERNELS,O2_GPU_KERNEL_NAMES>,REPLACE,[^A-Za-z0-9]+,_>,PREPEND,${O2_GPU_KERNEL_WRAPPER_FOLDER}/krnl_>,APPEND,.hip.cxx>, >)
13-
set(CMAKE_CXX_COMPILER ${hip_HIPCC_EXECUTABLE})
14-
set(CMAKE_CXX_FLAGS "${GPU_RTC_FLAGS} ${GPU_RTC_FLAGS_ARCH} --genco")
15-
unset(CMAKE_CXX_FLAGS_${CMAKE_BUILD_TYPE_UPPER})
12+
add_library(GPUTrackingHIPKernels OBJECT $<JOIN:$<LIST:TRANSFORM,$<LIST:TRANSFORM,$<LIST:TRANSFORM,$<TARGET_PROPERTY:O2_GPU_KERNELS,O2_GPU_KERNEL_NAMES>,REPLACE,[^A-Za-z0-9]+,_>,PREPEND,${O2_GPU_KERNEL_WRAPPER_FOLDER}/krnl_>,APPEND,.hip>, >)
13+
set(CMAKE_HIP_FLAGS "${CMAKE_HIP_FLAGS} --cuda-device-only")

GPU/GPUTracking/Base/hip/test/testGPUsortHIP.hip.cxx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
// granted to it by virtue of its status as an Intergovernmental Organization
1010
// or submit itself to any jurisdiction.
1111

12-
/// \file testGPUsortHIP.hip.cxx
12+
/// \file testGPUsortHIP.hip
1313
/// \author Michael Lettrich
1414

1515
#define GPUCA_GPUTYPE_VEGA

GPU/GPUTracking/cmake/kernel_helpers.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ function(o2_gpu_add_kernel kernel_name kernel_files kernel_bounds kernel_type)
9696
endif()
9797

9898
if(HIP_ENABLED)
99-
set(TMP_FILENAMEA "${O2_GPU_KERNEL_WRAPPER_FOLDER}/krnl_${TMP_FILENAME}.hip.cxx")
99+
set(TMP_FILENAMEA "${O2_GPU_KERNEL_WRAPPER_FOLDER}/krnl_${TMP_FILENAME}.hip")
100100
set(O2_GPU_KERNEL_TEMPLATE_REPLACE "${TMP_KERNEL}")
101101
configure_file(${O2_GPU_BASE_DIR}/Base/hip/GPUReconstructionHIPkernel.template.hip ${TMP_FILENAMEA})
102102
endif()

0 commit comments

Comments
 (0)