|
29 | 29 |
|
30 | 30 | find_package(Python COMPONENTS Development.Module) |
31 | 31 |
|
| 32 | +# Remove global coverage flags for tensor |
| 33 | +# use link-time only approach like dpctl |
| 34 | +if(DPNP_GENERATE_COVERAGE) |
| 35 | + string(REPLACE "-fprofile-instr-generate " "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") |
| 36 | + string(REPLACE "-fcoverage-mapping " "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") |
| 37 | + string(REPLACE "-fno-sycl-use-footer " "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") |
| 38 | +endif() |
| 39 | + |
32 | 40 | # Tensor-specific debug flags |
33 | | -if(CMAKE_BUILD_TYPE STREQUAL "Debug" OR CMAKE_BUILD_TYPE STREQUAL "DEBUG") |
| 41 | +# Disable device code debug info for Debug and Coverage builds to speed up linking |
| 42 | +if( |
| 43 | + CMAKE_BUILD_TYPE STREQUAL "Debug" |
| 44 | + OR CMAKE_BUILD_TYPE STREQUAL "DEBUG" |
| 45 | + OR CMAKE_BUILD_TYPE STREQUAL "Coverage" |
| 46 | +) |
34 | 47 | if(WIN32) |
35 | 48 | add_compile_options(-Xsycl-target-frontend=spir64 "-g0") |
36 | 49 | elseif(UNIX) |
37 | | - string(REPLACE "-g1" "-g" CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG}") |
38 | | - string(REPLACE "-g1" "-g" CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG}") |
| 50 | + add_compile_options(-Xsycl-target-frontend=spir64 "-g0") |
| 51 | + if(CMAKE_BUILD_TYPE STREQUAL "Debug" OR CMAKE_BUILD_TYPE STREQUAL "DEBUG") |
| 52 | + string(REPLACE "-g1" "-g" CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG}") |
| 53 | + string(REPLACE "-g1" "-g" CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG}") |
| 54 | + endif() |
39 | 55 | endif() |
40 | 56 | endif() |
41 | 57 |
|
@@ -313,18 +329,10 @@ foreach(python_module_name ${_py_trgts}) |
313 | 329 | ${python_module_name} |
314 | 330 | PRIVATE -fno-sycl-id-queries-fit-in-int |
315 | 331 | ) |
316 | | - # For coverage builds, use per_source 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_source |
321 | | - ) |
322 | | - else() |
323 | | - target_link_options( |
324 | | - ${python_module_name} |
325 | | - PRIVATE -fsycl-device-code-split=per_kernel |
326 | | - ) |
327 | | - endif() |
| 332 | + target_link_options( |
| 333 | + ${python_module_name} |
| 334 | + PRIVATE -fsycl-device-code-split=per_kernel |
| 335 | + ) |
328 | 336 | if(DPNP_TENSOR_OFFLOAD_COMPRESS) |
329 | 337 | target_link_options(${python_module_name} PRIVATE --offload-compress) |
330 | 338 | endif() |
|
0 commit comments