File tree Expand file tree Collapse file tree 2 files changed +8
-7
lines changed
build2cmake/src/templates/cuda Expand file tree Collapse file tree 2 files changed +8
-7
lines changed Original file line number Diff line number Diff 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
Original file line number Diff line number Diff line change @@ -85,9 +85,8 @@ if(GPU_LANG STREQUAL "CUDA")
8585
8686 add_compile_definitions (CUDA_KERNEL)
8787elseif (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)
You can’t perform that action at this time.
0 commit comments