From cbb483ff1923dbb0bda1c3cfd996b14ad81abe6c Mon Sep 17 00:00:00 2001 From: Anton Volkov Date: Mon, 6 Jul 2026 23:14:12 +0200 Subject: [PATCH] Suppress DPC++/SYCL header deprecation warnings when building dpnp.tensor on Windows Re-land of #2984, which was merged into the intermediate branch `pin-conda-to-avoid-installing-faulty-build` (whose PR #2982 was closed, not merged), so the change never reached master. Follow-up to #2856 and #2770. The `dpnp.tensor` target never got the same `SYSTEM` treatment, so it was the one target still leaking DPC++/SYCL header `-Wdeprecated-declarations` warnings (hundreds of thousands of lines in the Windows conda build CI log). All of them originate inside the DPC++/SYCL headers themselves, out of dpnp's control. Split the include directories in the `dpnp/tensor` target loop so dpnp's own headers stay `PRIVATE` and the third-party headers (`SYCL_INCLUDE_DIR`, `Dpctl_INCLUDE_DIR`, generated Cython headers) are added as `SYSTEM PRIVATE`, mirroring the pattern from #2770 for the `backend/extensions/*` targets. Co-Authored-By: Claude Opus 4.8 (1M context) --- CHANGELOG.md | 1 + dpnp/tensor/CMakeLists.txt | 9 ++++++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 81badeda4a72..7dcc70f1a3c0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -61,6 +61,7 @@ This release is compatible with NumPy 2.5. * Fixed `dpnp.mgrid` and `dpnp.ogrid` to return consistent results between single-slice and tuple-of-slices syntax when the step is a complex number with a non-integer magnitude (e.g. `2.5j`) [#2971](https://github.com/IntelPython/dpnp/pull/2971) * Fixed `icx`/`icpx` warning during `conda build` by stripping the GCC-only `-fno-merge-constants` flag injected by conda-forge into `CFLAGS`/`CXXFLAGS` [#2978](https://github.com/IntelPython/dpnp/pull/2978) * Fixed `dpnp.asnumpy` and `dpnp.ndarray.asnumpy` ignoring the `order` keyword, which caused a non-contiguous source array to be returned with a non-contiguous layout even when `order="C"` was requested [#2980](https://github.com/IntelPython/dpnp/pull/2980) +* Fixed a flood of deprecation warnings from the DPC++/SYCL headers when building `dpnp.tensor` on Windows [#2984](https://github.com/IntelPython/dpnp/pull/2984) * Fixed `dpnp.tensor.acosh` and `dpnp.tensor.acos` returning infinity for complex numbers with large negative real parts [#2928](https://github.com/IntelPython/dpnp/pull/2928) * Fixed `__array_namespace_info__().devices()` and `.default_device()` to return Python array API compatible device objects [#2979](https://github.com/IntelPython/dpnp/pull/2979) diff --git a/dpnp/tensor/CMakeLists.txt b/dpnp/tensor/CMakeLists.txt index 3a74361336c5..5345b672397d 100644 --- a/dpnp/tensor/CMakeLists.txt +++ b/dpnp/tensor/CMakeLists.txt @@ -356,9 +356,16 @@ foreach(python_module_name ${_py_trgts}) ${python_module_name} PRIVATE ${CMAKE_SOURCE_DIR}/dpnp/include - ${Dpctl_INCLUDE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/libtensor/include ${CMAKE_CURRENT_SOURCE_DIR}/libtensor/source/ + ) + + target_include_directories( + ${python_module_name} + SYSTEM + PRIVATE + ${SYCL_INCLUDE_DIR} + ${Dpctl_INCLUDE_DIR} ${CMAKE_BINARY_DIR} # For generated Cython headers ) target_link_options(${python_module_name} PRIVATE ${_linker_options})