Skip to content

Commit 1acdc2c

Browse files
Use profile instrumentation compile flags for pybind11 extensions
1 parent ee333f7 commit 1acdc2c

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

dpctl/tensor/CMakeLists.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -217,6 +217,9 @@ foreach(python_module_name ${_py_trgts})
217217
)
218218
target_link_options(${python_module_name} PRIVATE ${_linker_options})
219219
if(DPCTL_GENERATE_COVERAGE)
220+
target_compile_options(${python_module_name}
221+
PRIVATE -fprofile-instr-generate -fcoverage-mapping
222+
)
220223
target_link_options(${python_module_name}
221224
PRIVATE -fprofile-instr-generate -fcoverage-mapping
222225
)

dpctl/utils/CMakeLists.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,9 @@ pybind11_add_module(${python_module_name} MODULE
2222
)
2323
add_sycl_to_target(TARGET ${python_module_name} SOURCES ${_module_src})
2424
if(DPCTL_GENERATE_COVERAGE)
25+
target_compile_options(${python_module_name}
26+
PRIVATE -fprofile-instr-generate -fcoverage-mapping
27+
)
2528
target_link_options(${python_module_name}
2629
PRIVATE -fprofile-instr-generate -fcoverage-mapping
2730
)

0 commit comments

Comments
 (0)