Skip to content

Commit 4c4a759

Browse files
Do not override -fsycl
1 parent 43b1ef8 commit 4c4a759

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

examples/pybind11/onemkl_gemv/CMakeLists.txt

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -52,11 +52,14 @@ target_link_libraries(${py_module_name}
5252
install(TARGETS ${py_module_name} DESTINATION sycl_gemm)
5353
target_include_directories(${py_module_name} PUBLIC ${Dpctl_INCLUDE_DIRS})
5454

55-
get_target_property(_sycl_gemm_sources ${py_module_name} SOURCES)
56-
set_source_files_properties(${_sycl_gemm_sources}
57-
PROPERTIES
58-
COMPILE_OPTIONS "-O3"
59-
)
55+
foreach(_src_fn ${_sources})
56+
get_source_file_property(_compile_options ${_src_fn} COMPILE_OPTIONS)
57+
set(_combined_options ${_compile_options} "-O3")
58+
set_source_files_properties(${_src_fn}
59+
PROPERTIES
60+
COMPILE_OPTIONS "${_combined_options}"
61+
)
62+
endforeach()
6063
target_link_options(${py_module_name} PRIVATE -fsycl-device-code-split=per_kernel)
6164

6265
add_executable(standalone_cpp

0 commit comments

Comments
 (0)