Skip to content

Commit 4497e9e

Browse files
Test: use -fsycl-device-code-split=per_src for coverage build
1 parent 609e1ab commit 4497e9e

File tree

2 files changed

+18
-5
lines changed

2 files changed

+18
-5
lines changed

dpnp/CMakeLists.txt

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,12 @@ function(build_dpnp_tensor_ext _trgt _src _dest)
9595
if(BUILD_DPNP_SYCL)
9696
add_sycl_to_target(TARGET ${_trgt} SOURCES ${_generated_src})
9797
target_compile_options(${_trgt} PRIVATE -fno-sycl-id-queries-fit-in-int)
98-
target_link_options(${_trgt} PRIVATE -fsycl-device-code-split=per_kernel)
98+
# For coverage builds, use per_src instead of per_kernel to reduce memory
99+
if(DPNP_GENERATE_COVERAGE)
100+
target_link_options(${_trgt} PRIVATE -fsycl-device-code-split=per_src)
101+
else()
102+
target_link_options(${_trgt} PRIVATE -fsycl-device-code-split=per_kernel)
103+
endif()
99104
if(DPNP_TENSOR_OFFLOAD_COMPRESS)
100105
target_link_options(${_trgt} PRIVATE --offload-compress)
101106
endif()

dpnp/tensor/CMakeLists.txt

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -313,10 +313,18 @@ foreach(python_module_name ${_py_trgts})
313313
${python_module_name}
314314
PRIVATE -fno-sycl-id-queries-fit-in-int
315315
)
316-
target_link_options(
317-
${python_module_name}
318-
PRIVATE -fsycl-device-code-split=per_kernel
319-
)
316+
# For coverage builds, use per_src instead of per_kernel to reduce memory
317+
if(DPNP_GENERATE_COVERAGE)
318+
target_link_options(
319+
${python_module_name}
320+
PRIVATE -fsycl-device-code-split=per_src
321+
)
322+
else()
323+
target_link_options(
324+
${python_module_name}
325+
PRIVATE -fsycl-device-code-split=per_kernel
326+
)
327+
endif()
320328
if(DPNP_TENSOR_OFFLOAD_COMPRESS)
321329
target_link_options(${python_module_name} PRIVATE --offload-compress)
322330
endif()

0 commit comments

Comments
 (0)