Skip to content

Commit 6029e51

Browse files
committed
Fix useless intersection and not properly working property
1 parent bca2f44 commit 6029e51

File tree

2 files changed

+8
-7
lines changed

2 files changed

+8
-7
lines changed

build2cmake/src/templates/cuda/kernel.cmake

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -54,11 +54,13 @@ elseif(GPU_LANG STREQUAL "HIP")
5454

5555
foreach(_KERNEL_SRC {{'${' + kernel_name + '_SRC}'}})
5656
if(_KERNEL_SRC MATCHES ".*\\.hip$")
57-
set_property(
58-
SOURCE ${_KERNEL_SRC}
59-
PROPERTY
60-
HIP_ARCHITECTURES {{ '${' + kernel_name + '_ARCHS}'}}
61-
)
57+
foreach(_ROCM_ARCH {{ '${' + kernel_name + '_ARCHS}'}})
58+
set_property(
59+
SOURCE ${_KERNEL_SRC}
60+
APPEND PROPERTY
61+
COMPILE_OPTIONS "$<$<COMPILE_LANGUAGE:HIP>:--offload-arch=${_ROCM_ARCH}>"
62+
)
63+
endforeach()
6264
endif()
6365
endforeach()
6466

build2cmake/src/templates/cuda/preamble.cmake

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,9 +85,8 @@ if(GPU_LANG STREQUAL "CUDA")
8585

8686
add_compile_definitions(CUDA_KERNEL)
8787
elseif(GPU_LANG STREQUAL "HIP")
88-
set(ROCM_ARCHS "${HIP_SUPPORTED_ARCHS}")
8988
override_gpu_arches(GPU_ARCHES HIP ${HIP_SUPPORTED_ARCHS})
90-
hip_archs_loose_intersection(ROCM_ARCHS, "${HIP_SUPPORTED_ARCHS}" "${ROCM_ARCHS}")
89+
set(ROCM_ARCHS ${GPU_ARCHES})
9190
message(STATUS "ROCM supported target architectures: ${ROCM_ARCHS}")
9291

9392
add_compile_definitions(ROCM_KERNEL)

0 commit comments

Comments
 (0)