diff --git a/.github/workflows/build-sphinx.yml b/.github/workflows/build-sphinx.yml
index 31423357e3f3..05f5b2711e24 100644
--- a/.github/workflows/build-sphinx.yml
+++ b/.github/workflows/build-sphinx.yml
@@ -26,7 +26,7 @@ jobs:
name: Build and Deploy Docs
runs-on: ubuntu-22.04
- timeout-minutes: 60
+ timeout-minutes: 90
permissions:
# Needed to cancel any previous runs that are not completed for a given workflow
diff --git a/.github/workflows/check-onemath.yaml b/.github/workflows/check-onemath.yaml
index bead55d5f495..3ad8ba1ee84e 100644
--- a/.github/workflows/check-onemath.yaml
+++ b/.github/workflows/check-onemath.yaml
@@ -74,7 +74,7 @@ jobs:
os: [ubuntu-22.04] # windows-2022 - no DFT support for Windows in oneMKL
runs-on: ${{ matrix.os }}
- timeout-minutes: 60
+ timeout-minutes: 120
defaults:
run:
@@ -133,6 +133,14 @@ jobs:
if: env.rerun-tests-on-failure != 'true'
run: |
python -m pytest -ra --pyargs dpnp.tests
+ env:
+ SKIP_TENSOR_TESTS: 1
+ SYCL_CACHE_PERSISTENT: 1
+
+ - name: Run tensor tests
+ if: env.rerun-tests-on-failure != 'true'
+ run: |
+ python -m pytest -ra --pyargs dpnp.tests.tensor
env:
SYCL_CACHE_PERSISTENT: 1
@@ -150,6 +158,24 @@ jobs:
mamba activate ${{ env.test-env-name }}
python -m pytest -ra --pyargs dpnp.tests
+ env:
+ SKIP_TENSOR_TESTS: 1
+ SYCL_CACHE_PERSISTENT: 1
+
+ - name: ReRun tensor tests on Linux
+ if: env.rerun-tests-on-failure == 'true'
+ id: run_tensor_tests
+ uses: nick-fields/retry@ce71cc2ab81d554ebbe88c79ab5975992d79ba08 # v3.0.2
+ with:
+ timeout_minutes: ${{ env.rerun-tests-timeout }}
+ max_attempts: ${{ env.rerun-tests-max-attempts }}
+ retry_on: any
+ command: |
+ . $CONDA/etc/profile.d/conda.sh
+ . $CONDA/etc/profile.d/mamba.sh
+ mamba activate ${{ env.test-env-name }}
+
+ python -m pytest -ra --pyargs dpnp.tests.tensor
env:
SYCL_CACHE_PERSISTENT: 1
@@ -239,6 +265,14 @@ jobs:
if: env.rerun-tests-on-failure != 'true'
run: |
python -m pytest -ra --pyargs dpnp.tests
+ env:
+ SKIP_TENSOR_TESTS: 1
+ SYCL_CACHE_PERSISTENT: 1
+
+ - name: Run tensor tests
+ if: env.rerun-tests-on-failure != 'true'
+ run: |
+ python -m pytest -ra --pyargs dpnp.tests.tensor
env:
SYCL_CACHE_PERSISTENT: 1
@@ -256,5 +290,23 @@ jobs:
mamba activate ${{ env.test-env-name }}
python -m pytest -ra --pyargs dpnp.tests
+ env:
+ SKIP_TENSOR_TESTS: 1
+ SYCL_CACHE_PERSISTENT: 1
+
+ - name: ReRun tensor tests on Linux
+ if: env.rerun-tests-on-failure == 'true'
+ id: run_tensor_tests_branch
+ uses: nick-fields/retry@ce71cc2ab81d554ebbe88c79ab5975992d79ba08 # v3.0.2
+ with:
+ timeout_minutes: ${{ env.rerun-tests-timeout }}
+ max_attempts: ${{ env.rerun-tests-max-attempts }}
+ retry_on: any
+ command: |
+ . $CONDA/etc/profile.d/conda.sh
+ . $CONDA/etc/profile.d/mamba.sh
+ mamba activate ${{ env.test-env-name }}
+
+ python -m pytest -ra --pyargs dpnp.tests.tensor
env:
SYCL_CACHE_PERSISTENT: 1
diff --git a/.github/workflows/conda-package.yml b/.github/workflows/conda-package.yml
index 886204654a98..afd34ee00543 100644
--- a/.github/workflows/conda-package.yml
+++ b/.github/workflows/conda-package.yml
@@ -37,7 +37,7 @@ jobs:
actions: write
runs-on: ${{ matrix.os }}
- timeout-minutes: 60
+ timeout-minutes: 90
defaults:
run:
@@ -220,6 +220,7 @@ jobs:
- name: Run tests
if: env.rerun-tests-on-failure != 'true'
run: |
+ export SKIP_TENSOR_TESTS=1
if [[ "${{ matrix.python }}" == "${{ env.python-ver-test-all-dtypes }}" ]]; then
export DPNP_TEST_ALL_INT_TYPES=1
python -m pytest -ra --pyargs ${{ env.package-name }}.tests
@@ -239,6 +240,7 @@ jobs:
. $CONDA/etc/profile.d/conda.sh
. $CONDA/etc/profile.d/mamba.sh
mamba activate ${{ env.test-env-name }}
+ export SKIP_TENSOR_TESTS=1
if [[ "${{ matrix.python }}" == "${{ env.python-ver-test-all-dtypes }}" ]]; then
export DPNP_TEST_ALL_INT_TYPES=1
@@ -247,6 +249,26 @@ jobs:
python -m pytest -n auto -ra --pyargs ${{ env.package-name }}.tests
fi
+ - name: Run tensor tests
+ if: env.rerun-tests-on-failure != 'true'
+ run: |
+ python -m pytest -n auto -ra --pyargs dpnp.tests.tensor
+
+ - name: Run tensor tests
+ if: env.rerun-tests-on-failure == 'true'
+ id: run_tests_tensor_linux
+ uses: nick-fields/retry@ce71cc2ab81d554ebbe88c79ab5975992d79ba08 # v3.0.2
+ with:
+ timeout_minutes: ${{ env.rerun-tests-timeout }}
+ max_attempts: ${{ env.rerun-tests-max-attempts }}
+ retry_on: any
+ command: |
+ . $CONDA/etc/profile.d/conda.sh
+ . $CONDA/etc/profile.d/mamba.sh
+ mamba activate ${{ env.test-env-name }}
+
+ python -m pytest -n auto -ra --pyargs dpnp.tests.tensor
+
test_windows:
name: Test
@@ -382,6 +404,7 @@ jobs:
if: env.rerun-tests-on-failure != 'true'
shell: pwsh
run: |
+ $env:SKIP_TENSOR_TESTS=1
if (${{ matrix.python }} -eq ${{ env.python-ver-test-all-dtypes }}) {
$env:DPNP_TEST_ALL_INT_TYPES=1
python -m pytest -ra --pyargs ${{ env.package-name }}.tests
@@ -399,6 +422,7 @@ jobs:
retry_on: any
shell: pwsh
command: |
+ $env:SKIP_TENSOR_TESTS=1
if ( ${{ matrix.python }} -eq ${{ env.python-ver-test-all-dtypes }} ) {
$env:DPNP_TEST_ALL_INT_TYPES=1
python -m pytest -ra --pyargs ${{ env.package-name }}.tests
@@ -406,6 +430,24 @@ jobs:
python -m pytest -n auto -ra --pyargs ${{ env.package-name }}.tests
}
+ - name: Run tensor tests
+ if: env.rerun-tests-on-failure != 'true'
+ shell: pwsh
+ run: |
+ python -m pytest -n auto -ra --pyargs dpnp.tests.tensor
+
+ - name: Run tensor tests
+ if: env.rerun-tests-on-failure == 'true'
+ id: run_tests_tensor_win
+ uses: nick-fields/retry@ce71cc2ab81d554ebbe88c79ab5975992d79ba08 # v3.0.2
+ with:
+ timeout_minutes: ${{ env.rerun-tests-timeout }}
+ max_attempts: ${{ env.rerun-tests-max-attempts }}
+ retry_on: any
+ shell: pwsh
+ command: |
+ python -m pytest -n auto -ra --pyargs dpnp.tests.tensor
+
upload:
name: Upload
diff --git a/.github/workflows/generate_coverage.yaml b/.github/workflows/generate_coverage.yaml
index 5fd211e55a81..3d5d34531adf 100644
--- a/.github/workflows/generate_coverage.yaml
+++ b/.github/workflows/generate_coverage.yaml
@@ -11,7 +11,7 @@ jobs:
name: Generate coverage and push to Coveralls.io
runs-on: ubuntu-latest
- timeout-minutes: 120
+ timeout-minutes: 150
permissions:
# Needed to cancel any previous runs that are not completed for a given workflow
@@ -122,7 +122,7 @@ jobs:
uses: nick-fields/retry@ad984534de44a9489a53aefd81eb77f87c70dc60 # v4.0.0
with:
shell: bash
- timeout_minutes: 60
+ timeout_minutes: 120
max_attempts: 5
retry_on: error
command: |
@@ -130,6 +130,7 @@ jobs:
conda activate coverage
[ -f /opt/intel/oneapi/setvars.sh ] && source /opt/intel/oneapi/setvars.sh
git clean -fxd
+ export SKIP_TENSOR_TESTS=1
python scripts/gen_coverage.py
- name: Total number of coverage attempts
diff --git a/.gitignore b/.gitignore
index 5d2725d3186f..f66bfbb3fdd8 100644
--- a/.gitignore
+++ b/.gitignore
@@ -28,6 +28,7 @@ dpnp_pytest.*
example3
*dpnp_backend*
+dpnp/include/dpnp/tensor/*.h
dpnp/**/*.cpython*.so
dpnp/**/*.pyd
*~
diff --git a/CHANGELOG.md b/CHANGELOG.md
index f8aaae542ec5..bf659a351a57 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -6,6 +6,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## [0.20.0] - MM/DD/2026
+This release introduces a major architectural change: the Array API-compliant tensor implementation has been migrated from `dpctl.tensor` into `dpnp.tensor`, simplifying maintenance, reducing cross-project dependencies, and allows the tensor implementation to evolve within `dpnp`.
This release changes the license from `BSD-2-Clause` to `BSD-3-Clause`.
This release achieves `dpnp` compatibility with Python 3.14 and enables distributing `dpnp` packages with the latest Python version.
Also, that release drops support for Python 3.9, making Python 3.10 the minimum required version.
@@ -28,6 +29,7 @@ Also, that release drops support for Python 3.9, making Python 3.10 the minimum
* Added implementation of `dpnp.isin` function [#2595](https://github.com/IntelPython/dpnp/pull/2595)
* Added implementation of `dpnp.scipy.linalg.lu` (SciPy-compatible) [#2787](https://github.com/IntelPython/dpnp/pull/2787)
* Added support for ndarray subclassing via `dpnp.ndarray.view` method with `type` parameter [#2815](https://github.com/IntelPython/dpnp/issues/2815)
+* Migrated tensor implementation from `dpctl.tensor` into `dpnp.tensor`, making `dpnp` the primary owner of the Array API-compliant tensor layer [#2856](https://github.com/IntelPython/dpnp/pull/2856)
### Changed
@@ -84,6 +86,7 @@ Also, that release drops support for Python 3.9, making Python 3.10 the minimum
* Resolved an issue with strides calculation in `dpnp.diagonal` to return correct values for empty diagonals [#2814](https://github.com/IntelPython/dpnp/pull/2814)
* Fixed test tolerance issues for float16 intermediate precision that became visible when testing against conda-forge's NumPy [#2828](https://github.com/IntelPython/dpnp/pull/2828)
* Ensured device aware dtype handling in `dpnp.identity` and `dpnp.gradient` [#2835](https://github.com/IntelPython/dpnp/pull/2835)
+* Fixed `dpnp.tensor.round` to use device-aware output dtype for boolean input [#2851](https://github.com/IntelPython/dpnp/pull/2851)
### Security
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 129bf1d87c25..b5c1068c1677 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -37,12 +37,23 @@ project(
)
option(DPNP_GENERATE_COVERAGE "Enable build DPNP with coverage instrumentation" OFF)
+option(
+ DPNP_TENSOR_GENERATE_COVERAGE_FOR_PYBIND11_EXTENSIONS
+ "Build dpnp tensor pybind11 offloading extensions with coverage instrumentation"
+ OFF
+)
option(DPNP_BACKEND_TESTS "Enable building of DPNP backend test suite" OFF)
option(
DPNP_WITH_REDIST
"Build DPNP assuming DPC++ redistributable is installed into Python prefix"
OFF
)
+option(
+ DPNP_TENSOR_OFFLOAD_COMPRESS
+ "Build dpnp tensor using offload section compression feature of DPC++ to reduce \
+size of shared object with offloading sections"
+ OFF
+)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED True)
@@ -106,7 +117,6 @@ find_package(Cython REQUIRED)
find_package(Dpctl REQUIRED)
message(STATUS "Dpctl_INCLUDE_DIR=" ${Dpctl_INCLUDE_DIR})
-message(STATUS "Dpctl_TENSOR_INCLUDE_DIR=" ${Dpctl_TENSOR_INCLUDE_DIR})
option(DPNP_USE_ONEMATH "Build DPNP with oneMath" OFF)
set(DPNP_TARGET_CUDA
diff --git a/doc/conf.py b/doc/conf.py
index 469e6d5f5353..57119eab5396 100644
--- a/doc/conf.py
+++ b/doc/conf.py
@@ -6,6 +6,7 @@
# http://www.sphinx-doc.org/en/master/config
from datetime import datetime
+from urllib.parse import urljoin
from sphinx.ext.autodoc import FunctionDocumenter
from sphinx.ext.napoleon import NumpyDocstring, docstring
@@ -231,6 +232,9 @@ def _can_document_member(member, *args, **kwargs):
autosummary_generate = True
+_DPCTL_021_BASE = "https://intelpython.github.io/dpctl/0.21.1/"
+_DPCTL_021_INV = urljoin(_DPCTL_021_BASE, "objects.inv")
+
intersphinx_mapping = {
"python": ("https://docs.python.org/3/", None),
"numpy": ("https://numpy.org/doc/stable/", None),
@@ -302,3 +306,65 @@ def _parse_returns_section_patched(self, section: str) -> list[str]:
NumpyDocstring._parse_returns_section = _parse_returns_section_patched
+
+
+# TODO: Remove once dpnp.tensor docs are generated in dpnp
+def _load_dpctl_tensor_inventory(app):
+ """Load dpctl 0.21.1 inventory for dpnp.tensor fallback only."""
+ from sphinx.ext.intersphinx import fetch_inventory
+ from sphinx.util import logging
+
+ logger = logging.getLogger(__name__)
+
+ try:
+ inv = fetch_inventory(app, _DPCTL_021_BASE, _DPCTL_021_INV)
+ except Exception as exc:
+ logger.warning(
+ "Failed to load dpctl 0.21.1 inventory from %s: %s",
+ _DPCTL_021_INV,
+ exc,
+ )
+ inv = {}
+
+ app.builder.env._dpctl_tensor_021_inventory = inv
+
+
+# TODO: Remove once dpnp.tensor docs are generated in dpnp
+def _resolve_dpnp_tensor_refs(app, env, node, contnode):
+ """Resolve dpnp.tensor.* references to dpctl 0.21.1 documentation.
+
+ This temporary workaround is needed because dpnp.tensor documentation
+ is not generated yet, while the corresponding API is still documented
+ in dpctl 0.21.1.
+ """
+ from docutils import nodes as docutils_nodes
+
+ target = node.get("reftarget", "")
+ if not target.startswith("dpnp.tensor"):
+ return None
+
+ dpctl_target = target.replace("dpnp.tensor", "dpctl.tensor", 1)
+ dpctl_tensor_inv = getattr(env, "_dpctl_tensor_021_inventory", {})
+
+ for _objtype, objects in dpctl_tensor_inv.items():
+ if dpctl_target not in objects:
+ continue
+
+ item = objects[dpctl_target]
+ location = item.uri
+ if location.endswith("$"):
+ location = location[:-1] + dpctl_target
+
+ refuri = urljoin(_DPCTL_021_BASE, location)
+ newnode = docutils_nodes.reference(
+ "", "", internal=False, refuri=refuri
+ )
+ newnode += contnode.deepcopy()
+ return newnode
+
+ return None
+
+
+def setup(app):
+ app.connect("builder-inited", _load_dpctl_tensor_inventory, priority=400)
+ app.connect("missing-reference", _resolve_dpnp_tensor_refs, priority=400)
diff --git a/doc/index.rst b/doc/index.rst
index 38c12489636b..847680fc11d9 100644
--- a/doc/index.rst
+++ b/doc/index.rst
@@ -13,6 +13,7 @@ Data Parallel Extension for NumPy*
overview
quick_start_guide
reference/index
+ tensor
.. toctree::
:maxdepth: 1
diff --git a/doc/reference/exceptions.rst b/doc/reference/exceptions.rst
index 8f459b9f3aaa..69980ac8d8c2 100644
--- a/doc/reference/exceptions.rst
+++ b/doc/reference/exceptions.rst
@@ -20,7 +20,7 @@ Exceptions
.. exception:: DLPackCreationError
Given when constructing DLPack capsule from either :class:`dpnp.ndarray` or
- :class:`dpctl.tensor.usm_ndarray` based on a USM allocation
+ :class:`dpnp.tensor.usm_ndarray` based on a USM allocation
on a partitioned SYCL device.
.. rubric:: Examples
diff --git a/doc/tensor.rst b/doc/tensor.rst
new file mode 100644
index 000000000000..22a1812f38a3
--- /dev/null
+++ b/doc/tensor.rst
@@ -0,0 +1,70 @@
+.. _tensor:
+
+Tensor (``dpnp.tensor``)
+========================
+
+``dpnp.tensor`` provides a reference implementation of the
+`Python Array API `_ specification.
+The implementation uses data-parallel algorithms suitable for execution on
+accelerators, such as GPUs.
+
+It also provides the underlying Array API-compliant implementation
+used by ``dpnp``.
+
+``dpnp.tensor`` is written using C++ and
+`SYCL `_
+and oneAPI extensions implemented in
+`Intel(R) oneAPI DPC++ compiler `_.
+
+Design and Motivation
+---------------------
+
+The tensor implementation was originally developed as a standalone project and
+later integrated into the `dpctl `_
+library as ``dpctl.tensor``. It has since been migrated into ``dpnp``,
+making ``dpnp`` the primary owner and development location of the tensor implementation.
+
+This change simplifies maintenance, reduces cross-project
+dependencies, and enables independent development and release cycles.
+
+Relationship to ``dpnp.ndarray``
+--------------------------------
+
+:class:`dpnp.ndarray` is a high-level array object built on top of
+``dpnp.tensor.usm_ndarray``, storing array data in Unified Shared Memory
+(USM) allocated on a SYCL device. Most users interact with
+:class:`dpnp.ndarray` directly; ``dpnp.tensor.usm_ndarray`` may appear in error
+messages or type signatures when working with device placement or
+interoperability.
+
+Relationship to ``dpctl``
+-------------------------
+
+The migration of ``dpctl.tensor`` into ``dpnp.tensor`` does not replace
+`dpctl `_ itself.
+``dpctl`` remains responsible for device and queue management
+(:class:`dpctl.SyclDevice`, :class:`dpctl.SyclQueue`) as well as USM memory
+allocation. ``dpnp`` builds on top of these capabilities.
+
+Example
+-------
+
+.. code-block:: python
+
+ import dpnp
+ import dpnp.tensor as dpt
+
+ # Create a tensor array on the default device
+ x = dpt.asarray([1.0, 2.0, 3.0])
+
+ # dpnp.ndarray wraps the underlying usm_ndarray
+ a = dpnp.asarray([1.0, 2.0, 3.0])
+ assert isinstance(a.get_array(), dpt.usm_ndarray)
+
+.. note::
+
+ The ``dpnp.tensor`` API documentation will be added in a future release.
+
+ The current implementation remains compatible with the original
+ ``dpctl.tensor`` API. For the complete API reference, see the
+ `dpctl 0.21.1 tensor documentation `_.
diff --git a/dpnp/CMakeLists.txt b/dpnp/CMakeLists.txt
index 6850b799735c..d7acf368bcd0 100644
--- a/dpnp/CMakeLists.txt
+++ b/dpnp/CMakeLists.txt
@@ -86,11 +86,96 @@ function(build_dpnp_cython_ext _trgt _src _dest)
install(TARGETS ${_trgt} LIBRARY DESTINATION ${_dest})
endfunction()
+function(build_dpnp_tensor_ext _trgt _src _dest)
+ set(options SYCL)
+ cmake_parse_arguments(BUILD_DPNP_TENSOR "${options}" "RELATIVE_PATH" "" ${ARGN})
+ add_cython_target(${_trgt} ${_src} CXX OUTPUT_VAR _generated_src)
+ set(_cythonize_trgt "${_trgt}_cythonize_pyx")
+ python_add_library(${_trgt} MODULE WITH_SOABI ${_generated_src})
+ if(BUILD_DPNP_TENSOR_SYCL)
+ add_sycl_to_target(TARGET ${_trgt} SOURCES ${_generated_src})
+ target_compile_options(${_trgt} PRIVATE -fno-sycl-id-queries-fit-in-int)
+ target_link_options(${_trgt} PRIVATE -fsycl-device-code-split=per_kernel)
+ if(DPNP_TENSOR_OFFLOAD_COMPRESS)
+ target_link_options(${_trgt} PRIVATE --offload-compress)
+ endif()
+ if(_dpnp_sycl_targets)
+ # make fat binary
+ target_compile_options(
+ ${_trgt}
+ PRIVATE ${_dpnp_sycl_target_compile_options}
+ )
+ target_link_options(${_trgt} PRIVATE ${_dpnp_sycl_target_link_options})
+ endif()
+ endif()
+ target_link_libraries(${_trgt} PRIVATE Python::NumPy)
+ if(DPNP_GENERATE_COVERAGE)
+ target_compile_definitions(${_trgt} PRIVATE CYTHON_TRACE=1 CYTHON_TRACE_NOGIL=1)
+ if(BUILD_DPNP_TENSOR_SYCL)
+ target_compile_options(${_trgt} PRIVATE -fno-sycl-use-footer)
+ endif()
+ endif()
+ # Dpctl
+ target_include_directories(${_trgt} PRIVATE ${Dpctl_INCLUDE_DIR})
+ target_link_directories(${_trgt} PRIVATE ${Dpctl_INCLUDE_DIR}/..)
+ target_link_libraries(${_trgt} PRIVATE DPCTLSyclInterface)
+ set(_linker_options "LINKER:${DPNP_LDFLAGS}")
+ target_link_options(${_trgt} PRIVATE ${_linker_options})
+ get_filename_component(_name_wle ${_generated_src} NAME_WLE)
+ get_filename_component(_generated_src_dir ${_generated_src} DIRECTORY)
+ set(_generated_public_h "${_generated_src_dir}/${_name_wle}.h")
+ set(_generated_api_h "${_generated_src_dir}/${_name_wle}_api.h")
+
+ # TODO: create separate folder inside build folder that contains only
+ # headers related to this target and appropriate folder structure to
+ # eliminate shadow dependencies
+ # Go up two levels to build root for "dpnp/tensor/_usmarray.h" resolution
+ get_filename_component(_parent_dir ${_generated_src_dir} DIRECTORY)
+ get_filename_component(_build_root ${_parent_dir} DIRECTORY)
+ # TODO: do not set directory if we did not generate header
+ target_include_directories(${_trgt} INTERFACE ${_build_root})
+ set(_rpath_value "$ORIGIN")
+ if(BUILD_DPNP_TENSOR_RELATIVE_PATH)
+ set(_rpath_value "${_rpath_value}/${BUILD_DPNP_TENSOR_RELATIVE_PATH}")
+ endif()
+ if(DPNP_WITH_REDIST)
+ set(_rpath_value "${_rpath_value}:${_rpath_value}/../../..")
+ endif()
+ set_target_properties(${_trgt} PROPERTIES INSTALL_RPATH ${_rpath_value})
+
+ install(TARGETS ${_trgt} LIBRARY DESTINATION ${_dest})
+ install(
+ FILES ${_generated_api_h}
+ DESTINATION ${CMAKE_INSTALL_PREFIX}/dpnp/include/${_dest}
+ OPTIONAL
+ )
+ install(
+ FILES ${_generated_public_h}
+ DESTINATION ${CMAKE_INSTALL_PREFIX}/dpnp/include/${_dest}
+ OPTIONAL
+ )
+ if(DPNP_GENERATE_COVERAGE)
+ get_filename_component(_original_src_dir ${_src} DIRECTORY)
+ file(RELATIVE_PATH _rel_dir ${CMAKE_SOURCE_DIR} ${_original_src_dir})
+ install(FILES ${_generated_src} DESTINATION ${CMAKE_INSTALL_PREFIX}/${_rel_dir})
+ endif()
+
+ # Create target with headers only, because python is managing all the
+ # library imports at runtime
+ set(_trgt_headers ${_trgt}_headers)
+ add_library(${_trgt_headers} INTERFACE)
+ add_dependencies(${_trgt_headers} ${_trgt})
+ get_target_property(_trgt_headers_dir ${_trgt} INTERFACE_INCLUDE_DIRECTORIES)
+ target_include_directories(${_trgt_headers} INTERFACE ${_trgt_headers_dir})
+endfunction()
+
function(build_dpnp_cython_ext_with_backend _trgt _src _dest)
build_dpnp_cython_ext(${_trgt} ${_src} ${_dest})
target_link_libraries(${_trgt} PRIVATE dpnp_backend_library)
endfunction()
+add_subdirectory(tensor)
+
add_subdirectory(backend)
add_subdirectory(backend/extensions/blas)
add_subdirectory(backend/extensions/fft)
diff --git a/dpnp/__init__.py b/dpnp/__init__.py
index 02420107972f..d2ea158d4d44 100644
--- a/dpnp/__init__.py
+++ b/dpnp/__init__.py
@@ -28,7 +28,6 @@
import os
import sys
-import warnings
mypath = os.path.dirname(os.path.realpath(__file__))
@@ -61,10 +60,7 @@
[os.getenv("PATH", ""), dll_path]
)
-# Borrowed from DPCTL
-with warnings.catch_warnings():
- warnings.simplefilter("ignore", DeprecationWarning)
- from dpctl.tensor import __array_api_version__, DLDeviceType
+from .tensor import __array_api_version__, DLDeviceType
from .dpnp_array import dpnp_array as ndarray
from .dpnp_array_api_info import __array_namespace_info__
diff --git a/dpnp/__main__.py b/dpnp/__main__.py
new file mode 100644
index 000000000000..1c9c652109ee
--- /dev/null
+++ b/dpnp/__main__.py
@@ -0,0 +1,78 @@
+# *****************************************************************************
+# Copyright (c) 2026, Intel Corporation
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are met:
+# - Redistributions of source code must retain the above copyright notice,
+# this list of conditions and the following disclaimer.
+# - Redistributions in binary form must reproduce the above copyright notice,
+# this list of conditions and the following disclaimer in the documentation
+# and/or other materials provided with the distribution.
+# - Neither the name of the copyright holder nor the names of its contributors
+# may be used to endorse or promote products derived from this software
+# without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+# THE POSSIBILITY OF SUCH DAMAGE.
+# *****************************************************************************
+
+import argparse
+import importlib
+import os
+import os.path
+import sys
+
+
+def _dpnp_dir() -> str:
+ dpnp_dir = importlib.util.find_spec("dpnp").submodule_search_locations[0]
+ abs_dpnp_dir = os.path.abspath(dpnp_dir)
+ return abs_dpnp_dir
+
+
+def get_tensor_include_dir() -> str:
+ """Prints path to dpnp libtensor include directory"""
+ dpnp_dir = _dpnp_dir()
+ libtensor_dir = os.path.join(dpnp_dir, "tensor", "libtensor", "include")
+ return libtensor_dir
+
+
+def print_tensor_include_flags() -> None:
+ """Prints include flags for dpnp tensor library"""
+ libtensor_dir = get_tensor_include_dir()
+ print("-I " + libtensor_dir)
+
+
+def main() -> None:
+ """Main entry-point."""
+ parser = argparse.ArgumentParser()
+ parser.add_argument(
+ "--tensor-includes",
+ action="store_true",
+ help="Include flags for dpnp libtensor headers.",
+ )
+ parser.add_argument(
+ "--tensor-include-dir",
+ action="store_true",
+ help="Path to dpnp libtensor include directory.",
+ )
+ args = parser.parse_args()
+ if not sys.argv[1:]:
+ parser.print_help()
+ if args.tensor_includes:
+ print_tensor_include_flags()
+ if args.tensor_include_dir:
+ print(get_tensor_include_dir())
+
+
+if __name__ == "__main__":
+ main()
diff --git a/dpnp/backend/CMakeLists.txt b/dpnp/backend/CMakeLists.txt
index ddca557a08f4..433ab298d476 100644
--- a/dpnp/backend/CMakeLists.txt
+++ b/dpnp/backend/CMakeLists.txt
@@ -89,7 +89,6 @@ target_compile_definitions(${_trgt} PUBLIC PSTL_USE_PARALLEL_POLICIES=0)
target_compile_definitions(${_trgt} PUBLIC ONEDPL_USE_PREDEFINED_POLICIES=0)
target_include_directories(${_trgt} PUBLIC ${Dpctl_INCLUDE_DIR})
-target_include_directories(${_trgt} PUBLIC ${Dpctl_TENSOR_INCLUDE_DIR})
target_link_directories(${_trgt} PUBLIC "${Dpctl_INCLUDE_DIR}/..")
target_link_libraries(${_trgt} PUBLIC DPCTLSyclInterface)
diff --git a/dpnp/backend/extensions/blas/CMakeLists.txt b/dpnp/backend/extensions/blas/CMakeLists.txt
index 5960dfcd8028..b4013d82eb40 100644
--- a/dpnp/backend/extensions/blas/CMakeLists.txt
+++ b/dpnp/backend/extensions/blas/CMakeLists.txt
@@ -39,6 +39,9 @@ set(_module_src
pybind11_add_module(${python_module_name} MODULE ${_module_src})
add_sycl_to_target(TARGET ${python_module_name} SOURCES ${_module_src})
+# Ensure Cython modules build first so _usmarray.h exists
+add_dependencies(${python_module_name} _usmarray)
+
if(_dpnp_sycl_targets)
# make fat binary
target_compile_options(
@@ -65,14 +68,20 @@ set_target_properties(
target_include_directories(
${python_module_name}
- PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/../common
+ PRIVATE
+ ${CMAKE_CURRENT_SOURCE_DIR}/../common
+ ${CMAKE_SOURCE_DIR}/dpnp/backend/include
+ ${CMAKE_SOURCE_DIR}/dpnp/tensor/libtensor/include
)
# treat below headers as system to suppress the warnings there during the build
target_include_directories(
${python_module_name}
SYSTEM
- PRIVATE ${SYCL_INCLUDE_DIR} ${Dpctl_INCLUDE_DIRS} ${Dpctl_TENSOR_INCLUDE_DIR}
+ PRIVATE
+ ${SYCL_INCLUDE_DIR}
+ ${Dpctl_INCLUDE_DIRS}
+ ${CMAKE_BINARY_DIR} # For generated Cython headers
)
if(WIN32)
diff --git a/dpnp/backend/extensions/blas/dot_common.hpp b/dpnp/backend/extensions/blas/dot_common.hpp
index 383804ff1718..d9c3ae7f1c87 100644
--- a/dpnp/backend/extensions/blas/dot_common.hpp
+++ b/dpnp/backend/extensions/blas/dot_common.hpp
@@ -29,6 +29,7 @@
#pragma once
#include
+
#include
// dpctl tensor headers
diff --git a/dpnp/backend/extensions/blas/gemm.hpp b/dpnp/backend/extensions/blas/gemm.hpp
index 997d515f98a0..59a3d911d885 100644
--- a/dpnp/backend/extensions/blas/gemm.hpp
+++ b/dpnp/backend/extensions/blas/gemm.hpp
@@ -31,7 +31,7 @@
#include
#include
-#include
+#include "dpnp4pybind11.hpp"
namespace dpnp::extensions::blas
{
diff --git a/dpnp/backend/extensions/blas/gemv.hpp b/dpnp/backend/extensions/blas/gemv.hpp
index afe0c6387aa9..6da71ed0964f 100644
--- a/dpnp/backend/extensions/blas/gemv.hpp
+++ b/dpnp/backend/extensions/blas/gemv.hpp
@@ -31,7 +31,7 @@
#include
#include
-#include
+#include "dpnp4pybind11.hpp"
namespace dpnp::extensions::blas
{
diff --git a/dpnp/backend/extensions/blas/syrk.hpp b/dpnp/backend/extensions/blas/syrk.hpp
index 580239b28008..f6cec189489a 100644
--- a/dpnp/backend/extensions/blas/syrk.hpp
+++ b/dpnp/backend/extensions/blas/syrk.hpp
@@ -31,7 +31,7 @@
#include
#include
-#include
+#include "dpnp4pybind11.hpp"
namespace dpnp::extensions::blas
{
diff --git a/dpnp/backend/extensions/common/ext/common.hpp b/dpnp/backend/extensions/common/ext/common.hpp
index f0ce1722bfb1..3c82fb10ec16 100644
--- a/dpnp/backend/extensions/common/ext/common.hpp
+++ b/dpnp/backend/extensions/common/ext/common.hpp
@@ -29,8 +29,10 @@
#pragma once
#include
+
#include
#include
+
#include
// dpctl tensor headers
diff --git a/dpnp/backend/extensions/common/ext/details/common_internal.hpp b/dpnp/backend/extensions/common/ext/details/common_internal.hpp
index 31d9671a0a43..8db72ce32318 100644
--- a/dpnp/backend/extensions/common/ext/details/common_internal.hpp
+++ b/dpnp/backend/extensions/common/ext/details/common_internal.hpp
@@ -30,9 +30,11 @@
#include
+#include
+#include
+
#include "ext/common.hpp"
#include "utils/type_dispatch.hpp"
-#include
namespace dpctl_td_ns = dpctl::tensor::type_dispatch;
diff --git a/dpnp/backend/extensions/common/ext/validation_utils.hpp b/dpnp/backend/extensions/common/ext/validation_utils.hpp
index d41db8d5ca5a..03e0718d4450 100644
--- a/dpnp/backend/extensions/common/ext/validation_utils.hpp
+++ b/dpnp/backend/extensions/common/ext/validation_utils.hpp
@@ -32,7 +32,10 @@
#include
#include
-#include "dpctl4pybind11.hpp"
+#include "dpnp4pybind11.hpp"
+
+// dpctl tensor headers
+#include "utils/type_dispatch.hpp"
namespace ext::validation
{
diff --git a/dpnp/backend/extensions/elementwise_functions/elementwise_functions.hpp b/dpnp/backend/extensions/elementwise_functions/elementwise_functions.hpp
index 6a29c9a33c5a..affe2fb5dc49 100644
--- a/dpnp/backend/extensions/elementwise_functions/elementwise_functions.hpp
+++ b/dpnp/backend/extensions/elementwise_functions/elementwise_functions.hpp
@@ -30,16 +30,17 @@
#include
#include
+#include
#include
#include
#include
-#include
-
-#include "dpctl4pybind11.hpp"
#include
#include
-#include
+
+#include
+
+#include "dpnp4pybind11.hpp"
#include "elementwise_functions_type_utils.hpp"
#include "simplify_iteration_space.hpp"
diff --git a/dpnp/backend/extensions/elementwise_functions/elementwise_functions_type_utils.cpp b/dpnp/backend/extensions/elementwise_functions/elementwise_functions_type_utils.cpp
index 62f7584a3e0c..7300f938eabb 100644
--- a/dpnp/backend/extensions/elementwise_functions/elementwise_functions_type_utils.cpp
+++ b/dpnp/backend/extensions/elementwise_functions/elementwise_functions_type_utils.cpp
@@ -26,12 +26,13 @@
// THE POSSIBILITY OF SUCH DAMAGE.
//*****************************************************************************
-#include "dpctl4pybind11.hpp"
-
#include
#include
+
#include
+#include "dpnp4pybind11.hpp"
+
#include "elementwise_functions_type_utils.hpp"
// dpctl tensor headers
diff --git a/dpnp/backend/extensions/elementwise_functions/elementwise_functions_type_utils.hpp b/dpnp/backend/extensions/elementwise_functions/elementwise_functions_type_utils.hpp
index 1bb6fedd7027..58fe43c01589 100644
--- a/dpnp/backend/extensions/elementwise_functions/elementwise_functions_type_utils.hpp
+++ b/dpnp/backend/extensions/elementwise_functions/elementwise_functions_type_utils.hpp
@@ -28,10 +28,10 @@
#pragma once
-#include "dpctl4pybind11.hpp"
#include
#include
-#include
+
+#include "dpnp4pybind11.hpp"
// dpctl tensor headers
#include "utils/type_dispatch.hpp"
diff --git a/dpnp/backend/extensions/fft/CMakeLists.txt b/dpnp/backend/extensions/fft/CMakeLists.txt
index f8f63dd7fd3b..9c452d94bd23 100644
--- a/dpnp/backend/extensions/fft/CMakeLists.txt
+++ b/dpnp/backend/extensions/fft/CMakeLists.txt
@@ -33,6 +33,9 @@ set(_module_src ${CMAKE_CURRENT_SOURCE_DIR}/fft_py.cpp)
pybind11_add_module(${python_module_name} MODULE ${_module_src})
add_sycl_to_target(TARGET ${python_module_name} SOURCES ${_module_src})
+# Ensure Cython modules build first so _usmarray.h exists
+add_dependencies(${python_module_name} _usmarray)
+
if(_dpnp_sycl_targets)
# make fat binary
target_compile_options(
@@ -57,11 +60,21 @@ set_target_properties(
PROPERTIES CMAKE_POSITION_INDEPENDENT_CODE ON
)
+target_include_directories(
+ ${python_module_name}
+ PRIVATE
+ ${CMAKE_SOURCE_DIR}/dpnp/backend/include
+ ${CMAKE_SOURCE_DIR}/dpnp/tensor/libtensor/include
+)
+
# treat below headers as system to suppress the warnings there during the build
target_include_directories(
${python_module_name}
SYSTEM
- PRIVATE ${SYCL_INCLUDE_DIR} ${Dpctl_INCLUDE_DIRS} ${Dpctl_TENSOR_INCLUDE_DIR}
+ PRIVATE
+ ${SYCL_INCLUDE_DIR}
+ ${Dpctl_INCLUDE_DIRS}
+ ${CMAKE_BINARY_DIR} # For generated Cython headers
)
if(WIN32)
diff --git a/dpnp/backend/extensions/fft/in_place.hpp b/dpnp/backend/extensions/fft/in_place.hpp
index 7eed11565b9e..bc35201b9b6e 100644
--- a/dpnp/backend/extensions/fft/in_place.hpp
+++ b/dpnp/backend/extensions/fft/in_place.hpp
@@ -28,10 +28,13 @@
#pragma once
+#include
+#include
+
#include
#include
-#include
+#include "dpnp4pybind11.hpp"
namespace dpnp::extensions::fft
{
diff --git a/dpnp/backend/extensions/fft/in_place.tpp b/dpnp/backend/extensions/fft/in_place.tpp
index 4bc166b0e7ae..ace535284de6 100644
--- a/dpnp/backend/extensions/fft/in_place.tpp
+++ b/dpnp/backend/extensions/fft/in_place.tpp
@@ -27,15 +27,23 @@
//*****************************************************************************
#pragma once
+
#include
+#include
+#include
+#include
+
+#include
#include
#include
-#include
+#include "dpnp4pybind11.hpp"
#include "common.hpp"
#include "fft_utils.hpp"
+#include "in_place.hpp"
+
// dpctl tensor headers
#include "utils/output_validation.hpp"
diff --git a/dpnp/backend/extensions/fft/out_of_place.hpp b/dpnp/backend/extensions/fft/out_of_place.hpp
index 811a2bd6d1c4..55ca9383baaf 100644
--- a/dpnp/backend/extensions/fft/out_of_place.hpp
+++ b/dpnp/backend/extensions/fft/out_of_place.hpp
@@ -28,10 +28,13 @@
#pragma once
+#include
+#include
+
#include
#include
-#include
+#include "dpnp4pybind11.hpp"
namespace dpnp::extensions::fft
{
diff --git a/dpnp/backend/extensions/fft/out_of_place.tpp b/dpnp/backend/extensions/fft/out_of_place.tpp
index ed5cd37df7f1..aada49c16bda 100644
--- a/dpnp/backend/extensions/fft/out_of_place.tpp
+++ b/dpnp/backend/extensions/fft/out_of_place.tpp
@@ -27,15 +27,25 @@
//*****************************************************************************
#pragma once
+
+#include
+#include
#include
+#include
+#include
+#include
#include
#include
-#include
+#include
+
+#include "dpnp4pybind11.hpp"
#include "common.hpp"
#include "fft_utils.hpp"
+#include "out_of_place.hpp"
+
// dpctl tensor headers
#include "utils/memory_overlap.hpp"
#include "utils/output_validation.hpp"
diff --git a/dpnp/backend/extensions/indexing/CMakeLists.txt b/dpnp/backend/extensions/indexing/CMakeLists.txt
index e1bc34c9ae8b..ce800a87124c 100644
--- a/dpnp/backend/extensions/indexing/CMakeLists.txt
+++ b/dpnp/backend/extensions/indexing/CMakeLists.txt
@@ -36,6 +36,9 @@ set(_module_src
pybind11_add_module(${python_module_name} MODULE ${_module_src})
add_sycl_to_target(TARGET ${python_module_name} SOURCES ${_module_src})
+# Ensure Cython modules build first so _usmarray.h exists
+add_dependencies(${python_module_name} _usmarray)
+
if(_dpnp_sycl_targets)
# make fat binary
target_compile_options(
@@ -62,14 +65,21 @@ set_target_properties(
target_include_directories(
${python_module_name}
- PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/../../ ${CMAKE_CURRENT_SOURCE_DIR}/../common
+ PRIVATE
+ ${CMAKE_CURRENT_SOURCE_DIR}/../../
+ ${CMAKE_CURRENT_SOURCE_DIR}/../common
+ ${CMAKE_SOURCE_DIR}/dpnp/backend/include
+ ${CMAKE_SOURCE_DIR}/dpnp/tensor/libtensor/include
)
# treat below headers as system to suppress the warnings there during the build
target_include_directories(
${python_module_name}
SYSTEM
- PRIVATE ${SYCL_INCLUDE_DIR} ${Dpctl_INCLUDE_DIRS} ${Dpctl_TENSOR_INCLUDE_DIR}
+ PRIVATE
+ ${SYCL_INCLUDE_DIR}
+ ${Dpctl_INCLUDE_DIRS}
+ ${CMAKE_BINARY_DIR} # For generated Cython headers
)
if(WIN32)
diff --git a/dpnp/backend/extensions/indexing/choose.cpp b/dpnp/backend/extensions/indexing/choose.cpp
index 3b2df73f46ef..fafcbe1f2495 100644
--- a/dpnp/backend/extensions/indexing/choose.cpp
+++ b/dpnp/backend/extensions/indexing/choose.cpp
@@ -39,10 +39,11 @@
#include
-#include "dpctl4pybind11.hpp"
#include
#include
+#include "dpnp4pybind11.hpp"
+
#include "ext/common.hpp"
#include "kernels/indexing/choose.hpp"
diff --git a/dpnp/backend/extensions/lapack/CMakeLists.txt b/dpnp/backend/extensions/lapack/CMakeLists.txt
index 6dee8abebeca..6c898df05236 100644
--- a/dpnp/backend/extensions/lapack/CMakeLists.txt
+++ b/dpnp/backend/extensions/lapack/CMakeLists.txt
@@ -56,6 +56,9 @@ set(_module_src
pybind11_add_module(${python_module_name} MODULE ${_module_src})
add_sycl_to_target(TARGET ${python_module_name} SOURCES ${_module_src})
+# Ensure Cython modules build first so _usmarray.h exists
+add_dependencies(${python_module_name} _usmarray)
+
if(_dpnp_sycl_targets)
# make fat binary
target_compile_options(
@@ -82,14 +85,20 @@ set_target_properties(
target_include_directories(
${python_module_name}
- PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/../common
+ PRIVATE
+ ${CMAKE_CURRENT_SOURCE_DIR}/../common
+ ${CMAKE_SOURCE_DIR}/dpnp/backend/include
+ ${CMAKE_SOURCE_DIR}/dpnp/tensor/libtensor/include
)
# treat below headers as system to suppress the warnings there during the build
target_include_directories(
${python_module_name}
SYSTEM
- PRIVATE ${SYCL_INCLUDE_DIR} ${Dpctl_INCLUDE_DIRS} ${Dpctl_TENSOR_INCLUDE_DIR}
+ PRIVATE
+ ${SYCL_INCLUDE_DIR}
+ ${Dpctl_INCLUDE_DIRS}
+ ${CMAKE_BINARY_DIR} # For generated Cython headers
)
if(WIN32)
diff --git a/dpnp/backend/extensions/lapack/geqrf.hpp b/dpnp/backend/extensions/lapack/geqrf.hpp
index 522006ace8ab..7be1fee971cf 100644
--- a/dpnp/backend/extensions/lapack/geqrf.hpp
+++ b/dpnp/backend/extensions/lapack/geqrf.hpp
@@ -31,7 +31,7 @@
#include
#include
-#include
+#include "dpnp4pybind11.hpp"
namespace dpnp::extensions::lapack
{
diff --git a/dpnp/backend/extensions/lapack/gesv.hpp b/dpnp/backend/extensions/lapack/gesv.hpp
index d4198efae62e..a86039c9b72e 100644
--- a/dpnp/backend/extensions/lapack/gesv.hpp
+++ b/dpnp/backend/extensions/lapack/gesv.hpp
@@ -31,7 +31,7 @@
#include
#include
-#include
+#include "dpnp4pybind11.hpp"
namespace dpnp::extensions::lapack
{
diff --git a/dpnp/backend/extensions/lapack/gesvd.hpp b/dpnp/backend/extensions/lapack/gesvd.hpp
index 116348e01d9f..b2fea5e47299 100644
--- a/dpnp/backend/extensions/lapack/gesvd.hpp
+++ b/dpnp/backend/extensions/lapack/gesvd.hpp
@@ -31,7 +31,7 @@
#include
#include
-#include
+#include "dpnp4pybind11.hpp"
namespace dpnp::extensions::lapack
{
diff --git a/dpnp/backend/extensions/lapack/getrf.hpp b/dpnp/backend/extensions/lapack/getrf.hpp
index 24ec473f4dc7..ce6dc3e788b5 100644
--- a/dpnp/backend/extensions/lapack/getrf.hpp
+++ b/dpnp/backend/extensions/lapack/getrf.hpp
@@ -31,7 +31,7 @@
#include
#include
-#include
+#include "dpnp4pybind11.hpp"
namespace dpnp::extensions::lapack
{
diff --git a/dpnp/backend/extensions/lapack/getri.hpp b/dpnp/backend/extensions/lapack/getri.hpp
index d8c8e58f3fcb..728af4a77e01 100644
--- a/dpnp/backend/extensions/lapack/getri.hpp
+++ b/dpnp/backend/extensions/lapack/getri.hpp
@@ -31,7 +31,7 @@
#include
#include
-#include
+#include "dpnp4pybind11.hpp"
namespace dpnp::extensions::lapack
{
diff --git a/dpnp/backend/extensions/lapack/getrs.hpp b/dpnp/backend/extensions/lapack/getrs.hpp
index f5a47c69c9ec..2728b0c4e04a 100644
--- a/dpnp/backend/extensions/lapack/getrs.hpp
+++ b/dpnp/backend/extensions/lapack/getrs.hpp
@@ -31,7 +31,7 @@
#include
#include
-#include
+#include "dpnp4pybind11.hpp"
namespace dpnp::extensions::lapack
{
diff --git a/dpnp/backend/extensions/lapack/heevd.cpp b/dpnp/backend/extensions/lapack/heevd.cpp
index 96d6a03e9b8e..ecad85f468ef 100644
--- a/dpnp/backend/extensions/lapack/heevd.cpp
+++ b/dpnp/backend/extensions/lapack/heevd.cpp
@@ -28,6 +28,7 @@
#include
+#include
#include
#include "evd_common.hpp"
diff --git a/dpnp/backend/extensions/lapack/heevd_batch.cpp b/dpnp/backend/extensions/lapack/heevd_batch.cpp
index e8614498bd41..54521136127a 100644
--- a/dpnp/backend/extensions/lapack/heevd_batch.cpp
+++ b/dpnp/backend/extensions/lapack/heevd_batch.cpp
@@ -28,6 +28,7 @@
#include
+#include
#include
#include "common_helpers.hpp"
diff --git a/dpnp/backend/extensions/lapack/orgqr.hpp b/dpnp/backend/extensions/lapack/orgqr.hpp
index 962edc7b668f..2502fe567a1f 100644
--- a/dpnp/backend/extensions/lapack/orgqr.hpp
+++ b/dpnp/backend/extensions/lapack/orgqr.hpp
@@ -31,7 +31,7 @@
#include
#include
-#include
+#include "dpnp4pybind11.hpp"
namespace dpnp::extensions::lapack
{
diff --git a/dpnp/backend/extensions/lapack/potrf.hpp b/dpnp/backend/extensions/lapack/potrf.hpp
index d5df48a9ddf4..02faf2c04fde 100644
--- a/dpnp/backend/extensions/lapack/potrf.hpp
+++ b/dpnp/backend/extensions/lapack/potrf.hpp
@@ -31,7 +31,7 @@
#include
#include
-#include
+#include "dpnp4pybind11.hpp"
namespace dpnp::extensions::lapack
{
diff --git a/dpnp/backend/extensions/lapack/syevd.cpp b/dpnp/backend/extensions/lapack/syevd.cpp
index 3ecd386299ac..60dae80e90c6 100644
--- a/dpnp/backend/extensions/lapack/syevd.cpp
+++ b/dpnp/backend/extensions/lapack/syevd.cpp
@@ -28,6 +28,7 @@
#include
+#include
#include
#include "evd_common.hpp"
diff --git a/dpnp/backend/extensions/lapack/syevd_batch.cpp b/dpnp/backend/extensions/lapack/syevd_batch.cpp
index 13237d27a35c..884b6045f418 100644
--- a/dpnp/backend/extensions/lapack/syevd_batch.cpp
+++ b/dpnp/backend/extensions/lapack/syevd_batch.cpp
@@ -28,6 +28,7 @@
#include
+#include
#include
#include "common_helpers.hpp"
diff --git a/dpnp/backend/extensions/lapack/ungqr.hpp b/dpnp/backend/extensions/lapack/ungqr.hpp
index a149af1e24e1..8c9a36b3f4a6 100644
--- a/dpnp/backend/extensions/lapack/ungqr.hpp
+++ b/dpnp/backend/extensions/lapack/ungqr.hpp
@@ -31,7 +31,7 @@
#include
#include
-#include
+#include "dpnp4pybind11.hpp"
namespace dpnp::extensions::lapack
{
diff --git a/dpnp/backend/extensions/statistics/CMakeLists.txt b/dpnp/backend/extensions/statistics/CMakeLists.txt
index 36786c8cbaf3..434d223de3ab 100644
--- a/dpnp/backend/extensions/statistics/CMakeLists.txt
+++ b/dpnp/backend/extensions/statistics/CMakeLists.txt
@@ -41,6 +41,9 @@ set(_module_src
pybind11_add_module(${python_module_name} MODULE ${_module_src})
add_sycl_to_target(TARGET ${python_module_name} SOURCES ${_module_src})
+# Ensure Cython modules build first so _usmarray.h exists
+add_dependencies(${python_module_name} _usmarray)
+
if(_dpnp_sycl_targets)
# make fat binary
target_compile_options(
@@ -67,14 +70,21 @@ set_target_properties(
target_include_directories(
${python_module_name}
- PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/../../ ${CMAKE_CURRENT_SOURCE_DIR}/../common
+ PRIVATE
+ ${CMAKE_CURRENT_SOURCE_DIR}/../../
+ ${CMAKE_CURRENT_SOURCE_DIR}/../common
+ ${CMAKE_SOURCE_DIR}/dpnp/backend/include
+ ${CMAKE_SOURCE_DIR}/dpnp/tensor/libtensor/include
)
# treat below headers as system to suppress the warnings there during the build
target_include_directories(
${python_module_name}
SYSTEM
- PRIVATE ${SYCL_INCLUDE_DIR} ${Dpctl_INCLUDE_DIRS} ${Dpctl_TENSOR_INCLUDE_DIR}
+ PRIVATE
+ ${SYCL_INCLUDE_DIR}
+ ${Dpctl_INCLUDE_DIRS}
+ ${CMAKE_BINARY_DIR} # For generated Cython headers
)
if(WIN32)
diff --git a/dpnp/backend/extensions/statistics/bincount.hpp b/dpnp/backend/extensions/statistics/bincount.hpp
index 5e42952349b0..2fc477e71edc 100644
--- a/dpnp/backend/extensions/statistics/bincount.hpp
+++ b/dpnp/backend/extensions/statistics/bincount.hpp
@@ -31,7 +31,8 @@
#include
#include
-#include "dpctl4pybind11.hpp"
+#include "dpnp4pybind11.hpp"
+
#include "ext/dispatch_table.hpp"
namespace dpctl_td_ns = dpctl::tensor::type_dispatch;
diff --git a/dpnp/backend/extensions/statistics/histogram.cpp b/dpnp/backend/extensions/statistics/histogram.cpp
index 6d7da6836f60..afc5d9638f48 100644
--- a/dpnp/backend/extensions/statistics/histogram.cpp
+++ b/dpnp/backend/extensions/statistics/histogram.cpp
@@ -35,8 +35,9 @@
#include
#include
+#include "dpnp4pybind11.hpp"
+
// dpctl tensor headers
-#include "dpctl4pybind11.hpp"
#include "utils/type_dispatch.hpp"
#include "histogram.hpp"
@@ -50,7 +51,6 @@ using namespace ext::common;
namespace
{
-
template
struct HistogramEdges
{
diff --git a/dpnp/backend/extensions/statistics/histogram.hpp b/dpnp/backend/extensions/statistics/histogram.hpp
index c6a79ec24ee3..d04d8edbf02b 100644
--- a/dpnp/backend/extensions/statistics/histogram.hpp
+++ b/dpnp/backend/extensions/statistics/histogram.hpp
@@ -31,7 +31,9 @@
#include
#include
-#include "dpctl4pybind11.hpp"
+#include "dpnp4pybind11.hpp"
+
+// utils extension header
#include "ext/dispatch_table.hpp"
namespace statistics::histogram
diff --git a/dpnp/backend/extensions/statistics/histogram_common.cpp b/dpnp/backend/extensions/statistics/histogram_common.cpp
index 82afa2bd965d..252e1cd7c7cc 100644
--- a/dpnp/backend/extensions/statistics/histogram_common.cpp
+++ b/dpnp/backend/extensions/statistics/histogram_common.cpp
@@ -31,15 +31,18 @@
#include
#include
-#include "dpctl4pybind11.hpp"
-#include "utils/type_dispatch.hpp"
-
#include
+#include "dpnp4pybind11.hpp"
+
#include "histogram_common.hpp"
+// utils extension header
#include "ext/validation_utils.hpp"
+// dpctl tensor headers
+#include "utils/type_dispatch.hpp"
+
namespace dpctl_td_ns = dpctl::tensor::type_dispatch;
using dpctl::tensor::usm_ndarray;
using dpctl_td_ns::typenum_t;
@@ -57,7 +60,6 @@ using ext::validation::name_of;
namespace statistics::histogram
{
-
void validate(const usm_ndarray &sample,
const std::optional &bins,
const std::optional &weights,
diff --git a/dpnp/backend/extensions/statistics/histogram_common.hpp b/dpnp/backend/extensions/statistics/histogram_common.hpp
index 8091e8874d17..47fef11061f3 100644
--- a/dpnp/backend/extensions/statistics/histogram_common.hpp
+++ b/dpnp/backend/extensions/statistics/histogram_common.hpp
@@ -35,7 +35,7 @@
#include
-#include "dpctl4pybind11.hpp"
+#include "dpnp4pybind11.hpp"
#include "ext/common.hpp"
#include "kernels/statistics/histogram.hpp"
diff --git a/dpnp/backend/extensions/statistics/histogramdd.hpp b/dpnp/backend/extensions/statistics/histogramdd.hpp
index 327e9941dbc6..d7c46ae34b7d 100644
--- a/dpnp/backend/extensions/statistics/histogramdd.hpp
+++ b/dpnp/backend/extensions/statistics/histogramdd.hpp
@@ -31,7 +31,9 @@
#include
#include
-#include "dpctl4pybind11.hpp"
+#include "dpnp4pybind11.hpp"
+
+// utils extension header
#include "ext/dispatch_table.hpp"
namespace statistics::histogram
diff --git a/dpnp/backend/extensions/statistics/sliding_dot_product1d.cpp b/dpnp/backend/extensions/statistics/sliding_dot_product1d.cpp
index b8f679f1030e..6c0e39a11a19 100644
--- a/dpnp/backend/extensions/statistics/sliding_dot_product1d.cpp
+++ b/dpnp/backend/extensions/statistics/sliding_dot_product1d.cpp
@@ -33,11 +33,14 @@
#include
#include
+#include "dpnp4pybind11.hpp"
+
+// utils extension header
+#include "ext/common.hpp"
+
// dpctl tensor headers
-#include "dpctl4pybind11.hpp"
#include "utils/type_dispatch.hpp"
-#include "ext/common.hpp"
#include "sliding_dot_product1d.hpp"
#include "sliding_window1d.hpp"
@@ -51,7 +54,6 @@ using namespace ext::common;
namespace
{
-
template
struct SlidingDotProductF
{
diff --git a/dpnp/backend/extensions/statistics/sliding_window1d.cpp b/dpnp/backend/extensions/statistics/sliding_window1d.cpp
index 3ae66daa332b..81f8ae40104e 100644
--- a/dpnp/backend/extensions/statistics/sliding_window1d.cpp
+++ b/dpnp/backend/extensions/statistics/sliding_window1d.cpp
@@ -29,11 +29,16 @@
#include
#include
-#include "dpctl4pybind11.hpp"
-#include "utils/type_dispatch.hpp"
#include
+#include "dpnp4pybind11.hpp"
+
+// utils extension header
#include "ext/validation_utils.hpp"
+
+// dpctl tensor headers
+#include "utils/type_dispatch.hpp"
+
#include "sliding_window1d.hpp"
namespace dpctl_td_ns = dpctl::tensor::type_dispatch;
@@ -48,7 +53,6 @@ using ext::validation::name_of;
namespace statistics::sliding_window1d
{
-
void validate(const usm_ndarray &a,
const usm_ndarray &v,
const usm_ndarray &out,
@@ -89,5 +93,4 @@ void validate(const usm_ndarray &a,
std::to_string(expected_output_size) + ")");
}
}
-
} // namespace statistics::sliding_window1d
diff --git a/dpnp/backend/extensions/statistics/sliding_window1d.hpp b/dpnp/backend/extensions/statistics/sliding_window1d.hpp
index 329c96dfc1c6..a13c1f873e78 100644
--- a/dpnp/backend/extensions/statistics/sliding_window1d.hpp
+++ b/dpnp/backend/extensions/statistics/sliding_window1d.hpp
@@ -34,7 +34,7 @@
#include
-#include "dpctl4pybind11.hpp"
+#include "dpnp4pybind11.hpp"
#include "kernels/statistics/sliding_window1d.hpp"
diff --git a/dpnp/backend/extensions/ufunc/CMakeLists.txt b/dpnp/backend/extensions/ufunc/CMakeLists.txt
index ae6015e11d0f..2b01823d01f3 100644
--- a/dpnp/backend/extensions/ufunc/CMakeLists.txt
+++ b/dpnp/backend/extensions/ufunc/CMakeLists.txt
@@ -67,6 +67,9 @@ set(_module_src
pybind11_add_module(${python_module_name} MODULE ${_module_src})
add_sycl_to_target(TARGET ${python_module_name} SOURCES ${_module_src})
+# Ensure Cython modules build first so _usmarray.h exists
+add_dependencies(${python_module_name} _usmarray)
+
if(WIN32)
if(${CMAKE_VERSION} VERSION_LESS "3.27")
# this is a work-around for target_link_options inserting option after -link option, cause
@@ -84,14 +87,21 @@ set_target_properties(
target_include_directories(
${python_module_name}
- PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/../../ ${CMAKE_CURRENT_SOURCE_DIR}/../common
+ PRIVATE
+ ${CMAKE_CURRENT_SOURCE_DIR}/../../
+ ${CMAKE_CURRENT_SOURCE_DIR}/../common
+ ${CMAKE_SOURCE_DIR}/dpnp/backend/include
+ ${CMAKE_SOURCE_DIR}/dpnp/tensor/libtensor/include
)
# treat below headers as system to suppress the warnings there during the build
target_include_directories(
${python_module_name}
SYSTEM
- PRIVATE ${SYCL_INCLUDE_DIR} ${Dpctl_INCLUDE_DIRS} ${Dpctl_TENSOR_INCLUDE_DIR}
+ PRIVATE
+ ${SYCL_INCLUDE_DIR}
+ ${Dpctl_INCLUDE_DIRS}
+ ${CMAKE_BINARY_DIR} # For generated Cython headers
)
if(_dpnp_sycl_targets)
diff --git a/dpnp/backend/extensions/ufunc/elementwise_functions/bitwise_count.cpp b/dpnp/backend/extensions/ufunc/elementwise_functions/bitwise_count.cpp
index a0842f4ef259..761bd330a326 100644
--- a/dpnp/backend/extensions/ufunc/elementwise_functions/bitwise_count.cpp
+++ b/dpnp/backend/extensions/ufunc/elementwise_functions/bitwise_count.cpp
@@ -30,9 +30,13 @@
#include
#include
+#include
+#include
+#include
+
#include
-#include "dpctl4pybind11.hpp"
+#include "dpnp4pybind11.hpp"
#include "bitwise_count.hpp"
#include "kernels/elementwise_functions/bitwise_count.hpp"
diff --git a/dpnp/backend/extensions/ufunc/elementwise_functions/degrees.cpp b/dpnp/backend/extensions/ufunc/elementwise_functions/degrees.cpp
index 77452a6b777f..729fcb576c77 100644
--- a/dpnp/backend/extensions/ufunc/elementwise_functions/degrees.cpp
+++ b/dpnp/backend/extensions/ufunc/elementwise_functions/degrees.cpp
@@ -29,9 +29,13 @@
#include
#include
+#include
+#include
+#include
+
#include
-#include "dpctl4pybind11.hpp"
+#include "dpnp4pybind11.hpp"
#include "degrees.hpp"
#include "kernels/elementwise_functions/degrees.hpp"
diff --git a/dpnp/backend/extensions/ufunc/elementwise_functions/divmod.cpp b/dpnp/backend/extensions/ufunc/elementwise_functions/divmod.cpp
index af87dcc85f53..1bb3859a39f4 100644
--- a/dpnp/backend/extensions/ufunc/elementwise_functions/divmod.cpp
+++ b/dpnp/backend/extensions/ufunc/elementwise_functions/divmod.cpp
@@ -30,9 +30,13 @@
#include
#include
+#include
+#include
+#include
+
#include
-#include "dpctl4pybind11.hpp"
+#include "dpnp4pybind11.hpp"
#include "divmod.hpp"
#include "kernels/elementwise_functions/divmod.hpp"
diff --git a/dpnp/backend/extensions/ufunc/elementwise_functions/erf_funcs.cpp b/dpnp/backend/extensions/ufunc/elementwise_functions/erf_funcs.cpp
index 6f10e651fe25..c07989939b70 100644
--- a/dpnp/backend/extensions/ufunc/elementwise_functions/erf_funcs.cpp
+++ b/dpnp/backend/extensions/ufunc/elementwise_functions/erf_funcs.cpp
@@ -29,9 +29,13 @@
#include
#include
+#include
+#include
+#include
+
#include
-#include "dpctl4pybind11.hpp"
+#include "dpnp4pybind11.hpp"
#include "erf_funcs.hpp"
#include "kernels/elementwise_functions/erf.hpp"
diff --git a/dpnp/backend/extensions/ufunc/elementwise_functions/fabs.cpp b/dpnp/backend/extensions/ufunc/elementwise_functions/fabs.cpp
index d2b6ae24ac4b..f7c2183633af 100644
--- a/dpnp/backend/extensions/ufunc/elementwise_functions/fabs.cpp
+++ b/dpnp/backend/extensions/ufunc/elementwise_functions/fabs.cpp
@@ -29,9 +29,13 @@
#include
#include
+#include
+#include
+#include
+
#include
-#include "dpctl4pybind11.hpp"
+#include "dpnp4pybind11.hpp"
#include "fabs.hpp"
#include "kernels/elementwise_functions/fabs.hpp"
diff --git a/dpnp/backend/extensions/ufunc/elementwise_functions/float_power.cpp b/dpnp/backend/extensions/ufunc/elementwise_functions/float_power.cpp
index 0994afc7c738..43927eb93806 100644
--- a/dpnp/backend/extensions/ufunc/elementwise_functions/float_power.cpp
+++ b/dpnp/backend/extensions/ufunc/elementwise_functions/float_power.cpp
@@ -30,9 +30,13 @@
#include
#include
+#include
+#include
+#include
+
#include
-#include "dpctl4pybind11.hpp"
+#include "dpnp4pybind11.hpp"
#include "float_power.hpp"
diff --git a/dpnp/backend/extensions/ufunc/elementwise_functions/fmax.cpp b/dpnp/backend/extensions/ufunc/elementwise_functions/fmax.cpp
index 5e1a9f33444b..9471feaf2166 100644
--- a/dpnp/backend/extensions/ufunc/elementwise_functions/fmax.cpp
+++ b/dpnp/backend/extensions/ufunc/elementwise_functions/fmax.cpp
@@ -28,9 +28,13 @@
#include
+#include
+#include
+#include
+
#include
-#include "dpctl4pybind11.hpp"
+#include "dpnp4pybind11.hpp"
#include "fmax.hpp"
#include "kernels/elementwise_functions/fmax.hpp"
diff --git a/dpnp/backend/extensions/ufunc/elementwise_functions/fmin.cpp b/dpnp/backend/extensions/ufunc/elementwise_functions/fmin.cpp
index c0e1db654317..8e279897f414 100644
--- a/dpnp/backend/extensions/ufunc/elementwise_functions/fmin.cpp
+++ b/dpnp/backend/extensions/ufunc/elementwise_functions/fmin.cpp
@@ -28,9 +28,13 @@
#include
+#include
+#include
+#include
+
#include
-#include "dpctl4pybind11.hpp"
+#include "dpnp4pybind11.hpp"
#include "fmin.hpp"
#include "kernels/elementwise_functions/fmin.hpp"
diff --git a/dpnp/backend/extensions/ufunc/elementwise_functions/fmod.cpp b/dpnp/backend/extensions/ufunc/elementwise_functions/fmod.cpp
index 5b83595b3f7c..83fb750b6907 100644
--- a/dpnp/backend/extensions/ufunc/elementwise_functions/fmod.cpp
+++ b/dpnp/backend/extensions/ufunc/elementwise_functions/fmod.cpp
@@ -30,9 +30,13 @@
#include
#include
+#include
+#include
+#include
+
#include
-#include "dpctl4pybind11.hpp"
+#include "dpnp4pybind11.hpp"
#include "fmod.hpp"
#include "kernels/elementwise_functions/fmod.hpp"
diff --git a/dpnp/backend/extensions/ufunc/elementwise_functions/frexp.cpp b/dpnp/backend/extensions/ufunc/elementwise_functions/frexp.cpp
index 4439f1e76993..17e09f3ee816 100644
--- a/dpnp/backend/extensions/ufunc/elementwise_functions/frexp.cpp
+++ b/dpnp/backend/extensions/ufunc/elementwise_functions/frexp.cpp
@@ -31,9 +31,13 @@
#include
#include
+#include
+#include
+#include
+
#include
-#include "dpctl4pybind11.hpp"
+#include "dpnp4pybind11.hpp"
#include "frexp.hpp"
#include "kernels/elementwise_functions/frexp.hpp"
diff --git a/dpnp/backend/extensions/ufunc/elementwise_functions/gcd.cpp b/dpnp/backend/extensions/ufunc/elementwise_functions/gcd.cpp
index ec10504fa15e..0481365356ca 100644
--- a/dpnp/backend/extensions/ufunc/elementwise_functions/gcd.cpp
+++ b/dpnp/backend/extensions/ufunc/elementwise_functions/gcd.cpp
@@ -30,9 +30,13 @@
#include
#include
+#include
+#include
+#include
+
#include
-#include "dpctl4pybind11.hpp"
+#include "dpnp4pybind11.hpp"
#include "gcd.hpp"
#include "kernels/elementwise_functions/gcd.hpp"
diff --git a/dpnp/backend/extensions/ufunc/elementwise_functions/heaviside.cpp b/dpnp/backend/extensions/ufunc/elementwise_functions/heaviside.cpp
index e3212de86f7f..62affd206420 100644
--- a/dpnp/backend/extensions/ufunc/elementwise_functions/heaviside.cpp
+++ b/dpnp/backend/extensions/ufunc/elementwise_functions/heaviside.cpp
@@ -29,9 +29,13 @@
#include
#include
+#include
+#include
+#include
+
#include
-#include "dpctl4pybind11.hpp"
+#include "dpnp4pybind11.hpp"
#include "heaviside.hpp"
#include "kernels/elementwise_functions/heaviside.hpp"
diff --git a/dpnp/backend/extensions/ufunc/elementwise_functions/i0.cpp b/dpnp/backend/extensions/ufunc/elementwise_functions/i0.cpp
index 4d120a56e837..53ded341b58b 100644
--- a/dpnp/backend/extensions/ufunc/elementwise_functions/i0.cpp
+++ b/dpnp/backend/extensions/ufunc/elementwise_functions/i0.cpp
@@ -29,9 +29,13 @@
#include
#include
+#include
+#include
+#include
+
#include
-#include "dpctl4pybind11.hpp"
+#include "dpnp4pybind11.hpp"
#include "i0.hpp"
#include "kernels/elementwise_functions/i0.hpp"
diff --git a/dpnp/backend/extensions/ufunc/elementwise_functions/interpolate.cpp b/dpnp/backend/extensions/ufunc/elementwise_functions/interpolate.cpp
index 8830569ce9cf..36dae50e7b2c 100644
--- a/dpnp/backend/extensions/ufunc/elementwise_functions/interpolate.cpp
+++ b/dpnp/backend/extensions/ufunc/elementwise_functions/interpolate.cpp
@@ -35,12 +35,14 @@
#include
#include
-#include
-
-#include "dpctl4pybind11.hpp"
+#include
#include
#include
+#include
+
+#include "dpnp4pybind11.hpp"
+
#include "kernels/elementwise_functions/interpolate.hpp"
// dpctl tensor headers
diff --git a/dpnp/backend/extensions/ufunc/elementwise_functions/isclose.cpp b/dpnp/backend/extensions/ufunc/elementwise_functions/isclose.cpp
index b8179feb9263..3025cbf16586 100644
--- a/dpnp/backend/extensions/ufunc/elementwise_functions/isclose.cpp
+++ b/dpnp/backend/extensions/ufunc/elementwise_functions/isclose.cpp
@@ -32,12 +32,14 @@
#include
#include
-#include
-
-#include "dpctl4pybind11.hpp"
+#include
#include
#include
+#include
+
+#include "dpnp4pybind11.hpp"
+
#include "kernels/elementwise_functions/isclose.hpp"
#include "../../elementwise_functions/simplify_iteration_space.hpp"
diff --git a/dpnp/backend/extensions/ufunc/elementwise_functions/lcm.cpp b/dpnp/backend/extensions/ufunc/elementwise_functions/lcm.cpp
index 4276ceb6b246..35138e903eac 100644
--- a/dpnp/backend/extensions/ufunc/elementwise_functions/lcm.cpp
+++ b/dpnp/backend/extensions/ufunc/elementwise_functions/lcm.cpp
@@ -30,9 +30,13 @@
#include
#include
+#include
+#include
+#include
+
#include
-#include "dpctl4pybind11.hpp"
+#include "dpnp4pybind11.hpp"
#include "kernels/elementwise_functions/lcm.hpp"
#include "lcm.hpp"
diff --git a/dpnp/backend/extensions/ufunc/elementwise_functions/ldexp.cpp b/dpnp/backend/extensions/ufunc/elementwise_functions/ldexp.cpp
index 3e2c4f3d0149..44ef51726a6a 100644
--- a/dpnp/backend/extensions/ufunc/elementwise_functions/ldexp.cpp
+++ b/dpnp/backend/extensions/ufunc/elementwise_functions/ldexp.cpp
@@ -30,9 +30,13 @@
#include
#include
+#include
+#include
+#include
+
#include
-#include "dpctl4pybind11.hpp"
+#include "dpnp4pybind11.hpp"
#include "kernels/elementwise_functions/ldexp.hpp"
#include "ldexp.hpp"
diff --git a/dpnp/backend/extensions/ufunc/elementwise_functions/logaddexp2.cpp b/dpnp/backend/extensions/ufunc/elementwise_functions/logaddexp2.cpp
index 57c7c60ca9cf..e37f13b119d6 100644
--- a/dpnp/backend/extensions/ufunc/elementwise_functions/logaddexp2.cpp
+++ b/dpnp/backend/extensions/ufunc/elementwise_functions/logaddexp2.cpp
@@ -28,9 +28,13 @@
#include
+#include
+#include
+#include
+
#include
-#include "dpctl4pybind11.hpp"
+#include "dpnp4pybind11.hpp"
#include "kernels/elementwise_functions/logaddexp2.hpp"
#include "logaddexp2.hpp"
diff --git a/dpnp/backend/extensions/ufunc/elementwise_functions/modf.cpp b/dpnp/backend/extensions/ufunc/elementwise_functions/modf.cpp
index f8aab23d5630..266103248521 100644
--- a/dpnp/backend/extensions/ufunc/elementwise_functions/modf.cpp
+++ b/dpnp/backend/extensions/ufunc/elementwise_functions/modf.cpp
@@ -31,9 +31,13 @@
#include
#include
+#include
+#include
+#include
+
#include
-#include "dpctl4pybind11.hpp"
+#include "dpnp4pybind11.hpp"
#include "kernels/elementwise_functions/modf.hpp"
#include "modf.hpp"
diff --git a/dpnp/backend/extensions/ufunc/elementwise_functions/nan_to_num.cpp b/dpnp/backend/extensions/ufunc/elementwise_functions/nan_to_num.cpp
index 2490f1921a98..c30d388f8afd 100644
--- a/dpnp/backend/extensions/ufunc/elementwise_functions/nan_to_num.cpp
+++ b/dpnp/backend/extensions/ufunc/elementwise_functions/nan_to_num.cpp
@@ -38,11 +38,12 @@
#include
-#include "dpctl4pybind11.hpp"
#include
#include
#include
+#include "dpnp4pybind11.hpp"
+
#include "kernels/elementwise_functions/nan_to_num.hpp"
#include "../../elementwise_functions/simplify_iteration_space.hpp"
diff --git a/dpnp/backend/extensions/ufunc/elementwise_functions/radians.cpp b/dpnp/backend/extensions/ufunc/elementwise_functions/radians.cpp
index 7fc8ae5331dd..0a481fd33d11 100644
--- a/dpnp/backend/extensions/ufunc/elementwise_functions/radians.cpp
+++ b/dpnp/backend/extensions/ufunc/elementwise_functions/radians.cpp
@@ -29,9 +29,13 @@
#include
#include
+#include