This repository was archived by the owner on Apr 6, 2026. It is now read-only.
File tree Expand file tree Collapse file tree
build2cmake/src/templates Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -53,7 +53,7 @@ elseif(GPU_LANG STREQUAL "HIP")
5353 message (STATUS "Archs for kernel {{kernel_name}}: {{ '${' + kernel_name + '_ARCHS} '}}" )
5454
5555 foreach (_KERNEL_SRC {{'${' + kernel_name + '_SRC} '}})
56- if (_KERNEL_SRC MATCHES ".*\\ .hip$" )
56+ if (_KERNEL_SRC MATCHES ".*\\ .(cu| hip) $" )
5757 foreach (_ROCM_ARCH {{ '${' + kernel_name + '_ARCHS} '}})
5858 set_property (
5959 SOURCE ${_KERNEL_SRC}
Original file line number Diff line number Diff line change @@ -74,6 +74,7 @@ function (hipify_sources_target OUT_SRCS NAME ORIG_SRCS)
7474 set (HIP_SRCS)
7575 foreach (SRC ${SRCS} )
7676 get_source_file_property (include_dirs "${SRC} " INCLUDE_DIRECTORIES )
77+ get_source_file_property (compile_options "${SRC} " COMPILE_OPTIONS )
7778 string (REGEX REPLACE "\. cu$" "\. hip" SRC ${SRC} )
7879 string (REGEX REPLACE "cuda" "hip" SRC ${SRC} )
7980
@@ -84,6 +85,12 @@ function (hipify_sources_target OUT_SRCS NAME ORIG_SRCS)
8485 PROPERTIES INCLUDE_DIRECTORIES "${include_dirs} " )
8586 endif ()
8687
88+ if (compile_options)
89+ set_source_files_properties (
90+ ${SRC}
91+ PROPERTIES COMPILE_OPTIONS "${compile_options} " )
92+ endif ()
93+
8794 list (APPEND HIP_SRCS "${CMAKE_CURRENT_BINARY_DIR } /${SRC} " )
8895 endforeach ()
8996
You can’t perform that action at this time.
0 commit comments