Skip to content

Commit 2f9e5d9

Browse files
Use per_source device code splitting for coverage build
1 parent af8e355 commit 2f9e5d9

9 files changed

Lines changed: 102 additions & 9 deletions

File tree

dpnp/backend/CMakeLists.txt

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,12 @@ endif()
7070
# target_compile_definitions(${_trgt} PRIVATE _WIN=1)
7171
# endif()
7272

73-
target_link_options(${_trgt} PUBLIC -fsycl-device-code-split=per_kernel)
73+
# For coverage builds, use per_source instead of per_kernel to reduce memory
74+
if(DPNP_GENERATE_COVERAGE)
75+
target_link_options(${_trgt} PUBLIC -fsycl-device-code-split=per_source)
76+
else()
77+
target_link_options(${_trgt} PUBLIC -fsycl-device-code-split=per_kernel)
78+
endif()
7479

7580
if(DPNP_GENERATE_COVERAGE)
7681
target_link_options(${_trgt} PRIVATE -fprofile-instr-generate -fcoverage-mapping)

dpnp/backend/extensions/blas/CMakeLists.txt

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,18 @@ else()
100100
)
101101
endif()
102102

103-
target_link_options(${python_module_name} PUBLIC -fsycl-device-code-split=per_kernel)
103+
# For coverage builds, use per_source instead of per_kernel to reduce memory
104+
if(DPNP_GENERATE_COVERAGE)
105+
target_link_options(
106+
${python_module_name}
107+
PUBLIC -fsycl-device-code-split=per_source
108+
)
109+
else()
110+
target_link_options(
111+
${python_module_name}
112+
PUBLIC -fsycl-device-code-split=per_kernel
113+
)
114+
endif()
104115

105116
if(DPNP_GENERATE_COVERAGE)
106117
target_link_options(

dpnp/backend/extensions/fft/CMakeLists.txt

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,18 @@ else()
9393
)
9494
endif()
9595

96-
target_link_options(${python_module_name} PUBLIC -fsycl-device-code-split=per_kernel)
96+
# For coverage builds, use per_source instead of per_kernel to reduce memory
97+
if(DPNP_GENERATE_COVERAGE)
98+
target_link_options(
99+
${python_module_name}
100+
PUBLIC -fsycl-device-code-split=per_source
101+
)
102+
else()
103+
target_link_options(
104+
${python_module_name}
105+
PUBLIC -fsycl-device-code-split=per_kernel
106+
)
107+
endif()
97108

98109
if(DPNP_GENERATE_COVERAGE)
99110
target_link_options(

dpnp/backend/extensions/indexing/CMakeLists.txt

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,18 @@ else()
9898
endif()
9999

100100
target_compile_options(${python_module_name} PUBLIC -fno-sycl-id-queries-fit-in-int)
101-
target_link_options(${python_module_name} PUBLIC -fsycl-device-code-split=per_kernel)
101+
# For coverage builds, use per_source instead of per_kernel to reduce memory
102+
if(DPNP_GENERATE_COVERAGE)
103+
target_link_options(
104+
${python_module_name}
105+
PUBLIC -fsycl-device-code-split=per_source
106+
)
107+
else()
108+
target_link_options(
109+
${python_module_name}
110+
PUBLIC -fsycl-device-code-split=per_kernel
111+
)
112+
endif()
102113

103114
if(DPNP_GENERATE_COVERAGE)
104115
target_link_options(

dpnp/backend/extensions/lapack/CMakeLists.txt

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,18 @@ else()
118118
)
119119
endif()
120120

121-
target_link_options(${python_module_name} PUBLIC -fsycl-device-code-split=per_kernel)
121+
# For coverage builds, use per_source instead of per_kernel to reduce memory
122+
if(DPNP_GENERATE_COVERAGE)
123+
target_link_options(
124+
${python_module_name}
125+
PUBLIC -fsycl-device-code-split=per_source
126+
)
127+
else()
128+
target_link_options(
129+
${python_module_name}
130+
PUBLIC -fsycl-device-code-split=per_kernel
131+
)
132+
endif()
122133

123134
if(DPNP_GENERATE_COVERAGE)
124135
target_link_options(

dpnp/backend/extensions/statistics/CMakeLists.txt

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,18 @@ else()
102102
)
103103
endif()
104104

105-
target_link_options(${python_module_name} PUBLIC -fsycl-device-code-split=per_kernel)
105+
# For coverage builds, use per_source instead of per_kernel to reduce memory
106+
if(DPNP_GENERATE_COVERAGE)
107+
target_link_options(
108+
${python_module_name}
109+
PUBLIC -fsycl-device-code-split=per_source
110+
)
111+
else()
112+
target_link_options(
113+
${python_module_name}
114+
PUBLIC -fsycl-device-code-split=per_kernel
115+
)
116+
endif()
106117

107118
if(DPNP_GENERATE_COVERAGE)
108119
target_link_options(

dpnp/backend/extensions/ufunc/CMakeLists.txt

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,18 @@ else()
129129
)
130130
endif()
131131

132-
target_link_options(${python_module_name} PUBLIC -fsycl-device-code-split=per_kernel)
132+
# For coverage builds, use per_source instead of per_kernel to reduce memory
133+
if(DPNP_GENERATE_COVERAGE)
134+
target_link_options(
135+
${python_module_name}
136+
PUBLIC -fsycl-device-code-split=per_source
137+
)
138+
else()
139+
target_link_options(
140+
${python_module_name}
141+
PUBLIC -fsycl-device-code-split=per_kernel
142+
)
143+
endif()
133144

134145
if(DPNP_GENERATE_COVERAGE)
135146
target_link_options(

dpnp/backend/extensions/vm/CMakeLists.txt

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,18 @@ else()
142142
)
143143
endif()
144144

145-
target_link_options(${python_module_name} PUBLIC -fsycl-device-code-split=per_kernel)
145+
# For coverage builds, use per_source instead of per_kernel to reduce memory
146+
if(DPNP_GENERATE_COVERAGE)
147+
target_link_options(
148+
${python_module_name}
149+
PUBLIC -fsycl-device-code-split=per_source
150+
)
151+
else()
152+
target_link_options(
153+
${python_module_name}
154+
PUBLIC -fsycl-device-code-split=per_kernel
155+
)
156+
endif()
146157

147158
if(DPNP_GENERATE_COVERAGE)
148159
target_link_options(

dpnp/backend/extensions/window/CMakeLists.txt

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,18 @@ else()
9898
)
9999
endif()
100100

101-
target_link_options(${python_module_name} PUBLIC -fsycl-device-code-split=per_kernel)
101+
# For coverage builds, use per_source instead of per_kernel to reduce memory
102+
if(DPNP_GENERATE_COVERAGE)
103+
target_link_options(
104+
${python_module_name}
105+
PUBLIC -fsycl-device-code-split=per_source
106+
)
107+
else()
108+
target_link_options(
109+
${python_module_name}
110+
PUBLIC -fsycl-device-code-split=per_kernel
111+
)
112+
endif()
102113

103114
if(DPNP_GENERATE_COVERAGE)
104115
target_link_options(

0 commit comments

Comments
 (0)