Skip to content

Commit eb18b0a

Browse files
committed
GPU CMake: Use global hip_HIPIFY_PERL_EXECUTABLE variable
1 parent db32a53 commit eb18b0a

4 files changed

Lines changed: 6 additions & 6 deletions

File tree

GPU/GPUTracking/Base/hip/CMakeLists.txt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ if(NOT DEFINED GPUCA_HIP_HIPIFY_FROM_CUDA OR "${GPUCA_HIP_HIPIFY_FROM_CUDA}")
1818
file(MAKE_DIRECTORY ${GPUCA_HIP_SOURCE_DIR})
1919
set(GPUCA_HIP_FILE_LIST GPUReconstructionCUDA.cu GPUReconstructionCUDAExternalProvider.cu GPUReconstructionCUDA.h GPUReconstructionCUDAInternals.h GPUReconstructionCUDAkernel.template.cu CUDAThrustHelpers.h GPUReconstructionCUDADef.h GPUReconstructionCUDAGenRTC.cxx GPUReconstructionCUDAKernels.cu GPUReconstructionCUDArtc.cu)
2020
set(GPUCA_HIP_LOCAL_FILE_LIST GPUReconstructionHIPIncludes.h)
21-
set(HIPIFY_EXECUTABLE "/opt/rocm/bin/hipify-perl")
2221
set(HIP_SOURCES "")
2322
foreach(file ${GPUCA_HIP_FILE_LIST})
2423
get_filename_component(ABS_CUDA_SORUCE ../cuda/${file} ABSOLUTE)
@@ -27,7 +26,7 @@ if(NOT DEFINED GPUCA_HIP_HIPIFY_FROM_CUDA OR "${GPUCA_HIP_HIPIFY_FROM_CUDA}")
2726
string(REPLACE "CUDA" "HIP" HIP_SOURCE ${HIP_SOURCE1})
2827
add_custom_command(
2928
OUTPUT ${GPUCA_HIP_SOURCE_DIR}/${HIP_SOURCE}
30-
COMMAND ${HIPIFY_EXECUTABLE} --quiet-warnings ${ABS_CUDA_SORUCE} | sed -e 's/CUDA/HIP/g' -e 's/cuda/hip/g' > ${GPUCA_HIP_SOURCE_DIR}/${HIP_SOURCE}
29+
COMMAND ${hip_HIPIFY_PERL_EXECUTABLE} --quiet-warnings ${ABS_CUDA_SORUCE} | sed -e 's/CUDA/HIP/g' -e 's/cuda/hip/g' > ${GPUCA_HIP_SOURCE_DIR}/${HIP_SOURCE}
3130
DEPENDS ${ABS_CUDA_SORUCE}
3231
COMMENT "Hippifying ${HIP_SOURCE}"
3332
)

cmake/O2AddHipifiedExecutable.cmake

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ function(o2_add_hipified_executable baseTargetName)
2424
"SOURCES;PUBLIC_LINK_LIBRARIES;JOB_POOL")
2525

2626
# Process each .cu file to generate a .hip file
27-
set(HIPIFY_EXECUTABLE "/opt/rocm/bin/hipify-perl")
2827
set(HIP_SOURCES)
2928

3029
foreach(file ${A_SOURCES})
@@ -38,7 +37,7 @@ function(o2_add_hipified_executable baseTargetName)
3837

3938
add_custom_command(
4039
OUTPUT ${OUTPUT_HIP_FILE}
41-
COMMAND ${HIPIFY_EXECUTABLE} --quiet-warnings ${ABS_CUDA_SORUCE} | sed '1{/\#include \"hip\\/hip_runtime.h\"/d}' > ${OUTPUT_HIP_FILE}
40+
COMMAND ${hip_HIPIFY_PERL_EXECUTABLE} --quiet-warnings ${ABS_CUDA_SORUCE} | sed '1{/\#include \"hip\\/hip_runtime.h\"/d}' > ${OUTPUT_HIP_FILE}
4241
DEPENDS ${file}
4342
COMMENT "Hippifying ${HIP_SOURCE}"
4443
)

cmake/O2AddHipifiedLibrary.cmake

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ function(o2_add_hipified_library baseTargetName)
2424
)
2525

2626
# Process each .cu file to generate a .hip file
27-
set(HIPIFY_EXECUTABLE "/opt/rocm/bin/hipify-perl")
2827
set(HIP_SOURCES)
2928

3029
foreach(file ${A_SOURCES})
@@ -38,7 +37,7 @@ function(o2_add_hipified_library baseTargetName)
3837

3938
add_custom_command(
4039
OUTPUT ${OUTPUT_HIP_FILE}
41-
COMMAND ${HIPIFY_EXECUTABLE} --quiet-warnings ${ABS_CUDA_SORUCE} | sed '1{/\#include \"hip\\/hip_runtime.h\"/d}' > ${OUTPUT_HIP_FILE}
40+
COMMAND ${hip_HIPIFY_PERL_EXECUTABLE} --quiet-warnings ${ABS_CUDA_SORUCE} | sed '1{/\#include \"hip\\/hip_runtime.h\"/d}' > ${OUTPUT_HIP_FILE}
4241
DEPENDS ${file}
4342
COMMENT "Hippifying ${HIP_SOURCE}"
4443
)

dependencies/FindO2GPU.cmake

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -241,6 +241,9 @@ if(ENABLE_HIP)
241241
set_package_properties(hipcub PROPERTIES TYPE REQUIRED)
242242
set_package_properties(rocprim PROPERTIES TYPE REQUIRED)
243243
set_package_properties(rocthrust PROPERTIES TYPE REQUIRED)
244+
if(NOT hip_HIPIFY_PERL_EXECUTABLE)
245+
message(FATAL_ERROR "Could not find hipify-perl command")
246+
endif()
244247
endif()
245248
if (CMAKE_HIP_COMPILER)
246249
enable_language(HIP)

0 commit comments

Comments
 (0)