Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ This release drops support for Python 3.10, making Python 3.11 the minimum requi
* Fixed a segfault in `dpnp.from_dlpack` and `dpnp.tensor.from_dlpack` when importing a DLPack tensor on a oneAPI device with NULL strides, which DLPack before 1.2 allows for a C-contiguous tensor [#3183](https://github.com/IntelPython/dpnp/pull/3183)
* Fixed `ValueError` in `dpnp.from_dlpack` and `dpnp.tensor.from_dlpack` when copying a 0-d or non-C-contiguous host array to a SYCL device, unless its items are one byte [#3207](https://github.com/IntelPython/dpnp/pull/3207)
* Fixed wrong values from `dpnp.from_dlpack` and `dpnp.tensor.from_dlpack` when copying a `float64` or `complex128` host array to a SYCL device without fp64 support, which copied its bytes unchanged into the `float32` or `complex64` result [#3209](https://github.com/IntelPython/dpnp/pull/3209)
* Fixed a random segfault of the OpenCL CPU runtime in coverage builds, and their link failure with `DPNP_TENSOR_GENERATE_COVERAGE_FOR_PYBIND11_EXTENSIONS=ON`, by instrumenting only host code [#3193](https://github.com/IntelPython/dpnp/pull/3193)

### Security

Expand Down
7 changes: 5 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -375,10 +375,13 @@ mark_as_advanced(
)

if(DPNP_GENERATE_COVERAGE)
# Host only: device counters become device globals in every kernel image of
# their module and crash the OpenCL CPU runtime. Their counts are lost anyway:
# libsycl, loaded by dpctl first, never binds __sycl_increment_profile_counters
string(
CONCAT PROFILE_FLAGS
"-fprofile-instr-generate "
"-fcoverage-mapping "
"-Xarch_host -fprofile-instr-generate "
"-Xarch_host -fcoverage-mapping "
"-fno-sycl-use-footer "
# "-save-temps=obj "
)
Expand Down
4 changes: 1 addition & 3 deletions dpnp/cmake/tensor_build_flags.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,7 @@ endif()
# Remove global coverage flags for tensor
# use link-time only approach like dpctl
if(DPNP_GENERATE_COVERAGE)
string(REPLACE "-fprofile-instr-generate " "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
string(REPLACE "-fcoverage-mapping " "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
string(REPLACE "-fno-sycl-use-footer " "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
string(REPLACE "${PROFILE_FLAGS}" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
endif()

# Tensor-specific debug flags
Expand Down
18 changes: 8 additions & 10 deletions dpnp/libtensor/source/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -344,19 +344,20 @@ endforeach()
# An inline function with FP math that both instantiate gets the flags of the
# copy the linker keeps (the dpnp one, see above), so keep such helpers out of
# shared headers or give them the same flags in both groups.
# dpnp sources of the modules with the libtensor radix select kernels
set(_dpnp_radix_select_sources ${_dpnp_sorting_sources} ${_statistics_impl_sources})
foreach(_src_fn ${_dpnp_sources})
get_source_file_property(_cmpl_options_prop ${_src_fn} COMPILE_OPTIONS)
set(_combined_options_prop
${_cmpl_options_prop}
"${_clang_prefix}-fno-approx-func"
"${_clang_prefix}-fno-finite-math-only"
)
if(DPNP_GENERATE_COVERAGE AND NOT _src_fn IN_LIST _dpnp_radix_select_sources)
if(DPNP_GENERATE_COVERAGE)
# host only, as PROFILE_FLAGS in the top-level CMakeLists.txt
Comment thread
ndgrigorian marked this conversation as resolved.
Resolved
list(
APPEND _combined_options_prop
-Xarch_host
-fprofile-instr-generate
-Xarch_host
-fcoverage-mapping
-fno-sycl-use-footer
)
Expand All @@ -370,16 +371,11 @@ endforeach()
if(DPNP_GENERATE_COVERAGE)
# libtensor code the dpnp functions use, measured like the dpnp sources.
# Host only: their device coverage records break sycl-link
# (a source property, unlike target options, keeps the repeated -Xarch_host).
# The radix select modules are host only too: every kernel image of a module
# gets all its device counters as device globals, and their init events
# crash the OpenCL CPU runtime at random in the kernel bundle launches.
# The device counts never reach the profile anyway
# (a source property keeps the repeated -Xarch_host; target options need SHELL:)
set_property(
SOURCE
${_static_lib_sources}
${CMAKE_CURRENT_SOURCE_DIR}/elementwise_functions/elementwise_functions_type_utils.cpp
${_dpnp_radix_select_sources}
APPEND
PROPERTY
COMPILE_OPTIONS
Expand Down Expand Up @@ -426,7 +422,9 @@ foreach(python_module_name ${_py_trgts})
if(DPNP_TENSOR_GENERATE_COVERAGE_FOR_PYBIND11_EXTENSIONS)
target_compile_options(
${python_module_name}
PRIVATE -fprofile-instr-generate -fcoverage-mapping
PRIVATE
"SHELL:-Xarch_host -fprofile-instr-generate"
"SHELL:-Xarch_host -fcoverage-mapping"
)
endif()
target_link_options(
Expand Down
Loading