diff --git a/AGENTS.md b/AGENTS.md
index c4304d083f8c..e0c6f423ea7d 100644
--- a/AGENTS.md
+++ b/AGENTS.md
@@ -1,6 +1,6 @@
# AGENTS.md - dpnp
-dpnp is a NumPy-compatible array library for SYCL devices. Its main namespace, `dpnp.fft` and `dpnp.linalg` also conform to the Python Array API standard (2025.12, `doc/reference/array_api.rst`). The Python layer (`dpnp/`) is built on `dpnp.tensor` (Array API, `dpnp/tensor/`) and pybind11 SYCL extensions (`dpnp/backend/extensions/`); `dpctl` provides devices, queues and USM memory.
+dpnp is a NumPy-compatible array library for SYCL devices. Its main namespace, `dpnp.fft` and `dpnp.linalg` also conform to the Python Array API standard (2025.12, `doc/reference/array_api.rst`). The Python layer (`dpnp/`) is built on `dpnp.tensor` (Array API, `dpnp/tensor/`) and the pybind11 SYCL modules of `dpnp/libtensor/`; `dpctl` provides devices, queues and USM memory.
## Rules for Changes
@@ -31,7 +31,7 @@ python scripts/build_locally.py # in-place build + editable install
python -m pytest -ra dpnp/tests/test_.py
```
-The build needs the packages in `environments/build_with_oneapi.yml`, `environments/oneapi_pkgs.yml` and `environments/dpctl_pkg.yml`. The `no-commit-to-branch` hook fails on `master` and `maintenance/*`, so work on a branch. Full-suite commands and test env vars are in `dpnp/tests/AGENTS.md`; build options in `dpnp/backend/AGENTS.md`.
+The build needs the packages in `environments/build_with_oneapi.yml`, `environments/oneapi_pkgs.yml` and `environments/dpctl_pkg.yml`. The `no-commit-to-branch` hook fails on `master` and `maintenance/*`, so work on a branch. Full-suite commands and test env vars are in `dpnp/tests/AGENTS.md`; build options in `dpnp/libtensor/AGENTS.md`.
### Changelog format
@@ -67,8 +67,9 @@ Read the `AGENTS.md` nearest the files you change. When editing these files, eve
- [dpnp/AGENTS.md](dpnp/AGENTS.md): Python layer, adding a function, docstrings
- [dpnp/tests/AGENTS.md](dpnp/tests/AGENTS.md): test helpers, fp64, CuPy tests, running the suite
-- [dpnp/backend/AGENTS.md](dpnp/backend/AGENTS.md): pybind11 SYCL extensions, C++ rules, build options
-- [dpnp/tensor/AGENTS.md](dpnp/tensor/AGENTS.md): `dpnp.tensor` and libtensor
+- [dpnp/libtensor/AGENTS.md](dpnp/libtensor/AGENTS.md): libtensor kernels, pybind11 SYCL modules and extensions, C++ rules, build options
+- [dpnp/backend/AGENTS.md](dpnp/backend/AGENTS.md): legacy `dpnp_backend_c`
+- [dpnp/tensor/AGENTS.md](dpnp/tensor/AGENTS.md): `dpnp.tensor`
- [doc/AGENTS.md](doc/AGENTS.md): Sphinx docs
- [benchmarks/AGENTS.md](benchmarks/AGENTS.md): ASV benchmarks
- [.github/AGENTS.md](.github/AGENTS.md): workflow hardening rules
diff --git a/CHANGELOG.md b/CHANGELOG.md
index b4771ac5ae86..eaf3c1aa1e6c 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -13,6 +13,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Changed
* Changed `dpnp.tensor.top_k` to select the `k` elements with a radix select instead of sorting every row, for all but complex data types. The order of the returned elements is now unspecified, where it was largest-first or smallest-first before [#3079](https://github.com/IntelPython/dpnp/pull/3079)
+* Moved libtensor from `dpnp/tensor/libtensor` to `dpnp/libtensor`. All pybind11 extension modules are installed into `dpnp/libtensor` (e.g. `dpnp.libtensor._tensor_impl`, `dpnp.libtensor._blas_impl`), while `dpnp/backend` now contains only the legacy `dpnp_backend_c` library [#3131](https://github.com/IntelPython/dpnp/pull/3131)
+* Merged the `ufunc` and `indexing` extensions into `dpnp.libtensor._tensor_elementwise_impl` and `dpnp.libtensor._tensor_impl`, while `statistics` and `window` extensions became part of libtensor [#3131](https://github.com/IntelPython/dpnp/pull/3131)
+* Moved `blas`, `fft`, `lapack`, `sparse` and `vm` extensions into `dpnp/libtensor/extensions` [#3131](https://github.com/IntelPython/dpnp/pull/3131)
+* Moved the libtensor headers shipped with dpnp from `dpnp/tensor/libtensor/include` to `dpnp/libtensor/include`, and changed `dpnp.get_include` to return that directory [#3131](https://github.com/IntelPython/dpnp/pull/3131)
### Deprecated
@@ -21,6 +25,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Removed
+* Removed the unused `FourZeroOffsets_Indexer`, `FixedDimStridedIndexer` and `ThreeOffsets_FixedDimStridedIndexer` from the libtensor header `utils/offset_utils.hpp` [#3131](https://github.com/IntelPython/dpnp/pull/3131)
+
### Fixed
### Security
diff --git a/cmake/dpnp-config.cmake b/cmake/dpnp-config.cmake
index 33cf5fe98580..3b185944aa48 100644
--- a/cmake/dpnp-config.cmake
+++ b/cmake/dpnp-config.cmake
@@ -50,7 +50,7 @@ get_filename_component(_dpnp_dir "${Dpnp_INCLUDE_DIR}" DIRECTORY)
find_path(
Dpnp_TENSOR_INCLUDE_DIR
kernels
- PATHS "${_dpnp_dir}/tensor/libtensor/include"
+ PATHS "${_dpnp_dir}/libtensor/include"
NO_DEFAULT_PATH
)
diff --git a/dpnp/AGENTS.md b/dpnp/AGENTS.md
index 219ee8bec459..b7d3956d4134 100644
--- a/dpnp/AGENTS.md
+++ b/dpnp/AGENTS.md
@@ -6,7 +6,7 @@
- `dpnp_algo/dpnp_elementwise_common.py`: ufunc wrapper classes (`DPNPUnaryFunc`, `DPNPBinaryFunc`, two-output and specialised variants)
- `dpnp_utils/`: shared helpers (`get_usm_allocations`, `map_dtype_to_device`, reduction wrappers)
- `linalg/`, `fft/`, `random/`, `scipy/`, `lib/`: subpackages, each exporting through its own `__init__.py`
-- Legacy, don't extend: the Cython `dpnp_algo` path and `dpnp_backend_c` (still used by `dpnp.partition` and `dpnp.random`), and the NumPy fallback `call_origin`. New kernels go into pybind11 extensions or `dpnp.tensor`.
+- Legacy, don't extend: the Cython `dpnp_algo` path and `dpnp_backend_c` (still used by `dpnp.partition` and `dpnp.random`), and the NumPy fallback `call_origin`. New kernels go into `dpnp/libtensor` (see `dpnp/libtensor/AGENTS.md`).
## Adding a Public Function
1. Implement it in the matching `dpnp_iface_*.py` or subpackage module. Iface modules have no `__all__`.
@@ -14,7 +14,7 @@
3. Add it to `doc/reference/` (see `doc/AGENTS.md`), tests (see `dpnp/tests/AGENTS.md`) and `CHANGELOG.md`.
## Patterns
-- Ufuncs are module-level wrapper instances, e.g. `cbrt = DPNPUnaryFunc("cbrt", ti._cbrt_result_type, ti._cbrt, _CBRT_DOCSTRING, mkl_fn_to_call=..., mkl_impl_fn=...)`. The first argument is the public name, with no leading underscore. Kernels come from `dpnp.tensor._tensor_elementwise_impl` or `dpnp.backend.extensions.ufunc._ufunc_impl`; the oneMKL VM path runs first when `mkl_fn_to_call` is given and supported.
+- Ufuncs are module-level wrapper instances, e.g. `cbrt = DPNPUnaryFunc("cbrt", ti._cbrt_result_type, ti._cbrt, _CBRT_DOCSTRING, mkl_fn_to_call=..., mkl_impl_fn=...)`. The first argument is the public name, with no leading underscore. Kernels come from `dpnp.libtensor._tensor_elementwise_impl`; the oneMKL VM path runs first when `mkl_fn_to_call` is given and supported.
- Other functions: `dpnp.check_supported_arrays_type(...)`, unwrap with `dpnp.get_usm_ndarray`, call `dpnp.tensor` (`import dpnp.tensor as dpt`) or an extension, and wrap with `dpnp_array._create_from_usm_ndarray`. Pass `out` straight to the `dpnp.tensor` or extension call when it accepts one; otherwise `dpnp.get_result_array(res, out)` copies the result into it.
- Get the result queue and USM type with `get_usm_allocations([...])` (raises `ValueError` on mixed queues) or `dpt.get_execution_queue(...)` (returns `None`; raise `ExecutionPlacementError`). Creation functions take `device`, `usm_type` and `sycl_queue` (normalised by `dpnp.get_normalized_queue_device`); `*_like` functions inherit them from the input.
- Extension calls are ordered with `_manager = dpctl.utils.SequentialOrderManager[exec_q]`: pass `depends=_manager.submitted_events`, then `_manager.add_event_pair(ht_ev, ev)`. Don't add blocking waits.
diff --git a/dpnp/CMakeLists.txt b/dpnp/CMakeLists.txt
index b2942cd6a854..e96cf5bbc5a9 100644
--- a/dpnp/CMakeLists.txt
+++ b/dpnp/CMakeLists.txt
@@ -28,7 +28,6 @@
# *****************************************************************************
function(build_dpnp_cython_ext _trgt _src _dest)
- set(options SYCL)
add_cython_target(${_trgt} ${_src} CXX OUTPUT_VAR _generated_src)
message(STATUS "Using ${_trgt}")
@@ -37,10 +36,6 @@ function(build_dpnp_cython_ext _trgt _src _dest)
add_custom_target(${_trgt_deps} DEPENDS ${_src})
add_dependencies(${_trgt} ${_trgt_deps})
- if(BUILD_DPNP_EXT_SYCL)
- add_sycl_to_target(TARGET ${_trgt} SOURCES ${_generated_src})
- endif()
-
if(DPNP_GENERATE_COVERAGE)
# Pass CYTHON_USE_SYS_MONITORING=0 to force Cython's legacy (settrace-based)
# line tracing instead of the sys.monitoring path
@@ -92,30 +87,9 @@ function(build_dpnp_cython_ext _trgt _src _dest)
endfunction()
function(build_dpnp_tensor_ext _trgt _src _dest)
- set(options SYCL)
- cmake_parse_arguments(BUILD_DPNP_TENSOR "${options}" "RELATIVE_PATH" "" ${ARGN})
+ cmake_parse_arguments(BUILD_DPNP_TENSOR "" "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 -fno-sycl-id-queries-fit-in-int
- )
- 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)
# Pass CYTHON_USE_SYS_MONITORING=0 to force Cython's legacy (settrace-based)
@@ -125,9 +99,6 @@ function(build_dpnp_tensor_ext _trgt _src _dest)
${_trgt}
PRIVATE CYTHON_TRACE=1 CYTHON_TRACE_NOGIL=1 CYTHON_USE_SYS_MONITORING=0
)
- 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})
@@ -173,14 +144,6 @@ function(build_dpnp_tensor_ext _trgt _src _dest)
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)
@@ -188,12 +151,13 @@ function(build_dpnp_cython_ext_with_backend _trgt _src _dest)
target_link_libraries(${_trgt} PRIVATE dpnp_backend_library)
endfunction()
-# Builds a pybind11 extension of dpnp/backend/extensions with the options all of
-# them share. INCLUDE_DIRS come before the common include directories, and
-# LARGE_RANGES is for modules whose kernels can be launched over more than
-# INT_MAX work-items.
-function(build_dpnp_pybind11_ext _trgt _dest)
- cmake_parse_arguments(PARSE_ARGV 2 _arg "LARGE_RANGES" "" "SOURCES;INCLUDE_DIRS")
+# Builds a pybind11 extension of dpnp/libtensor/extensions with the options all
+# of them share and installs it into dpnp/libtensor, next to the libtensor
+# modules.
+# INCLUDE_DIRS come before the common include directories, and LARGE_RANGES is
+# for modules whose kernels can be launched over more than INT_MAX work-items.
+function(build_dpnp_pybind11_ext _trgt)
+ cmake_parse_arguments(PARSE_ARGV 1 _arg "LARGE_RANGES" "" "SOURCES;INCLUDE_DIRS")
pybind11_add_module(${_trgt} MODULE ${_arg_SOURCES})
add_sycl_to_target(TARGET ${_trgt} SOURCES ${_arg_SOURCES})
@@ -207,14 +171,12 @@ function(build_dpnp_pybind11_ext _trgt _dest)
target_link_options(${_trgt} PRIVATE ${_dpnp_sycl_target_link_options})
endif()
- set_target_properties(${_trgt} PROPERTIES CMAKE_POSITION_INDEPENDENT_CODE ON)
-
target_include_directories(
${_trgt}
PRIVATE
${_arg_INCLUDE_DIRS}
${CMAKE_SOURCE_DIR}/dpnp/include
- ${CMAKE_SOURCE_DIR}/dpnp/tensor/libtensor/include
+ ${CMAKE_SOURCE_DIR}/dpnp/libtensor/include
)
# treat below headers as system to suppress the warnings there during the build
@@ -254,27 +216,21 @@ function(build_dpnp_pybind11_ext _trgt _dest)
endif()
if(DPNP_WITH_REDIST)
- set_target_properties(
- ${_trgt}
- PROPERTIES INSTALL_RPATH "$ORIGIN/../../../../../../"
- )
+ set_target_properties(${_trgt} PROPERTIES INSTALL_RPATH "$ORIGIN/../../../..")
endif()
- install(TARGETS ${_trgt} DESTINATION ${_dest})
+ install(TARGETS ${_trgt} DESTINATION "dpnp/libtensor")
endfunction()
add_subdirectory(tensor)
add_subdirectory(backend)
-add_subdirectory(backend/extensions/blas)
-add_subdirectory(backend/extensions/fft)
-add_subdirectory(backend/extensions/indexing)
-add_subdirectory(backend/extensions/lapack)
-add_subdirectory(backend/extensions/statistics)
-add_subdirectory(backend/extensions/ufunc)
-add_subdirectory(backend/extensions/vm)
-add_subdirectory(backend/extensions/window)
-add_subdirectory(backend/extensions/sparse)
+add_subdirectory(libtensor/source)
+add_subdirectory(libtensor/extensions/blas)
+add_subdirectory(libtensor/extensions/fft)
+add_subdirectory(libtensor/extensions/lapack)
+add_subdirectory(libtensor/extensions/vm)
+add_subdirectory(libtensor/extensions/sparse)
add_subdirectory(dpnp_algo)
add_subdirectory(dpnp_utils)
diff --git a/dpnp/__main__.py b/dpnp/__main__.py
index 7520a63a784d..e925b31c8ede 100644
--- a/dpnp/__main__.py
+++ b/dpnp/__main__.py
@@ -51,7 +51,7 @@ def print_include_flags() -> None:
def get_tensor_include_dir() -> str:
"""Returns path to dpnp libtensor include directory"""
- libtensor_dir = os.path.join(_dpnp_dir(), "tensor", "libtensor", "include")
+ libtensor_dir = os.path.join(_dpnp_dir(), "libtensor", "include")
return libtensor_dir
diff --git a/dpnp/backend/AGENTS.md b/dpnp/backend/AGENTS.md
index e7f700bf9e5f..9066c8c933a6 100644
--- a/dpnp/backend/AGENTS.md
+++ b/dpnp/backend/AGENTS.md
@@ -1,39 +1,7 @@
-# AGENTS.md - C++ Backend (dpnp/backend/)
+# AGENTS.md - Legacy C++ Backend (dpnp/backend/)
-## Layout
-- `extensions//`: one pybind11 module `__impl` per directory (`blas`, `fft`, `indexing`, `lapack`, `sparse`, `statistics`, `ufunc`, `vm`, `window`), imported as `dpnp.backend.extensions..__impl`
-- `extensions/common/ext/`: dispatch helpers (`init_dispatch_vector`, `init_dispatch_table`, `DispatchTable`) and validation helpers (`validation_utils.hpp`)
-- `extensions/elementwise_functions/`: copy of the libtensor elementwise Python-API helpers, compiled into `ufunc` and `vm`
-- `kernels/{elementwise_functions,indexing,statistics,window}/`: header-only SYCL functors in namespaces under `dpnp::kernels`
-- Legacy: `src/`, `include/` and `kernels/dpnp_krnl_*.cpp` build `dpnp_backend_c` (still used by `dpnp.partition` and `dpnp.random`); `tests/` (GTest, `-DDPNP_BACKEND_TESTS=ON`) and `examples/` are not built in CI
-- `cmake/Modules/`: vendored `IntelSYCL`, `MKL`, `TBB` and `oneDPL` config modules
-
-## Adding a ufunc Kernel (model: `fabs`)
-1. Functor in `kernels/elementwise_functions/.hpp`.
-2. Binding in `extensions/ufunc/elementwise_functions/.{hpp,cpp}`: output-type map built from `td_ns::TypeMapResultEntry<...>` ending in `td_ns::DefaultResultEntry`, `MACRO_POPULATE_DISPATCH_VECTORS()`, and `init_(m)` defining `_` and `__result_type`.
-3. Register `init_(m)` in `extensions/ufunc/elementwise_functions/common.cpp` and add the source to `_elementwise_sources` in `extensions/ufunc/CMakeLists.txt`.
-4. Wrap it in Python (see `dpnp/AGENTS.md`).
-
-A new extension's `CMakeLists.txt` lists its sources and calls `build_dpnp_pybind11_ext( SOURCES ... [INCLUDE_DIRS ...] [LARGE_RANGES])` from `dpnp/CMakeLists.txt`, which sets the options all extensions share; only oneMKL/oneMath linking and the `-DUSE_ONEMATH*` definitions stay in the extension. Add it with `add_subdirectory` in `dpnp/CMakeLists.txt`, and put an option every extension needs into the helper, not into one extension.
+Legacy, don't extend: new kernels and bindings go into `dpnp/libtensor` (see `dpnp/libtensor/AGENTS.md`, which also holds the C++ rules and build options).
-## Rules for Changes
-These also apply to `dpnp/tensor/libtensor/`.
-- C++17. Include what you use (``, ``, ...), use `std::`-qualified fixed-width types (`std::int64_t`, `std::size_t`), make by-value parameters and locals `const` (`constexpr` where possible), and pass non-output parameters as `const T &`.
-- Headers use `#pragma once`.
-- Python-facing functions take `sycl::queue &exec_q` and `const std::vector &depends`, and return `std::pair` (keep-alive host-task event, compute event). Keep arguments alive with `dpnp::utils::keep_args_alive`.
-- Validate inputs before launching: queue compatibility, contiguity, writability, memory overlap (including the same logical tensor), dtype and ndim. Reuse the helpers neighbouring files use: `check_queue`, `check_c_contig`, `check_no_overlap`, `check_writable` from `extensions/common/ext/validation_utils.hpp` (`indexing`, `statistics`, `ufunc`), or `dpnp::utils::queues_are_compatible`, `dpnp::tensor::overlap::MemoryOverlap` and `dpnp::tensor::validation::CheckWritable` (other extensions and libtensor). Don't silently accept strided input.
-- Throw `py::value_error` for bad arguments and `std::runtime_error` for internal failures; catch oneMKL and SYCL exceptions and rethrow them.
-- Guard double, complex and half with `dpnp::tensor::type_utils::validate_type_for_device(q)`; don't use double literals or casts in kernels that must run without fp64.
-- `blas`, `fft`, `lapack` and `sparse` build against either oneMKL or oneMath (`USE_ONEMATH`); `vm` has kernels only with oneMKL: with oneMath it builds empty and `_is_available()` returns `False`.
-- Release the GIL around blocking oneMKL calls (`py::gil_scoped_release`).
-- An extension whose kernels may be launched over more than `INT_MAX` work-items passes `LARGE_RANGES` to `build_dpnp_pybind11_ext`, which adds `-fno-sycl-id-queries-fit-in-int` at compile and link time (DPC++ 2026.2 and later need it at link time). Outside the helper (`dpnp_backend_c`, `dpnp/tensor`) pass it to both `target_compile_options` and `target_link_options`.
-- clang-format 23 formats C++ (`.clang-format`: LLVM base, 4-space indent, 80 columns); gersemi formats CMake at 88 columns, except `cmake/Modules/`.
-
-## Build
-```bash
-python scripts/build_locally.py # Release, Ninja, icx/icpx, then pip install -e
-python scripts/build_locally.py --clean --debug # remove _skbuild first; Debug build
-python scripts/build_locally.py --onemath # oneMath instead of oneMKL
-python scripts/build_locally.py --target-cuda # plus NVIDIA sm_50 (or --target-cuda=sm_80); --target-hip= for AMD
-```
-`--target-cuda`, `--target-hip` and `--onemath-dir` imply oneMath. Extra CMake options go through `--cmake-opts="..."`; the `--onemkl_interfaces*` options are deprecated. The in-place build copies the `.so` files into the source tree; they are gitignored.
+## Layout
+- `src/`, `include/` and `kernels/dpnp_krnl_*.cpp` build `dpnp_backend_c` (still used by `dpnp.partition` and `dpnp.random`); `tests/` (GTest, `-DDPNP_BACKEND_TESTS=ON`) and `examples/` are not built in CI
+- `cmake/Modules/`: vendored `IntelSYCL`, `MKL`, `TBB` and `oneDPL` config modules, used by the whole build
diff --git a/dpnp/backend/CMakeLists.txt b/dpnp/backend/CMakeLists.txt
index 5d127451d706..7a474b29170c 100644
--- a/dpnp/backend/CMakeLists.txt
+++ b/dpnp/backend/CMakeLists.txt
@@ -42,7 +42,6 @@ set(DPNP_SRC
set(_trgt "dpnp_backend_c")
add_library(${_trgt} SHARED ${DPNP_SRC})
-set_target_properties(${_trgt} PROPERTIES CMAKE_POSITION_INDEPENDENT_CODE ON)
target_include_directories(${_trgt} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include)
target_include_directories(${_trgt} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/src)
diff --git a/dpnp/backend/extensions/elementwise_functions/elementwise_functions_type_utils.cpp b/dpnp/backend/extensions/elementwise_functions/elementwise_functions_type_utils.cpp
deleted file mode 100644
index 6a2bc13d7d2b..000000000000
--- a/dpnp/backend/extensions/elementwise_functions/elementwise_functions_type_utils.cpp
+++ /dev/null
@@ -1,81 +0,0 @@
-//*****************************************************************************
-// Copyright (c) 2024, 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.
-//*****************************************************************************
-
-#include
-#include
-
-#include
-
-#include "dpnp4pybind11.hpp"
-
-#include "elementwise_functions_type_utils.hpp"
-
-// dpnp tensor headers
-#include "utils/type_dispatch.hpp"
-
-namespace dpnp::extensions::py_internal::type_utils
-{
-namespace py = pybind11;
-namespace td_ns = dpnp::tensor::type_dispatch;
-
-py::dtype _dtype_from_typenum(td_ns::typenum_t dst_typenum_t)
-{
- switch (dst_typenum_t) {
- case td_ns::typenum_t::BOOL:
- return py::dtype("?");
- case td_ns::typenum_t::INT8:
- return py::dtype("i1");
- case td_ns::typenum_t::UINT8:
- return py::dtype("u1");
- case td_ns::typenum_t::INT16:
- return py::dtype("i2");
- case td_ns::typenum_t::UINT16:
- return py::dtype("u2");
- case td_ns::typenum_t::INT32:
- return py::dtype("i4");
- case td_ns::typenum_t::UINT32:
- return py::dtype("u4");
- case td_ns::typenum_t::INT64:
- return py::dtype("i8");
- case td_ns::typenum_t::UINT64:
- return py::dtype("u8");
- case td_ns::typenum_t::HALF:
- return py::dtype("f2");
- case td_ns::typenum_t::FLOAT:
- return py::dtype("f4");
- case td_ns::typenum_t::DOUBLE:
- return py::dtype("f8");
- case td_ns::typenum_t::CFLOAT:
- return py::dtype("c8");
- case td_ns::typenum_t::CDOUBLE:
- return py::dtype("c16");
- default:
- throw py::value_error("Unrecognized dst_typeid");
- }
-}
-} // namespace dpnp::extensions::py_internal::type_utils
diff --git a/dpnp/backend/extensions/elementwise_functions/elementwise_functions_type_utils.hpp b/dpnp/backend/extensions/elementwise_functions/elementwise_functions_type_utils.hpp
deleted file mode 100644
index ffc0573c7aa1..000000000000
--- a/dpnp/backend/extensions/elementwise_functions/elementwise_functions_type_utils.hpp
+++ /dev/null
@@ -1,59 +0,0 @@
-//*****************************************************************************
-// Copyright (c) 2024, 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.
-//*****************************************************************************
-
-#pragma once
-
-#include
-#include
-
-#include "dpnp4pybind11.hpp"
-
-// dpnp tensor headers
-#include "utils/type_dispatch.hpp"
-
-namespace dpnp::extensions::py_internal::type_utils
-{
-namespace py = pybind11;
-namespace td_ns = dpnp::tensor::type_dispatch;
-
-/*! @brief Produce dtype from a type number */
-extern py::dtype _dtype_from_typenum(td_ns::typenum_t);
-
-/*! @brief Lookup typeid of the result from typeid of
- * argument and the mapping table */
-template
-output_idT _result_typeid(int arg_typeid, const output_idT *fn_output_id)
-{
- if (arg_typeid < 0 || arg_typeid >= td_ns::num_types) {
- throw py::value_error("Input typeid " + std::to_string(arg_typeid) +
- " is outside of expected bounds.");
- }
-
- return fn_output_id[arg_typeid];
-}
-} // namespace dpnp::extensions::py_internal::type_utils
diff --git a/dpnp/backend/extensions/elementwise_functions/simplify_iteration_space.cpp b/dpnp/backend/extensions/elementwise_functions/simplify_iteration_space.cpp
deleted file mode 100644
index d489d847e610..000000000000
--- a/dpnp/backend/extensions/elementwise_functions/simplify_iteration_space.cpp
+++ /dev/null
@@ -1,320 +0,0 @@
-//*****************************************************************************
-// Copyright (c) 2024, 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.
-//*****************************************************************************
-
-#include
-#include
-#include
-
-#include "simplify_iteration_space.hpp"
-
-// dpnp tensor headers
-#include "utils/strided_iters.hpp"
-
-namespace dpnp::extensions::py_internal
-{
-namespace py = pybind11;
-namespace st_ns = dpnp::tensor::strides;
-
-void simplify_iteration_space(int &nd,
- const py::ssize_t *const &shape,
- std::vector const &src_strides,
- std::vector const &dst_strides,
- // output
- std::vector &simplified_shape,
- std::vector &simplified_src_strides,
- std::vector &simplified_dst_strides,
- py::ssize_t &src_offset,
- py::ssize_t &dst_offset)
-{
- if (nd > 1) {
- // Simplify iteration space to reduce dimensionality
- // and improve access pattern
- simplified_shape.reserve(nd);
- simplified_shape.insert(std::begin(simplified_shape), shape,
- shape + nd);
- assert(simplified_shape.size() == static_cast(nd));
-
- simplified_src_strides.reserve(nd);
- simplified_src_strides.insert(std::end(simplified_src_strides),
- std::begin(src_strides),
- std::end(src_strides));
- assert(simplified_src_strides.size() == static_cast(nd));
-
- simplified_dst_strides.reserve(nd);
- simplified_dst_strides.insert(std::end(simplified_dst_strides),
- std::begin(dst_strides),
- std::end(dst_strides));
- assert(simplified_dst_strides.size() == static_cast(nd));
-
- int contracted_nd = st_ns::simplify_iteration_two_strides(
- nd, simplified_shape.data(), simplified_src_strides.data(),
- simplified_dst_strides.data(),
- src_offset, // modified by reference
- dst_offset // modified by reference
- );
- simplified_shape.resize(contracted_nd);
- simplified_src_strides.resize(contracted_nd);
- simplified_dst_strides.resize(contracted_nd);
-
- nd = contracted_nd;
- }
- else if (nd == 1) {
- src_offset = 0;
- dst_offset = 0;
- // Populate vectors
- simplified_shape.reserve(nd);
- simplified_shape.push_back(shape[0]);
- assert(simplified_shape.size() == static_cast(nd));
-
- simplified_src_strides.reserve(nd);
- simplified_dst_strides.reserve(nd);
-
- if (src_strides[0] < 0 && dst_strides[0] < 0) {
- simplified_src_strides.push_back(-src_strides[0]);
- simplified_dst_strides.push_back(-dst_strides[0]);
- if (shape[0] > 1) {
- src_offset += (shape[0] - 1) * src_strides[0];
- dst_offset += (shape[0] - 1) * dst_strides[0];
- }
- }
- else {
- simplified_src_strides.push_back(src_strides[0]);
- simplified_dst_strides.push_back(dst_strides[0]);
- }
-
- assert(simplified_src_strides.size() == static_cast(nd));
- assert(simplified_dst_strides.size() == static_cast(nd));
- }
-}
-
-void simplify_iteration_space_3(
- int &nd,
- const py::ssize_t *const &shape,
- // src1
- std::vector const &src1_strides,
- // src2
- std::vector const &src2_strides,
- // dst
- std::vector const &dst_strides,
- // output
- std::vector &simplified_shape,
- std::vector &simplified_src1_strides,
- std::vector &simplified_src2_strides,
- std::vector &simplified_dst_strides,
- py::ssize_t &src1_offset,
- py::ssize_t &src2_offset,
- py::ssize_t &dst_offset)
-{
- if (nd > 1) {
- // Simplify iteration space to reduce dimensionality
- // and improve access pattern
- simplified_shape.reserve(nd);
- simplified_shape.insert(std::end(simplified_shape), shape, shape + nd);
- assert(simplified_shape.size() == static_cast(nd));
-
- simplified_src1_strides.reserve(nd);
- simplified_src1_strides.insert(std::end(simplified_src1_strides),
- std::begin(src1_strides),
- std::end(src1_strides));
- assert(simplified_src1_strides.size() == static_cast(nd));
-
- simplified_src2_strides.reserve(nd);
- simplified_src2_strides.insert(std::end(simplified_src2_strides),
- std::begin(src2_strides),
- std::end(src2_strides));
- assert(simplified_src2_strides.size() == static_cast(nd));
-
- simplified_dst_strides.reserve(nd);
- simplified_dst_strides.insert(std::end(simplified_dst_strides),
- std::begin(dst_strides),
- std::end(dst_strides));
- assert(simplified_dst_strides.size() == static_cast(nd));
-
- int contracted_nd = st_ns::simplify_iteration_three_strides(
- nd, simplified_shape.data(), simplified_src1_strides.data(),
- simplified_src2_strides.data(), simplified_dst_strides.data(),
- src1_offset, // modified by reference
- src2_offset, // modified by reference
- dst_offset // modified by reference
- );
- simplified_shape.resize(contracted_nd);
- simplified_src1_strides.resize(contracted_nd);
- simplified_src2_strides.resize(contracted_nd);
- simplified_dst_strides.resize(contracted_nd);
-
- nd = contracted_nd;
- }
- else if (nd == 1) {
- src1_offset = 0;
- src2_offset = 0;
- dst_offset = 0;
- // Populate vectors
- simplified_shape.reserve(nd);
- simplified_shape.push_back(shape[0]);
- assert(simplified_shape.size() == static_cast(nd));
-
- simplified_src1_strides.reserve(nd);
- simplified_src2_strides.reserve(nd);
- simplified_dst_strides.reserve(nd);
-
- if ((src1_strides[0] < 0) && (src2_strides[0] < 0) &&
- (dst_strides[0] < 0)) {
- simplified_src1_strides.push_back(-src1_strides[0]);
- simplified_src2_strides.push_back(-src2_strides[0]);
- simplified_dst_strides.push_back(-dst_strides[0]);
- if (shape[0] > 1) {
- src1_offset += src1_strides[0] * (shape[0] - 1);
- src2_offset += src2_strides[0] * (shape[0] - 1);
- dst_offset += dst_strides[0] * (shape[0] - 1);
- }
- }
- else {
- simplified_src1_strides.push_back(src1_strides[0]);
- simplified_src2_strides.push_back(src2_strides[0]);
- simplified_dst_strides.push_back(dst_strides[0]);
- }
-
- assert(simplified_src1_strides.size() == static_cast(nd));
- assert(simplified_src2_strides.size() == static_cast(nd));
- assert(simplified_dst_strides.size() == static_cast(nd));
- }
-}
-
-void simplify_iteration_space_4(
- int &nd,
- const py::ssize_t *const &shape,
- // src1
- std::vector const &src1_strides,
- // src2
- std::vector const &src2_strides,
- // src3
- std::vector const &src3_strides,
- // dst
- std::vector const &dst_strides,
- // output
- std::vector &simplified_shape,
- std::vector &simplified_src1_strides,
- std::vector &simplified_src2_strides,
- std::vector &simplified_src3_strides,
- std::vector &simplified_dst_strides,
- py::ssize_t &src1_offset,
- py::ssize_t &src2_offset,
- py::ssize_t &src3_offset,
- py::ssize_t &dst_offset)
-{
- using dpnp::tensor::strides::simplify_iteration_four_strides;
- if (nd > 1) {
- // Simplify iteration space to reduce dimensionality
- // and improve access pattern
- simplified_shape.reserve(nd);
- simplified_shape.insert(std::end(simplified_shape), shape, shape + nd);
- assert(simplified_shape.size() == static_cast(nd));
-
- simplified_src1_strides.reserve(nd);
- simplified_src1_strides.insert(std::end(simplified_src1_strides),
- std::begin(src1_strides),
- std::end(src1_strides));
- assert(simplified_src1_strides.size() == static_cast(nd));
-
- simplified_src2_strides.reserve(nd);
- simplified_src2_strides.insert(std::end(simplified_src2_strides),
- std::begin(src2_strides),
- std::end(src2_strides));
- assert(simplified_src2_strides.size() == static_cast(nd));
-
- simplified_src3_strides.reserve(nd);
- simplified_src3_strides.insert(std::end(simplified_src3_strides),
- std::begin(src3_strides),
- std::end(src3_strides));
- assert(simplified_src3_strides.size() == static_cast(nd));
-
- simplified_dst_strides.reserve(nd);
- simplified_dst_strides.insert(std::end(simplified_dst_strides),
- std::begin(dst_strides),
- std::end(dst_strides));
- assert(simplified_dst_strides.size() == static_cast(nd));
-
- int contracted_nd = simplify_iteration_four_strides(
- nd, simplified_shape.data(), simplified_src1_strides.data(),
- simplified_src2_strides.data(), simplified_src3_strides.data(),
- simplified_dst_strides.data(),
- src1_offset, // modified by reference
- src2_offset, // modified by reference
- src3_offset, // modified by reference
- dst_offset // modified by reference
- );
- simplified_shape.resize(contracted_nd);
- simplified_src1_strides.resize(contracted_nd);
- simplified_src2_strides.resize(contracted_nd);
- simplified_src3_strides.resize(contracted_nd);
- simplified_dst_strides.resize(contracted_nd);
-
- nd = contracted_nd;
- }
- else if (nd == 1) {
- src1_offset = 0;
- src2_offset = 0;
- src3_offset = 0;
- dst_offset = 0;
- // Populate vectors
- simplified_shape.reserve(nd);
- simplified_shape.push_back(shape[0]);
- assert(simplified_shape.size() == static_cast(nd));
-
- simplified_src1_strides.reserve(nd);
- simplified_src2_strides.reserve(nd);
- simplified_src3_strides.reserve(nd);
- simplified_dst_strides.reserve(nd);
-
- if ((src1_strides[0] < 0) && (src2_strides[0] < 0) &&
- (src3_strides[0] < 0) && (dst_strides[0] < 0)) {
- simplified_src1_strides.push_back(-src1_strides[0]);
- simplified_src2_strides.push_back(-src2_strides[0]);
- simplified_src3_strides.push_back(-src3_strides[0]);
- simplified_dst_strides.push_back(-dst_strides[0]);
- if (shape[0] > 1) {
- src1_offset += src1_strides[0] * (shape[0] - 1);
- src2_offset += src2_strides[0] * (shape[0] - 1);
- src3_offset += src3_strides[0] * (shape[0] - 1);
- dst_offset += dst_strides[0] * (shape[0] - 1);
- }
- }
- else {
- simplified_src1_strides.push_back(src1_strides[0]);
- simplified_src2_strides.push_back(src2_strides[0]);
- simplified_src3_strides.push_back(src3_strides[0]);
- simplified_dst_strides.push_back(dst_strides[0]);
- }
-
- assert(simplified_src1_strides.size() == static_cast(nd));
- assert(simplified_src2_strides.size() == static_cast(nd));
- assert(simplified_src3_strides.size() == static_cast(nd));
- assert(simplified_dst_strides.size() == static_cast(nd));
- }
-}
-} // namespace dpnp::extensions::py_internal
diff --git a/dpnp/backend/extensions/elementwise_functions/simplify_iteration_space.hpp b/dpnp/backend/extensions/elementwise_functions/simplify_iteration_space.hpp
deleted file mode 100644
index 5dc7b196b3e0..000000000000
--- a/dpnp/backend/extensions/elementwise_functions/simplify_iteration_space.hpp
+++ /dev/null
@@ -1,85 +0,0 @@
-//*****************************************************************************
-// Copyright (c) 2024, 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.
-//*****************************************************************************
-
-#pragma once
-
-#include
-#include
-
-namespace dpnp::extensions::py_internal
-{
-namespace py = pybind11;
-
-void simplify_iteration_space(int &,
- const py::ssize_t *const &,
- std::vector const &,
- std::vector const &,
- std::vector &,
- std::vector &,
- std::vector &,
- py::ssize_t &,
- py::ssize_t &);
-
-void simplify_iteration_space_3(int &,
- const py::ssize_t *const &,
- // src1
- std::vector const &,
- // src2
- std::vector const &,
- // dst
- std::vector const &,
- // output
- std::vector &,
- std::vector &,
- std::vector &,
- std::vector &,
- py::ssize_t &,
- py::ssize_t &,
- py::ssize_t &);
-
-void simplify_iteration_space_4(int &,
- const py::ssize_t *const &,
- // src1
- std::vector const &,
- // src2
- std::vector const &,
- // src3
- std::vector const &,
- // dst
- std::vector const &,
- // output
- std::vector &,
- std::vector &,
- std::vector &,
- std::vector &,
- std::vector &,
- py::ssize_t &,
- py::ssize_t &,
- py::ssize_t &,
- py::ssize_t &);
-} // namespace dpnp::extensions::py_internal
diff --git a/dpnp/backend/extensions/elementwise_functions/type_dispatch_building.hpp b/dpnp/backend/extensions/elementwise_functions/type_dispatch_building.hpp
deleted file mode 100644
index 80d4d1f72dde..000000000000
--- a/dpnp/backend/extensions/elementwise_functions/type_dispatch_building.hpp
+++ /dev/null
@@ -1,79 +0,0 @@
-//*****************************************************************************
-// Copyright (c) 2025, 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.
-//*****************************************************************************
-
-#pragma once
-
-#include
-
-#include "utils/type_dispatch.hpp"
-
-namespace dpnp::extensions::py_internal::type_dispatch
-{
-/**
- * Extends dpnp::tensor::type_dispatch::TypeMapResultEntry helper structure
- * with support of the two result types.
- */
-template
-struct TypeMapTwoResultsEntry : std::bool_constant>
-{
- using result_type1 = ResTy1;
- using result_type2 = ResTy2;
-};
-
-/**
- * Extends dpnp::tensor::type_dispatch::BinaryTypeMapResultEntry helper
- * structure with support of the two result types.
- */
-template
-struct BinaryTypeMapTwoResultsEntry
- : std::bool_constant,
- std::is_same>>
-{
- using result_type1 = ResTy1;
- using result_type2 = ResTy2;
-};
-
-/**
- * Extends dpnp::tensor::type_dispatch::DefaultResultEntry helper structure
- * with support of the two result types.
- */
-template
-struct DefaultTwoResultsEntry : std::true_type
-{
- using result_type1 = Ty;
- using result_type2 = Ty;
-};
-} // namespace dpnp::extensions::py_internal::type_dispatch
diff --git a/dpnp/backend/extensions/indexing/CMakeLists.txt b/dpnp/backend/extensions/indexing/CMakeLists.txt
deleted file mode 100644
index 78957a4b028f..000000000000
--- a/dpnp/backend/extensions/indexing/CMakeLists.txt
+++ /dev/null
@@ -1,43 +0,0 @@
-# -*- coding: utf-8 -*-
-# *****************************************************************************
-# Copyright (c) 2025, 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.
-# *****************************************************************************
-
-set(python_module_name _indexing_impl)
-set(_module_src
- ${CMAKE_CURRENT_SOURCE_DIR}/choose.cpp
- ${CMAKE_CURRENT_SOURCE_DIR}/putmask.cpp
- ${CMAKE_CURRENT_SOURCE_DIR}/indexing_py.cpp
-)
-
-build_dpnp_pybind11_ext(
- ${python_module_name}
- "dpnp/backend/extensions/indexing"
- SOURCES ${_module_src}
- INCLUDE_DIRS ${CMAKE_CURRENT_SOURCE_DIR}/../../ ${CMAKE_CURRENT_SOURCE_DIR}/../common
- LARGE_RANGES
-)
diff --git a/dpnp/backend/extensions/indexing/indexing_py.cpp b/dpnp/backend/extensions/indexing/indexing_py.cpp
deleted file mode 100644
index 23a3bcaeb1a1..000000000000
--- a/dpnp/backend/extensions/indexing/indexing_py.cpp
+++ /dev/null
@@ -1,42 +0,0 @@
-//*****************************************************************************
-// Copyright (c) 2025, 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.
-//*****************************************************************************
-//
-// This file defines functions of dpnp.backend._indexing_impl extensions
-//
-//*****************************************************************************
-
-#include
-
-#include "choose.hpp"
-#include "putmask.hpp"
-
-PYBIND11_MODULE(_indexing_impl, m, py::mod_gil_not_used())
-{
- dpnp::extensions::indexing::init_choose(m);
- dpnp::extensions::indexing::init_putmask(m);
-}
diff --git a/dpnp/backend/extensions/statistics/CMakeLists.txt b/dpnp/backend/extensions/statistics/CMakeLists.txt
deleted file mode 100644
index 088b1e667338..000000000000
--- a/dpnp/backend/extensions/statistics/CMakeLists.txt
+++ /dev/null
@@ -1,47 +0,0 @@
-# -*- coding: utf-8 -*-
-# *****************************************************************************
-# Copyright (c) 2024, 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.
-# *****************************************************************************
-
-set(python_module_name _statistics_impl)
-set(_module_src
- ${CMAKE_CURRENT_SOURCE_DIR}/bincount.cpp
- ${CMAKE_CURRENT_SOURCE_DIR}/histogram.cpp
- ${CMAKE_CURRENT_SOURCE_DIR}/histogramdd.cpp
- ${CMAKE_CURRENT_SOURCE_DIR}/histogram_common.cpp
- ${CMAKE_CURRENT_SOURCE_DIR}/sliding_dot_product1d.cpp
- ${CMAKE_CURRENT_SOURCE_DIR}/sliding_window1d.cpp
- ${CMAKE_CURRENT_SOURCE_DIR}/statistics_py.cpp
-)
-
-build_dpnp_pybind11_ext(
- ${python_module_name}
- "dpnp/backend/extensions/statistics"
- SOURCES ${_module_src}
- INCLUDE_DIRS ${CMAKE_CURRENT_SOURCE_DIR}/../../ ${CMAKE_CURRENT_SOURCE_DIR}/../common
- LARGE_RANGES
-)
diff --git a/dpnp/backend/extensions/ufunc/CMakeLists.txt b/dpnp/backend/extensions/ufunc/CMakeLists.txt
deleted file mode 100644
index 7f1059bcdc85..000000000000
--- a/dpnp/backend/extensions/ufunc/CMakeLists.txt
+++ /dev/null
@@ -1,73 +0,0 @@
-# -*- coding: utf-8 -*-
-# *****************************************************************************
-# Copyright (c) 2024, 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.
-# *****************************************************************************
-
-set(_elementwise_sources
- ${CMAKE_CURRENT_SOURCE_DIR}/elementwise_functions/bitwise_count.cpp
- ${CMAKE_CURRENT_SOURCE_DIR}/elementwise_functions/common.cpp
- ${CMAKE_CURRENT_SOURCE_DIR}/elementwise_functions/degrees.cpp
- ${CMAKE_CURRENT_SOURCE_DIR}/elementwise_functions/divmod.cpp
- ${CMAKE_CURRENT_SOURCE_DIR}/elementwise_functions/erf_funcs.cpp
- ${CMAKE_CURRENT_SOURCE_DIR}/elementwise_functions/fabs.cpp
- ${CMAKE_CURRENT_SOURCE_DIR}/elementwise_functions/float_power.cpp
- ${CMAKE_CURRENT_SOURCE_DIR}/elementwise_functions/fmax.cpp
- ${CMAKE_CURRENT_SOURCE_DIR}/elementwise_functions/fmin.cpp
- ${CMAKE_CURRENT_SOURCE_DIR}/elementwise_functions/fmod.cpp
- ${CMAKE_CURRENT_SOURCE_DIR}/elementwise_functions/frexp.cpp
- ${CMAKE_CURRENT_SOURCE_DIR}/elementwise_functions/gcd.cpp
- ${CMAKE_CURRENT_SOURCE_DIR}/elementwise_functions/heaviside.cpp
- ${CMAKE_CURRENT_SOURCE_DIR}/elementwise_functions/i0.cpp
- ${CMAKE_CURRENT_SOURCE_DIR}/elementwise_functions/interpolate.cpp
- ${CMAKE_CURRENT_SOURCE_DIR}/elementwise_functions/isclose.cpp
- ${CMAKE_CURRENT_SOURCE_DIR}/elementwise_functions/lcm.cpp
- ${CMAKE_CURRENT_SOURCE_DIR}/elementwise_functions/ldexp.cpp
- ${CMAKE_CURRENT_SOURCE_DIR}/elementwise_functions/logaddexp2.cpp
- ${CMAKE_CURRENT_SOURCE_DIR}/elementwise_functions/modf.cpp
- ${CMAKE_CURRENT_SOURCE_DIR}/elementwise_functions/nan_to_num.cpp
- ${CMAKE_CURRENT_SOURCE_DIR}/elementwise_functions/radians.cpp
- ${CMAKE_CURRENT_SOURCE_DIR}/elementwise_functions/sinc.cpp
- ${CMAKE_CURRENT_SOURCE_DIR}/elementwise_functions/spacing.cpp
-)
-
-set(python_module_name _ufunc_impl)
-
-set(_module_src
- # TODO: remove sources from `elementwise_functions` folder
- ${CMAKE_CURRENT_SOURCE_DIR}/../elementwise_functions/elementwise_functions_type_utils.cpp
- ${CMAKE_CURRENT_SOURCE_DIR}/../elementwise_functions/simplify_iteration_space.cpp
- ${CMAKE_CURRENT_SOURCE_DIR}/ufunc_py.cpp
- ${_elementwise_sources}
-)
-
-build_dpnp_pybind11_ext(
- ${python_module_name}
- "dpnp/backend/extensions/ufunc"
- SOURCES ${_module_src}
- INCLUDE_DIRS ${CMAKE_CURRENT_SOURCE_DIR}/../../ ${CMAKE_CURRENT_SOURCE_DIR}/../common
- LARGE_RANGES
-)
diff --git a/dpnp/backend/extensions/ufunc/elementwise_functions/common.cpp b/dpnp/backend/extensions/ufunc/elementwise_functions/common.cpp
deleted file mode 100644
index 9254e87e52c4..000000000000
--- a/dpnp/backend/extensions/ufunc/elementwise_functions/common.cpp
+++ /dev/null
@@ -1,88 +0,0 @@
-//*****************************************************************************
-// Copyright (c) 2024, 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.
-//*****************************************************************************
-
-#include
-
-#include "bitwise_count.hpp"
-#include "degrees.hpp"
-#include "divmod.hpp"
-#include "erf_funcs.hpp"
-#include "fabs.hpp"
-#include "float_power.hpp"
-#include "fmax.hpp"
-#include "fmin.hpp"
-#include "fmod.hpp"
-#include "frexp.hpp"
-#include "gcd.hpp"
-#include "heaviside.hpp"
-#include "i0.hpp"
-#include "interpolate.hpp"
-#include "isclose.hpp"
-#include "lcm.hpp"
-#include "ldexp.hpp"
-#include "logaddexp2.hpp"
-#include "modf.hpp"
-#include "nan_to_num.hpp"
-#include "radians.hpp"
-#include "sinc.hpp"
-#include "spacing.hpp"
-
-namespace py = pybind11;
-
-namespace dpnp::extensions::ufunc
-{
-/**
- * @brief Add elementwise functions to Python module
- */
-void init_elementwise_functions(py::module_ m)
-{
- init_bitwise_count(m);
- init_degrees(m);
- init_divmod(m);
- init_erf_funcs(m);
- init_fabs(m);
- init_float_power(m);
- init_fmax(m);
- init_fmin(m);
- init_fmod(m);
- init_frexp(m);
- init_gcd(m);
- init_heaviside(m);
- init_i0(m);
- init_interpolate(m);
- init_isclose(m);
- init_lcm(m);
- init_ldexp(m);
- init_logaddexp2(m);
- init_modf(m);
- init_nan_to_num(m);
- init_radians(m);
- init_sinc(m);
- init_spacing(m);
-}
-} // namespace dpnp::extensions::ufunc
diff --git a/dpnp/backend/extensions/ufunc/elementwise_functions/common.hpp b/dpnp/backend/extensions/ufunc/elementwise_functions/common.hpp
deleted file mode 100644
index 8cad6a650962..000000000000
--- a/dpnp/backend/extensions/ufunc/elementwise_functions/common.hpp
+++ /dev/null
@@ -1,38 +0,0 @@
-//*****************************************************************************
-// Copyright (c) 2024, 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.
-//*****************************************************************************
-
-#pragma once
-
-#include
-
-namespace py = pybind11;
-
-namespace dpnp::extensions::ufunc
-{
-void init_elementwise_functions(py::module_);
-} // namespace dpnp::extensions::ufunc
diff --git a/dpnp/backend/extensions/ufunc/ufunc_py.cpp b/dpnp/backend/extensions/ufunc/ufunc_py.cpp
deleted file mode 100644
index 6ac16e7a48e9..000000000000
--- a/dpnp/backend/extensions/ufunc/ufunc_py.cpp
+++ /dev/null
@@ -1,38 +0,0 @@
-//*****************************************************************************
-// Copyright (c) 2024, 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.
-//*****************************************************************************
-
-#include
-
-#include "elementwise_functions/common.hpp"
-
-namespace ufunc_ns = dpnp::extensions::ufunc;
-
-PYBIND11_MODULE(_ufunc_impl, m, py::mod_gil_not_used())
-{
- ufunc_ns::init_elementwise_functions(m);
-}
diff --git a/dpnp/backend/extensions/window/CMakeLists.txt b/dpnp/backend/extensions/window/CMakeLists.txt
deleted file mode 100644
index f25e9464ac57..000000000000
--- a/dpnp/backend/extensions/window/CMakeLists.txt
+++ /dev/null
@@ -1,42 +0,0 @@
-# -*- coding: utf-8 -*-
-# *****************************************************************************
-# Copyright (c) 2025, 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.
-# *****************************************************************************
-
-set(python_module_name _window_impl)
-set(_module_src
- ${CMAKE_CURRENT_SOURCE_DIR}/kaiser.cpp
- ${CMAKE_CURRENT_SOURCE_DIR}/window_py.cpp
-)
-
-build_dpnp_pybind11_ext(
- ${python_module_name}
- "dpnp/backend/extensions/window"
- SOURCES ${_module_src}
- INCLUDE_DIRS ${CMAKE_CURRENT_SOURCE_DIR}/../../ ${CMAKE_CURRENT_SOURCE_DIR}/../common
- LARGE_RANGES
-)
diff --git a/dpnp/cmake/tensor_build_flags.cmake b/dpnp/cmake/tensor_build_flags.cmake
new file mode 100644
index 000000000000..6097cd57e4d1
--- /dev/null
+++ b/dpnp/cmake/tensor_build_flags.cmake
@@ -0,0 +1,73 @@
+# -*- coding: utf-8 -*-
+# *****************************************************************************
+# 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.
+# *****************************************************************************
+
+# Directory-scoped build flags shared by the dpnp.tensor Cython extensions and
+# the libtensor pybind11 modules built in dpnp/libtensor/source. Include it from
+# the CMakeLists.txt of a directory before defining any targets there.
+
+# Tensor-specific flags
+
+# dpctl doesn't add -fsycl globally
+# only to pybind11 module sources via add_sycl_to_target()
+string(REPLACE "-fsycl " "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
+
+# Use LLD linker (dpctl sets this at root level)
+if(UNIX)
+ add_link_options("-fuse-ld=lld")
+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}")
+endif()
+
+# Tensor-specific debug flags
+# Disable device code debug info for Debug and Coverage builds to speed up linking
+if(
+ CMAKE_BUILD_TYPE STREQUAL "Debug"
+ OR CMAKE_BUILD_TYPE STREQUAL "DEBUG"
+ OR CMAKE_BUILD_TYPE STREQUAL "Coverage"
+)
+ if(WIN32)
+ add_compile_options(-Xsycl-target-frontend=spir64 "-g0")
+ elseif(UNIX)
+ add_compile_options(-Xsycl-target-frontend=spir64 "-g0")
+ if(CMAKE_BUILD_TYPE STREQUAL "Debug" OR CMAKE_BUILD_TYPE STREQUAL "DEBUG")
+ string(REPLACE "-g1" "-g" CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG}")
+ string(REPLACE "-g1" "-g" CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG}")
+ endif()
+ endif()
+endif()
+
+# Match dpctl warning flags
+# Suppress unused parameter warnings
+add_compile_options(-Wno-unused-parameter)
diff --git a/dpnp/dpnp_algo/dpnp_elementwise_common.py b/dpnp/dpnp_algo/dpnp_elementwise_common.py
index 8790c479365e..14ecf295e3f5 100644
--- a/dpnp/dpnp_algo/dpnp_elementwise_common.py
+++ b/dpnp/dpnp_algo/dpnp_elementwise_common.py
@@ -33,12 +33,12 @@
import numpy
import dpnp
-import dpnp.backend.extensions.vm._vm_impl as vmi
+import dpnp.libtensor._tensor_impl as dti
+import dpnp.libtensor._vm_impl as vmi
# pylint: disable=no-name-in-module
import dpnp.tensor as dpt
import dpnp.tensor._copy_utils as dtc
-import dpnp.tensor._tensor_impl as dti
import dpnp.tensor._type_utils as dtu
from dpnp.dpnp_array import dpnp_array
from dpnp.dpnp_utils import get_usm_allocations
diff --git a/dpnp/dpnp_algo/dpnp_fill.py b/dpnp/dpnp_algo/dpnp_fill.py
index 84aa9e47b27e..8ffd2e6f2fad 100644
--- a/dpnp/dpnp_algo/dpnp_fill.py
+++ b/dpnp/dpnp_algo/dpnp_fill.py
@@ -33,12 +33,12 @@
import dpnp
import dpnp.tensor as dpt
from dpnp.exceptions import ExecutionPlacementError
-from dpnp.tensor._ctors import _cast_fill_val
-from dpnp.tensor._tensor_impl import (
+from dpnp.libtensor._tensor_impl import (
_copy_usm_ndarray_into_usm_ndarray,
_full_usm_ndarray,
_zeros_usm_ndarray,
)
+from dpnp.tensor._ctors import _cast_fill_val
def dpnp_fill(arr, val):
diff --git a/dpnp/dpnp_iface.py b/dpnp/dpnp_iface.py
index 2561e24b4a01..e3f36711c905 100644
--- a/dpnp/dpnp_iface.py
+++ b/dpnp/dpnp_iface.py
@@ -49,10 +49,10 @@
import numpy
import dpnp
+import dpnp.libtensor._tensor_impl as ti
# pylint: disable=no-name-in-module
import dpnp.tensor as dpt
-import dpnp.tensor._tensor_impl as ti
from .dpnp_array import dpnp_array
from .dpnp_utils import (
@@ -428,14 +428,17 @@ def get_dpnp_descriptor(
def get_include():
r"""
- Return the directory that contains \*.h header files of dpnp C++ backend.
+ Return the directory that contains the \*.hpp header files of the dpnp
+ C++ library (libtensor).
- An extension module that needs to be compiled against dpnp backend
- should use this function to locate the appropriate include directory.
+ An extension module that needs to be compiled against libtensor should
+ use this function to locate the appropriate include directory.
+ It is the same directory as returned by
+ ``python -m dpnp --tensor-include-dir``.
"""
- return os.path.join(os.path.dirname(__file__), "backend", "include")
+ return os.path.join(os.path.dirname(__file__), "libtensor", "include")
def get_normalized_queue_device(obj=None, device=None, sycl_queue=None):
diff --git a/dpnp/dpnp_iface_bitwise.py b/dpnp/dpnp_iface_bitwise.py
index 350cc740782d..301fa0571669 100644
--- a/dpnp/dpnp_iface_bitwise.py
+++ b/dpnp/dpnp_iface_bitwise.py
@@ -45,8 +45,7 @@
import numpy
-import dpnp.backend.extensions.ufunc._ufunc_impl as ufi
-import dpnp.tensor._tensor_elementwise_impl as ti
+import dpnp.libtensor._tensor_elementwise_impl as ti
from dpnp.dpnp_algo.dpnp_elementwise_common import DPNPBinaryFunc, DPNPUnaryFunc
@@ -260,8 +259,8 @@ def binary_repr(num, width=None):
bitwise_count = DPNPUnaryFunc(
"bitwise_count",
- ufi._bitwise_count_result_type,
- ufi._bitwise_count,
+ ti._bitwise_count_result_type,
+ ti._bitwise_count,
_BITWISE_COUNT_DOCSTRING,
)
diff --git a/dpnp/dpnp_iface_histograms.py b/dpnp/dpnp_iface_histograms.py
index 1ac51d18f4c8..0a968d62ea93 100644
--- a/dpnp/dpnp_iface_histograms.py
+++ b/dpnp/dpnp_iface_histograms.py
@@ -48,7 +48,7 @@
import dpnp
# pylint: disable=no-name-in-module
-import dpnp.backend.extensions.statistics._statistics_impl as statistics_ext
+import dpnp.libtensor._statistics_impl as statistics_ext
from dpnp.dpnp_utils.dpnp_utils_common import (
result_type_for_device,
to_supported_dtypes,
diff --git a/dpnp/dpnp_iface_indexing.py b/dpnp/dpnp_iface_indexing.py
index 05f6cfd76bc7..de82c555aa07 100644
--- a/dpnp/dpnp_iface_indexing.py
+++ b/dpnp/dpnp_iface_indexing.py
@@ -50,11 +50,8 @@
import dpnp
# pylint: disable=no-name-in-module
-import dpnp.backend.extensions.indexing._indexing_impl as indexing_ext
-
-# pylint: disable=no-name-in-module
+import dpnp.libtensor._tensor_impl as ti
import dpnp.tensor as dpt
-import dpnp.tensor._tensor_impl as ti
from .dpnp_array import dpnp_array
from .dpnp_utils import get_usm_allocations
@@ -145,7 +142,7 @@ def _choose_run(inds, chcs, q, usm_type, out=None, mode=0):
_manager = dpu.SequentialOrderManager[q]
dep_evs = _manager.submitted_events
- h_ev, choose_ev = indexing_ext._choose(inds, chcs, out, mode, q, dep_evs)
+ h_ev, choose_ev = ti._choose(inds, chcs, out, mode, q, dep_evs)
_manager.add_event_pair(h_ev, choose_ev)
return out
@@ -1914,7 +1911,7 @@ def putmask(a, /, mask, values):
_manager = dpu.SequentialOrderManager[exec_q]
dep_evs = _manager.submitted_events
- h_ev, putmask_ev = indexing_ext._putmask(
+ h_ev, putmask_ev = ti._putmask(
usm_a, usm_mask, usm_values_1d, exec_q, dep_evs
)
_manager.add_event_pair(h_ev, putmask_ev)
diff --git a/dpnp/dpnp_iface_logic.py b/dpnp/dpnp_iface_logic.py
index 0a1379d20735..91b584678a56 100644
--- a/dpnp/dpnp_iface_logic.py
+++ b/dpnp/dpnp_iface_logic.py
@@ -47,9 +47,8 @@
import numpy
import dpnp
-import dpnp.backend.extensions.ufunc._ufunc_impl as ufi
+import dpnp.libtensor._tensor_elementwise_impl as ti
import dpnp.tensor as dpt
-import dpnp.tensor._tensor_elementwise_impl as ti
from dpnp.tensor._type_utils import _resolve_weak_types_all_py_ints
from .dpnp_algo.dpnp_elementwise_common import DPNPBinaryFunc, DPNPUnaryFunc
@@ -108,7 +107,7 @@ def _isclose_scalar_tol(a, b, rtol, atol, equal_nan):
)
_manager = dpu.SequentialOrderManager[exec_q]
- mem_ev, ht_ev = ufi._isclose_scalar(
+ mem_ev, ht_ev = ti._isclose_scalar(
a.get_array(),
b.get_array(),
rtol,
diff --git a/dpnp/dpnp_iface_mathematical.py b/dpnp/dpnp_iface_mathematical.py
index e5d7daa26a24..bb7e043c7ab9 100644
--- a/dpnp/dpnp_iface_mathematical.py
+++ b/dpnp/dpnp_iface_mathematical.py
@@ -50,9 +50,8 @@
import numpy
import dpnp
-import dpnp.backend.extensions.ufunc._ufunc_impl as ufi
+import dpnp.libtensor._tensor_elementwise_impl as ti
import dpnp.tensor as dpt
-import dpnp.tensor._tensor_elementwise_impl as ti
import dpnp.tensor._type_utils as dtu
from .dpnp_algo.dpnp_elementwise_common import (
@@ -1634,8 +1633,8 @@ def diff(a, n=1, axis=-1, prepend=None, append=None):
divmod = DPNPBinaryTwoOutputsFunc(
"divmod",
- ufi._divmod_result_type,
- ufi._divmod,
+ ti._divmod_result_type,
+ ti._divmod,
_DIVMOD_DOCSTRING,
)
@@ -1786,8 +1785,8 @@ def ediff1d(ary, to_end=None, to_begin=None):
fabs = DPNPUnaryFunc(
"fabs",
- ufi._fabs_result_type,
- ufi._fabs,
+ ti._fabs_result_type,
+ ti._fabs,
_FABS_DOCSTRING,
mkl_fn_to_call="_mkl_abs_to_call",
mkl_impl_fn="_abs",
@@ -1967,7 +1966,7 @@ def ediff1d(ary, to_end=None, to_begin=None):
float_power = DPNPBinaryFunc(
"float_power",
- ufi._float_power_result_type,
+ ti._float_power_result_type,
ti._pow,
_FLOAT_POWER_DOCSTRING,
mkl_fn_to_call="_mkl_pow_to_call",
@@ -2209,8 +2208,8 @@ def ediff1d(ary, to_end=None, to_begin=None):
fmax = DPNPBinaryFunc(
"fmax",
- ufi._fmax_result_type,
- ufi._fmax,
+ ti._fmax_result_type,
+ ti._fmax,
_FMAX_DOCSTRING,
mkl_fn_to_call="_mkl_fmax_to_call",
mkl_impl_fn="_fmax",
@@ -2302,8 +2301,8 @@ def ediff1d(ary, to_end=None, to_begin=None):
fmin = DPNPBinaryFunc(
"fmin",
- ufi._fmin_result_type,
- ufi._fmin,
+ ti._fmin_result_type,
+ ti._fmin,
_FMIN_DOCSTRING,
mkl_fn_to_call="_mkl_fmin_to_call",
mkl_impl_fn="_fmin",
@@ -2387,8 +2386,8 @@ def ediff1d(ary, to_end=None, to_begin=None):
fmod = DPNPBinaryFunc(
"fmod",
- ufi._fmod_result_type,
- ufi._fmod,
+ ti._fmod_result_type,
+ ti._fmod,
_FMOD_DOCSTRING,
mkl_fn_to_call="_mkl_fmod_to_call",
mkl_impl_fn="_fmod",
@@ -2467,8 +2466,8 @@ def ediff1d(ary, to_end=None, to_begin=None):
frexp = DPNPUnaryTwoOutputsFunc(
"frexp",
- ufi._frexp_result_type,
- ufi._frexp,
+ ti._frexp_result_type,
+ ti._frexp,
_FREXP_DOCSTRING,
)
@@ -2530,8 +2529,8 @@ def ediff1d(ary, to_end=None, to_begin=None):
gcd = DPNPBinaryFunc(
"gcd",
- ufi._gcd_result_type,
- ufi._gcd,
+ ti._gcd_result_type,
+ ti._gcd,
_GCD_DOCSTRING,
acceptance_fn=acceptance_fn_gcd_lcm,
)
@@ -2803,8 +2802,8 @@ def gradient(f, *varargs, axis=None, edge_order=1):
heaviside = DPNPBinaryFunc(
"heaviside",
- ufi._heaviside_result_type,
- ufi._heaviside,
+ ti._heaviside_result_type,
+ ti._heaviside,
_HEAVISIDE_DOCSTRING,
)
@@ -2853,8 +2852,8 @@ def gradient(f, *varargs, axis=None, edge_order=1):
i0 = DPNPI0(
"i0",
- ufi._i0_result_type,
- ufi._i0,
+ ti._i0_result_type,
+ ti._i0,
_I0_DOCSTRING,
mkl_fn_to_call="_mkl_i0_to_call",
mkl_impl_fn="_i0",
@@ -3084,7 +3083,7 @@ def interp(x, xp, fp, left=None, right=None, period=None):
right_usm = right.get_array() if right is not None else None
_manager = dpu.SequentialOrderManager[exec_q]
- mem_ev, ht_ev = ufi._interpolate(
+ mem_ev, ht_ev = ti._interpolate(
x.get_array(),
idx.get_array(),
xp.get_array(),
@@ -3157,8 +3156,8 @@ def interp(x, xp, fp, left=None, right=None, period=None):
lcm = DPNPBinaryFunc(
"lcm",
- ufi._lcm_result_type,
- ufi._lcm,
+ ti._lcm_result_type,
+ ti._lcm,
_LCM_DOCSTRING,
acceptance_fn=acceptance_fn_gcd_lcm,
)
@@ -3229,8 +3228,8 @@ def interp(x, xp, fp, left=None, right=None, period=None):
ldexp = DPNPBinaryFunc(
"ldexp",
- ufi._ldexp_result_type,
- ufi._ldexp,
+ ti._ldexp_result_type,
+ ti._ldexp,
_LDEXP_DOCSTRING,
weak_type_resolver=resolve_weak_types_2nd_arg_int,
)
@@ -3509,8 +3508,8 @@ def interp(x, xp, fp, left=None, right=None, period=None):
modf = DPNPUnaryTwoOutputsFunc(
"modf",
- ufi._modf_result_type,
- ufi._modf,
+ ti._modf_result_type,
+ ti._modf,
_MODF_DOCSTRING,
mkl_fn_to_call="_mkl_modf_to_call",
mkl_impl_fn="_modf",
@@ -3743,7 +3742,7 @@ def _check_nan_inf(val, val_dt):
q = x.sycl_queue
_manager = dpu.SequentialOrderManager[q]
- h_ev, comp_ev = ufi._nan_to_num(
+ h_ev, comp_ev = ti._nan_to_num(
x_ary,
nan,
max_f,
@@ -4776,8 +4775,8 @@ def real_if_close(a, tol=100):
sinc = DPNPSinc(
"sinc",
- ufi._sinc_result_type,
- ufi._sinc,
+ ti._sinc_result_type,
+ ti._sinc,
_SINC_DOCSTRING,
)
@@ -4837,8 +4836,8 @@ def real_if_close(a, tol=100):
spacing = DPNPUnaryFunc(
"spacing",
- ufi._spacing_result_type,
- ufi._spacing,
+ ti._spacing_result_type,
+ ti._spacing,
_SPACING_DOCSTRING,
)
diff --git a/dpnp/dpnp_iface_searching.py b/dpnp/dpnp_iface_searching.py
index d72130a6f1f4..52890705afbc 100644
--- a/dpnp/dpnp_iface_searching.py
+++ b/dpnp/dpnp_iface_searching.py
@@ -44,8 +44,8 @@
import dpnp
# pylint: disable=no-name-in-module
+import dpnp.libtensor._tensor_impl as dti
import dpnp.tensor as dpt
-import dpnp.tensor._tensor_impl as dti
from .dpnp_array import dpnp_array
from .dpnp_utils.dpnp_utils_reduction import dpnp_wrap_reduction_call
diff --git a/dpnp/dpnp_iface_statistics.py b/dpnp/dpnp_iface_statistics.py
index 114072407ca8..d86b37f3c5ba 100644
--- a/dpnp/dpnp_iface_statistics.py
+++ b/dpnp/dpnp_iface_statistics.py
@@ -47,9 +47,9 @@
import numpy
import dpnp
-import dpnp.backend.extensions.statistics._statistics_impl as statistics_ext
+import dpnp.libtensor._statistics_impl as statistics_ext
+import dpnp.libtensor._tensor_elementwise_impl as ti
import dpnp.tensor as dpt
-import dpnp.tensor._tensor_elementwise_impl as ti
from .dpnp_utils import get_usm_allocations
from .dpnp_utils.dpnp_utils_common import (
diff --git a/dpnp/dpnp_iface_trigonometric.py b/dpnp/dpnp_iface_trigonometric.py
index b82f090de476..a7fe7c6c9ae6 100644
--- a/dpnp/dpnp_iface_trigonometric.py
+++ b/dpnp/dpnp_iface_trigonometric.py
@@ -43,9 +43,8 @@
# pylint: disable=no-name-in-module
import dpnp
-import dpnp.backend.extensions.ufunc._ufunc_impl as ufi
+import dpnp.libtensor._tensor_elementwise_impl as ti
import dpnp.tensor as dpt
-import dpnp.tensor._tensor_elementwise_impl as ti
import dpnp.tensor._type_utils as dtu
from .dpnp_algo.dpnp_elementwise_common import DPNPBinaryFunc, DPNPUnaryFunc
@@ -996,8 +995,8 @@ def cumlogsumexp(
deg2rad = DPNPUnaryFunc(
"deg2rad",
- ufi._radians_result_type,
- ufi._radians,
+ ti._radians_result_type,
+ ti._radians,
_DEG2RAD_DOCSTRING,
)
@@ -1067,8 +1066,8 @@ def cumlogsumexp(
degrees = DPNPUnaryFunc(
"degrees",
- ufi._degrees_result_type,
- ufi._degrees,
+ ti._degrees_result_type,
+ ti._degrees,
_DEGREES_DOCSTRING,
)
@@ -1817,8 +1816,8 @@ def cumlogsumexp(
logaddexp2 = DPNPBinaryFunc(
"logaddexp2",
- ufi._logaddexp2_result_type,
- ufi._logaddexp2,
+ ti._logaddexp2_result_type,
+ ti._logaddexp2,
_LOGADDEXP2_DOCSTRING,
)
@@ -1974,8 +1973,8 @@ def logsumexp(x, /, *, axis=None, dtype=None, keepdims=False, out=None):
rad2deg = DPNPUnaryFunc(
"rad2deg",
- ufi._degrees_result_type,
- ufi._degrees,
+ ti._degrees_result_type,
+ ti._degrees,
_RAD2DEG_DOCSTRING,
)
@@ -2046,8 +2045,8 @@ def logsumexp(x, /, *, axis=None, dtype=None, keepdims=False, out=None):
radians = DPNPUnaryFunc(
"radians",
- ufi._radians_result_type,
- ufi._radians,
+ ti._radians_result_type,
+ ti._radians,
_RADIANS_DOCSTRING,
)
diff --git a/dpnp/dpnp_iface_window.py b/dpnp/dpnp_iface_window.py
index bc12e714663c..e87a3faed8bf 100644
--- a/dpnp/dpnp_iface_window.py
+++ b/dpnp/dpnp_iface_window.py
@@ -46,7 +46,7 @@
import dpctl.utils as dpu
import dpnp
-import dpnp.backend.extensions.window._window_impl as wi
+import dpnp.libtensor._window_impl as wi
def _call_window_kernel(
diff --git a/dpnp/dpnp_utils/dpnp_utils_linearalgebra.py b/dpnp/dpnp_utils/dpnp_utils_linearalgebra.py
index 8b7b643c11d3..f0659d43a10d 100644
--- a/dpnp/dpnp_utils/dpnp_utils_linearalgebra.py
+++ b/dpnp/dpnp_utils/dpnp_utils_linearalgebra.py
@@ -30,11 +30,11 @@
import numpy
import dpnp
-import dpnp.backend.extensions.blas._blas_impl as bi
+import dpnp.libtensor._blas_impl as bi
+import dpnp.libtensor._tensor_impl as ti
# pylint: disable=no-name-in-module
import dpnp.tensor as dpt
-import dpnp.tensor._tensor_impl as ti
from dpnp.dpnp_array import dpnp_array
from dpnp.dpnp_utils import get_usm_allocations
from dpnp.exceptions import AxisError, ExecutionPlacementError
diff --git a/dpnp/fft/dpnp_utils_fft.py b/dpnp/fft/dpnp_utils_fft.py
index 6d4ffc9ed12b..78893a3c01e4 100644
--- a/dpnp/fft/dpnp_utils_fft.py
+++ b/dpnp/fft/dpnp_utils_fft.py
@@ -45,8 +45,8 @@
import numpy
import dpnp
-import dpnp.backend.extensions.fft._fft_impl as fi
-import dpnp.tensor._tensor_impl as ti
+import dpnp.libtensor._fft_impl as fi
+import dpnp.libtensor._tensor_impl as ti
from dpnp.exceptions import ExecutionPlacementError
from dpnp.tensor import get_execution_queue
from dpnp.tensor._numpy_helper import (
diff --git a/dpnp/libtensor/AGENTS.md b/dpnp/libtensor/AGENTS.md
new file mode 100644
index 000000000000..c6cec65c2044
--- /dev/null
+++ b/dpnp/libtensor/AGENTS.md
@@ -0,0 +1,36 @@
+# AGENTS.md - libtensor and pybind11 extensions (dpnp/libtensor/)
+
+## Layout
+- `include/kernels/`: header-only SYCL kernels in namespaces under `dpnp::tensor::kernels`; `include/utils/`: type dispatch, type, offset and memory-overlap helpers (`type_dispatch.hpp`, `type_dispatch_building.hpp`, `type_utils.hpp`, `memory_overlap.hpp`, ...); `include/ext/`: dispatch helpers (`init_dispatch_vector`, `init_dispatch_table`, `DispatchTable`) and validation helpers (`validation_utils.hpp`). The headers ship with dpnp; `dpnp.get_include()` and `python -m dpnp --tensor-include-dir` return `include/`.
+- `source/`: bindings built by `source/CMakeLists.txt` into `_tensor_impl`, `_tensor_elementwise_impl`, `_tensor_reductions_impl`, `_tensor_sorting_impl`, `_tensor_accumulation_impl`, `_tensor_linalg_impl`, `_statistics_impl` and `_window_impl`. The functions dpnp adds beyond the Array API are listed in the `_dpnp_*_sources` variables there and compiled into the same modules.
+- `extensions/{blas,fft,lapack,sparse,vm}/`: oneMKL/oneMath extensions, one module `__impl` per directory.
+- Every module installs into `dpnp/libtensor` and is imported as `dpnp.libtensor.__impl`. A new kernel goes into `source/` and an existing module; only code that needs oneMKL gets a new extension.
+
+## Adding a ufunc Kernel (model: `fabs`)
+1. Functor in `include/kernels/elementwise_functions/.hpp`, in namespace `dpnp::tensor::kernels::`.
+2. Binding in `source/elementwise_functions/.{hpp,cpp}`: output-type map built from `td_ns::TypeMapResultEntry<...>` ending in `td_ns::DefaultResultEntry`, `MACRO_POPULATE_DISPATCH_VECTORS()` (`MACRO_POPULATE_DISPATCH_TABLES` for binary) from `populate.hpp`, and `init_(m)` defining `_` and `__result_type`.
+3. Register `init_(m)` in `source/elementwise_functions/elementwise_common.cpp` and add the source to `_dpnp_elementwise_sources` in `source/CMakeLists.txt`, which compiles it with `-fno-approx-func -fno-finite-math-only`; the Array API functions in `_elementwise_sources` get `-fno-fast-math` instead.
+4. Wrap it in Python (see `dpnp/AGENTS.md`).
+
+A new extension's `CMakeLists.txt` lists its sources and calls `build_dpnp_pybind11_ext( SOURCES ... [INCLUDE_DIRS ...] [LARGE_RANGES])` from `dpnp/CMakeLists.txt`, which sets the options all extensions share and installs the module into `dpnp/libtensor`; only oneMKL/oneMath linking and the `-DUSE_ONEMATH*` definitions stay in the extension. Add it with `add_subdirectory` in `dpnp/CMakeLists.txt`, and put an option every extension needs into the helper, not into one extension.
+
+## Rules for Changes
+- C++17. Include what you use (``, ``, ...), use `std::`-qualified fixed-width types (`std::int64_t`, `std::size_t`), make by-value parameters and locals `const` (`constexpr` where possible), and pass non-output parameters as `const T &`.
+- Headers use `#pragma once`. New files in `include/` and `source/` add a `/// \file` block after the license header.
+- Python-facing functions take `sycl::queue &exec_q` and `const std::vector &depends`, and return `std::pair` (keep-alive host-task event, compute event). Keep arguments alive with `dpnp::utils::keep_args_alive`.
+- Validate inputs before launching: queue compatibility, contiguity, writability, memory overlap (including the same logical tensor), dtype and ndim. Reuse the helpers neighbouring files use: `check_queue`, `check_c_contig`, `check_no_overlap`, `check_writable` from `include/ext/validation_utils.hpp` (`putmask`, `statistics`, `isclose`, `interpolate`), or `dpnp::utils::queues_are_compatible`, `dpnp::tensor::overlap::MemoryOverlap` and `dpnp::tensor::validation::CheckWritable` (extensions and the Array API functions). Don't silently accept strided input.
+- Throw `py::value_error` for bad arguments and `std::runtime_error` for internal failures; catch oneMKL and SYCL exceptions and rethrow them.
+- Guard double, complex and half with `dpnp::tensor::type_utils::validate_type_for_device(q)`; don't use double literals or casts in kernels that must run without fp64.
+- `blas`, `fft`, `lapack` and `sparse` build against either oneMKL or oneMath (`USE_ONEMATH`); `vm` has kernels only with oneMKL: with oneMath it builds empty and `_is_available()` returns `False`.
+- Release the GIL around blocking oneMKL calls (`py::gil_scoped_release`).
+- An extension whose kernels may be launched over more than `INT_MAX` work-items passes `LARGE_RANGES` to `build_dpnp_pybind11_ext`, which adds `-fno-sycl-id-queries-fit-in-int` at compile and link time (DPC++ 2026.2 and later need it at link time). `source/CMakeLists.txt` and `dpnp_backend_c` pass it to both `target_compile_options` and `target_link_options`.
+- clang-format 23 formats C++ (`.clang-format`: LLVM base, 4-space indent, 80 columns); gersemi formats CMake at 88 columns, except `dpnp/backend/cmake/Modules/`.
+
+## Build
+```bash
+python scripts/build_locally.py # Release, Ninja, icx/icpx, then pip install -e
+python scripts/build_locally.py --clean --debug # remove _skbuild first; Debug build
+python scripts/build_locally.py --onemath # oneMath instead of oneMKL
+python scripts/build_locally.py --target-cuda # plus NVIDIA sm_50 (or --target-cuda=sm_80); --target-hip= for AMD
+```
+`--target-cuda`, `--target-hip` and `--onemath-dir` imply oneMath. Extra CMake options go through `--cmake-opts="..."`; the `--onemkl_interfaces*` options are deprecated. The in-place build copies the `.so` files into the source tree; they are gitignored.
diff --git a/dpnp/backend/extensions/blas/CMakeLists.txt b/dpnp/libtensor/extensions/blas/CMakeLists.txt
similarity index 96%
rename from dpnp/backend/extensions/blas/CMakeLists.txt
rename to dpnp/libtensor/extensions/blas/CMakeLists.txt
index bb0ca93390e4..02ba56063e0d 100644
--- a/dpnp/backend/extensions/blas/CMakeLists.txt
+++ b/dpnp/libtensor/extensions/blas/CMakeLists.txt
@@ -38,9 +38,7 @@ set(_module_src
build_dpnp_pybind11_ext(
${python_module_name}
- "dpnp/backend/extensions/blas"
SOURCES ${_module_src}
- INCLUDE_DIRS ${CMAKE_CURRENT_SOURCE_DIR}/../common
LARGE_RANGES
)
diff --git a/dpnp/backend/extensions/blas/blas_py.cpp b/dpnp/libtensor/extensions/blas/blas_py.cpp
similarity index 98%
rename from dpnp/backend/extensions/blas/blas_py.cpp
rename to dpnp/libtensor/extensions/blas/blas_py.cpp
index 28714194abb2..e0e65c9a066c 100644
--- a/dpnp/backend/extensions/blas/blas_py.cpp
+++ b/dpnp/libtensor/extensions/blas/blas_py.cpp
@@ -26,7 +26,7 @@
// THE POSSIBILITY OF SUCH DAMAGE.
//*****************************************************************************
//
-// This file defines functions of dpnp.backend._blas_impl extensions
+// This file defines functions of dpnp.libtensor._blas_impl extensions
//
//*****************************************************************************
diff --git a/dpnp/backend/extensions/blas/dot.hpp b/dpnp/libtensor/extensions/blas/dot.hpp
similarity index 100%
rename from dpnp/backend/extensions/blas/dot.hpp
rename to dpnp/libtensor/extensions/blas/dot.hpp
diff --git a/dpnp/backend/extensions/blas/dot_common.hpp b/dpnp/libtensor/extensions/blas/dot_common.hpp
similarity index 100%
rename from dpnp/backend/extensions/blas/dot_common.hpp
rename to dpnp/libtensor/extensions/blas/dot_common.hpp
diff --git a/dpnp/backend/extensions/blas/dotc.hpp b/dpnp/libtensor/extensions/blas/dotc.hpp
similarity index 100%
rename from dpnp/backend/extensions/blas/dotc.hpp
rename to dpnp/libtensor/extensions/blas/dotc.hpp
diff --git a/dpnp/backend/extensions/blas/dotu.hpp b/dpnp/libtensor/extensions/blas/dotu.hpp
similarity index 100%
rename from dpnp/backend/extensions/blas/dotu.hpp
rename to dpnp/libtensor/extensions/blas/dotu.hpp
diff --git a/dpnp/backend/extensions/blas/gemm.cpp b/dpnp/libtensor/extensions/blas/gemm.cpp
similarity index 100%
rename from dpnp/backend/extensions/blas/gemm.cpp
rename to dpnp/libtensor/extensions/blas/gemm.cpp
diff --git a/dpnp/backend/extensions/blas/gemm.hpp b/dpnp/libtensor/extensions/blas/gemm.hpp
similarity index 100%
rename from dpnp/backend/extensions/blas/gemm.hpp
rename to dpnp/libtensor/extensions/blas/gemm.hpp
diff --git a/dpnp/backend/extensions/blas/gemm_batch.cpp b/dpnp/libtensor/extensions/blas/gemm_batch.cpp
similarity index 100%
rename from dpnp/backend/extensions/blas/gemm_batch.cpp
rename to dpnp/libtensor/extensions/blas/gemm_batch.cpp
diff --git a/dpnp/backend/extensions/blas/gemv.cpp b/dpnp/libtensor/extensions/blas/gemv.cpp
similarity index 100%
rename from dpnp/backend/extensions/blas/gemv.cpp
rename to dpnp/libtensor/extensions/blas/gemv.cpp
diff --git a/dpnp/backend/extensions/blas/gemv.hpp b/dpnp/libtensor/extensions/blas/gemv.hpp
similarity index 100%
rename from dpnp/backend/extensions/blas/gemv.hpp
rename to dpnp/libtensor/extensions/blas/gemv.hpp
diff --git a/dpnp/backend/extensions/blas/syrk.cpp b/dpnp/libtensor/extensions/blas/syrk.cpp
similarity index 100%
rename from dpnp/backend/extensions/blas/syrk.cpp
rename to dpnp/libtensor/extensions/blas/syrk.cpp
diff --git a/dpnp/backend/extensions/blas/syrk.hpp b/dpnp/libtensor/extensions/blas/syrk.hpp
similarity index 100%
rename from dpnp/backend/extensions/blas/syrk.hpp
rename to dpnp/libtensor/extensions/blas/syrk.hpp
diff --git a/dpnp/backend/extensions/blas/types_matrix.hpp b/dpnp/libtensor/extensions/blas/types_matrix.hpp
similarity index 100%
rename from dpnp/backend/extensions/blas/types_matrix.hpp
rename to dpnp/libtensor/extensions/blas/types_matrix.hpp
diff --git a/dpnp/backend/extensions/fft/CMakeLists.txt b/dpnp/libtensor/extensions/fft/CMakeLists.txt
similarity index 98%
rename from dpnp/backend/extensions/fft/CMakeLists.txt
rename to dpnp/libtensor/extensions/fft/CMakeLists.txt
index b663091ff512..3a30562b1ff1 100644
--- a/dpnp/backend/extensions/fft/CMakeLists.txt
+++ b/dpnp/libtensor/extensions/fft/CMakeLists.txt
@@ -32,7 +32,6 @@ set(_module_src ${CMAKE_CURRENT_SOURCE_DIR}/fft_py.cpp)
build_dpnp_pybind11_ext(
${python_module_name}
- "dpnp/backend/extensions/fft"
SOURCES ${_module_src}
)
diff --git a/dpnp/backend/extensions/fft/common.hpp b/dpnp/libtensor/extensions/fft/common.hpp
similarity index 100%
rename from dpnp/backend/extensions/fft/common.hpp
rename to dpnp/libtensor/extensions/fft/common.hpp
diff --git a/dpnp/backend/extensions/fft/fft_py.cpp b/dpnp/libtensor/extensions/fft/fft_py.cpp
similarity index 98%
rename from dpnp/backend/extensions/fft/fft_py.cpp
rename to dpnp/libtensor/extensions/fft/fft_py.cpp
index 5e88cb6111da..590ca739302c 100644
--- a/dpnp/backend/extensions/fft/fft_py.cpp
+++ b/dpnp/libtensor/extensions/fft/fft_py.cpp
@@ -26,7 +26,7 @@
// THE POSSIBILITY OF SUCH DAMAGE.
//*****************************************************************************
//
-// This file defines functions of dpnp.backend._fft_impl extensions
+// This file defines functions of dpnp.libtensor._fft_impl extensions
//
//*****************************************************************************
diff --git a/dpnp/backend/extensions/fft/fft_utils.hpp b/dpnp/libtensor/extensions/fft/fft_utils.hpp
similarity index 100%
rename from dpnp/backend/extensions/fft/fft_utils.hpp
rename to dpnp/libtensor/extensions/fft/fft_utils.hpp
diff --git a/dpnp/backend/extensions/fft/in_place.hpp b/dpnp/libtensor/extensions/fft/in_place.hpp
similarity index 100%
rename from dpnp/backend/extensions/fft/in_place.hpp
rename to dpnp/libtensor/extensions/fft/in_place.hpp
diff --git a/dpnp/backend/extensions/fft/in_place.tpp b/dpnp/libtensor/extensions/fft/in_place.tpp
similarity index 100%
rename from dpnp/backend/extensions/fft/in_place.tpp
rename to dpnp/libtensor/extensions/fft/in_place.tpp
diff --git a/dpnp/backend/extensions/fft/out_of_place.hpp b/dpnp/libtensor/extensions/fft/out_of_place.hpp
similarity index 100%
rename from dpnp/backend/extensions/fft/out_of_place.hpp
rename to dpnp/libtensor/extensions/fft/out_of_place.hpp
diff --git a/dpnp/backend/extensions/fft/out_of_place.tpp b/dpnp/libtensor/extensions/fft/out_of_place.tpp
similarity index 100%
rename from dpnp/backend/extensions/fft/out_of_place.tpp
rename to dpnp/libtensor/extensions/fft/out_of_place.tpp
diff --git a/dpnp/backend/extensions/lapack/CMakeLists.txt b/dpnp/libtensor/extensions/lapack/CMakeLists.txt
similarity index 97%
rename from dpnp/backend/extensions/lapack/CMakeLists.txt
rename to dpnp/libtensor/extensions/lapack/CMakeLists.txt
index b24065c998e1..7fabc921a865 100644
--- a/dpnp/backend/extensions/lapack/CMakeLists.txt
+++ b/dpnp/libtensor/extensions/lapack/CMakeLists.txt
@@ -55,9 +55,7 @@ set(_module_src
build_dpnp_pybind11_ext(
${python_module_name}
- "dpnp/backend/extensions/lapack"
SOURCES ${_module_src}
- INCLUDE_DIRS ${CMAKE_CURRENT_SOURCE_DIR}/../common
)
if(_use_onemath)
diff --git a/dpnp/backend/extensions/lapack/common_helpers.hpp b/dpnp/libtensor/extensions/lapack/common_helpers.hpp
similarity index 100%
rename from dpnp/backend/extensions/lapack/common_helpers.hpp
rename to dpnp/libtensor/extensions/lapack/common_helpers.hpp
diff --git a/dpnp/backend/extensions/lapack/evd_batch_common.hpp b/dpnp/libtensor/extensions/lapack/evd_batch_common.hpp
similarity index 100%
rename from dpnp/backend/extensions/lapack/evd_batch_common.hpp
rename to dpnp/libtensor/extensions/lapack/evd_batch_common.hpp
diff --git a/dpnp/backend/extensions/lapack/evd_common.hpp b/dpnp/libtensor/extensions/lapack/evd_common.hpp
similarity index 100%
rename from dpnp/backend/extensions/lapack/evd_common.hpp
rename to dpnp/libtensor/extensions/lapack/evd_common.hpp
diff --git a/dpnp/backend/extensions/lapack/evd_common_utils.hpp b/dpnp/libtensor/extensions/lapack/evd_common_utils.hpp
similarity index 100%
rename from dpnp/backend/extensions/lapack/evd_common_utils.hpp
rename to dpnp/libtensor/extensions/lapack/evd_common_utils.hpp
diff --git a/dpnp/backend/extensions/lapack/geqrf.cpp b/dpnp/libtensor/extensions/lapack/geqrf.cpp
similarity index 100%
rename from dpnp/backend/extensions/lapack/geqrf.cpp
rename to dpnp/libtensor/extensions/lapack/geqrf.cpp
diff --git a/dpnp/backend/extensions/lapack/geqrf.hpp b/dpnp/libtensor/extensions/lapack/geqrf.hpp
similarity index 100%
rename from dpnp/backend/extensions/lapack/geqrf.hpp
rename to dpnp/libtensor/extensions/lapack/geqrf.hpp
diff --git a/dpnp/backend/extensions/lapack/geqrf_batch.cpp b/dpnp/libtensor/extensions/lapack/geqrf_batch.cpp
similarity index 100%
rename from dpnp/backend/extensions/lapack/geqrf_batch.cpp
rename to dpnp/libtensor/extensions/lapack/geqrf_batch.cpp
diff --git a/dpnp/backend/extensions/lapack/gesv.cpp b/dpnp/libtensor/extensions/lapack/gesv.cpp
similarity index 100%
rename from dpnp/backend/extensions/lapack/gesv.cpp
rename to dpnp/libtensor/extensions/lapack/gesv.cpp
diff --git a/dpnp/backend/extensions/lapack/gesv.hpp b/dpnp/libtensor/extensions/lapack/gesv.hpp
similarity index 100%
rename from dpnp/backend/extensions/lapack/gesv.hpp
rename to dpnp/libtensor/extensions/lapack/gesv.hpp
diff --git a/dpnp/backend/extensions/lapack/gesv_batch.cpp b/dpnp/libtensor/extensions/lapack/gesv_batch.cpp
similarity index 100%
rename from dpnp/backend/extensions/lapack/gesv_batch.cpp
rename to dpnp/libtensor/extensions/lapack/gesv_batch.cpp
diff --git a/dpnp/backend/extensions/lapack/gesv_common_utils.hpp b/dpnp/libtensor/extensions/lapack/gesv_common_utils.hpp
similarity index 100%
rename from dpnp/backend/extensions/lapack/gesv_common_utils.hpp
rename to dpnp/libtensor/extensions/lapack/gesv_common_utils.hpp
diff --git a/dpnp/backend/extensions/lapack/gesvd.cpp b/dpnp/libtensor/extensions/lapack/gesvd.cpp
similarity index 100%
rename from dpnp/backend/extensions/lapack/gesvd.cpp
rename to dpnp/libtensor/extensions/lapack/gesvd.cpp
diff --git a/dpnp/backend/extensions/lapack/gesvd.hpp b/dpnp/libtensor/extensions/lapack/gesvd.hpp
similarity index 100%
rename from dpnp/backend/extensions/lapack/gesvd.hpp
rename to dpnp/libtensor/extensions/lapack/gesvd.hpp
diff --git a/dpnp/backend/extensions/lapack/gesvd_batch.cpp b/dpnp/libtensor/extensions/lapack/gesvd_batch.cpp
similarity index 100%
rename from dpnp/backend/extensions/lapack/gesvd_batch.cpp
rename to dpnp/libtensor/extensions/lapack/gesvd_batch.cpp
diff --git a/dpnp/backend/extensions/lapack/gesvd_common_utils.hpp b/dpnp/libtensor/extensions/lapack/gesvd_common_utils.hpp
similarity index 98%
rename from dpnp/backend/extensions/lapack/gesvd_common_utils.hpp
rename to dpnp/libtensor/extensions/lapack/gesvd_common_utils.hpp
index 8e2760a9bd4c..2ce9d6a102f6 100644
--- a/dpnp/backend/extensions/lapack/gesvd_common_utils.hpp
+++ b/dpnp/libtensor/extensions/lapack/gesvd_common_utils.hpp
@@ -172,7 +172,7 @@ inline void common_gesvd_checks(sycl::queue &exec_q,
if (a_array_type_id != out_u_type_id || a_array_type_id != out_vt_type_id) {
throw py::type_error(
"Input array, output left singular vectors array, "
- "and outpuy right singular vectors array must have "
+ "and output right singular vectors array must have "
"the same data type");
}
}
@@ -231,7 +231,7 @@ inline void handle_lapack_exc(const std::int64_t scratchpad_size,
}
else {
error_msg
- << "Unexpected MKL exception caught during gesv() call:\nreason: "
+ << "Unexpected MKL exception caught during gesvd() call:\nreason: "
<< e.what() << "\ninfo: " << e.info();
}
}
diff --git a/dpnp/backend/extensions/lapack/getrf.cpp b/dpnp/libtensor/extensions/lapack/getrf.cpp
similarity index 100%
rename from dpnp/backend/extensions/lapack/getrf.cpp
rename to dpnp/libtensor/extensions/lapack/getrf.cpp
diff --git a/dpnp/backend/extensions/lapack/getrf.hpp b/dpnp/libtensor/extensions/lapack/getrf.hpp
similarity index 100%
rename from dpnp/backend/extensions/lapack/getrf.hpp
rename to dpnp/libtensor/extensions/lapack/getrf.hpp
diff --git a/dpnp/backend/extensions/lapack/getrf_batch.cpp b/dpnp/libtensor/extensions/lapack/getrf_batch.cpp
similarity index 100%
rename from dpnp/backend/extensions/lapack/getrf_batch.cpp
rename to dpnp/libtensor/extensions/lapack/getrf_batch.cpp
diff --git a/dpnp/backend/extensions/lapack/getri.hpp b/dpnp/libtensor/extensions/lapack/getri.hpp
similarity index 100%
rename from dpnp/backend/extensions/lapack/getri.hpp
rename to dpnp/libtensor/extensions/lapack/getri.hpp
diff --git a/dpnp/backend/extensions/lapack/getri_batch.cpp b/dpnp/libtensor/extensions/lapack/getri_batch.cpp
similarity index 100%
rename from dpnp/backend/extensions/lapack/getri_batch.cpp
rename to dpnp/libtensor/extensions/lapack/getri_batch.cpp
diff --git a/dpnp/backend/extensions/lapack/getrs.cpp b/dpnp/libtensor/extensions/lapack/getrs.cpp
similarity index 100%
rename from dpnp/backend/extensions/lapack/getrs.cpp
rename to dpnp/libtensor/extensions/lapack/getrs.cpp
diff --git a/dpnp/backend/extensions/lapack/getrs.hpp b/dpnp/libtensor/extensions/lapack/getrs.hpp
similarity index 100%
rename from dpnp/backend/extensions/lapack/getrs.hpp
rename to dpnp/libtensor/extensions/lapack/getrs.hpp
diff --git a/dpnp/backend/extensions/lapack/getrs_batch.cpp b/dpnp/libtensor/extensions/lapack/getrs_batch.cpp
similarity index 100%
rename from dpnp/backend/extensions/lapack/getrs_batch.cpp
rename to dpnp/libtensor/extensions/lapack/getrs_batch.cpp
diff --git a/dpnp/backend/extensions/lapack/heevd.cpp b/dpnp/libtensor/extensions/lapack/heevd.cpp
similarity index 100%
rename from dpnp/backend/extensions/lapack/heevd.cpp
rename to dpnp/libtensor/extensions/lapack/heevd.cpp
diff --git a/dpnp/backend/extensions/lapack/heevd.hpp b/dpnp/libtensor/extensions/lapack/heevd.hpp
similarity index 100%
rename from dpnp/backend/extensions/lapack/heevd.hpp
rename to dpnp/libtensor/extensions/lapack/heevd.hpp
diff --git a/dpnp/backend/extensions/lapack/heevd_batch.cpp b/dpnp/libtensor/extensions/lapack/heevd_batch.cpp
similarity index 100%
rename from dpnp/backend/extensions/lapack/heevd_batch.cpp
rename to dpnp/libtensor/extensions/lapack/heevd_batch.cpp
diff --git a/dpnp/backend/extensions/lapack/heevd_batch.hpp b/dpnp/libtensor/extensions/lapack/heevd_batch.hpp
similarity index 100%
rename from dpnp/backend/extensions/lapack/heevd_batch.hpp
rename to dpnp/libtensor/extensions/lapack/heevd_batch.hpp
diff --git a/dpnp/backend/extensions/lapack/lapack_py.cpp b/dpnp/libtensor/extensions/lapack/lapack_py.cpp
similarity index 99%
rename from dpnp/backend/extensions/lapack/lapack_py.cpp
rename to dpnp/libtensor/extensions/lapack/lapack_py.cpp
index eca276f719c4..bbe07d191764 100644
--- a/dpnp/backend/extensions/lapack/lapack_py.cpp
+++ b/dpnp/libtensor/extensions/lapack/lapack_py.cpp
@@ -26,7 +26,7 @@
// THE POSSIBILITY OF SUCH DAMAGE.
//*****************************************************************************
//
-// This file defines functions of dpnp.backend._lapack_impl extensions
+// This file defines functions of dpnp.libtensor._lapack_impl extensions
//
//*****************************************************************************
diff --git a/dpnp/backend/extensions/lapack/linalg_exceptions.hpp b/dpnp/libtensor/extensions/lapack/linalg_exceptions.hpp
similarity index 100%
rename from dpnp/backend/extensions/lapack/linalg_exceptions.hpp
rename to dpnp/libtensor/extensions/lapack/linalg_exceptions.hpp
diff --git a/dpnp/backend/extensions/lapack/orgqr.cpp b/dpnp/libtensor/extensions/lapack/orgqr.cpp
similarity index 100%
rename from dpnp/backend/extensions/lapack/orgqr.cpp
rename to dpnp/libtensor/extensions/lapack/orgqr.cpp
diff --git a/dpnp/backend/extensions/lapack/orgqr.hpp b/dpnp/libtensor/extensions/lapack/orgqr.hpp
similarity index 100%
rename from dpnp/backend/extensions/lapack/orgqr.hpp
rename to dpnp/libtensor/extensions/lapack/orgqr.hpp
diff --git a/dpnp/backend/extensions/lapack/orgqr_batch.cpp b/dpnp/libtensor/extensions/lapack/orgqr_batch.cpp
similarity index 100%
rename from dpnp/backend/extensions/lapack/orgqr_batch.cpp
rename to dpnp/libtensor/extensions/lapack/orgqr_batch.cpp
diff --git a/dpnp/backend/extensions/lapack/potrf.cpp b/dpnp/libtensor/extensions/lapack/potrf.cpp
similarity index 100%
rename from dpnp/backend/extensions/lapack/potrf.cpp
rename to dpnp/libtensor/extensions/lapack/potrf.cpp
diff --git a/dpnp/backend/extensions/lapack/potrf.hpp b/dpnp/libtensor/extensions/lapack/potrf.hpp
similarity index 100%
rename from dpnp/backend/extensions/lapack/potrf.hpp
rename to dpnp/libtensor/extensions/lapack/potrf.hpp
diff --git a/dpnp/backend/extensions/lapack/potrf_batch.cpp b/dpnp/libtensor/extensions/lapack/potrf_batch.cpp
similarity index 100%
rename from dpnp/backend/extensions/lapack/potrf_batch.cpp
rename to dpnp/libtensor/extensions/lapack/potrf_batch.cpp
diff --git a/dpnp/backend/extensions/lapack/syevd.cpp b/dpnp/libtensor/extensions/lapack/syevd.cpp
similarity index 99%
rename from dpnp/backend/extensions/lapack/syevd.cpp
rename to dpnp/libtensor/extensions/lapack/syevd.cpp
index f2be6214f60a..e98882718240 100644
--- a/dpnp/backend/extensions/lapack/syevd.cpp
+++ b/dpnp/libtensor/extensions/lapack/syevd.cpp
@@ -61,7 +61,7 @@ static sycl::event syevd_impl(sycl::queue &exec_q,
type_utils::validate_type_for_device(exec_q);
T *a = reinterpret_cast(in_a);
- RealT *w = reinterpret_cast(out_w);
+ RealT *w = reinterpret_cast(out_w);
const std::int64_t lda = std::max(1UL, n);
const std::int64_t scratchpad_size =
diff --git a/dpnp/backend/extensions/lapack/syevd.hpp b/dpnp/libtensor/extensions/lapack/syevd.hpp
similarity index 100%
rename from dpnp/backend/extensions/lapack/syevd.hpp
rename to dpnp/libtensor/extensions/lapack/syevd.hpp
diff --git a/dpnp/backend/extensions/lapack/syevd_batch.cpp b/dpnp/libtensor/extensions/lapack/syevd_batch.cpp
similarity index 100%
rename from dpnp/backend/extensions/lapack/syevd_batch.cpp
rename to dpnp/libtensor/extensions/lapack/syevd_batch.cpp
diff --git a/dpnp/backend/extensions/lapack/syevd_batch.hpp b/dpnp/libtensor/extensions/lapack/syevd_batch.hpp
similarity index 100%
rename from dpnp/backend/extensions/lapack/syevd_batch.hpp
rename to dpnp/libtensor/extensions/lapack/syevd_batch.hpp
diff --git a/dpnp/backend/extensions/lapack/types_matrix.hpp b/dpnp/libtensor/extensions/lapack/types_matrix.hpp
similarity index 100%
rename from dpnp/backend/extensions/lapack/types_matrix.hpp
rename to dpnp/libtensor/extensions/lapack/types_matrix.hpp
diff --git a/dpnp/backend/extensions/lapack/ungqr.cpp b/dpnp/libtensor/extensions/lapack/ungqr.cpp
similarity index 100%
rename from dpnp/backend/extensions/lapack/ungqr.cpp
rename to dpnp/libtensor/extensions/lapack/ungqr.cpp
diff --git a/dpnp/backend/extensions/lapack/ungqr.hpp b/dpnp/libtensor/extensions/lapack/ungqr.hpp
similarity index 100%
rename from dpnp/backend/extensions/lapack/ungqr.hpp
rename to dpnp/libtensor/extensions/lapack/ungqr.hpp
diff --git a/dpnp/backend/extensions/lapack/ungqr_batch.cpp b/dpnp/libtensor/extensions/lapack/ungqr_batch.cpp
similarity index 100%
rename from dpnp/backend/extensions/lapack/ungqr_batch.cpp
rename to dpnp/libtensor/extensions/lapack/ungqr_batch.cpp
diff --git a/dpnp/backend/extensions/sparse/CMakeLists.txt b/dpnp/libtensor/extensions/sparse/CMakeLists.txt
similarity index 95%
rename from dpnp/backend/extensions/sparse/CMakeLists.txt
rename to dpnp/libtensor/extensions/sparse/CMakeLists.txt
index 3355b5fe8c0f..e249f9ddb766 100644
--- a/dpnp/backend/extensions/sparse/CMakeLists.txt
+++ b/dpnp/libtensor/extensions/sparse/CMakeLists.txt
@@ -35,9 +35,7 @@ set(_module_src
build_dpnp_pybind11_ext(
${python_module_name}
- "dpnp/backend/extensions/sparse"
SOURCES ${_module_src}
- INCLUDE_DIRS ${CMAKE_CURRENT_SOURCE_DIR}/../common
)
if(_use_onemath)
diff --git a/dpnp/backend/extensions/sparse/gemv.cpp b/dpnp/libtensor/extensions/sparse/gemv.cpp
similarity index 100%
rename from dpnp/backend/extensions/sparse/gemv.cpp
rename to dpnp/libtensor/extensions/sparse/gemv.cpp
diff --git a/dpnp/backend/extensions/sparse/gemv.hpp b/dpnp/libtensor/extensions/sparse/gemv.hpp
similarity index 100%
rename from dpnp/backend/extensions/sparse/gemv.hpp
rename to dpnp/libtensor/extensions/sparse/gemv.hpp
diff --git a/dpnp/backend/extensions/sparse/sparse_py.cpp b/dpnp/libtensor/extensions/sparse/sparse_py.cpp
similarity index 100%
rename from dpnp/backend/extensions/sparse/sparse_py.cpp
rename to dpnp/libtensor/extensions/sparse/sparse_py.cpp
diff --git a/dpnp/backend/extensions/sparse/types_matrix.hpp b/dpnp/libtensor/extensions/sparse/types_matrix.hpp
similarity index 100%
rename from dpnp/backend/extensions/sparse/types_matrix.hpp
rename to dpnp/libtensor/extensions/sparse/types_matrix.hpp
diff --git a/dpnp/backend/extensions/vm/CMakeLists.txt b/dpnp/libtensor/extensions/vm/CMakeLists.txt
similarity index 92%
rename from dpnp/backend/extensions/vm/CMakeLists.txt
rename to dpnp/libtensor/extensions/vm/CMakeLists.txt
index 082d23c0d54d..b90425fbed98 100644
--- a/dpnp/backend/extensions/vm/CMakeLists.txt
+++ b/dpnp/libtensor/extensions/vm/CMakeLists.txt
@@ -78,9 +78,7 @@ if(NOT _use_onemath)
endif()
set(_module_src
- # TODO: remove sources from `elementwise_functions` folder
- ${CMAKE_CURRENT_SOURCE_DIR}/../elementwise_functions/elementwise_functions_type_utils.cpp
- ${CMAKE_CURRENT_SOURCE_DIR}/../elementwise_functions/simplify_iteration_space.cpp
+ ${CMAKE_SOURCE_DIR}/dpnp/libtensor/source/elementwise_functions/elementwise_functions_type_utils.cpp
${CMAKE_CURRENT_SOURCE_DIR}/vm_py.cpp
${_elementwise_sources}
)
@@ -89,10 +87,10 @@ set(python_module_name _vm_impl)
build_dpnp_pybind11_ext(
${python_module_name}
- "dpnp/backend/extensions/vm"
SOURCES ${_module_src}
- INCLUDE_DIRS ${CMAKE_CURRENT_SOURCE_DIR}/../common
+ INCLUDE_DIRS ${CMAKE_SOURCE_DIR}/dpnp/libtensor/source
)
+target_link_libraries(${python_module_name} PRIVATE simplify_iteration_space)
if(_use_onemath)
target_compile_options(${python_module_name} PRIVATE -DUSE_ONEMATH)
diff --git a/dpnp/backend/extensions/vm/abs.cpp b/dpnp/libtensor/extensions/vm/abs.cpp
similarity index 94%
rename from dpnp/backend/extensions/vm/abs.cpp
rename to dpnp/libtensor/extensions/vm/abs.cpp
index 4402dd1c0326..2c2ade041fba 100644
--- a/dpnp/backend/extensions/vm/abs.cpp
+++ b/dpnp/libtensor/extensions/vm/abs.cpp
@@ -43,10 +43,7 @@
#include "abs.hpp"
#include "common.hpp"
-// include a local copy of elementwise common header from dpnp tensor:
-// dpnp/tensor/libtensor/source/elementwise_functions/elementwise_functions.hpp
-// TODO: replace by consolidating with tensor post-migration
-#include "../elementwise_functions/elementwise_functions.hpp"
+#include "elementwise_functions/elementwise_functions.hpp"
// dpnp tensor headers
#include "kernels/elementwise_functions/common.hpp"
@@ -56,7 +53,7 @@
namespace dpnp::extensions::vm
{
namespace py = pybind11;
-namespace py_int = dpnp::extensions::py_internal;
+namespace py_int = dpnp::tensor::py_internal;
namespace td_ns = dpnp::tensor::type_dispatch;
namespace impl
diff --git a/dpnp/backend/extensions/vm/abs.hpp b/dpnp/libtensor/extensions/vm/abs.hpp
similarity index 100%
rename from dpnp/backend/extensions/vm/abs.hpp
rename to dpnp/libtensor/extensions/vm/abs.hpp
diff --git a/dpnp/backend/extensions/vm/acos.cpp b/dpnp/libtensor/extensions/vm/acos.cpp
similarity index 94%
rename from dpnp/backend/extensions/vm/acos.cpp
rename to dpnp/libtensor/extensions/vm/acos.cpp
index 9c66c60da8ca..5242a01bbf31 100644
--- a/dpnp/backend/extensions/vm/acos.cpp
+++ b/dpnp/libtensor/extensions/vm/acos.cpp
@@ -43,10 +43,7 @@
#include "acos.hpp"
#include "common.hpp"
-// include a local copy of elementwise common header from dpnp tensor:
-// dpnp/tensor/libtensor/source/elementwise_functions/elementwise_functions.hpp
-// TODO: replace by consolidating with tensor post-migration
-#include "../elementwise_functions/elementwise_functions.hpp"
+#include "elementwise_functions/elementwise_functions.hpp"
// dpnp tensor headers
#include "kernels/elementwise_functions/common.hpp"
@@ -56,7 +53,7 @@
namespace dpnp::extensions::vm
{
namespace py = pybind11;
-namespace py_int = dpnp::extensions::py_internal;
+namespace py_int = dpnp::tensor::py_internal;
namespace td_ns = dpnp::tensor::type_dispatch;
namespace impl
diff --git a/dpnp/backend/extensions/vm/acos.hpp b/dpnp/libtensor/extensions/vm/acos.hpp
similarity index 100%
rename from dpnp/backend/extensions/vm/acos.hpp
rename to dpnp/libtensor/extensions/vm/acos.hpp
diff --git a/dpnp/backend/extensions/vm/acosh.cpp b/dpnp/libtensor/extensions/vm/acosh.cpp
similarity index 94%
rename from dpnp/backend/extensions/vm/acosh.cpp
rename to dpnp/libtensor/extensions/vm/acosh.cpp
index 5fb1dd1ebcd9..3518a3ec94eb 100644
--- a/dpnp/backend/extensions/vm/acosh.cpp
+++ b/dpnp/libtensor/extensions/vm/acosh.cpp
@@ -43,10 +43,7 @@
#include "acosh.hpp"
#include "common.hpp"
-// include a local copy of elementwise common header from dpnp tensor:
-// dpnp/tensor/libtensor/source/elementwise_functions/elementwise_functions.hpp
-// TODO: replace by consolidating with tensor post-migration
-#include "../elementwise_functions/elementwise_functions.hpp"
+#include "elementwise_functions/elementwise_functions.hpp"
// dpnp tensor headers
#include "kernels/elementwise_functions/common.hpp"
@@ -56,7 +53,7 @@
namespace dpnp::extensions::vm
{
namespace py = pybind11;
-namespace py_int = dpnp::extensions::py_internal;
+namespace py_int = dpnp::tensor::py_internal;
namespace td_ns = dpnp::tensor::type_dispatch;
namespace impl
diff --git a/dpnp/backend/extensions/vm/acosh.hpp b/dpnp/libtensor/extensions/vm/acosh.hpp
similarity index 100%
rename from dpnp/backend/extensions/vm/acosh.hpp
rename to dpnp/libtensor/extensions/vm/acosh.hpp
diff --git a/dpnp/backend/extensions/vm/add.cpp b/dpnp/libtensor/extensions/vm/add.cpp
similarity index 95%
rename from dpnp/backend/extensions/vm/add.cpp
rename to dpnp/libtensor/extensions/vm/add.cpp
index 3ac73662a937..49c0a2faf116 100644
--- a/dpnp/backend/extensions/vm/add.cpp
+++ b/dpnp/libtensor/extensions/vm/add.cpp
@@ -44,10 +44,7 @@
#include "add.hpp"
#include "common.hpp"
-// include a local copy of elementwise common header from dpnp tensor:
-// dpnp/tensor/libtensor/source/elementwise_functions/elementwise_functions.hpp
-// TODO: replace by consolidating with tensor post-migration
-#include "../elementwise_functions/elementwise_functions.hpp"
+#include "elementwise_functions/elementwise_functions.hpp"
// dpnp tensor headers
#include "kernels/elementwise_functions/common.hpp"
@@ -57,7 +54,7 @@
namespace dpnp::extensions::vm
{
namespace py = pybind11;
-namespace py_int = dpnp::extensions::py_internal;
+namespace py_int = dpnp::tensor::py_internal;
namespace td_ns = dpnp::tensor::type_dispatch;
namespace impl
diff --git a/dpnp/backend/extensions/vm/add.hpp b/dpnp/libtensor/extensions/vm/add.hpp
similarity index 100%
rename from dpnp/backend/extensions/vm/add.hpp
rename to dpnp/libtensor/extensions/vm/add.hpp
diff --git a/dpnp/backend/extensions/vm/arg.cpp b/dpnp/libtensor/extensions/vm/arg.cpp
similarity index 94%
rename from dpnp/backend/extensions/vm/arg.cpp
rename to dpnp/libtensor/extensions/vm/arg.cpp
index 1b025662cd8e..75ab640dbf86 100644
--- a/dpnp/backend/extensions/vm/arg.cpp
+++ b/dpnp/libtensor/extensions/vm/arg.cpp
@@ -43,10 +43,7 @@
#include "arg.hpp"
#include "common.hpp"
-// include a local copy of elementwise common header from dpnp tensor:
-// dpnp/tensor/libtensor/source/elementwise_functions/elementwise_functions.hpp
-// TODO: replace by consolidating with tensor post-migration
-#include "../elementwise_functions/elementwise_functions.hpp"
+#include "elementwise_functions/elementwise_functions.hpp"
// dpnp tensor headers
#include "kernels/elementwise_functions/common.hpp"
@@ -56,7 +53,7 @@
namespace dpnp::extensions::vm
{
namespace py = pybind11;
-namespace py_int = dpnp::extensions::py_internal;
+namespace py_int = dpnp::tensor::py_internal;
namespace td_ns = dpnp::tensor::type_dispatch;
namespace impl
diff --git a/dpnp/backend/extensions/vm/arg.hpp b/dpnp/libtensor/extensions/vm/arg.hpp
similarity index 100%
rename from dpnp/backend/extensions/vm/arg.hpp
rename to dpnp/libtensor/extensions/vm/arg.hpp
diff --git a/dpnp/backend/extensions/vm/asin.cpp b/dpnp/libtensor/extensions/vm/asin.cpp
similarity index 94%
rename from dpnp/backend/extensions/vm/asin.cpp
rename to dpnp/libtensor/extensions/vm/asin.cpp
index 93f271e34485..3ad3f42c0975 100644
--- a/dpnp/backend/extensions/vm/asin.cpp
+++ b/dpnp/libtensor/extensions/vm/asin.cpp
@@ -43,10 +43,7 @@
#include "asin.hpp"
#include "common.hpp"
-// include a local copy of elementwise common header from dpnp tensor:
-// dpnp/tensor/libtensor/source/elementwise_functions/elementwise_functions.hpp
-// TODO: replace by consolidating with tensor post-migration
-#include "../elementwise_functions/elementwise_functions.hpp"
+#include "elementwise_functions/elementwise_functions.hpp"
// dpnp tensor headers
#include "kernels/elementwise_functions/common.hpp"
@@ -56,7 +53,7 @@
namespace dpnp::extensions::vm
{
namespace py = pybind11;
-namespace py_int = dpnp::extensions::py_internal;
+namespace py_int = dpnp::tensor::py_internal;
namespace td_ns = dpnp::tensor::type_dispatch;
namespace impl
diff --git a/dpnp/backend/extensions/vm/asin.hpp b/dpnp/libtensor/extensions/vm/asin.hpp
similarity index 100%
rename from dpnp/backend/extensions/vm/asin.hpp
rename to dpnp/libtensor/extensions/vm/asin.hpp
diff --git a/dpnp/backend/extensions/vm/asinh.cpp b/dpnp/libtensor/extensions/vm/asinh.cpp
similarity index 94%
rename from dpnp/backend/extensions/vm/asinh.cpp
rename to dpnp/libtensor/extensions/vm/asinh.cpp
index 1ea0c296464a..7c3788ebebb2 100644
--- a/dpnp/backend/extensions/vm/asinh.cpp
+++ b/dpnp/libtensor/extensions/vm/asinh.cpp
@@ -43,10 +43,7 @@
#include "asinh.hpp"
#include "common.hpp"
-// include a local copy of elementwise common header from dpnp tensor:
-// dpnp/tensor/libtensor/source/elementwise_functions/elementwise_functions.hpp
-// TODO: replace by consolidating with tensor post-migration
-#include "../elementwise_functions/elementwise_functions.hpp"
+#include "elementwise_functions/elementwise_functions.hpp"
// dpnp tensor headers
#include "kernels/elementwise_functions/common.hpp"
@@ -56,7 +53,7 @@
namespace dpnp::extensions::vm
{
namespace py = pybind11;
-namespace py_int = dpnp::extensions::py_internal;
+namespace py_int = dpnp::tensor::py_internal;
namespace td_ns = dpnp::tensor::type_dispatch;
namespace impl
diff --git a/dpnp/backend/extensions/vm/asinh.hpp b/dpnp/libtensor/extensions/vm/asinh.hpp
similarity index 100%
rename from dpnp/backend/extensions/vm/asinh.hpp
rename to dpnp/libtensor/extensions/vm/asinh.hpp
diff --git a/dpnp/backend/extensions/vm/atan.cpp b/dpnp/libtensor/extensions/vm/atan.cpp
similarity index 94%
rename from dpnp/backend/extensions/vm/atan.cpp
rename to dpnp/libtensor/extensions/vm/atan.cpp
index 26a7f7155a14..b8df2c0390da 100644
--- a/dpnp/backend/extensions/vm/atan.cpp
+++ b/dpnp/libtensor/extensions/vm/atan.cpp
@@ -43,10 +43,7 @@
#include "atan.hpp"
#include "common.hpp"
-// include a local copy of elementwise common header from dpnp tensor:
-// dpnp/tensor/libtensor/source/elementwise_functions/elementwise_functions.hpp
-// TODO: replace by consolidating with tensor post-migration
-#include "../elementwise_functions/elementwise_functions.hpp"
+#include "elementwise_functions/elementwise_functions.hpp"
// dpnp tensor headers
#include "kernels/elementwise_functions/common.hpp"
@@ -56,7 +53,7 @@
namespace dpnp::extensions::vm
{
namespace py = pybind11;
-namespace py_int = dpnp::extensions::py_internal;
+namespace py_int = dpnp::tensor::py_internal;
namespace td_ns = dpnp::tensor::type_dispatch;
namespace impl
diff --git a/dpnp/backend/extensions/vm/atan.hpp b/dpnp/libtensor/extensions/vm/atan.hpp
similarity index 100%
rename from dpnp/backend/extensions/vm/atan.hpp
rename to dpnp/libtensor/extensions/vm/atan.hpp
diff --git a/dpnp/backend/extensions/vm/atan2.cpp b/dpnp/libtensor/extensions/vm/atan2.cpp
similarity index 95%
rename from dpnp/backend/extensions/vm/atan2.cpp
rename to dpnp/libtensor/extensions/vm/atan2.cpp
index 3ee102d46f3c..643668613fb5 100644
--- a/dpnp/backend/extensions/vm/atan2.cpp
+++ b/dpnp/libtensor/extensions/vm/atan2.cpp
@@ -43,10 +43,7 @@
#include "atan2.hpp"
#include "common.hpp"
-// include a local copy of elementwise common header from dpnp tensor:
-// dpnp/tensor/libtensor/source/elementwise_functions/elementwise_functions.hpp
-// TODO: replace by consolidating with tensor post-migration
-#include "../elementwise_functions/elementwise_functions.hpp"
+#include "elementwise_functions/elementwise_functions.hpp"
// dpnp tensor headers
#include "kernels/elementwise_functions/common.hpp"
@@ -56,7 +53,7 @@
namespace dpnp::extensions::vm
{
namespace py = pybind11;
-namespace py_int = dpnp::extensions::py_internal;
+namespace py_int = dpnp::tensor::py_internal;
namespace td_ns = dpnp::tensor::type_dispatch;
namespace impl
diff --git a/dpnp/backend/extensions/vm/atan2.hpp b/dpnp/libtensor/extensions/vm/atan2.hpp
similarity index 100%
rename from dpnp/backend/extensions/vm/atan2.hpp
rename to dpnp/libtensor/extensions/vm/atan2.hpp
diff --git a/dpnp/backend/extensions/vm/atanh.cpp b/dpnp/libtensor/extensions/vm/atanh.cpp
similarity index 94%
rename from dpnp/backend/extensions/vm/atanh.cpp
rename to dpnp/libtensor/extensions/vm/atanh.cpp
index 42d7d3de3278..2a71dfcad88a 100644
--- a/dpnp/backend/extensions/vm/atanh.cpp
+++ b/dpnp/libtensor/extensions/vm/atanh.cpp
@@ -43,10 +43,7 @@
#include "atanh.hpp"
#include "common.hpp"
-// include a local copy of elementwise common header from dpnp tensor:
-// dpnp/tensor/libtensor/source/elementwise_functions/elementwise_functions.hpp
-// TODO: replace by consolidating with tensor post-migration
-#include "../elementwise_functions/elementwise_functions.hpp"
+#include "elementwise_functions/elementwise_functions.hpp"
// dpnp tensor headers
#include "kernels/elementwise_functions/common.hpp"
@@ -56,7 +53,7 @@
namespace dpnp::extensions::vm
{
namespace py = pybind11;
-namespace py_int = dpnp::extensions::py_internal;
+namespace py_int = dpnp::tensor::py_internal;
namespace td_ns = dpnp::tensor::type_dispatch;
namespace impl
diff --git a/dpnp/backend/extensions/vm/atanh.hpp b/dpnp/libtensor/extensions/vm/atanh.hpp
similarity index 100%
rename from dpnp/backend/extensions/vm/atanh.hpp
rename to dpnp/libtensor/extensions/vm/atanh.hpp
diff --git a/dpnp/backend/extensions/vm/cbrt.cpp b/dpnp/libtensor/extensions/vm/cbrt.cpp
similarity index 94%
rename from dpnp/backend/extensions/vm/cbrt.cpp
rename to dpnp/libtensor/extensions/vm/cbrt.cpp
index d83e366668f8..3a37a8f30508 100644
--- a/dpnp/backend/extensions/vm/cbrt.cpp
+++ b/dpnp/libtensor/extensions/vm/cbrt.cpp
@@ -42,10 +42,7 @@
#include "cbrt.hpp"
#include "common.hpp"
-// include a local copy of elementwise common header from dpnp tensor:
-// dpnp/tensor/libtensor/source/elementwise_functions/elementwise_functions.hpp
-// TODO: replace by consolidating with tensor post-migration
-#include "../elementwise_functions/elementwise_functions.hpp"
+#include "elementwise_functions/elementwise_functions.hpp"
// dpnp tensor headers
#include "kernels/elementwise_functions/common.hpp"
@@ -55,7 +52,7 @@
namespace dpnp::extensions::vm
{
namespace py = pybind11;
-namespace py_int = dpnp::extensions::py_internal;
+namespace py_int = dpnp::tensor::py_internal;
namespace td_ns = dpnp::tensor::type_dispatch;
namespace impl
diff --git a/dpnp/backend/extensions/vm/cbrt.hpp b/dpnp/libtensor/extensions/vm/cbrt.hpp
similarity index 100%
rename from dpnp/backend/extensions/vm/cbrt.hpp
rename to dpnp/libtensor/extensions/vm/cbrt.hpp
diff --git a/dpnp/backend/extensions/vm/ceil.cpp b/dpnp/libtensor/extensions/vm/ceil.cpp
similarity index 94%
rename from dpnp/backend/extensions/vm/ceil.cpp
rename to dpnp/libtensor/extensions/vm/ceil.cpp
index 1f494c4c41b7..88698445a346 100644
--- a/dpnp/backend/extensions/vm/ceil.cpp
+++ b/dpnp/libtensor/extensions/vm/ceil.cpp
@@ -42,10 +42,7 @@
#include "ceil.hpp"
#include "common.hpp"
-// include a local copy of elementwise common header from dpnp tensor:
-// dpnp/tensor/libtensor/source/elementwise_functions/elementwise_functions.hpp
-// TODO: replace by consolidating with tensor post-migration
-#include "../elementwise_functions/elementwise_functions.hpp"
+#include "elementwise_functions/elementwise_functions.hpp"
// dpnp tensor headers
#include "kernels/elementwise_functions/common.hpp"
@@ -55,7 +52,7 @@
namespace dpnp::extensions::vm
{
namespace py = pybind11;
-namespace py_int = dpnp::extensions::py_internal;
+namespace py_int = dpnp::tensor::py_internal;
namespace td_ns = dpnp::tensor::type_dispatch;
namespace impl
diff --git a/dpnp/backend/extensions/vm/ceil.hpp b/dpnp/libtensor/extensions/vm/ceil.hpp
similarity index 100%
rename from dpnp/backend/extensions/vm/ceil.hpp
rename to dpnp/libtensor/extensions/vm/ceil.hpp
diff --git a/dpnp/backend/extensions/vm/common.hpp b/dpnp/libtensor/extensions/vm/common.hpp
similarity index 99%
rename from dpnp/backend/extensions/vm/common.hpp
rename to dpnp/libtensor/extensions/vm/common.hpp
index f2a46477d78c..a350013ff24b 100644
--- a/dpnp/backend/extensions/vm/common.hpp
+++ b/dpnp/libtensor/extensions/vm/common.hpp
@@ -352,7 +352,7 @@ bool need_to_call_binary_ufunc(sycl::queue &exec_q,
}
// MKL function is not defined for the type
- if (contig_dispatch_table[src1_typeid] == nullptr) {
+ if (contig_dispatch_table[src1_typeid][src2_typeid] == nullptr) {
return false;
}
return true;
diff --git a/dpnp/backend/extensions/vm/conj.cpp b/dpnp/libtensor/extensions/vm/conj.cpp
similarity index 94%
rename from dpnp/backend/extensions/vm/conj.cpp
rename to dpnp/libtensor/extensions/vm/conj.cpp
index 23ae85be814e..3a8e38e67995 100644
--- a/dpnp/backend/extensions/vm/conj.cpp
+++ b/dpnp/libtensor/extensions/vm/conj.cpp
@@ -43,10 +43,7 @@
#include "common.hpp"
#include "conj.hpp"
-// include a local copy of elementwise common header from dpnp tensor:
-// dpnp/tensor/libtensor/source/elementwise_functions/elementwise_functions.hpp
-// TODO: replace by consolidating with tensor post-migration
-#include "../elementwise_functions/elementwise_functions.hpp"
+#include "elementwise_functions/elementwise_functions.hpp"
// dpnp tensor headers
#include "kernels/elementwise_functions/common.hpp"
@@ -56,7 +53,7 @@
namespace dpnp::extensions::vm
{
namespace py = pybind11;
-namespace py_int = dpnp::extensions::py_internal;
+namespace py_int = dpnp::tensor::py_internal;
namespace td_ns = dpnp::tensor::type_dispatch;
namespace impl
diff --git a/dpnp/backend/extensions/vm/conj.hpp b/dpnp/libtensor/extensions/vm/conj.hpp
similarity index 100%
rename from dpnp/backend/extensions/vm/conj.hpp
rename to dpnp/libtensor/extensions/vm/conj.hpp
diff --git a/dpnp/backend/extensions/vm/copysign.cpp b/dpnp/libtensor/extensions/vm/copysign.cpp
similarity index 95%
rename from dpnp/backend/extensions/vm/copysign.cpp
rename to dpnp/libtensor/extensions/vm/copysign.cpp
index 543e77d704ab..ec5e7d4e23a4 100644
--- a/dpnp/backend/extensions/vm/copysign.cpp
+++ b/dpnp/libtensor/extensions/vm/copysign.cpp
@@ -43,10 +43,7 @@
#include "common.hpp"
#include "copysign.hpp"
-// include a local copy of elementwise common header from dpnp tensor:
-// dpnp/tensor/libtensor/source/elementwise_functions/elementwise_functions.hpp
-// TODO: replace by consolidating with tensor post-migration
-#include "../elementwise_functions/elementwise_functions.hpp"
+#include "elementwise_functions/elementwise_functions.hpp"
// dpnp tensor headers
#include "kernels/elementwise_functions/common.hpp"
@@ -56,7 +53,7 @@
namespace dpnp::extensions::vm
{
namespace py = pybind11;
-namespace py_int = dpnp::extensions::py_internal;
+namespace py_int = dpnp::tensor::py_internal;
namespace td_ns = dpnp::tensor::type_dispatch;
namespace impl
diff --git a/dpnp/backend/extensions/vm/copysign.hpp b/dpnp/libtensor/extensions/vm/copysign.hpp
similarity index 100%
rename from dpnp/backend/extensions/vm/copysign.hpp
rename to dpnp/libtensor/extensions/vm/copysign.hpp
diff --git a/dpnp/backend/extensions/vm/cos.cpp b/dpnp/libtensor/extensions/vm/cos.cpp
similarity index 94%
rename from dpnp/backend/extensions/vm/cos.cpp
rename to dpnp/libtensor/extensions/vm/cos.cpp
index 90a77b543778..98653c1be014 100644
--- a/dpnp/backend/extensions/vm/cos.cpp
+++ b/dpnp/libtensor/extensions/vm/cos.cpp
@@ -43,10 +43,7 @@
#include "common.hpp"
#include "cos.hpp"
-// include a local copy of elementwise common header from dpnp tensor:
-// dpnp/tensor/libtensor/source/elementwise_functions/elementwise_functions.hpp
-// TODO: replace by consolidating with tensor post-migration
-#include "../elementwise_functions/elementwise_functions.hpp"
+#include "elementwise_functions/elementwise_functions.hpp"
// dpnp tensor headers
#include "kernels/elementwise_functions/common.hpp"
@@ -56,7 +53,7 @@
namespace dpnp::extensions::vm
{
namespace py = pybind11;
-namespace py_int = dpnp::extensions::py_internal;
+namespace py_int = dpnp::tensor::py_internal;
namespace td_ns = dpnp::tensor::type_dispatch;
namespace impl
diff --git a/dpnp/backend/extensions/vm/cos.hpp b/dpnp/libtensor/extensions/vm/cos.hpp
similarity index 100%
rename from dpnp/backend/extensions/vm/cos.hpp
rename to dpnp/libtensor/extensions/vm/cos.hpp
diff --git a/dpnp/backend/extensions/vm/cosh.cpp b/dpnp/libtensor/extensions/vm/cosh.cpp
similarity index 94%
rename from dpnp/backend/extensions/vm/cosh.cpp
rename to dpnp/libtensor/extensions/vm/cosh.cpp
index 8ea80f29145d..d655b2dcc68c 100644
--- a/dpnp/backend/extensions/vm/cosh.cpp
+++ b/dpnp/libtensor/extensions/vm/cosh.cpp
@@ -43,10 +43,7 @@
#include "common.hpp"
#include "cosh.hpp"
-// include a local copy of elementwise common header from dpnp tensor:
-// dpnp/tensor/libtensor/source/elementwise_functions/elementwise_functions.hpp
-// TODO: replace by consolidating with tensor post-migration
-#include "../elementwise_functions/elementwise_functions.hpp"
+#include "elementwise_functions/elementwise_functions.hpp"
// dpnp tensor headers
#include "kernels/elementwise_functions/common.hpp"
@@ -56,7 +53,7 @@
namespace dpnp::extensions::vm
{
namespace py = pybind11;
-namespace py_int = dpnp::extensions::py_internal;
+namespace py_int = dpnp::tensor::py_internal;
namespace td_ns = dpnp::tensor::type_dispatch;
namespace impl
diff --git a/dpnp/backend/extensions/vm/cosh.hpp b/dpnp/libtensor/extensions/vm/cosh.hpp
similarity index 100%
rename from dpnp/backend/extensions/vm/cosh.hpp
rename to dpnp/libtensor/extensions/vm/cosh.hpp
diff --git a/dpnp/backend/extensions/vm/div.cpp b/dpnp/libtensor/extensions/vm/div.cpp
similarity index 95%
rename from dpnp/backend/extensions/vm/div.cpp
rename to dpnp/libtensor/extensions/vm/div.cpp
index 386684d11a81..68de80960d64 100644
--- a/dpnp/backend/extensions/vm/div.cpp
+++ b/dpnp/libtensor/extensions/vm/div.cpp
@@ -44,10 +44,7 @@
#include "common.hpp"
#include "div.hpp"
-// include a local copy of elementwise common header from dpnp tensor:
-// dpnp/tensor/libtensor/source/elementwise_functions/elementwise_functions.hpp
-// TODO: replace by consolidating with tensor post-migration
-#include "../elementwise_functions/elementwise_functions.hpp"
+#include "elementwise_functions/elementwise_functions.hpp"
// dpnp tensor headers
#include "kernels/elementwise_functions/common.hpp"
@@ -57,7 +54,7 @@
namespace dpnp::extensions::vm
{
namespace py = pybind11;
-namespace py_int = dpnp::extensions::py_internal;
+namespace py_int = dpnp::tensor::py_internal;
namespace td_ns = dpnp::tensor::type_dispatch;
namespace impl
diff --git a/dpnp/backend/extensions/vm/div.hpp b/dpnp/libtensor/extensions/vm/div.hpp
similarity index 100%
rename from dpnp/backend/extensions/vm/div.hpp
rename to dpnp/libtensor/extensions/vm/div.hpp
diff --git a/dpnp/backend/extensions/vm/erf_funcs.cpp b/dpnp/libtensor/extensions/vm/erf_funcs.cpp
similarity index 96%
rename from dpnp/backend/extensions/vm/erf_funcs.cpp
rename to dpnp/libtensor/extensions/vm/erf_funcs.cpp
index b43b7a19945e..38796ae15ff6 100644
--- a/dpnp/backend/extensions/vm/erf_funcs.cpp
+++ b/dpnp/libtensor/extensions/vm/erf_funcs.cpp
@@ -42,10 +42,7 @@
#include "common.hpp"
#include "erf_funcs.hpp"
-// include a local copy of elementwise common header from dpnp tensor:
-// dpnp/tensor/libtensor/source/elementwise_functions/elementwise_functions.hpp
-// TODO: replace by consolidating with tensor post-migration
-#include "../elementwise_functions/elementwise_functions.hpp"
+#include "elementwise_functions/elementwise_functions.hpp"
// dpnp tensor headers
#include "kernels/elementwise_functions/common.hpp"
@@ -55,7 +52,7 @@
namespace dpnp::extensions::vm
{
namespace py = pybind11;
-namespace py_int = dpnp::extensions::py_internal;
+namespace py_int = dpnp::tensor::py_internal;
namespace td_ns = dpnp::tensor::type_dispatch;
using ext::common::init_dispatch_vector;
diff --git a/dpnp/backend/extensions/vm/erf_funcs.hpp b/dpnp/libtensor/extensions/vm/erf_funcs.hpp
similarity index 100%
rename from dpnp/backend/extensions/vm/erf_funcs.hpp
rename to dpnp/libtensor/extensions/vm/erf_funcs.hpp
diff --git a/dpnp/backend/extensions/vm/exp.cpp b/dpnp/libtensor/extensions/vm/exp.cpp
similarity index 94%
rename from dpnp/backend/extensions/vm/exp.cpp
rename to dpnp/libtensor/extensions/vm/exp.cpp
index fb765d0d7f2e..bbcefdc460b1 100644
--- a/dpnp/backend/extensions/vm/exp.cpp
+++ b/dpnp/libtensor/extensions/vm/exp.cpp
@@ -43,10 +43,7 @@
#include "common.hpp"
#include "exp.hpp"
-// include a local copy of elementwise common header from dpnp tensor:
-// dpnp/tensor/libtensor/source/elementwise_functions/elementwise_functions.hpp
-// TODO: replace by consolidating with tensor post-migration
-#include "../elementwise_functions/elementwise_functions.hpp"
+#include "elementwise_functions/elementwise_functions.hpp"
// dpnp tensor headers
#include "kernels/elementwise_functions/common.hpp"
@@ -56,7 +53,7 @@
namespace dpnp::extensions::vm
{
namespace py = pybind11;
-namespace py_int = dpnp::extensions::py_internal;
+namespace py_int = dpnp::tensor::py_internal;
namespace td_ns = dpnp::tensor::type_dispatch;
namespace impl
diff --git a/dpnp/backend/extensions/vm/exp.hpp b/dpnp/libtensor/extensions/vm/exp.hpp
similarity index 100%
rename from dpnp/backend/extensions/vm/exp.hpp
rename to dpnp/libtensor/extensions/vm/exp.hpp
diff --git a/dpnp/backend/extensions/vm/exp2.cpp b/dpnp/libtensor/extensions/vm/exp2.cpp
similarity index 94%
rename from dpnp/backend/extensions/vm/exp2.cpp
rename to dpnp/libtensor/extensions/vm/exp2.cpp
index 3472187f7d4a..d25e9b89bcd8 100644
--- a/dpnp/backend/extensions/vm/exp2.cpp
+++ b/dpnp/libtensor/extensions/vm/exp2.cpp
@@ -42,10 +42,7 @@
#include "common.hpp"
#include "exp2.hpp"
-// include a local copy of elementwise common header from dpnp tensor:
-// dpnp/tensor/libtensor/source/elementwise_functions/elementwise_functions.hpp
-// TODO: replace by consolidating with tensor post-migration
-#include "../elementwise_functions/elementwise_functions.hpp"
+#include "elementwise_functions/elementwise_functions.hpp"
// dpnp tensor headers
#include "kernels/elementwise_functions/common.hpp"
@@ -55,7 +52,7 @@
namespace dpnp::extensions::vm
{
namespace py = pybind11;
-namespace py_int = dpnp::extensions::py_internal;
+namespace py_int = dpnp::tensor::py_internal;
namespace td_ns = dpnp::tensor::type_dispatch;
namespace impl
diff --git a/dpnp/backend/extensions/vm/exp2.hpp b/dpnp/libtensor/extensions/vm/exp2.hpp
similarity index 100%
rename from dpnp/backend/extensions/vm/exp2.hpp
rename to dpnp/libtensor/extensions/vm/exp2.hpp
diff --git a/dpnp/backend/extensions/vm/expm1.cpp b/dpnp/libtensor/extensions/vm/expm1.cpp
similarity index 94%
rename from dpnp/backend/extensions/vm/expm1.cpp
rename to dpnp/libtensor/extensions/vm/expm1.cpp
index 9ad3db32813b..6d62800bc735 100644
--- a/dpnp/backend/extensions/vm/expm1.cpp
+++ b/dpnp/libtensor/extensions/vm/expm1.cpp
@@ -42,10 +42,7 @@
#include "common.hpp"
#include "expm1.hpp"
-// include a local copy of elementwise common header from dpnp tensor:
-// dpnp/tensor/libtensor/source/elementwise_functions/elementwise_functions.hpp
-// TODO: replace by consolidating with tensor post-migration
-#include "../elementwise_functions/elementwise_functions.hpp"
+#include "elementwise_functions/elementwise_functions.hpp"
// dpnp tensor headers
#include "kernels/elementwise_functions/common.hpp"
@@ -55,7 +52,7 @@
namespace dpnp::extensions::vm
{
namespace py = pybind11;
-namespace py_int = dpnp::extensions::py_internal;
+namespace py_int = dpnp::tensor::py_internal;
namespace td_ns = dpnp::tensor::type_dispatch;
namespace impl
diff --git a/dpnp/backend/extensions/vm/expm1.hpp b/dpnp/libtensor/extensions/vm/expm1.hpp
similarity index 100%
rename from dpnp/backend/extensions/vm/expm1.hpp
rename to dpnp/libtensor/extensions/vm/expm1.hpp
diff --git a/dpnp/backend/extensions/vm/floor.cpp b/dpnp/libtensor/extensions/vm/floor.cpp
similarity index 94%
rename from dpnp/backend/extensions/vm/floor.cpp
rename to dpnp/libtensor/extensions/vm/floor.cpp
index 086097a5db52..91350e695887 100644
--- a/dpnp/backend/extensions/vm/floor.cpp
+++ b/dpnp/libtensor/extensions/vm/floor.cpp
@@ -42,10 +42,7 @@
#include "common.hpp"
#include "floor.hpp"
-// include a local copy of elementwise common header from dpnp tensor:
-// dpnp/tensor/libtensor/source/elementwise_functions/elementwise_functions.hpp
-// TODO: replace by consolidating with tensor post-migration
-#include "../elementwise_functions/elementwise_functions.hpp"
+#include "elementwise_functions/elementwise_functions.hpp"
// dpnp tensor headers
#include "kernels/elementwise_functions/common.hpp"
@@ -55,7 +52,7 @@
namespace dpnp::extensions::vm
{
namespace py = pybind11;
-namespace py_int = dpnp::extensions::py_internal;
+namespace py_int = dpnp::tensor::py_internal;
namespace td_ns = dpnp::tensor::type_dispatch;
namespace impl
diff --git a/dpnp/backend/extensions/vm/floor.hpp b/dpnp/libtensor/extensions/vm/floor.hpp
similarity index 100%
rename from dpnp/backend/extensions/vm/floor.hpp
rename to dpnp/libtensor/extensions/vm/floor.hpp
diff --git a/dpnp/backend/extensions/vm/fmax.cpp b/dpnp/libtensor/extensions/vm/fmax.cpp
similarity index 93%
rename from dpnp/backend/extensions/vm/fmax.cpp
rename to dpnp/libtensor/extensions/vm/fmax.cpp
index 709c96b27080..71000e1392b7 100644
--- a/dpnp/backend/extensions/vm/fmax.cpp
+++ b/dpnp/libtensor/extensions/vm/fmax.cpp
@@ -43,10 +43,7 @@
#include "common.hpp"
#include "fmax.hpp"
-// include a local copy of elementwise common header from dpnp tensor:
-// dpnp/tensor/libtensor/source/elementwise_functions/elementwise_functions.hpp
-// TODO: replace by consolidating with tensor post-migration
-#include "../elementwise_functions/elementwise_functions.hpp"
+#include "elementwise_functions/elementwise_functions.hpp"
// dpnp tensor headers
#include "kernels/elementwise_functions/common.hpp"
@@ -56,7 +53,7 @@
namespace dpnp::extensions::vm
{
namespace py = pybind11;
-namespace py_int = dpnp::extensions::py_internal;
+namespace py_int = dpnp::tensor::py_internal;
namespace td_ns = dpnp::tensor::type_dispatch;
namespace impl
@@ -152,8 +149,8 @@ void init_fmax(py::module_ m)
};
m.def("_fmax", fmax_pyapi,
"Call `fmax` function from OneMKL VM library to performs element "
- "by element computation of the modulus function of vector `src1` "
- "with respect to vector `src2` to resulting vector `dst`",
+ "by element computation of the maximum of vector `src1` and vector "
+ "`src2` to resulting vector `dst`",
py::arg("sycl_queue"), py::arg("src1"), py::arg("src2"),
py::arg("dst"), py::arg("depends") = py::list());
diff --git a/dpnp/backend/extensions/vm/fmax.hpp b/dpnp/libtensor/extensions/vm/fmax.hpp
similarity index 100%
rename from dpnp/backend/extensions/vm/fmax.hpp
rename to dpnp/libtensor/extensions/vm/fmax.hpp
diff --git a/dpnp/backend/extensions/vm/fmin.cpp b/dpnp/libtensor/extensions/vm/fmin.cpp
similarity index 93%
rename from dpnp/backend/extensions/vm/fmin.cpp
rename to dpnp/libtensor/extensions/vm/fmin.cpp
index a20c07136c87..1a8f331125d5 100644
--- a/dpnp/backend/extensions/vm/fmin.cpp
+++ b/dpnp/libtensor/extensions/vm/fmin.cpp
@@ -43,10 +43,7 @@
#include "common.hpp"
#include "fmin.hpp"
-// include a local copy of elementwise common header from dpnp tensor:
-// dpnp/tensor/libtensor/source/elementwise_functions/elementwise_functions.hpp
-// TODO: replace by consolidating with tensor post-migration
-#include "../elementwise_functions/elementwise_functions.hpp"
+#include "elementwise_functions/elementwise_functions.hpp"
// dpnp tensor headers
#include "kernels/elementwise_functions/common.hpp"
@@ -56,7 +53,7 @@
namespace dpnp::extensions::vm
{
namespace py = pybind11;
-namespace py_int = dpnp::extensions::py_internal;
+namespace py_int = dpnp::tensor::py_internal;
namespace td_ns = dpnp::tensor::type_dispatch;
namespace impl
@@ -152,8 +149,8 @@ void init_fmin(py::module_ m)
};
m.def("_fmin", fmin_pyapi,
"Call `fmin` function from OneMKL VM library to performs element "
- "by element computation of the modulus function of vector `src1` "
- "with respect to vector `src2` to resulting vector `dst`",
+ "by element computation of the minimum of vector `src1` and vector "
+ "`src2` to resulting vector `dst`",
py::arg("sycl_queue"), py::arg("src1"), py::arg("src2"),
py::arg("dst"), py::arg("depends") = py::list());
diff --git a/dpnp/backend/extensions/vm/fmin.hpp b/dpnp/libtensor/extensions/vm/fmin.hpp
similarity index 100%
rename from dpnp/backend/extensions/vm/fmin.hpp
rename to dpnp/libtensor/extensions/vm/fmin.hpp
diff --git a/dpnp/backend/extensions/vm/fmod.cpp b/dpnp/libtensor/extensions/vm/fmod.cpp
similarity index 95%
rename from dpnp/backend/extensions/vm/fmod.cpp
rename to dpnp/libtensor/extensions/vm/fmod.cpp
index a9b66e820da9..56481afa5ef4 100644
--- a/dpnp/backend/extensions/vm/fmod.cpp
+++ b/dpnp/libtensor/extensions/vm/fmod.cpp
@@ -43,10 +43,7 @@
#include "common.hpp"
#include "fmod.hpp"
-// include a local copy of elementwise common header from dpnp tensor:
-// dpnp/tensor/libtensor/source/elementwise_functions/elementwise_functions.hpp
-// TODO: replace by consolidating with tensor post-migration
-#include "../elementwise_functions/elementwise_functions.hpp"
+#include "elementwise_functions/elementwise_functions.hpp"
// dpnp tensor headers
#include "kernels/elementwise_functions/common.hpp"
@@ -56,7 +53,7 @@
namespace dpnp::extensions::vm
{
namespace py = pybind11;
-namespace py_int = dpnp::extensions::py_internal;
+namespace py_int = dpnp::tensor::py_internal;
namespace td_ns = dpnp::tensor::type_dispatch;
namespace impl
diff --git a/dpnp/backend/extensions/vm/fmod.hpp b/dpnp/libtensor/extensions/vm/fmod.hpp
similarity index 100%
rename from dpnp/backend/extensions/vm/fmod.hpp
rename to dpnp/libtensor/extensions/vm/fmod.hpp
diff --git a/dpnp/backend/extensions/vm/hypot.cpp b/dpnp/libtensor/extensions/vm/hypot.cpp
similarity index 95%
rename from dpnp/backend/extensions/vm/hypot.cpp
rename to dpnp/libtensor/extensions/vm/hypot.cpp
index d979fc4dcd4a..88195916d322 100644
--- a/dpnp/backend/extensions/vm/hypot.cpp
+++ b/dpnp/libtensor/extensions/vm/hypot.cpp
@@ -43,10 +43,7 @@
#include "common.hpp"
#include "hypot.hpp"
-// include a local copy of elementwise common header from dpnp tensor:
-// dpnp/tensor/libtensor/source/elementwise_functions/elementwise_functions.hpp
-// TODO: replace by consolidating with tensor post-migration
-#include "../elementwise_functions/elementwise_functions.hpp"
+#include "elementwise_functions/elementwise_functions.hpp"
// dpnp tensor headers
#include "kernels/elementwise_functions/common.hpp"
@@ -56,7 +53,7 @@
namespace dpnp::extensions::vm
{
namespace py = pybind11;
-namespace py_int = dpnp::extensions::py_internal;
+namespace py_int = dpnp::tensor::py_internal;
namespace td_ns = dpnp::tensor::type_dispatch;
namespace impl
diff --git a/dpnp/backend/extensions/vm/hypot.hpp b/dpnp/libtensor/extensions/vm/hypot.hpp
similarity index 100%
rename from dpnp/backend/extensions/vm/hypot.hpp
rename to dpnp/libtensor/extensions/vm/hypot.hpp
diff --git a/dpnp/backend/extensions/vm/i0.cpp b/dpnp/libtensor/extensions/vm/i0.cpp
similarity index 94%
rename from dpnp/backend/extensions/vm/i0.cpp
rename to dpnp/libtensor/extensions/vm/i0.cpp
index a2ce992877a2..68d3d8660647 100644
--- a/dpnp/backend/extensions/vm/i0.cpp
+++ b/dpnp/libtensor/extensions/vm/i0.cpp
@@ -42,10 +42,7 @@
#include "common.hpp"
#include "i0.hpp"
-// include a local copy of elementwise common header from dpnp tensor:
-// dpnp/tensor/libtensor/source/elementwise_functions/elementwise_functions.hpp
-// TODO: replace by consolidating with tensor post-migration
-#include "../elementwise_functions/elementwise_functions.hpp"
+#include "elementwise_functions/elementwise_functions.hpp"
// dpnp tensor headers
#include "kernels/elementwise_functions/common.hpp"
@@ -55,7 +52,7 @@
namespace dpnp::extensions::vm
{
namespace py = pybind11;
-namespace py_int = dpnp::extensions::py_internal;
+namespace py_int = dpnp::tensor::py_internal;
namespace td_ns = dpnp::tensor::type_dispatch;
namespace impl
diff --git a/dpnp/backend/extensions/vm/i0.hpp b/dpnp/libtensor/extensions/vm/i0.hpp
similarity index 100%
rename from dpnp/backend/extensions/vm/i0.hpp
rename to dpnp/libtensor/extensions/vm/i0.hpp
diff --git a/dpnp/backend/extensions/vm/inv.cpp b/dpnp/libtensor/extensions/vm/inv.cpp
similarity index 94%
rename from dpnp/backend/extensions/vm/inv.cpp
rename to dpnp/libtensor/extensions/vm/inv.cpp
index 1df30d520ef7..5575be3cb42b 100644
--- a/dpnp/backend/extensions/vm/inv.cpp
+++ b/dpnp/libtensor/extensions/vm/inv.cpp
@@ -42,10 +42,7 @@
#include "common.hpp"
#include "inv.hpp"
-// include a local copy of elementwise common header from dpnp tensor:
-// dpnp/tensor/libtensor/source/elementwise_functions/elementwise_functions.hpp
-// TODO: replace by consolidating with tensor post-migration
-#include "../elementwise_functions/elementwise_functions.hpp"
+#include "elementwise_functions/elementwise_functions.hpp"
// dpnp tensor headers
#include "kernels/elementwise_functions/common.hpp"
@@ -55,7 +52,7 @@
namespace dpnp::extensions::vm
{
namespace py = pybind11;
-namespace py_int = dpnp::extensions::py_internal;
+namespace py_int = dpnp::tensor::py_internal;
namespace td_ns = dpnp::tensor::type_dispatch;
namespace impl
diff --git a/dpnp/backend/extensions/vm/inv.hpp b/dpnp/libtensor/extensions/vm/inv.hpp
similarity index 100%
rename from dpnp/backend/extensions/vm/inv.hpp
rename to dpnp/libtensor/extensions/vm/inv.hpp
diff --git a/dpnp/backend/extensions/vm/ln.cpp b/dpnp/libtensor/extensions/vm/ln.cpp
similarity index 94%
rename from dpnp/backend/extensions/vm/ln.cpp
rename to dpnp/libtensor/extensions/vm/ln.cpp
index 029266d38cce..8ce83e2c4762 100644
--- a/dpnp/backend/extensions/vm/ln.cpp
+++ b/dpnp/libtensor/extensions/vm/ln.cpp
@@ -43,10 +43,7 @@
#include "common.hpp"
#include "ln.hpp"
-// include a local copy of elementwise common header from dpnp tensor:
-// dpnp/tensor/libtensor/source/elementwise_functions/elementwise_functions.hpp
-// TODO: replace by consolidating with tensor post-migration
-#include "../elementwise_functions/elementwise_functions.hpp"
+#include "elementwise_functions/elementwise_functions.hpp"
// dpnp tensor headers
#include "kernels/elementwise_functions/common.hpp"
@@ -56,7 +53,7 @@
namespace dpnp::extensions::vm
{
namespace py = pybind11;
-namespace py_int = dpnp::extensions::py_internal;
+namespace py_int = dpnp::tensor::py_internal;
namespace td_ns = dpnp::tensor::type_dispatch;
namespace impl
diff --git a/dpnp/backend/extensions/vm/ln.hpp b/dpnp/libtensor/extensions/vm/ln.hpp
similarity index 100%
rename from dpnp/backend/extensions/vm/ln.hpp
rename to dpnp/libtensor/extensions/vm/ln.hpp
diff --git a/dpnp/backend/extensions/vm/log10.cpp b/dpnp/libtensor/extensions/vm/log10.cpp
similarity index 94%
rename from dpnp/backend/extensions/vm/log10.cpp
rename to dpnp/libtensor/extensions/vm/log10.cpp
index 4eb0b4a7781d..b175c336a8c2 100644
--- a/dpnp/backend/extensions/vm/log10.cpp
+++ b/dpnp/libtensor/extensions/vm/log10.cpp
@@ -43,10 +43,7 @@
#include "common.hpp"
#include "log10.hpp"
-// include a local copy of elementwise common header from dpnp tensor:
-// dpnp/tensor/libtensor/source/elementwise_functions/elementwise_functions.hpp
-// TODO: replace by consolidating with tensor post-migration
-#include "../elementwise_functions/elementwise_functions.hpp"
+#include "elementwise_functions/elementwise_functions.hpp"
// dpnp tensor headers
#include "kernels/elementwise_functions/common.hpp"
@@ -56,7 +53,7 @@
namespace dpnp::extensions::vm
{
namespace py = pybind11;
-namespace py_int = dpnp::extensions::py_internal;
+namespace py_int = dpnp::tensor::py_internal;
namespace td_ns = dpnp::tensor::type_dispatch;
namespace impl
diff --git a/dpnp/backend/extensions/vm/log10.hpp b/dpnp/libtensor/extensions/vm/log10.hpp
similarity index 100%
rename from dpnp/backend/extensions/vm/log10.hpp
rename to dpnp/libtensor/extensions/vm/log10.hpp
diff --git a/dpnp/backend/extensions/vm/log1p.cpp b/dpnp/libtensor/extensions/vm/log1p.cpp
similarity index 94%
rename from dpnp/backend/extensions/vm/log1p.cpp
rename to dpnp/libtensor/extensions/vm/log1p.cpp
index 7a1673ad7e0a..336ddb8cbc80 100644
--- a/dpnp/backend/extensions/vm/log1p.cpp
+++ b/dpnp/libtensor/extensions/vm/log1p.cpp
@@ -42,10 +42,7 @@
#include "common.hpp"
#include "log1p.hpp"
-// include a local copy of elementwise common header from dpnp tensor:
-// dpnp/tensor/libtensor/source/elementwise_functions/elementwise_functions.hpp
-// TODO: replace by consolidating with tensor post-migration
-#include "../elementwise_functions/elementwise_functions.hpp"
+#include "elementwise_functions/elementwise_functions.hpp"
// dpnp tensor headers
#include "kernels/elementwise_functions/common.hpp"
@@ -55,7 +52,7 @@
namespace dpnp::extensions::vm
{
namespace py = pybind11;
-namespace py_int = dpnp::extensions::py_internal;
+namespace py_int = dpnp::tensor::py_internal;
namespace td_ns = dpnp::tensor::type_dispatch;
namespace impl
diff --git a/dpnp/backend/extensions/vm/log1p.hpp b/dpnp/libtensor/extensions/vm/log1p.hpp
similarity index 100%
rename from dpnp/backend/extensions/vm/log1p.hpp
rename to dpnp/libtensor/extensions/vm/log1p.hpp
diff --git a/dpnp/backend/extensions/vm/log2.cpp b/dpnp/libtensor/extensions/vm/log2.cpp
similarity index 94%
rename from dpnp/backend/extensions/vm/log2.cpp
rename to dpnp/libtensor/extensions/vm/log2.cpp
index 95395a069921..c17f4e19ab12 100644
--- a/dpnp/backend/extensions/vm/log2.cpp
+++ b/dpnp/libtensor/extensions/vm/log2.cpp
@@ -42,10 +42,7 @@
#include "common.hpp"
#include "log2.hpp"
-// include a local copy of elementwise common header from dpnp tensor:
-// dpnp/tensor/libtensor/source/elementwise_functions/elementwise_functions.hpp
-// TODO: replace by consolidating with tensor post-migration
-#include "../elementwise_functions/elementwise_functions.hpp"
+#include "elementwise_functions/elementwise_functions.hpp"
// dpnp tensor headers
#include "kernels/elementwise_functions/common.hpp"
@@ -55,7 +52,7 @@
namespace dpnp::extensions::vm
{
namespace py = pybind11;
-namespace py_int = dpnp::extensions::py_internal;
+namespace py_int = dpnp::tensor::py_internal;
namespace td_ns = dpnp::tensor::type_dispatch;
namespace impl
diff --git a/dpnp/backend/extensions/vm/log2.hpp b/dpnp/libtensor/extensions/vm/log2.hpp
similarity index 100%
rename from dpnp/backend/extensions/vm/log2.hpp
rename to dpnp/libtensor/extensions/vm/log2.hpp
diff --git a/dpnp/backend/extensions/vm/modf.cpp b/dpnp/libtensor/extensions/vm/modf.cpp
similarity index 87%
rename from dpnp/backend/extensions/vm/modf.cpp
rename to dpnp/libtensor/extensions/vm/modf.cpp
index 7ba980462888..68b6f9459108 100644
--- a/dpnp/backend/extensions/vm/modf.cpp
+++ b/dpnp/libtensor/extensions/vm/modf.cpp
@@ -43,13 +43,10 @@
#include "common.hpp"
#include "modf.hpp"
-// include a local copy of elementwise common header from dpnp tensor:
-// dpnp/tensor/libtensor/source/elementwise_functions/elementwise_functions.hpp
-// TODO: replace by consolidating with tensor post-migration
-#include "../elementwise_functions/elementwise_functions.hpp"
+#include "elementwise_functions/elementwise_functions.hpp"
-#include "../elementwise_functions/common.hpp"
-#include "../elementwise_functions/type_dispatch_building.hpp"
+#include "kernels/elementwise_functions/common_two_outputs.hpp"
+#include "utils/type_dispatch_building.hpp"
// dpnp tensor headers
#include "utils/type_dispatch.hpp"
@@ -58,14 +55,13 @@
namespace dpnp::extensions::vm
{
namespace py = pybind11;
-namespace py_int = dpnp::extensions::py_internal;
+namespace py_int = dpnp::tensor::py_internal;
namespace td_ns = dpnp::tensor::type_dispatch;
namespace impl
{
-namespace ew_cmn_ns = dpnp::extensions::py_internal::elementwise_common;
+namespace ew_cmn_ns = dpnp::tensor::kernels::elementwise_common;
namespace mkl_vm = oneapi::mkl::vm; // OneMKL namespace with VM functions
-namespace td_int_ns = py_int::type_dispatch;
namespace tu_ns = dpnp::tensor::type_utils;
/**
@@ -78,10 +74,10 @@ template
struct OutputType
{
using table_type =
- std::disjunction,
- td_int_ns::TypeMapTwoResultsEntry,
- td_int_ns::TypeMapTwoResultsEntry,
- td_int_ns::DefaultTwoResultsEntry>;
+ std::disjunction,
+ td_ns::TypeMapTwoResultsEntry,
+ td_ns::TypeMapTwoResultsEntry,
+ td_ns::DefaultTwoResultsEntry>;
using value_type1 = typename table_type::result_type1;
using value_type2 = typename table_type::result_type2;
};
diff --git a/dpnp/backend/extensions/vm/modf.hpp b/dpnp/libtensor/extensions/vm/modf.hpp
similarity index 100%
rename from dpnp/backend/extensions/vm/modf.hpp
rename to dpnp/libtensor/extensions/vm/modf.hpp
diff --git a/dpnp/backend/extensions/vm/mul.cpp b/dpnp/libtensor/extensions/vm/mul.cpp
similarity index 95%
rename from dpnp/backend/extensions/vm/mul.cpp
rename to dpnp/libtensor/extensions/vm/mul.cpp
index 1e48af3c6714..a25f6794da48 100644
--- a/dpnp/backend/extensions/vm/mul.cpp
+++ b/dpnp/libtensor/extensions/vm/mul.cpp
@@ -44,10 +44,7 @@
#include "common.hpp"
#include "mul.hpp"
-// include a local copy of elementwise common header from dpnp tensor:
-// dpnp/tensor/libtensor/source/elementwise_functions/elementwise_functions.hpp
-// TODO: replace by consolidating with tensor post-migration
-#include "../elementwise_functions/elementwise_functions.hpp"
+#include "elementwise_functions/elementwise_functions.hpp"
// dpnp tensor headers
#include "kernels/elementwise_functions/common.hpp"
@@ -57,7 +54,7 @@
namespace dpnp::extensions::vm
{
namespace py = pybind11;
-namespace py_int = dpnp::extensions::py_internal;
+namespace py_int = dpnp::tensor::py_internal;
namespace td_ns = dpnp::tensor::type_dispatch;
namespace impl
diff --git a/dpnp/backend/extensions/vm/mul.hpp b/dpnp/libtensor/extensions/vm/mul.hpp
similarity index 100%
rename from dpnp/backend/extensions/vm/mul.hpp
rename to dpnp/libtensor/extensions/vm/mul.hpp
diff --git a/dpnp/backend/extensions/vm/nextafter.cpp b/dpnp/libtensor/extensions/vm/nextafter.cpp
similarity index 95%
rename from dpnp/backend/extensions/vm/nextafter.cpp
rename to dpnp/libtensor/extensions/vm/nextafter.cpp
index eb2d82e23f9b..32e4df5895df 100644
--- a/dpnp/backend/extensions/vm/nextafter.cpp
+++ b/dpnp/libtensor/extensions/vm/nextafter.cpp
@@ -43,10 +43,7 @@
#include "common.hpp"
#include "nextafter.hpp"
-// include a local copy of elementwise common header from dpnp tensor:
-// dpnp/tensor/libtensor/source/elementwise_functions/elementwise_functions.hpp
-// TODO: replace by consolidating with tensor post-migration
-#include "../elementwise_functions/elementwise_functions.hpp"
+#include "elementwise_functions/elementwise_functions.hpp"
// dpnp tensor headers
#include "kernels/elementwise_functions/common.hpp"
@@ -56,7 +53,7 @@
namespace dpnp::extensions::vm
{
namespace py = pybind11;
-namespace py_int = dpnp::extensions::py_internal;
+namespace py_int = dpnp::tensor::py_internal;
namespace td_ns = dpnp::tensor::type_dispatch;
namespace impl
diff --git a/dpnp/backend/extensions/vm/nextafter.hpp b/dpnp/libtensor/extensions/vm/nextafter.hpp
similarity index 100%
rename from dpnp/backend/extensions/vm/nextafter.hpp
rename to dpnp/libtensor/extensions/vm/nextafter.hpp
diff --git a/dpnp/backend/extensions/vm/pow.cpp b/dpnp/libtensor/extensions/vm/pow.cpp
similarity index 95%
rename from dpnp/backend/extensions/vm/pow.cpp
rename to dpnp/libtensor/extensions/vm/pow.cpp
index c970abbbf350..7aed34fe5fd3 100644
--- a/dpnp/backend/extensions/vm/pow.cpp
+++ b/dpnp/libtensor/extensions/vm/pow.cpp
@@ -44,10 +44,7 @@
#include "common.hpp"
#include "pow.hpp"
-// include a local copy of elementwise common header from dpnp tensor:
-// dpnp/tensor/libtensor/source/elementwise_functions/elementwise_functions.hpp
-// TODO: replace by consolidating with tensor post-migration
-#include "../elementwise_functions/elementwise_functions.hpp"
+#include "elementwise_functions/elementwise_functions.hpp"
// dpnp tensor headers
#include "kernels/elementwise_functions/common.hpp"
@@ -57,7 +54,7 @@
namespace dpnp::extensions::vm
{
namespace py = pybind11;
-namespace py_int = dpnp::extensions::py_internal;
+namespace py_int = dpnp::tensor::py_internal;
namespace td_ns = dpnp::tensor::type_dispatch;
namespace impl
diff --git a/dpnp/backend/extensions/vm/pow.hpp b/dpnp/libtensor/extensions/vm/pow.hpp
similarity index 100%
rename from dpnp/backend/extensions/vm/pow.hpp
rename to dpnp/libtensor/extensions/vm/pow.hpp
diff --git a/dpnp/backend/extensions/vm/rint.cpp b/dpnp/libtensor/extensions/vm/rint.cpp
similarity index 94%
rename from dpnp/backend/extensions/vm/rint.cpp
rename to dpnp/libtensor/extensions/vm/rint.cpp
index ff333d877a30..5723065c53ac 100644
--- a/dpnp/backend/extensions/vm/rint.cpp
+++ b/dpnp/libtensor/extensions/vm/rint.cpp
@@ -42,10 +42,7 @@
#include "common.hpp"
#include "rint.hpp"
-// include a local copy of elementwise common header from dpnp tensor:
-// dpnp/tensor/libtensor/source/elementwise_functions/elementwise_functions.hpp
-// TODO: replace by consolidating with tensor post-migration
-#include "../elementwise_functions/elementwise_functions.hpp"
+#include "elementwise_functions/elementwise_functions.hpp"
// dpnp tensor headers
#include "kernels/elementwise_functions/common.hpp"
@@ -55,7 +52,7 @@
namespace dpnp::extensions::vm
{
namespace py = pybind11;
-namespace py_int = dpnp::extensions::py_internal;
+namespace py_int = dpnp::tensor::py_internal;
namespace td_ns = dpnp::tensor::type_dispatch;
namespace impl
diff --git a/dpnp/backend/extensions/vm/rint.hpp b/dpnp/libtensor/extensions/vm/rint.hpp
similarity index 100%
rename from dpnp/backend/extensions/vm/rint.hpp
rename to dpnp/libtensor/extensions/vm/rint.hpp
diff --git a/dpnp/backend/extensions/vm/sin.cpp b/dpnp/libtensor/extensions/vm/sin.cpp
similarity index 94%
rename from dpnp/backend/extensions/vm/sin.cpp
rename to dpnp/libtensor/extensions/vm/sin.cpp
index cdf7e6b57816..9dec89ad9d6b 100644
--- a/dpnp/backend/extensions/vm/sin.cpp
+++ b/dpnp/libtensor/extensions/vm/sin.cpp
@@ -43,10 +43,7 @@
#include "common.hpp"
#include "sin.hpp"
-// include a local copy of elementwise common header from dpnp tensor:
-// dpnp/tensor/libtensor/source/elementwise_functions/elementwise_functions.hpp
-// TODO: replace by consolidating with tensor post-migration
-#include "../elementwise_functions/elementwise_functions.hpp"
+#include "elementwise_functions/elementwise_functions.hpp"
// dpnp tensor headers
#include "kernels/elementwise_functions/common.hpp"
@@ -56,7 +53,7 @@
namespace dpnp::extensions::vm
{
namespace py = pybind11;
-namespace py_int = dpnp::extensions::py_internal;
+namespace py_int = dpnp::tensor::py_internal;
namespace td_ns = dpnp::tensor::type_dispatch;
namespace impl
diff --git a/dpnp/backend/extensions/vm/sin.hpp b/dpnp/libtensor/extensions/vm/sin.hpp
similarity index 100%
rename from dpnp/backend/extensions/vm/sin.hpp
rename to dpnp/libtensor/extensions/vm/sin.hpp
diff --git a/dpnp/backend/extensions/vm/sinh.cpp b/dpnp/libtensor/extensions/vm/sinh.cpp
similarity index 94%
rename from dpnp/backend/extensions/vm/sinh.cpp
rename to dpnp/libtensor/extensions/vm/sinh.cpp
index 6593c3c907e7..ab3d77b9add1 100644
--- a/dpnp/backend/extensions/vm/sinh.cpp
+++ b/dpnp/libtensor/extensions/vm/sinh.cpp
@@ -43,10 +43,7 @@
#include "common.hpp"
#include "sinh.hpp"
-// include a local copy of elementwise common header from dpnp tensor:
-// dpnp/tensor/libtensor/source/elementwise_functions/elementwise_functions.hpp
-// TODO: replace by consolidating with tensor post-migration
-#include "../elementwise_functions/elementwise_functions.hpp"
+#include "elementwise_functions/elementwise_functions.hpp"
// dpnp tensor headers
#include "kernels/elementwise_functions/common.hpp"
@@ -56,7 +53,7 @@
namespace dpnp::extensions::vm
{
namespace py = pybind11;
-namespace py_int = dpnp::extensions::py_internal;
+namespace py_int = dpnp::tensor::py_internal;
namespace td_ns = dpnp::tensor::type_dispatch;
namespace impl
diff --git a/dpnp/backend/extensions/vm/sinh.hpp b/dpnp/libtensor/extensions/vm/sinh.hpp
similarity index 100%
rename from dpnp/backend/extensions/vm/sinh.hpp
rename to dpnp/libtensor/extensions/vm/sinh.hpp
diff --git a/dpnp/backend/extensions/vm/sqr.cpp b/dpnp/libtensor/extensions/vm/sqr.cpp
similarity index 94%
rename from dpnp/backend/extensions/vm/sqr.cpp
rename to dpnp/libtensor/extensions/vm/sqr.cpp
index e6b8f2180c22..80e30762a0b0 100644
--- a/dpnp/backend/extensions/vm/sqr.cpp
+++ b/dpnp/libtensor/extensions/vm/sqr.cpp
@@ -42,10 +42,7 @@
#include "common.hpp"
#include "sqr.hpp"
-// include a local copy of elementwise common header from dpnp tensor:
-// dpnp/tensor/libtensor/source/elementwise_functions/elementwise_functions.hpp
-// TODO: replace by consolidating with tensor post-migration
-#include "../elementwise_functions/elementwise_functions.hpp"
+#include "elementwise_functions/elementwise_functions.hpp"
// dpnp tensor headers
#include "kernels/elementwise_functions/common.hpp"
@@ -55,7 +52,7 @@
namespace dpnp::extensions::vm
{
namespace py = pybind11;
-namespace py_int = dpnp::extensions::py_internal;
+namespace py_int = dpnp::tensor::py_internal;
namespace td_ns = dpnp::tensor::type_dispatch;
namespace impl
diff --git a/dpnp/backend/extensions/vm/sqr.hpp b/dpnp/libtensor/extensions/vm/sqr.hpp
similarity index 100%
rename from dpnp/backend/extensions/vm/sqr.hpp
rename to dpnp/libtensor/extensions/vm/sqr.hpp
diff --git a/dpnp/backend/extensions/vm/sqrt.cpp b/dpnp/libtensor/extensions/vm/sqrt.cpp
similarity index 94%
rename from dpnp/backend/extensions/vm/sqrt.cpp
rename to dpnp/libtensor/extensions/vm/sqrt.cpp
index 27bda2a1a912..2a1bb7f7a991 100644
--- a/dpnp/backend/extensions/vm/sqrt.cpp
+++ b/dpnp/libtensor/extensions/vm/sqrt.cpp
@@ -43,10 +43,7 @@
#include "common.hpp"
#include "sqrt.hpp"
-// include a local copy of elementwise common header from dpnp tensor:
-// dpnp/tensor/libtensor/source/elementwise_functions/elementwise_functions.hpp
-// TODO: replace by consolidating with tensor post-migration
-#include "../elementwise_functions/elementwise_functions.hpp"
+#include "elementwise_functions/elementwise_functions.hpp"
// dpnp tensor headers
#include "kernels/elementwise_functions/common.hpp"
@@ -56,7 +53,7 @@
namespace dpnp::extensions::vm
{
namespace py = pybind11;
-namespace py_int = dpnp::extensions::py_internal;
+namespace py_int = dpnp::tensor::py_internal;
namespace td_ns = dpnp::tensor::type_dispatch;
namespace impl
diff --git a/dpnp/backend/extensions/vm/sqrt.hpp b/dpnp/libtensor/extensions/vm/sqrt.hpp
similarity index 100%
rename from dpnp/backend/extensions/vm/sqrt.hpp
rename to dpnp/libtensor/extensions/vm/sqrt.hpp
diff --git a/dpnp/backend/extensions/vm/sub.cpp b/dpnp/libtensor/extensions/vm/sub.cpp
similarity index 95%
rename from dpnp/backend/extensions/vm/sub.cpp
rename to dpnp/libtensor/extensions/vm/sub.cpp
index 099f6d11dc87..022ec5bfefaa 100644
--- a/dpnp/backend/extensions/vm/sub.cpp
+++ b/dpnp/libtensor/extensions/vm/sub.cpp
@@ -44,10 +44,7 @@
#include "common.hpp"
#include "sub.hpp"
-// include a local copy of elementwise common header from dpnp tensor:
-// dpnp/tensor/libtensor/source/elementwise_functions/elementwise_functions.hpp
-// TODO: replace by consolidating with tensor post-migration
-#include "../elementwise_functions/elementwise_functions.hpp"
+#include "elementwise_functions/elementwise_functions.hpp"
// dpnp tensor headers
#include "kernels/elementwise_functions/common.hpp"
@@ -57,7 +54,7 @@
namespace dpnp::extensions::vm
{
namespace py = pybind11;
-namespace py_int = dpnp::extensions::py_internal;
+namespace py_int = dpnp::tensor::py_internal;
namespace td_ns = dpnp::tensor::type_dispatch;
namespace impl
diff --git a/dpnp/backend/extensions/vm/sub.hpp b/dpnp/libtensor/extensions/vm/sub.hpp
similarity index 100%
rename from dpnp/backend/extensions/vm/sub.hpp
rename to dpnp/libtensor/extensions/vm/sub.hpp
diff --git a/dpnp/backend/extensions/vm/tan.cpp b/dpnp/libtensor/extensions/vm/tan.cpp
similarity index 94%
rename from dpnp/backend/extensions/vm/tan.cpp
rename to dpnp/libtensor/extensions/vm/tan.cpp
index 9c1d43011122..a4ff4842c4af 100644
--- a/dpnp/backend/extensions/vm/tan.cpp
+++ b/dpnp/libtensor/extensions/vm/tan.cpp
@@ -43,10 +43,7 @@
#include "common.hpp"
#include "tan.hpp"
-// include a local copy of elementwise common header from dpnp tensor:
-// dpnp/tensor/libtensor/source/elementwise_functions/elementwise_functions.hpp
-// TODO: replace by consolidating with tensor post-migration
-#include "../elementwise_functions/elementwise_functions.hpp"
+#include "elementwise_functions/elementwise_functions.hpp"
// dpnp tensor headers
#include "kernels/elementwise_functions/common.hpp"
@@ -56,7 +53,7 @@
namespace dpnp::extensions::vm
{
namespace py = pybind11;
-namespace py_int = dpnp::extensions::py_internal;
+namespace py_int = dpnp::tensor::py_internal;
namespace td_ns = dpnp::tensor::type_dispatch;
namespace impl
diff --git a/dpnp/backend/extensions/vm/tan.hpp b/dpnp/libtensor/extensions/vm/tan.hpp
similarity index 100%
rename from dpnp/backend/extensions/vm/tan.hpp
rename to dpnp/libtensor/extensions/vm/tan.hpp
diff --git a/dpnp/backend/extensions/vm/tanh.cpp b/dpnp/libtensor/extensions/vm/tanh.cpp
similarity index 94%
rename from dpnp/backend/extensions/vm/tanh.cpp
rename to dpnp/libtensor/extensions/vm/tanh.cpp
index bf8ef3d0b018..9734a2fc7185 100644
--- a/dpnp/backend/extensions/vm/tanh.cpp
+++ b/dpnp/libtensor/extensions/vm/tanh.cpp
@@ -43,10 +43,7 @@
#include "common.hpp"
#include "tanh.hpp"
-// include a local copy of elementwise common header from dpnp tensor:
-// dpnp/tensor/libtensor/source/elementwise_functions/elementwise_functions.hpp
-// TODO: replace by consolidating with tensor post-migration
-#include "../elementwise_functions/elementwise_functions.hpp"
+#include "elementwise_functions/elementwise_functions.hpp"
// dpnp tensor headers
#include "kernels/elementwise_functions/common.hpp"
@@ -56,7 +53,7 @@
namespace dpnp::extensions::vm
{
namespace py = pybind11;
-namespace py_int = dpnp::extensions::py_internal;
+namespace py_int = dpnp::tensor::py_internal;
namespace td_ns = dpnp::tensor::type_dispatch;
namespace impl
diff --git a/dpnp/backend/extensions/vm/tanh.hpp b/dpnp/libtensor/extensions/vm/tanh.hpp
similarity index 100%
rename from dpnp/backend/extensions/vm/tanh.hpp
rename to dpnp/libtensor/extensions/vm/tanh.hpp
diff --git a/dpnp/backend/extensions/vm/trunc.cpp b/dpnp/libtensor/extensions/vm/trunc.cpp
similarity index 94%
rename from dpnp/backend/extensions/vm/trunc.cpp
rename to dpnp/libtensor/extensions/vm/trunc.cpp
index f04216176373..57a749916af9 100644
--- a/dpnp/backend/extensions/vm/trunc.cpp
+++ b/dpnp/libtensor/extensions/vm/trunc.cpp
@@ -42,10 +42,7 @@
#include "common.hpp"
#include "trunc.hpp"
-// include a local copy of elementwise common header from dpnp tensor:
-// dpnp/tensor/libtensor/source/elementwise_functions/elementwise_functions.hpp
-// TODO: replace by consolidating with tensor post-migration
-#include "../elementwise_functions/elementwise_functions.hpp"
+#include "elementwise_functions/elementwise_functions.hpp"
// dpnp tensor headers
#include "kernels/elementwise_functions/common.hpp"
@@ -55,7 +52,7 @@
namespace dpnp::extensions::vm
{
namespace py = pybind11;
-namespace py_int = dpnp::extensions::py_internal;
+namespace py_int = dpnp::tensor::py_internal;
namespace td_ns = dpnp::tensor::type_dispatch;
namespace impl
diff --git a/dpnp/backend/extensions/vm/trunc.hpp b/dpnp/libtensor/extensions/vm/trunc.hpp
similarity index 100%
rename from dpnp/backend/extensions/vm/trunc.hpp
rename to dpnp/libtensor/extensions/vm/trunc.hpp
diff --git a/dpnp/backend/extensions/vm/vm_py.cpp b/dpnp/libtensor/extensions/vm/vm_py.cpp
similarity index 98%
rename from dpnp/backend/extensions/vm/vm_py.cpp
rename to dpnp/libtensor/extensions/vm/vm_py.cpp
index 8c42671a0b27..8965fbc79584 100644
--- a/dpnp/backend/extensions/vm/vm_py.cpp
+++ b/dpnp/libtensor/extensions/vm/vm_py.cpp
@@ -26,7 +26,7 @@
// THE POSSIBILITY OF SUCH DAMAGE.
//*****************************************************************************
//
-// This file defines functions of dpnp.backend._vm_impl extensions
+// This file defines functions of dpnp.libtensor._vm_impl extensions
//
//*****************************************************************************
diff --git a/dpnp/backend/extensions/common/ext/common.hpp b/dpnp/libtensor/include/ext/common.hpp
similarity index 86%
rename from dpnp/backend/extensions/common/ext/common.hpp
rename to dpnp/libtensor/include/ext/common.hpp
index 6b9a42a87d8e..2184c0ec5090 100644
--- a/dpnp/backend/extensions/common/ext/common.hpp
+++ b/dpnp/libtensor/include/ext/common.hpp
@@ -145,53 +145,21 @@ inline size_t get_max_local_size(const sycl::queue &queue)
return get_max_local_size(queue.get_device());
}
-inline size_t get_max_local_size(const sycl::queue &queue,
- int cpu_local_size_limit,
- int gpu_local_size_limit)
-{
- return get_max_local_size(queue.get_device(), cpu_local_size_limit,
- gpu_local_size_limit);
-}
-
size_t get_local_mem_size_in_bytes(const sycl::device &device);
size_t get_local_mem_size_in_bytes(const sycl::device &device, size_t reserve);
-inline size_t get_local_mem_size_in_bytes(const sycl::queue &queue)
-{
- return get_local_mem_size_in_bytes(queue.get_device());
-}
-
-inline size_t get_local_mem_size_in_bytes(const sycl::queue &queue,
- size_t reserve)
-{
- return get_local_mem_size_in_bytes(queue.get_device(), reserve);
-}
-
template
size_t get_local_mem_size_in_items(const sycl::device &device)
{
return get_local_mem_size_in_bytes(device) / sizeof(T);
}
-template
-size_t get_local_mem_size_in_items(const sycl::device &device, size_t reserve)
-{
- return get_local_mem_size_in_bytes(device, sizeof(T) * reserve) / sizeof(T);
-}
-
template
inline size_t get_local_mem_size_in_items(const sycl::queue &queue)
{
return get_local_mem_size_in_items(queue.get_device());
}
-template
-inline size_t get_local_mem_size_in_items(const sycl::queue &queue,
- size_t reserve)
-{
- return get_local_mem_size_in_items(queue.get_device(), reserve);
-}
-
template
sycl::nd_range make_ndrange(const sycl::range &global_range,
const sycl::range &local_range,
diff --git a/dpnp/backend/extensions/common/ext/details/common_internal.hpp b/dpnp/libtensor/include/ext/details/common_internal.hpp
similarity index 100%
rename from dpnp/backend/extensions/common/ext/details/common_internal.hpp
rename to dpnp/libtensor/include/ext/details/common_internal.hpp
diff --git a/dpnp/backend/extensions/common/ext/details/validation_utils_internal.hpp b/dpnp/libtensor/include/ext/details/validation_utils_internal.hpp
similarity index 99%
rename from dpnp/backend/extensions/common/ext/details/validation_utils_internal.hpp
rename to dpnp/libtensor/include/ext/details/validation_utils_internal.hpp
index 6a46c97293f3..a514f72884bc 100644
--- a/dpnp/backend/extensions/common/ext/details/validation_utils_internal.hpp
+++ b/dpnp/libtensor/include/ext/details/validation_utils_internal.hpp
@@ -89,7 +89,7 @@ inline void check_c_contig(const std::vector &arrays,
for (const auto &arr : arrays) {
if (arr != nullptr && !arr->is_c_contiguous()) {
throw py::value_error(name_of(arr, names) +
- " parameter is not c-contiguos");
+ " parameter is not c-contiguous");
}
}
}
diff --git a/dpnp/backend/extensions/common/ext/dispatch_table.hpp b/dpnp/libtensor/include/ext/dispatch_table.hpp
similarity index 98%
rename from dpnp/backend/extensions/common/ext/dispatch_table.hpp
rename to dpnp/libtensor/include/ext/dispatch_table.hpp
index 44437fb1a40f..abb1ec55a236 100644
--- a/dpnp/backend/extensions/common/ext/dispatch_table.hpp
+++ b/dpnp/libtensor/include/ext/dispatch_table.hpp
@@ -316,16 +316,6 @@ class DispatchTable2
return fn;
}
- const SupportedDTypeList &get_supported_first_type() const
- {
- return supported_first_type;
- }
-
- const SupportedDTypeList &get_supported_second_type() const
- {
- return supported_second_type;
- }
-
const SupportedDTypeList2 &get_all_supported_types() const
{
return all_supported_types;
diff --git a/dpnp/backend/extensions/common/ext/validation_utils.hpp b/dpnp/libtensor/include/ext/validation_utils.hpp
similarity index 100%
rename from dpnp/backend/extensions/common/ext/validation_utils.hpp
rename to dpnp/libtensor/include/ext/validation_utils.hpp
diff --git a/dpnp/tensor/libtensor/include/kernels/accumulators.hpp b/dpnp/libtensor/include/kernels/accumulators.hpp
similarity index 100%
rename from dpnp/tensor/libtensor/include/kernels/accumulators.hpp
rename to dpnp/libtensor/include/kernels/accumulators.hpp
diff --git a/dpnp/tensor/libtensor/include/kernels/alignment.hpp b/dpnp/libtensor/include/kernels/alignment.hpp
similarity index 100%
rename from dpnp/tensor/libtensor/include/kernels/alignment.hpp
rename to dpnp/libtensor/include/kernels/alignment.hpp
diff --git a/dpnp/tensor/libtensor/include/kernels/boolean_advanced_indexing.hpp b/dpnp/libtensor/include/kernels/boolean_advanced_indexing.hpp
similarity index 100%
rename from dpnp/tensor/libtensor/include/kernels/boolean_advanced_indexing.hpp
rename to dpnp/libtensor/include/kernels/boolean_advanced_indexing.hpp
diff --git a/dpnp/backend/kernels/indexing/choose.hpp b/dpnp/libtensor/include/kernels/choose.hpp
similarity index 98%
rename from dpnp/backend/kernels/indexing/choose.hpp
rename to dpnp/libtensor/include/kernels/choose.hpp
index 853394780475..b7f9a9e57db0 100644
--- a/dpnp/backend/kernels/indexing/choose.hpp
+++ b/dpnp/libtensor/include/kernels/choose.hpp
@@ -35,7 +35,7 @@
#include "kernels/dpnp_tensor_types.hpp"
#include "utils/strided_iters.hpp"
-namespace dpnp::kernels::choose
+namespace dpnp::tensor::kernels::choose
{
using dpnp::tensor::ssize_t;
@@ -125,4 +125,4 @@ struct NthStrideOffsetUnpacked
static_assert(sycl::is_device_copyable_v);
} // namespace strides
-} // namespace dpnp::kernels::choose
+} // namespace dpnp::tensor::kernels::choose
diff --git a/dpnp/tensor/libtensor/include/kernels/clip.hpp b/dpnp/libtensor/include/kernels/clip.hpp
similarity index 100%
rename from dpnp/tensor/libtensor/include/kernels/clip.hpp
rename to dpnp/libtensor/include/kernels/clip.hpp
diff --git a/dpnp/tensor/libtensor/include/kernels/constructors.hpp b/dpnp/libtensor/include/kernels/constructors.hpp
similarity index 100%
rename from dpnp/tensor/libtensor/include/kernels/constructors.hpp
rename to dpnp/libtensor/include/kernels/constructors.hpp
diff --git a/dpnp/tensor/libtensor/include/kernels/copy_and_cast.hpp b/dpnp/libtensor/include/kernels/copy_and_cast.hpp
similarity index 100%
rename from dpnp/tensor/libtensor/include/kernels/copy_and_cast.hpp
rename to dpnp/libtensor/include/kernels/copy_and_cast.hpp
diff --git a/dpnp/tensor/libtensor/include/kernels/copy_as_contiguous.hpp b/dpnp/libtensor/include/kernels/copy_as_contiguous.hpp
similarity index 100%
rename from dpnp/tensor/libtensor/include/kernels/copy_as_contiguous.hpp
rename to dpnp/libtensor/include/kernels/copy_as_contiguous.hpp
diff --git a/dpnp/tensor/libtensor/include/kernels/dpnp_tensor_types.hpp b/dpnp/libtensor/include/kernels/dpnp_tensor_types.hpp
similarity index 96%
rename from dpnp/tensor/libtensor/include/kernels/dpnp_tensor_types.hpp
rename to dpnp/libtensor/include/kernels/dpnp_tensor_types.hpp
index 6f9777b6e416..348b16be06a6 100644
--- a/dpnp/tensor/libtensor/include/kernels/dpnp_tensor_types.hpp
+++ b/dpnp/libtensor/include/kernels/dpnp_tensor_types.hpp
@@ -27,7 +27,7 @@
//*****************************************************************************
///
/// \file
-/// This file defines functions of dpnp.tensor._tensor_impl extensions
+/// This file defines functions of dpnp.libtensor._tensor_impl extensions
//===--------------------------------------------------------------------===//
#pragma once
diff --git a/dpnp/tensor/libtensor/include/kernels/elementwise_functions/abs.hpp b/dpnp/libtensor/include/kernels/elementwise_functions/abs.hpp
similarity index 100%
rename from dpnp/tensor/libtensor/include/kernels/elementwise_functions/abs.hpp
rename to dpnp/libtensor/include/kernels/elementwise_functions/abs.hpp
diff --git a/dpnp/tensor/libtensor/include/kernels/elementwise_functions/acos.hpp b/dpnp/libtensor/include/kernels/elementwise_functions/acos.hpp
similarity index 100%
rename from dpnp/tensor/libtensor/include/kernels/elementwise_functions/acos.hpp
rename to dpnp/libtensor/include/kernels/elementwise_functions/acos.hpp
diff --git a/dpnp/tensor/libtensor/include/kernels/elementwise_functions/acosh.hpp b/dpnp/libtensor/include/kernels/elementwise_functions/acosh.hpp
similarity index 100%
rename from dpnp/tensor/libtensor/include/kernels/elementwise_functions/acosh.hpp
rename to dpnp/libtensor/include/kernels/elementwise_functions/acosh.hpp
diff --git a/dpnp/tensor/libtensor/include/kernels/elementwise_functions/add.hpp b/dpnp/libtensor/include/kernels/elementwise_functions/add.hpp
similarity index 100%
rename from dpnp/tensor/libtensor/include/kernels/elementwise_functions/add.hpp
rename to dpnp/libtensor/include/kernels/elementwise_functions/add.hpp
diff --git a/dpnp/tensor/libtensor/include/kernels/elementwise_functions/angle.hpp b/dpnp/libtensor/include/kernels/elementwise_functions/angle.hpp
similarity index 100%
rename from dpnp/tensor/libtensor/include/kernels/elementwise_functions/angle.hpp
rename to dpnp/libtensor/include/kernels/elementwise_functions/angle.hpp
diff --git a/dpnp/tensor/libtensor/include/kernels/elementwise_functions/asin.hpp b/dpnp/libtensor/include/kernels/elementwise_functions/asin.hpp
similarity index 100%
rename from dpnp/tensor/libtensor/include/kernels/elementwise_functions/asin.hpp
rename to dpnp/libtensor/include/kernels/elementwise_functions/asin.hpp
diff --git a/dpnp/tensor/libtensor/include/kernels/elementwise_functions/asinh.hpp b/dpnp/libtensor/include/kernels/elementwise_functions/asinh.hpp
similarity index 100%
rename from dpnp/tensor/libtensor/include/kernels/elementwise_functions/asinh.hpp
rename to dpnp/libtensor/include/kernels/elementwise_functions/asinh.hpp
diff --git a/dpnp/tensor/libtensor/include/kernels/elementwise_functions/atan.hpp b/dpnp/libtensor/include/kernels/elementwise_functions/atan.hpp
similarity index 100%
rename from dpnp/tensor/libtensor/include/kernels/elementwise_functions/atan.hpp
rename to dpnp/libtensor/include/kernels/elementwise_functions/atan.hpp
diff --git a/dpnp/tensor/libtensor/include/kernels/elementwise_functions/atan2.hpp b/dpnp/libtensor/include/kernels/elementwise_functions/atan2.hpp
similarity index 100%
rename from dpnp/tensor/libtensor/include/kernels/elementwise_functions/atan2.hpp
rename to dpnp/libtensor/include/kernels/elementwise_functions/atan2.hpp
diff --git a/dpnp/tensor/libtensor/include/kernels/elementwise_functions/atanh.hpp b/dpnp/libtensor/include/kernels/elementwise_functions/atanh.hpp
similarity index 100%
rename from dpnp/tensor/libtensor/include/kernels/elementwise_functions/atanh.hpp
rename to dpnp/libtensor/include/kernels/elementwise_functions/atanh.hpp
diff --git a/dpnp/tensor/libtensor/include/kernels/elementwise_functions/bitwise_and.hpp b/dpnp/libtensor/include/kernels/elementwise_functions/bitwise_and.hpp
similarity index 100%
rename from dpnp/tensor/libtensor/include/kernels/elementwise_functions/bitwise_and.hpp
rename to dpnp/libtensor/include/kernels/elementwise_functions/bitwise_and.hpp
diff --git a/dpnp/backend/kernels/elementwise_functions/bitwise_count.hpp b/dpnp/libtensor/include/kernels/elementwise_functions/bitwise_count.hpp
similarity index 96%
rename from dpnp/backend/kernels/elementwise_functions/bitwise_count.hpp
rename to dpnp/libtensor/include/kernels/elementwise_functions/bitwise_count.hpp
index d73d9303145e..3201a8404af2 100644
--- a/dpnp/backend/kernels/elementwise_functions/bitwise_count.hpp
+++ b/dpnp/libtensor/include/kernels/elementwise_functions/bitwise_count.hpp
@@ -33,7 +33,7 @@
// dpnp tensor headers
#include "utils/type_utils.hpp"
-namespace dpnp::kernels::bitwise_count
+namespace dpnp::tensor::kernels::bitwise_count
{
namespace tu_ns = dpnp::tensor::type_utils;
@@ -59,4 +59,4 @@ struct BitwiseCountFunctor
}
}
};
-} // namespace dpnp::kernels::bitwise_count
+} // namespace dpnp::tensor::kernels::bitwise_count
diff --git a/dpnp/tensor/libtensor/include/kernels/elementwise_functions/bitwise_invert.hpp b/dpnp/libtensor/include/kernels/elementwise_functions/bitwise_invert.hpp
similarity index 100%
rename from dpnp/tensor/libtensor/include/kernels/elementwise_functions/bitwise_invert.hpp
rename to dpnp/libtensor/include/kernels/elementwise_functions/bitwise_invert.hpp
diff --git a/dpnp/tensor/libtensor/include/kernels/elementwise_functions/bitwise_left_shift.hpp b/dpnp/libtensor/include/kernels/elementwise_functions/bitwise_left_shift.hpp
similarity index 100%
rename from dpnp/tensor/libtensor/include/kernels/elementwise_functions/bitwise_left_shift.hpp
rename to dpnp/libtensor/include/kernels/elementwise_functions/bitwise_left_shift.hpp
diff --git a/dpnp/tensor/libtensor/include/kernels/elementwise_functions/bitwise_or.hpp b/dpnp/libtensor/include/kernels/elementwise_functions/bitwise_or.hpp
similarity index 100%
rename from dpnp/tensor/libtensor/include/kernels/elementwise_functions/bitwise_or.hpp
rename to dpnp/libtensor/include/kernels/elementwise_functions/bitwise_or.hpp
diff --git a/dpnp/tensor/libtensor/include/kernels/elementwise_functions/bitwise_right_shift.hpp b/dpnp/libtensor/include/kernels/elementwise_functions/bitwise_right_shift.hpp
similarity index 100%
rename from dpnp/tensor/libtensor/include/kernels/elementwise_functions/bitwise_right_shift.hpp
rename to dpnp/libtensor/include/kernels/elementwise_functions/bitwise_right_shift.hpp
diff --git a/dpnp/tensor/libtensor/include/kernels/elementwise_functions/bitwise_xor.hpp b/dpnp/libtensor/include/kernels/elementwise_functions/bitwise_xor.hpp
similarity index 100%
rename from dpnp/tensor/libtensor/include/kernels/elementwise_functions/bitwise_xor.hpp
rename to dpnp/libtensor/include/kernels/elementwise_functions/bitwise_xor.hpp
diff --git a/dpnp/tensor/libtensor/include/kernels/elementwise_functions/cabs_impl.hpp b/dpnp/libtensor/include/kernels/elementwise_functions/cabs_impl.hpp
similarity index 100%
rename from dpnp/tensor/libtensor/include/kernels/elementwise_functions/cabs_impl.hpp
rename to dpnp/libtensor/include/kernels/elementwise_functions/cabs_impl.hpp
diff --git a/dpnp/tensor/libtensor/include/kernels/elementwise_functions/cbrt.hpp b/dpnp/libtensor/include/kernels/elementwise_functions/cbrt.hpp
similarity index 100%
rename from dpnp/tensor/libtensor/include/kernels/elementwise_functions/cbrt.hpp
rename to dpnp/libtensor/include/kernels/elementwise_functions/cbrt.hpp
diff --git a/dpnp/tensor/libtensor/include/kernels/elementwise_functions/ceil.hpp b/dpnp/libtensor/include/kernels/elementwise_functions/ceil.hpp
similarity index 100%
rename from dpnp/tensor/libtensor/include/kernels/elementwise_functions/ceil.hpp
rename to dpnp/libtensor/include/kernels/elementwise_functions/ceil.hpp
diff --git a/dpnp/tensor/libtensor/include/kernels/elementwise_functions/common.hpp b/dpnp/libtensor/include/kernels/elementwise_functions/common.hpp
similarity index 100%
rename from dpnp/tensor/libtensor/include/kernels/elementwise_functions/common.hpp
rename to dpnp/libtensor/include/kernels/elementwise_functions/common.hpp
diff --git a/dpnp/tensor/libtensor/include/kernels/elementwise_functions/common_detail.hpp b/dpnp/libtensor/include/kernels/elementwise_functions/common_detail.hpp
similarity index 100%
rename from dpnp/tensor/libtensor/include/kernels/elementwise_functions/common_detail.hpp
rename to dpnp/libtensor/include/kernels/elementwise_functions/common_detail.hpp
diff --git a/dpnp/tensor/libtensor/include/kernels/elementwise_functions/common_inplace.hpp b/dpnp/libtensor/include/kernels/elementwise_functions/common_inplace.hpp
similarity index 100%
rename from dpnp/tensor/libtensor/include/kernels/elementwise_functions/common_inplace.hpp
rename to dpnp/libtensor/include/kernels/elementwise_functions/common_inplace.hpp
diff --git a/dpnp/backend/extensions/elementwise_functions/common.hpp b/dpnp/libtensor/include/kernels/elementwise_functions/common_two_outputs.hpp
similarity index 97%
rename from dpnp/backend/extensions/elementwise_functions/common.hpp
rename to dpnp/libtensor/include/kernels/elementwise_functions/common_two_outputs.hpp
index 8cfdb6b46890..a0dd592a8102 100644
--- a/dpnp/backend/extensions/elementwise_functions/common.hpp
+++ b/dpnp/libtensor/include/kernels/elementwise_functions/common_two_outputs.hpp
@@ -25,6 +25,13 @@
// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
// THE POSSIBILITY OF SUCH DAMAGE.
//*****************************************************************************
+//
+//===---------------------------------------------------------------------===//
+///
+/// \file
+/// This file defines common code for elementwise tensor operations with two
+/// output arrays.
+//===---------------------------------------------------------------------===//
#pragma once
@@ -36,19 +43,16 @@
#include
-// dpnp tensor headers
#include "kernels/alignment.hpp"
#include "kernels/elementwise_functions/common.hpp"
#include "utils/sycl_utils.hpp"
-namespace dpnp::extensions::py_internal::elementwise_common
+namespace dpnp::tensor::kernels::elementwise_common
{
using dpnp::tensor::kernels::alignment_utils::disabled_sg_loadstore_wrapper_krn;
using dpnp::tensor::kernels::alignment_utils::is_aligned;
using dpnp::tensor::kernels::alignment_utils::required_alignment;
-using dpnp::tensor::kernels::elementwise_common::select_lws;
-
using dpnp::tensor::sycl_utils::sub_group_load;
using dpnp::tensor::sycl_utils::sub_group_store;
@@ -56,8 +60,8 @@ using dpnp::tensor::sycl_utils::sub_group_store;
* @brief Functor for evaluation of a unary function with two output arrays on
* contiguous arrays.
*
- * @note It extends UnaryContigFunctor from
- * dpnp::tensor::kernels::elementwise_common namespace.
+ * @note It extends UnaryContigFunctor with support of
+ * the two output arrays.
*/
template class UnaryTwoOutputsType,
@@ -599,8 +603,8 @@ sycl::event
* @brief Function to submit a kernel for unary functor with two output arrays
* on strided data.
*
- * @note It extends unary_strided_impl from
- * dpnp::tensor::kernels::elementwise_common namespace.
+ * @note It extends unary_strided_impl with support of
+ * the two output arrays.
*/
template class UnaryTwoOutputsType,
@@ -655,8 +659,8 @@ sycl::event unary_two_outputs_strided_impl(
* @brief Function to submit a kernel for binary functor with two output arrays
* on contiguous arrays.
*
- * @note It extends binary_contig_impl from
- * dpnp::tensor::kernels::elementwise_common namespace.
+ * @note It extends binary_contig_impl with support of
+ * the two output arrays.
*/
template <
typename argTy1,
@@ -748,8 +752,8 @@ sycl::event
* @brief Function to submit a kernel for binary functor with two output arrays
* on strided data.
*
- * @note It extends binary_strided_impl from
- * dpnp::tensor::kernels::elementwise_common namespace.
+ * @note It extends binary_strided_impl with support of
+ * the two output arrays.
*/
template &,
const std::vector &);
-} // namespace dpnp::extensions::py_internal::elementwise_common
+} // namespace dpnp::tensor::kernels::elementwise_common
diff --git a/dpnp/tensor/libtensor/include/kernels/elementwise_functions/complex_math.hpp b/dpnp/libtensor/include/kernels/elementwise_functions/complex_math.hpp
similarity index 100%
rename from dpnp/tensor/libtensor/include/kernels/elementwise_functions/complex_math.hpp
rename to dpnp/libtensor/include/kernels/elementwise_functions/complex_math.hpp
diff --git a/dpnp/tensor/libtensor/include/kernels/elementwise_functions/conj.hpp b/dpnp/libtensor/include/kernels/elementwise_functions/conj.hpp
similarity index 100%
rename from dpnp/tensor/libtensor/include/kernels/elementwise_functions/conj.hpp
rename to dpnp/libtensor/include/kernels/elementwise_functions/conj.hpp
diff --git a/dpnp/tensor/libtensor/include/kernels/elementwise_functions/copysign.hpp b/dpnp/libtensor/include/kernels/elementwise_functions/copysign.hpp
similarity index 100%
rename from dpnp/tensor/libtensor/include/kernels/elementwise_functions/copysign.hpp
rename to dpnp/libtensor/include/kernels/elementwise_functions/copysign.hpp
diff --git a/dpnp/tensor/libtensor/include/kernels/elementwise_functions/cos.hpp b/dpnp/libtensor/include/kernels/elementwise_functions/cos.hpp
similarity index 100%
rename from dpnp/tensor/libtensor/include/kernels/elementwise_functions/cos.hpp
rename to dpnp/libtensor/include/kernels/elementwise_functions/cos.hpp
diff --git a/dpnp/tensor/libtensor/include/kernels/elementwise_functions/cosh.hpp b/dpnp/libtensor/include/kernels/elementwise_functions/cosh.hpp
similarity index 100%
rename from dpnp/tensor/libtensor/include/kernels/elementwise_functions/cosh.hpp
rename to dpnp/libtensor/include/kernels/elementwise_functions/cosh.hpp
diff --git a/dpnp/backend/kernels/elementwise_functions/degrees.hpp b/dpnp/libtensor/include/kernels/elementwise_functions/degrees.hpp
similarity index 96%
rename from dpnp/backend/kernels/elementwise_functions/degrees.hpp
rename to dpnp/libtensor/include/kernels/elementwise_functions/degrees.hpp
index 8493a1821a6a..664faf0e0ab2 100644
--- a/dpnp/backend/kernels/elementwise_functions/degrees.hpp
+++ b/dpnp/libtensor/include/kernels/elementwise_functions/degrees.hpp
@@ -30,7 +30,7 @@
#include
-namespace dpnp::kernels::degrees
+namespace dpnp::tensor::kernels::degrees
{
template
struct DegreesFunctor
@@ -52,4 +52,4 @@ struct DegreesFunctor
return sycl::degrees(x);
}
};
-} // namespace dpnp::kernels::degrees
+} // namespace dpnp::tensor::kernels::degrees
diff --git a/dpnp/backend/kernels/elementwise_functions/divmod.hpp b/dpnp/libtensor/include/kernels/elementwise_functions/divmod.hpp
similarity index 98%
rename from dpnp/backend/kernels/elementwise_functions/divmod.hpp
rename to dpnp/libtensor/include/kernels/elementwise_functions/divmod.hpp
index 37a79cffb7f2..5e0fd3ce9a27 100644
--- a/dpnp/backend/kernels/elementwise_functions/divmod.hpp
+++ b/dpnp/libtensor/include/kernels/elementwise_functions/divmod.hpp
@@ -33,7 +33,7 @@
#include
-namespace dpnp::kernels::divmod
+namespace dpnp::tensor::kernels::divmod
{
template
struct DivmodFunctor
@@ -117,4 +117,4 @@ struct DivmodFunctor
private:
bool l_xor(bool b1, bool b2) const { return (b1 != b2); }
};
-} // namespace dpnp::kernels::divmod
+} // namespace dpnp::tensor::kernels::divmod
diff --git a/dpnp/tensor/libtensor/include/kernels/elementwise_functions/equal.hpp b/dpnp/libtensor/include/kernels/elementwise_functions/equal.hpp
similarity index 100%
rename from dpnp/tensor/libtensor/include/kernels/elementwise_functions/equal.hpp
rename to dpnp/libtensor/include/kernels/elementwise_functions/equal.hpp
diff --git a/dpnp/backend/kernels/elementwise_functions/erf.hpp b/dpnp/libtensor/include/kernels/elementwise_functions/erf.hpp
similarity index 98%
rename from dpnp/backend/kernels/elementwise_functions/erf.hpp
rename to dpnp/libtensor/include/kernels/elementwise_functions/erf.hpp
index 4ead1174a0c1..d73ac7d30b72 100644
--- a/dpnp/backend/kernels/elementwise_functions/erf.hpp
+++ b/dpnp/libtensor/include/kernels/elementwise_functions/erf.hpp
@@ -46,7 +46,7 @@
#include "erfinv.hpp"
#endif
-namespace dpnp::kernels::erfs
+namespace dpnp::tensor::kernels::erfs
{
template
struct BaseFunctor
@@ -97,4 +97,4 @@ MACRO_DEFINE_FUNCTOR(sycl::erfc, Erfc);
MACRO_DEFINE_FUNCTOR(erfcx, Erfcx);
MACRO_DEFINE_FUNCTOR(erfinv, Erfinv);
MACRO_DEFINE_FUNCTOR(erfcinv, Erfcinv);
-} // namespace dpnp::kernels::erfs
+} // namespace dpnp::tensor::kernels::erfs
diff --git a/dpnp/backend/kernels/elementwise_functions/erfcx.hpp b/dpnp/libtensor/include/kernels/elementwise_functions/erfcx.hpp
similarity index 99%
rename from dpnp/backend/kernels/elementwise_functions/erfcx.hpp
rename to dpnp/libtensor/include/kernels/elementwise_functions/erfcx.hpp
index 1dd3205d3484..cc7cdcab296d 100644
--- a/dpnp/backend/kernels/elementwise_functions/erfcx.hpp
+++ b/dpnp/libtensor/include/kernels/elementwise_functions/erfcx.hpp
@@ -31,7 +31,7 @@
#include
#include
-namespace dpnp::kernels::erfs::impl
+namespace dpnp::tensor::kernels::erfs::impl
{
/**
Steven G. Johnson, October 2012.
@@ -1648,4 +1648,4 @@ inline Tp erfcx(Tp x)
: (x < -6.1 ? 2 * sycl::exp(x * x)
: 2 * sycl::exp(x * x) - erfcx_y100(400 / (4 - x)));
}
-} // namespace dpnp::kernels::erfs::impl
+} // namespace dpnp::tensor::kernels::erfs::impl
diff --git a/dpnp/backend/kernels/elementwise_functions/erfinv.hpp b/dpnp/libtensor/include/kernels/elementwise_functions/erfinv.hpp
similarity index 98%
rename from dpnp/backend/kernels/elementwise_functions/erfinv.hpp
rename to dpnp/libtensor/include/kernels/elementwise_functions/erfinv.hpp
index 80409d6c14a4..f14ca082e8c4 100644
--- a/dpnp/backend/kernels/elementwise_functions/erfinv.hpp
+++ b/dpnp/libtensor/include/kernels/elementwise_functions/erfinv.hpp
@@ -31,7 +31,7 @@
#include
#include
-namespace dpnp::kernels::erfs::impl
+namespace dpnp::tensor::kernels::erfs::impl
{
template
inline Tp polevl(Tp x, const Tp *coeff, int i)
@@ -216,4 +216,4 @@ inline Tp erfcinv(Tp y)
}
return std::numeric_limits::quiet_NaN();
}
-} // namespace dpnp::kernels::erfs::impl
+} // namespace dpnp::tensor::kernels::erfs::impl
diff --git a/dpnp/tensor/libtensor/include/kernels/elementwise_functions/exp.hpp b/dpnp/libtensor/include/kernels/elementwise_functions/exp.hpp
similarity index 100%
rename from dpnp/tensor/libtensor/include/kernels/elementwise_functions/exp.hpp
rename to dpnp/libtensor/include/kernels/elementwise_functions/exp.hpp
diff --git a/dpnp/tensor/libtensor/include/kernels/elementwise_functions/exp2.hpp b/dpnp/libtensor/include/kernels/elementwise_functions/exp2.hpp
similarity index 100%
rename from dpnp/tensor/libtensor/include/kernels/elementwise_functions/exp2.hpp
rename to dpnp/libtensor/include/kernels/elementwise_functions/exp2.hpp
diff --git a/dpnp/tensor/libtensor/include/kernels/elementwise_functions/expm1.hpp b/dpnp/libtensor/include/kernels/elementwise_functions/expm1.hpp
similarity index 100%
rename from dpnp/tensor/libtensor/include/kernels/elementwise_functions/expm1.hpp
rename to dpnp/libtensor/include/kernels/elementwise_functions/expm1.hpp
diff --git a/dpnp/backend/kernels/elementwise_functions/fabs.hpp b/dpnp/libtensor/include/kernels/elementwise_functions/fabs.hpp
similarity index 96%
rename from dpnp/backend/kernels/elementwise_functions/fabs.hpp
rename to dpnp/libtensor/include/kernels/elementwise_functions/fabs.hpp
index 13c5e81898b7..4cf5707972b3 100644
--- a/dpnp/backend/kernels/elementwise_functions/fabs.hpp
+++ b/dpnp/libtensor/include/kernels/elementwise_functions/fabs.hpp
@@ -30,7 +30,7 @@
#include
-namespace dpnp::kernels::fabs
+namespace dpnp::tensor::kernels::fabs
{
template
struct FabsFunctor
@@ -46,4 +46,4 @@ struct FabsFunctor
resT operator()(const argT &x) const { return sycl::fabs(x); }
};
-} // namespace dpnp::kernels::fabs
+} // namespace dpnp::tensor::kernels::fabs
diff --git a/dpnp/tensor/libtensor/include/kernels/elementwise_functions/floor.hpp b/dpnp/libtensor/include/kernels/elementwise_functions/floor.hpp
similarity index 100%
rename from dpnp/tensor/libtensor/include/kernels/elementwise_functions/floor.hpp
rename to dpnp/libtensor/include/kernels/elementwise_functions/floor.hpp
diff --git a/dpnp/tensor/libtensor/include/kernels/elementwise_functions/floor_divide.hpp b/dpnp/libtensor/include/kernels/elementwise_functions/floor_divide.hpp
similarity index 100%
rename from dpnp/tensor/libtensor/include/kernels/elementwise_functions/floor_divide.hpp
rename to dpnp/libtensor/include/kernels/elementwise_functions/floor_divide.hpp
diff --git a/dpnp/backend/kernels/elementwise_functions/fmax.hpp b/dpnp/libtensor/include/kernels/elementwise_functions/fmax.hpp
similarity index 97%
rename from dpnp/backend/kernels/elementwise_functions/fmax.hpp
rename to dpnp/libtensor/include/kernels/elementwise_functions/fmax.hpp
index b7521c1367fe..3ce9747daa8f 100644
--- a/dpnp/backend/kernels/elementwise_functions/fmax.hpp
+++ b/dpnp/libtensor/include/kernels/elementwise_functions/fmax.hpp
@@ -34,7 +34,7 @@
#include "utils/math_utils.hpp"
#include "utils/type_utils.hpp"
-namespace dpnp::kernels::fmax
+namespace dpnp::tensor::kernels::fmax
{
namespace mu_ns = dpnp::tensor::math_utils;
namespace tu_ns = dpnp::tensor::type_utils;
@@ -81,4 +81,4 @@ struct FmaxFunctor
return sycl::fmax(in1, in2);
}
};
-} // namespace dpnp::kernels::fmax
+} // namespace dpnp::tensor::kernels::fmax
diff --git a/dpnp/backend/kernels/elementwise_functions/fmin.hpp b/dpnp/libtensor/include/kernels/elementwise_functions/fmin.hpp
similarity index 97%
rename from dpnp/backend/kernels/elementwise_functions/fmin.hpp
rename to dpnp/libtensor/include/kernels/elementwise_functions/fmin.hpp
index 3fdd1a2aa260..d0dbd576a38e 100644
--- a/dpnp/backend/kernels/elementwise_functions/fmin.hpp
+++ b/dpnp/libtensor/include/kernels/elementwise_functions/fmin.hpp
@@ -34,7 +34,7 @@
#include "utils/math_utils.hpp"
#include "utils/type_utils.hpp"
-namespace dpnp::kernels::fmin
+namespace dpnp::tensor::kernels::fmin
{
namespace mu_ns = dpnp::tensor::math_utils;
namespace tu_ns = dpnp::tensor::type_utils;
@@ -81,4 +81,4 @@ struct FminFunctor
return sycl::fmin(in1, in2);
}
};
-} // namespace dpnp::kernels::fmin
+} // namespace dpnp::tensor::kernels::fmin
diff --git a/dpnp/backend/kernels/elementwise_functions/fmod.hpp b/dpnp/libtensor/include/kernels/elementwise_functions/fmod.hpp
similarity index 96%
rename from dpnp/backend/kernels/elementwise_functions/fmod.hpp
rename to dpnp/libtensor/include/kernels/elementwise_functions/fmod.hpp
index e9278f9be41c..9495ed13b1fe 100644
--- a/dpnp/backend/kernels/elementwise_functions/fmod.hpp
+++ b/dpnp/libtensor/include/kernels/elementwise_functions/fmod.hpp
@@ -30,7 +30,7 @@
#include
-namespace dpnp::kernels::fmod
+namespace dpnp::tensor::kernels::fmod
{
template
struct FmodFunctor
@@ -60,4 +60,4 @@ struct FmodFunctor
return sycl::fmod(in1, in2);
}
};
-} // namespace dpnp::kernels::fmod
+} // namespace dpnp::tensor::kernels::fmod
diff --git a/dpnp/backend/kernels/elementwise_functions/frexp.hpp b/dpnp/libtensor/include/kernels/elementwise_functions/frexp.hpp
similarity index 96%
rename from dpnp/backend/kernels/elementwise_functions/frexp.hpp
rename to dpnp/libtensor/include/kernels/elementwise_functions/frexp.hpp
index 8ab800fef15e..ad6acf38fcf3 100644
--- a/dpnp/backend/kernels/elementwise_functions/frexp.hpp
+++ b/dpnp/libtensor/include/kernels/elementwise_functions/frexp.hpp
@@ -30,7 +30,7 @@
#include
-namespace dpnp::kernels::frexp
+namespace dpnp::tensor::kernels::frexp
{
template
struct FrexpFunctor
@@ -50,4 +50,4 @@ struct FrexpFunctor
return sycl::frexp(in, &exp);
}
};
-} // namespace dpnp::kernels::frexp
+} // namespace dpnp::tensor::kernels::frexp
diff --git a/dpnp/backend/kernels/elementwise_functions/gcd.hpp b/dpnp/libtensor/include/kernels/elementwise_functions/gcd.hpp
similarity index 96%
rename from dpnp/backend/kernels/elementwise_functions/gcd.hpp
rename to dpnp/libtensor/include/kernels/elementwise_functions/gcd.hpp
index 5b7e76e5c3c7..632c7bb268b7 100644
--- a/dpnp/backend/kernels/elementwise_functions/gcd.hpp
+++ b/dpnp/libtensor/include/kernels/elementwise_functions/gcd.hpp
@@ -31,7 +31,7 @@
#include
#include
-namespace dpnp::kernels::gcd
+namespace dpnp::tensor::kernels::gcd
{
template
struct GcdFunctor
@@ -47,4 +47,4 @@ struct GcdFunctor
return oneapi::dpl::gcd(in1, in2);
}
};
-} // namespace dpnp::kernels::gcd
+} // namespace dpnp::tensor::kernels::gcd
diff --git a/dpnp/tensor/libtensor/include/kernels/elementwise_functions/greater.hpp b/dpnp/libtensor/include/kernels/elementwise_functions/greater.hpp
similarity index 100%
rename from dpnp/tensor/libtensor/include/kernels/elementwise_functions/greater.hpp
rename to dpnp/libtensor/include/kernels/elementwise_functions/greater.hpp
diff --git a/dpnp/tensor/libtensor/include/kernels/elementwise_functions/greater_equal.hpp b/dpnp/libtensor/include/kernels/elementwise_functions/greater_equal.hpp
similarity index 100%
rename from dpnp/tensor/libtensor/include/kernels/elementwise_functions/greater_equal.hpp
rename to dpnp/libtensor/include/kernels/elementwise_functions/greater_equal.hpp
diff --git a/dpnp/backend/kernels/elementwise_functions/heaviside.hpp b/dpnp/libtensor/include/kernels/elementwise_functions/heaviside.hpp
similarity index 96%
rename from dpnp/backend/kernels/elementwise_functions/heaviside.hpp
rename to dpnp/libtensor/include/kernels/elementwise_functions/heaviside.hpp
index d2f3efbbdcac..2738070ce5c1 100644
--- a/dpnp/backend/kernels/elementwise_functions/heaviside.hpp
+++ b/dpnp/libtensor/include/kernels/elementwise_functions/heaviside.hpp
@@ -34,7 +34,7 @@
#include "utils/math_utils.hpp"
#include "utils/type_utils.hpp"
-namespace dpnp::kernels::heaviside
+namespace dpnp::tensor::kernels::heaviside
{
namespace mu_ns = dpnp::tensor::math_utils;
namespace tu_ns = dpnp::tensor::type_utils;
@@ -57,4 +57,4 @@ struct HeavisideFunctor
return resT(in1 > 0);
}
};
-} // namespace dpnp::kernels::heaviside
+} // namespace dpnp::tensor::kernels::heaviside
diff --git a/dpnp/tensor/libtensor/include/kernels/elementwise_functions/hypot.hpp b/dpnp/libtensor/include/kernels/elementwise_functions/hypot.hpp
similarity index 100%
rename from dpnp/tensor/libtensor/include/kernels/elementwise_functions/hypot.hpp
rename to dpnp/libtensor/include/kernels/elementwise_functions/hypot.hpp
diff --git a/dpnp/backend/kernels/elementwise_functions/i0.hpp b/dpnp/libtensor/include/kernels/elementwise_functions/i0.hpp
similarity index 99%
rename from dpnp/backend/kernels/elementwise_functions/i0.hpp
rename to dpnp/libtensor/include/kernels/elementwise_functions/i0.hpp
index 7b244dd1164d..fa226d2c8384 100644
--- a/dpnp/backend/kernels/elementwise_functions/i0.hpp
+++ b/dpnp/libtensor/include/kernels/elementwise_functions/i0.hpp
@@ -43,7 +43,7 @@
#include
#endif
-namespace dpnp::kernels::i0
+namespace dpnp::tensor::kernels::i0
{
#if defined(__SYCL_EXT_INTEL_MATH_SUPPORT)
using sycl::ext::intel::math::cyl_bessel_i0;
@@ -274,4 +274,4 @@ struct I0Functor
}
}
};
-} // namespace dpnp::kernels::i0
+} // namespace dpnp::tensor::kernels::i0
diff --git a/dpnp/tensor/libtensor/include/kernels/elementwise_functions/imag.hpp b/dpnp/libtensor/include/kernels/elementwise_functions/imag.hpp
similarity index 100%
rename from dpnp/tensor/libtensor/include/kernels/elementwise_functions/imag.hpp
rename to dpnp/libtensor/include/kernels/elementwise_functions/imag.hpp
diff --git a/dpnp/backend/kernels/elementwise_functions/interpolate.hpp b/dpnp/libtensor/include/kernels/elementwise_functions/interpolate.hpp
similarity index 97%
rename from dpnp/backend/kernels/elementwise_functions/interpolate.hpp
rename to dpnp/libtensor/include/kernels/elementwise_functions/interpolate.hpp
index 704820ad3c1e..191e3c5cb32b 100644
--- a/dpnp/backend/kernels/elementwise_functions/interpolate.hpp
+++ b/dpnp/libtensor/include/kernels/elementwise_functions/interpolate.hpp
@@ -35,7 +35,7 @@
#include "ext/common.hpp"
-namespace dpnp::kernels::interpolate
+namespace dpnp::tensor::kernels::interpolate
{
using ext::common::IsNan;
@@ -106,4 +106,4 @@ class InterpolateFunctor
}
}
};
-} // namespace dpnp::kernels::interpolate
+} // namespace dpnp::tensor::kernels::interpolate
diff --git a/dpnp/backend/kernels/elementwise_functions/isclose.hpp b/dpnp/libtensor/include/kernels/elementwise_functions/isclose.hpp
similarity index 99%
rename from dpnp/backend/kernels/elementwise_functions/isclose.hpp
rename to dpnp/libtensor/include/kernels/elementwise_functions/isclose.hpp
index 883d4081f86c..00a5ea715427 100644
--- a/dpnp/backend/kernels/elementwise_functions/isclose.hpp
+++ b/dpnp/libtensor/include/kernels/elementwise_functions/isclose.hpp
@@ -42,7 +42,7 @@
#include "utils/sycl_utils.hpp"
#include "utils/type_utils.hpp"
-namespace dpnp::kernels::isclose
+namespace dpnp::tensor::kernels::isclose
{
template
@@ -335,4 +335,4 @@ sycl::event
return comp_ev;
}
-} // namespace dpnp::kernels::isclose
+} // namespace dpnp::tensor::kernels::isclose
diff --git a/dpnp/tensor/libtensor/include/kernels/elementwise_functions/isfinite.hpp b/dpnp/libtensor/include/kernels/elementwise_functions/isfinite.hpp
similarity index 100%
rename from dpnp/tensor/libtensor/include/kernels/elementwise_functions/isfinite.hpp
rename to dpnp/libtensor/include/kernels/elementwise_functions/isfinite.hpp
diff --git a/dpnp/tensor/libtensor/include/kernels/elementwise_functions/isinf.hpp b/dpnp/libtensor/include/kernels/elementwise_functions/isinf.hpp
similarity index 100%
rename from dpnp/tensor/libtensor/include/kernels/elementwise_functions/isinf.hpp
rename to dpnp/libtensor/include/kernels/elementwise_functions/isinf.hpp
diff --git a/dpnp/tensor/libtensor/include/kernels/elementwise_functions/isnan.hpp b/dpnp/libtensor/include/kernels/elementwise_functions/isnan.hpp
similarity index 100%
rename from dpnp/tensor/libtensor/include/kernels/elementwise_functions/isnan.hpp
rename to dpnp/libtensor/include/kernels/elementwise_functions/isnan.hpp
diff --git a/dpnp/backend/kernels/elementwise_functions/lcm.hpp b/dpnp/libtensor/include/kernels/elementwise_functions/lcm.hpp
similarity index 96%
rename from dpnp/backend/kernels/elementwise_functions/lcm.hpp
rename to dpnp/libtensor/include/kernels/elementwise_functions/lcm.hpp
index 5ea8df3789b7..2635f21b3d6a 100644
--- a/dpnp/backend/kernels/elementwise_functions/lcm.hpp
+++ b/dpnp/libtensor/include/kernels/elementwise_functions/lcm.hpp
@@ -31,7 +31,7 @@
#include
#include
-namespace dpnp::kernels::lcm
+namespace dpnp::tensor::kernels::lcm
{
template
struct LcmFunctor
@@ -59,4 +59,4 @@ struct LcmFunctor
// return oneapi::dpl::lcm(in1, in2);
}
};
-} // namespace dpnp::kernels::lcm
+} // namespace dpnp::tensor::kernels::lcm
diff --git a/dpnp/backend/kernels/elementwise_functions/ldexp.hpp b/dpnp/libtensor/include/kernels/elementwise_functions/ldexp.hpp
similarity index 96%
rename from dpnp/backend/kernels/elementwise_functions/ldexp.hpp
rename to dpnp/libtensor/include/kernels/elementwise_functions/ldexp.hpp
index 12ecd10e43ae..beaa7bb302a4 100644
--- a/dpnp/backend/kernels/elementwise_functions/ldexp.hpp
+++ b/dpnp/libtensor/include/kernels/elementwise_functions/ldexp.hpp
@@ -34,7 +34,7 @@
#include "utils/math_utils.hpp"
#include "utils/type_utils.hpp"
-namespace dpnp::kernels::ldexp
+namespace dpnp::tensor::kernels::ldexp
{
template
struct LdexpFunctor
@@ -55,4 +55,4 @@ struct LdexpFunctor
return resT(0);
}
};
-} // namespace dpnp::kernels::ldexp
+} // namespace dpnp::tensor::kernels::ldexp
diff --git a/dpnp/tensor/libtensor/include/kernels/elementwise_functions/less.hpp b/dpnp/libtensor/include/kernels/elementwise_functions/less.hpp
similarity index 100%
rename from dpnp/tensor/libtensor/include/kernels/elementwise_functions/less.hpp
rename to dpnp/libtensor/include/kernels/elementwise_functions/less.hpp
diff --git a/dpnp/tensor/libtensor/include/kernels/elementwise_functions/less_equal.hpp b/dpnp/libtensor/include/kernels/elementwise_functions/less_equal.hpp
similarity index 100%
rename from dpnp/tensor/libtensor/include/kernels/elementwise_functions/less_equal.hpp
rename to dpnp/libtensor/include/kernels/elementwise_functions/less_equal.hpp
diff --git a/dpnp/tensor/libtensor/include/kernels/elementwise_functions/log.hpp b/dpnp/libtensor/include/kernels/elementwise_functions/log.hpp
similarity index 100%
rename from dpnp/tensor/libtensor/include/kernels/elementwise_functions/log.hpp
rename to dpnp/libtensor/include/kernels/elementwise_functions/log.hpp
diff --git a/dpnp/tensor/libtensor/include/kernels/elementwise_functions/log10.hpp b/dpnp/libtensor/include/kernels/elementwise_functions/log10.hpp
similarity index 100%
rename from dpnp/tensor/libtensor/include/kernels/elementwise_functions/log10.hpp
rename to dpnp/libtensor/include/kernels/elementwise_functions/log10.hpp
diff --git a/dpnp/tensor/libtensor/include/kernels/elementwise_functions/log1p.hpp b/dpnp/libtensor/include/kernels/elementwise_functions/log1p.hpp
similarity index 100%
rename from dpnp/tensor/libtensor/include/kernels/elementwise_functions/log1p.hpp
rename to dpnp/libtensor/include/kernels/elementwise_functions/log1p.hpp
diff --git a/dpnp/tensor/libtensor/include/kernels/elementwise_functions/log2.hpp b/dpnp/libtensor/include/kernels/elementwise_functions/log2.hpp
similarity index 100%
rename from dpnp/tensor/libtensor/include/kernels/elementwise_functions/log2.hpp
rename to dpnp/libtensor/include/kernels/elementwise_functions/log2.hpp
diff --git a/dpnp/tensor/libtensor/include/kernels/elementwise_functions/logaddexp.hpp b/dpnp/libtensor/include/kernels/elementwise_functions/logaddexp.hpp
similarity index 100%
rename from dpnp/tensor/libtensor/include/kernels/elementwise_functions/logaddexp.hpp
rename to dpnp/libtensor/include/kernels/elementwise_functions/logaddexp.hpp
diff --git a/dpnp/backend/kernels/elementwise_functions/logaddexp2.hpp b/dpnp/libtensor/include/kernels/elementwise_functions/logaddexp2.hpp
similarity index 96%
rename from dpnp/backend/kernels/elementwise_functions/logaddexp2.hpp
rename to dpnp/libtensor/include/kernels/elementwise_functions/logaddexp2.hpp
index 2287f6cd7857..8e45d789ee53 100644
--- a/dpnp/backend/kernels/elementwise_functions/logaddexp2.hpp
+++ b/dpnp/libtensor/include/kernels/elementwise_functions/logaddexp2.hpp
@@ -31,7 +31,7 @@
#include
#include
-namespace dpnp::kernels::logaddexp2
+namespace dpnp::tensor::kernels::logaddexp2
{
constexpr double log2e = 1.442695040888963407359924681001892137;
@@ -70,4 +70,4 @@ struct Logaddexp2Functor
return logaddexp2(in1, in2);
}
};
-} // namespace dpnp::kernels::logaddexp2
+} // namespace dpnp::tensor::kernels::logaddexp2
diff --git a/dpnp/tensor/libtensor/include/kernels/elementwise_functions/logical_and.hpp b/dpnp/libtensor/include/kernels/elementwise_functions/logical_and.hpp
similarity index 100%
rename from dpnp/tensor/libtensor/include/kernels/elementwise_functions/logical_and.hpp
rename to dpnp/libtensor/include/kernels/elementwise_functions/logical_and.hpp
diff --git a/dpnp/tensor/libtensor/include/kernels/elementwise_functions/logical_not.hpp b/dpnp/libtensor/include/kernels/elementwise_functions/logical_not.hpp
similarity index 100%
rename from dpnp/tensor/libtensor/include/kernels/elementwise_functions/logical_not.hpp
rename to dpnp/libtensor/include/kernels/elementwise_functions/logical_not.hpp
diff --git a/dpnp/tensor/libtensor/include/kernels/elementwise_functions/logical_or.hpp b/dpnp/libtensor/include/kernels/elementwise_functions/logical_or.hpp
similarity index 100%
rename from dpnp/tensor/libtensor/include/kernels/elementwise_functions/logical_or.hpp
rename to dpnp/libtensor/include/kernels/elementwise_functions/logical_or.hpp
diff --git a/dpnp/tensor/libtensor/include/kernels/elementwise_functions/logical_xor.hpp b/dpnp/libtensor/include/kernels/elementwise_functions/logical_xor.hpp
similarity index 100%
rename from dpnp/tensor/libtensor/include/kernels/elementwise_functions/logical_xor.hpp
rename to dpnp/libtensor/include/kernels/elementwise_functions/logical_xor.hpp
diff --git a/dpnp/tensor/libtensor/include/kernels/elementwise_functions/maximum.hpp b/dpnp/libtensor/include/kernels/elementwise_functions/maximum.hpp
similarity index 100%
rename from dpnp/tensor/libtensor/include/kernels/elementwise_functions/maximum.hpp
rename to dpnp/libtensor/include/kernels/elementwise_functions/maximum.hpp
diff --git a/dpnp/tensor/libtensor/include/kernels/elementwise_functions/minimum.hpp b/dpnp/libtensor/include/kernels/elementwise_functions/minimum.hpp
similarity index 100%
rename from dpnp/tensor/libtensor/include/kernels/elementwise_functions/minimum.hpp
rename to dpnp/libtensor/include/kernels/elementwise_functions/minimum.hpp
diff --git a/dpnp/backend/kernels/elementwise_functions/modf.hpp b/dpnp/libtensor/include/kernels/elementwise_functions/modf.hpp
similarity index 96%
rename from dpnp/backend/kernels/elementwise_functions/modf.hpp
rename to dpnp/libtensor/include/kernels/elementwise_functions/modf.hpp
index 07a8ef65e55e..454c295de32f 100644
--- a/dpnp/backend/kernels/elementwise_functions/modf.hpp
+++ b/dpnp/libtensor/include/kernels/elementwise_functions/modf.hpp
@@ -30,7 +30,7 @@
#include
-namespace dpnp::kernels::modf
+namespace dpnp::tensor::kernels::modf
{
template
struct ModfFunctor
@@ -50,4 +50,4 @@ struct ModfFunctor
return sycl::modf(in, &integral);
}
};
-} // namespace dpnp::kernels::modf
+} // namespace dpnp::tensor::kernels::modf
diff --git a/dpnp/tensor/libtensor/include/kernels/elementwise_functions/multiply.hpp b/dpnp/libtensor/include/kernels/elementwise_functions/multiply.hpp
similarity index 100%
rename from dpnp/tensor/libtensor/include/kernels/elementwise_functions/multiply.hpp
rename to dpnp/libtensor/include/kernels/elementwise_functions/multiply.hpp
diff --git a/dpnp/backend/kernels/elementwise_functions/nan_to_num.hpp b/dpnp/libtensor/include/kernels/elementwise_functions/nan_to_num.hpp
similarity index 99%
rename from dpnp/backend/kernels/elementwise_functions/nan_to_num.hpp
rename to dpnp/libtensor/include/kernels/elementwise_functions/nan_to_num.hpp
index edbbe7f028b8..095d75e4a4fc 100644
--- a/dpnp/backend/kernels/elementwise_functions/nan_to_num.hpp
+++ b/dpnp/libtensor/include/kernels/elementwise_functions/nan_to_num.hpp
@@ -41,7 +41,7 @@
#include "utils/sycl_utils.hpp"
#include "utils/type_utils.hpp"
-namespace dpnp::kernels::nan_to_num
+namespace dpnp::tensor::kernels::nan_to_num
{
template
@@ -284,4 +284,4 @@ sycl::event nan_to_num_contig_impl(sycl::queue &exec_q,
return comp_ev;
}
-} // namespace dpnp::kernels::nan_to_num
+} // namespace dpnp::tensor::kernels::nan_to_num
diff --git a/dpnp/tensor/libtensor/include/kernels/elementwise_functions/negative.hpp b/dpnp/libtensor/include/kernels/elementwise_functions/negative.hpp
similarity index 100%
rename from dpnp/tensor/libtensor/include/kernels/elementwise_functions/negative.hpp
rename to dpnp/libtensor/include/kernels/elementwise_functions/negative.hpp
diff --git a/dpnp/tensor/libtensor/include/kernels/elementwise_functions/nextafter.hpp b/dpnp/libtensor/include/kernels/elementwise_functions/nextafter.hpp
similarity index 100%
rename from dpnp/tensor/libtensor/include/kernels/elementwise_functions/nextafter.hpp
rename to dpnp/libtensor/include/kernels/elementwise_functions/nextafter.hpp
diff --git a/dpnp/tensor/libtensor/include/kernels/elementwise_functions/not_equal.hpp b/dpnp/libtensor/include/kernels/elementwise_functions/not_equal.hpp
similarity index 100%
rename from dpnp/tensor/libtensor/include/kernels/elementwise_functions/not_equal.hpp
rename to dpnp/libtensor/include/kernels/elementwise_functions/not_equal.hpp
diff --git a/dpnp/tensor/libtensor/include/kernels/elementwise_functions/positive.hpp b/dpnp/libtensor/include/kernels/elementwise_functions/positive.hpp
similarity index 100%
rename from dpnp/tensor/libtensor/include/kernels/elementwise_functions/positive.hpp
rename to dpnp/libtensor/include/kernels/elementwise_functions/positive.hpp
diff --git a/dpnp/tensor/libtensor/include/kernels/elementwise_functions/pow.hpp b/dpnp/libtensor/include/kernels/elementwise_functions/pow.hpp
similarity index 100%
rename from dpnp/tensor/libtensor/include/kernels/elementwise_functions/pow.hpp
rename to dpnp/libtensor/include/kernels/elementwise_functions/pow.hpp
diff --git a/dpnp/tensor/libtensor/include/kernels/elementwise_functions/proj.hpp b/dpnp/libtensor/include/kernels/elementwise_functions/proj.hpp
similarity index 100%
rename from dpnp/tensor/libtensor/include/kernels/elementwise_functions/proj.hpp
rename to dpnp/libtensor/include/kernels/elementwise_functions/proj.hpp
diff --git a/dpnp/backend/kernels/elementwise_functions/radians.hpp b/dpnp/libtensor/include/kernels/elementwise_functions/radians.hpp
similarity index 96%
rename from dpnp/backend/kernels/elementwise_functions/radians.hpp
rename to dpnp/libtensor/include/kernels/elementwise_functions/radians.hpp
index cb676249a6ac..16d184670b94 100644
--- a/dpnp/backend/kernels/elementwise_functions/radians.hpp
+++ b/dpnp/libtensor/include/kernels/elementwise_functions/radians.hpp
@@ -30,7 +30,7 @@
#include
-namespace dpnp::kernels::radians
+namespace dpnp::tensor::kernels::radians
{
template
struct RadiansFunctor
@@ -52,4 +52,4 @@ struct RadiansFunctor
return sycl::radians(x);
}
};
-} // namespace dpnp::kernels::radians
+} // namespace dpnp::tensor::kernels::radians
diff --git a/dpnp/tensor/libtensor/include/kernels/elementwise_functions/real.hpp b/dpnp/libtensor/include/kernels/elementwise_functions/real.hpp
similarity index 100%
rename from dpnp/tensor/libtensor/include/kernels/elementwise_functions/real.hpp
rename to dpnp/libtensor/include/kernels/elementwise_functions/real.hpp
diff --git a/dpnp/tensor/libtensor/include/kernels/elementwise_functions/reciprocal.hpp b/dpnp/libtensor/include/kernels/elementwise_functions/reciprocal.hpp
similarity index 100%
rename from dpnp/tensor/libtensor/include/kernels/elementwise_functions/reciprocal.hpp
rename to dpnp/libtensor/include/kernels/elementwise_functions/reciprocal.hpp
diff --git a/dpnp/tensor/libtensor/include/kernels/elementwise_functions/remainder.hpp b/dpnp/libtensor/include/kernels/elementwise_functions/remainder.hpp
similarity index 100%
rename from dpnp/tensor/libtensor/include/kernels/elementwise_functions/remainder.hpp
rename to dpnp/libtensor/include/kernels/elementwise_functions/remainder.hpp
diff --git a/dpnp/tensor/libtensor/include/kernels/elementwise_functions/round.hpp b/dpnp/libtensor/include/kernels/elementwise_functions/round.hpp
similarity index 100%
rename from dpnp/tensor/libtensor/include/kernels/elementwise_functions/round.hpp
rename to dpnp/libtensor/include/kernels/elementwise_functions/round.hpp
diff --git a/dpnp/tensor/libtensor/include/kernels/elementwise_functions/rsqrt.hpp b/dpnp/libtensor/include/kernels/elementwise_functions/rsqrt.hpp
similarity index 100%
rename from dpnp/tensor/libtensor/include/kernels/elementwise_functions/rsqrt.hpp
rename to dpnp/libtensor/include/kernels/elementwise_functions/rsqrt.hpp
diff --git a/dpnp/tensor/libtensor/include/kernels/elementwise_functions/sign.hpp b/dpnp/libtensor/include/kernels/elementwise_functions/sign.hpp
similarity index 100%
rename from dpnp/tensor/libtensor/include/kernels/elementwise_functions/sign.hpp
rename to dpnp/libtensor/include/kernels/elementwise_functions/sign.hpp
diff --git a/dpnp/tensor/libtensor/include/kernels/elementwise_functions/signbit.hpp b/dpnp/libtensor/include/kernels/elementwise_functions/signbit.hpp
similarity index 100%
rename from dpnp/tensor/libtensor/include/kernels/elementwise_functions/signbit.hpp
rename to dpnp/libtensor/include/kernels/elementwise_functions/signbit.hpp
diff --git a/dpnp/tensor/libtensor/include/kernels/elementwise_functions/sin.hpp b/dpnp/libtensor/include/kernels/elementwise_functions/sin.hpp
similarity index 100%
rename from dpnp/tensor/libtensor/include/kernels/elementwise_functions/sin.hpp
rename to dpnp/libtensor/include/kernels/elementwise_functions/sin.hpp
diff --git a/dpnp/backend/kernels/elementwise_functions/sinc.hpp b/dpnp/libtensor/include/kernels/elementwise_functions/sinc.hpp
similarity index 98%
rename from dpnp/backend/kernels/elementwise_functions/sinc.hpp
rename to dpnp/libtensor/include/kernels/elementwise_functions/sinc.hpp
index a3f914b7f666..098ef452120c 100644
--- a/dpnp/backend/kernels/elementwise_functions/sinc.hpp
+++ b/dpnp/libtensor/include/kernels/elementwise_functions/sinc.hpp
@@ -39,7 +39,7 @@
#include "kernels/elementwise_functions/sycl_complex.hpp"
#include "utils/type_utils.hpp"
-namespace dpnp::kernels::sinc
+namespace dpnp::tensor::kernels::sinc
{
namespace tu_ns = dpnp::tensor::type_utils;
@@ -197,4 +197,4 @@ struct SincFunctor
}
}
};
-} // namespace dpnp::kernels::sinc
+} // namespace dpnp::tensor::kernels::sinc
diff --git a/dpnp/tensor/libtensor/include/kernels/elementwise_functions/sinh.hpp b/dpnp/libtensor/include/kernels/elementwise_functions/sinh.hpp
similarity index 100%
rename from dpnp/tensor/libtensor/include/kernels/elementwise_functions/sinh.hpp
rename to dpnp/libtensor/include/kernels/elementwise_functions/sinh.hpp
diff --git a/dpnp/backend/kernels/elementwise_functions/spacing.hpp b/dpnp/libtensor/include/kernels/elementwise_functions/spacing.hpp
similarity index 96%
rename from dpnp/backend/kernels/elementwise_functions/spacing.hpp
rename to dpnp/libtensor/include/kernels/elementwise_functions/spacing.hpp
index c7d849a3bd6b..c86c0c3ba166 100644
--- a/dpnp/backend/kernels/elementwise_functions/spacing.hpp
+++ b/dpnp/libtensor/include/kernels/elementwise_functions/spacing.hpp
@@ -30,7 +30,7 @@
#include
-namespace dpnp::kernels::spacing
+namespace dpnp::tensor::kernels::spacing
{
template
struct SpacingFunctor
@@ -64,4 +64,4 @@ struct SpacingFunctor
}
}
};
-} // namespace dpnp::kernels::spacing
+} // namespace dpnp::tensor::kernels::spacing
diff --git a/dpnp/tensor/libtensor/include/kernels/elementwise_functions/sqrt.hpp b/dpnp/libtensor/include/kernels/elementwise_functions/sqrt.hpp
similarity index 100%
rename from dpnp/tensor/libtensor/include/kernels/elementwise_functions/sqrt.hpp
rename to dpnp/libtensor/include/kernels/elementwise_functions/sqrt.hpp
diff --git a/dpnp/tensor/libtensor/include/kernels/elementwise_functions/square.hpp b/dpnp/libtensor/include/kernels/elementwise_functions/square.hpp
similarity index 100%
rename from dpnp/tensor/libtensor/include/kernels/elementwise_functions/square.hpp
rename to dpnp/libtensor/include/kernels/elementwise_functions/square.hpp
diff --git a/dpnp/tensor/libtensor/include/kernels/elementwise_functions/subtract.hpp b/dpnp/libtensor/include/kernels/elementwise_functions/subtract.hpp
similarity index 100%
rename from dpnp/tensor/libtensor/include/kernels/elementwise_functions/subtract.hpp
rename to dpnp/libtensor/include/kernels/elementwise_functions/subtract.hpp
diff --git a/dpnp/tensor/libtensor/include/kernels/elementwise_functions/sycl_complex.hpp b/dpnp/libtensor/include/kernels/elementwise_functions/sycl_complex.hpp
similarity index 100%
rename from dpnp/tensor/libtensor/include/kernels/elementwise_functions/sycl_complex.hpp
rename to dpnp/libtensor/include/kernels/elementwise_functions/sycl_complex.hpp
diff --git a/dpnp/tensor/libtensor/include/kernels/elementwise_functions/tan.hpp b/dpnp/libtensor/include/kernels/elementwise_functions/tan.hpp
similarity index 100%
rename from dpnp/tensor/libtensor/include/kernels/elementwise_functions/tan.hpp
rename to dpnp/libtensor/include/kernels/elementwise_functions/tan.hpp
diff --git a/dpnp/tensor/libtensor/include/kernels/elementwise_functions/tanh.hpp b/dpnp/libtensor/include/kernels/elementwise_functions/tanh.hpp
similarity index 100%
rename from dpnp/tensor/libtensor/include/kernels/elementwise_functions/tanh.hpp
rename to dpnp/libtensor/include/kernels/elementwise_functions/tanh.hpp
diff --git a/dpnp/tensor/libtensor/include/kernels/elementwise_functions/true_divide.hpp b/dpnp/libtensor/include/kernels/elementwise_functions/true_divide.hpp
similarity index 100%
rename from dpnp/tensor/libtensor/include/kernels/elementwise_functions/true_divide.hpp
rename to dpnp/libtensor/include/kernels/elementwise_functions/true_divide.hpp
diff --git a/dpnp/tensor/libtensor/include/kernels/elementwise_functions/trunc.hpp b/dpnp/libtensor/include/kernels/elementwise_functions/trunc.hpp
similarity index 100%
rename from dpnp/tensor/libtensor/include/kernels/elementwise_functions/trunc.hpp
rename to dpnp/libtensor/include/kernels/elementwise_functions/trunc.hpp
diff --git a/dpnp/tensor/libtensor/include/kernels/elementwise_functions/vec_size_util.hpp b/dpnp/libtensor/include/kernels/elementwise_functions/vec_size_util.hpp
similarity index 100%
rename from dpnp/tensor/libtensor/include/kernels/elementwise_functions/vec_size_util.hpp
rename to dpnp/libtensor/include/kernels/elementwise_functions/vec_size_util.hpp
diff --git a/dpnp/tensor/libtensor/include/kernels/integer_advanced_indexing.hpp b/dpnp/libtensor/include/kernels/integer_advanced_indexing.hpp
similarity index 100%
rename from dpnp/tensor/libtensor/include/kernels/integer_advanced_indexing.hpp
rename to dpnp/libtensor/include/kernels/integer_advanced_indexing.hpp
diff --git a/dpnp/tensor/libtensor/include/kernels/linalg_functions/dot_product.hpp b/dpnp/libtensor/include/kernels/linalg_functions/dot_product.hpp
similarity index 100%
rename from dpnp/tensor/libtensor/include/kernels/linalg_functions/dot_product.hpp
rename to dpnp/libtensor/include/kernels/linalg_functions/dot_product.hpp
diff --git a/dpnp/tensor/libtensor/include/kernels/linalg_functions/gemm.hpp b/dpnp/libtensor/include/kernels/linalg_functions/gemm.hpp
similarity index 100%
rename from dpnp/tensor/libtensor/include/kernels/linalg_functions/gemm.hpp
rename to dpnp/libtensor/include/kernels/linalg_functions/gemm.hpp
diff --git a/dpnp/backend/kernels/indexing/putmask.hpp b/dpnp/libtensor/include/kernels/putmask.hpp
similarity index 99%
rename from dpnp/backend/kernels/indexing/putmask.hpp
rename to dpnp/libtensor/include/kernels/putmask.hpp
index 37650072ac0c..729d64c34931 100644
--- a/dpnp/backend/kernels/indexing/putmask.hpp
+++ b/dpnp/libtensor/include/kernels/putmask.hpp
@@ -41,7 +41,7 @@
#include "utils/sycl_utils.hpp"
#include "utils/type_utils.hpp"
-namespace dpnp::kernels::putmask
+namespace dpnp::tensor::kernels::putmask
{
using dpnp::tensor::ssize_t;
@@ -287,4 +287,4 @@ sycl::event putmask_contig_impl(sycl::queue &exec_q,
return comp_ev;
}
-} // namespace dpnp::kernels::putmask
+} // namespace dpnp::tensor::kernels::putmask
diff --git a/dpnp/tensor/libtensor/include/kernels/reductions.hpp b/dpnp/libtensor/include/kernels/reductions.hpp
similarity index 100%
rename from dpnp/tensor/libtensor/include/kernels/reductions.hpp
rename to dpnp/libtensor/include/kernels/reductions.hpp
diff --git a/dpnp/tensor/libtensor/include/kernels/repeat.hpp b/dpnp/libtensor/include/kernels/repeat.hpp
similarity index 100%
rename from dpnp/tensor/libtensor/include/kernels/repeat.hpp
rename to dpnp/libtensor/include/kernels/repeat.hpp
diff --git a/dpnp/tensor/libtensor/include/kernels/sorting/isin.hpp b/dpnp/libtensor/include/kernels/sorting/isin.hpp
similarity index 100%
rename from dpnp/tensor/libtensor/include/kernels/sorting/isin.hpp
rename to dpnp/libtensor/include/kernels/sorting/isin.hpp
diff --git a/dpnp/tensor/libtensor/include/kernels/sorting/merge_sort.hpp b/dpnp/libtensor/include/kernels/sorting/merge_sort.hpp
similarity index 100%
rename from dpnp/tensor/libtensor/include/kernels/sorting/merge_sort.hpp
rename to dpnp/libtensor/include/kernels/sorting/merge_sort.hpp
diff --git a/dpnp/tensor/libtensor/include/kernels/sorting/radix_select.hpp b/dpnp/libtensor/include/kernels/sorting/radix_select.hpp
similarity index 100%
rename from dpnp/tensor/libtensor/include/kernels/sorting/radix_select.hpp
rename to dpnp/libtensor/include/kernels/sorting/radix_select.hpp
diff --git a/dpnp/tensor/libtensor/include/kernels/sorting/radix_sort.hpp b/dpnp/libtensor/include/kernels/sorting/radix_sort.hpp
similarity index 99%
rename from dpnp/tensor/libtensor/include/kernels/sorting/radix_sort.hpp
rename to dpnp/libtensor/include/kernels/sorting/radix_sort.hpp
index 6950890af85d..3d3531b0eb03 100644
--- a/dpnp/tensor/libtensor/include/kernels/sorting/radix_sort.hpp
+++ b/dpnp/libtensor/include/kernels/sorting/radix_sort.hpp
@@ -29,7 +29,7 @@
//===----------------------------------------------------------------------===//
///
/// \file
-/// This file defines functions of dpnp.tensor._tensor_sorting_impl
+/// This file defines functions of dpnp.libtensor._tensor_sorting_impl
/// extension.
//===----------------------------------------------------------------------===//
diff --git a/dpnp/tensor/libtensor/include/kernels/sorting/radix_utils.hpp b/dpnp/libtensor/include/kernels/sorting/radix_utils.hpp
similarity index 100%
rename from dpnp/tensor/libtensor/include/kernels/sorting/radix_utils.hpp
rename to dpnp/libtensor/include/kernels/sorting/radix_utils.hpp
diff --git a/dpnp/tensor/libtensor/include/kernels/sorting/search_sorted_detail.hpp b/dpnp/libtensor/include/kernels/sorting/search_sorted_detail.hpp
similarity index 100%
rename from dpnp/tensor/libtensor/include/kernels/sorting/search_sorted_detail.hpp
rename to dpnp/libtensor/include/kernels/sorting/search_sorted_detail.hpp
diff --git a/dpnp/tensor/libtensor/include/kernels/sorting/searchsorted.hpp b/dpnp/libtensor/include/kernels/sorting/searchsorted.hpp
similarity index 100%
rename from dpnp/tensor/libtensor/include/kernels/sorting/searchsorted.hpp
rename to dpnp/libtensor/include/kernels/sorting/searchsorted.hpp
diff --git a/dpnp/tensor/libtensor/include/kernels/sorting/sort_impl_fn_ptr_t.hpp b/dpnp/libtensor/include/kernels/sorting/sort_impl_fn_ptr_t.hpp
similarity index 97%
rename from dpnp/tensor/libtensor/include/kernels/sorting/sort_impl_fn_ptr_t.hpp
rename to dpnp/libtensor/include/kernels/sorting/sort_impl_fn_ptr_t.hpp
index 2cff5d9585f2..f02583bc239b 100644
--- a/dpnp/tensor/libtensor/include/kernels/sorting/sort_impl_fn_ptr_t.hpp
+++ b/dpnp/libtensor/include/kernels/sorting/sort_impl_fn_ptr_t.hpp
@@ -29,7 +29,7 @@
//===----------------------------------------------------------------------===//
///
/// \file
-/// This file defines functions of dpnp.tensor._tensor_sorting_impl
+/// This file defines functions of dpnp.libtensor._tensor_sorting_impl
/// extension.
//===----------------------------------------------------------------------===//
diff --git a/dpnp/tensor/libtensor/include/kernels/sorting/sort_utils.hpp b/dpnp/libtensor/include/kernels/sorting/sort_utils.hpp
similarity index 100%
rename from dpnp/tensor/libtensor/include/kernels/sorting/sort_utils.hpp
rename to dpnp/libtensor/include/kernels/sorting/sort_utils.hpp
diff --git a/dpnp/tensor/libtensor/include/kernels/sorting/topk.hpp b/dpnp/libtensor/include/kernels/sorting/topk.hpp
similarity index 100%
rename from dpnp/tensor/libtensor/include/kernels/sorting/topk.hpp
rename to dpnp/libtensor/include/kernels/sorting/topk.hpp
diff --git a/dpnp/backend/kernels/statistics/histogram.hpp b/dpnp/libtensor/include/kernels/statistics/histogram.hpp
similarity index 97%
rename from dpnp/backend/kernels/statistics/histogram.hpp
rename to dpnp/libtensor/include/kernels/statistics/histogram.hpp
index 6d0fedbe0bc3..99ddefe00ff5 100644
--- a/dpnp/backend/kernels/statistics/histogram.hpp
+++ b/dpnp/libtensor/include/kernels/statistics/histogram.hpp
@@ -33,7 +33,7 @@
#include
-namespace dpnp::kernels::histogram
+namespace dpnp::tensor::kernels::histogram
{
template
class HistogramFunctor
@@ -96,4 +96,4 @@ class HistogramFunctor
hist.finalize(item);
}
};
-} // namespace dpnp::kernels::histogram
+} // namespace dpnp::tensor::kernels::histogram
diff --git a/dpnp/backend/kernels/statistics/sliding_window1d.hpp b/dpnp/libtensor/include/kernels/statistics/sliding_window1d.hpp
similarity index 98%
rename from dpnp/backend/kernels/statistics/sliding_window1d.hpp
rename to dpnp/libtensor/include/kernels/statistics/sliding_window1d.hpp
index 5b3c5535afd4..16ef7e514cc8 100644
--- a/dpnp/backend/kernels/statistics/sliding_window1d.hpp
+++ b/dpnp/libtensor/include/kernels/statistics/sliding_window1d.hpp
@@ -35,7 +35,7 @@
#include "ext/common.hpp"
-namespace dpnp::kernels::sliding_window1d
+namespace dpnp::tensor::kernels::sliding_window1d
{
using ext::common::CeilDiv;
@@ -271,4 +271,4 @@ class SlidingWindow1dSmallFunctor
// [out_end](auto &&ptr) { return ptr < out_end; });
}
};
-} // namespace dpnp::kernels::sliding_window1d
+} // namespace dpnp::tensor::kernels::sliding_window1d
diff --git a/dpnp/tensor/libtensor/include/kernels/where.hpp b/dpnp/libtensor/include/kernels/where.hpp
similarity index 100%
rename from dpnp/tensor/libtensor/include/kernels/where.hpp
rename to dpnp/libtensor/include/kernels/where.hpp
diff --git a/dpnp/backend/kernels/window/bartlett.hpp b/dpnp/libtensor/include/kernels/window/bartlett.hpp
similarity index 96%
rename from dpnp/backend/kernels/window/bartlett.hpp
rename to dpnp/libtensor/include/kernels/window/bartlett.hpp
index 20d410150dcb..3ac4c27806eb 100644
--- a/dpnp/backend/kernels/window/bartlett.hpp
+++ b/dpnp/libtensor/include/kernels/window/bartlett.hpp
@@ -32,7 +32,7 @@
#include
-namespace dpnp::kernels::bartlett
+namespace dpnp::tensor::kernels::bartlett
{
template
class BartlettFunctor
@@ -52,4 +52,4 @@ class BartlettFunctor
res[i] = T(1) - sycl::fabs(i - alpha) / alpha;
}
};
-} // namespace dpnp::kernels::bartlett
+} // namespace dpnp::tensor::kernels::bartlett
diff --git a/dpnp/backend/kernels/window/blackman.hpp b/dpnp/libtensor/include/kernels/window/blackman.hpp
similarity index 96%
rename from dpnp/backend/kernels/window/blackman.hpp
rename to dpnp/libtensor/include/kernels/window/blackman.hpp
index 9df7cb8728e2..6191c6ace98f 100644
--- a/dpnp/backend/kernels/window/blackman.hpp
+++ b/dpnp/libtensor/include/kernels/window/blackman.hpp
@@ -32,7 +32,7 @@
#include
-namespace dpnp::kernels::blackman
+namespace dpnp::tensor::kernels::blackman
{
template
class BlackmanFunctor
@@ -53,4 +53,4 @@ class BlackmanFunctor
T(0.08) * sycl::cospi(T(2) * alpha);
}
};
-} // namespace dpnp::kernels::blackman
+} // namespace dpnp::tensor::kernels::blackman
diff --git a/dpnp/backend/kernels/window/hamming.hpp b/dpnp/libtensor/include/kernels/window/hamming.hpp
similarity index 96%
rename from dpnp/backend/kernels/window/hamming.hpp
rename to dpnp/libtensor/include/kernels/window/hamming.hpp
index 895ecb0e588c..2dc6d47b4184 100644
--- a/dpnp/backend/kernels/window/hamming.hpp
+++ b/dpnp/libtensor/include/kernels/window/hamming.hpp
@@ -32,7 +32,7 @@
#include
-namespace dpnp::kernels::hamming
+namespace dpnp::tensor::kernels::hamming
{
template
class HammingFunctor
@@ -51,4 +51,4 @@ class HammingFunctor
res[i] = T(0.54) - T(0.46) * sycl::cospi(T(2) * i / (N - 1));
}
};
-} // namespace dpnp::kernels::hamming
+} // namespace dpnp::tensor::kernels::hamming
diff --git a/dpnp/backend/kernels/window/hanning.hpp b/dpnp/libtensor/include/kernels/window/hanning.hpp
similarity index 96%
rename from dpnp/backend/kernels/window/hanning.hpp
rename to dpnp/libtensor/include/kernels/window/hanning.hpp
index 35b441f921f8..193087065008 100644
--- a/dpnp/backend/kernels/window/hanning.hpp
+++ b/dpnp/libtensor/include/kernels/window/hanning.hpp
@@ -32,7 +32,7 @@
#include
-namespace dpnp::kernels::hanning
+namespace dpnp::tensor::kernels::hanning
{
template
class HanningFunctor
@@ -51,4 +51,4 @@ class HanningFunctor
res[i] = T(0.5) - T(0.5) * sycl::cospi(T(2) * i / (N - 1));
}
};
-} // namespace dpnp::kernels::hanning
+} // namespace dpnp::tensor::kernels::hanning
diff --git a/dpnp/backend/kernels/window/kaiser.hpp b/dpnp/libtensor/include/kernels/window/kaiser.hpp
similarity index 94%
rename from dpnp/backend/kernels/window/kaiser.hpp
rename to dpnp/libtensor/include/kernels/window/kaiser.hpp
index ce8c8e52fd18..7ff6299a0b09 100644
--- a/dpnp/backend/kernels/window/kaiser.hpp
+++ b/dpnp/libtensor/include/kernels/window/kaiser.hpp
@@ -34,7 +34,7 @@
#include "kernels/elementwise_functions/i0.hpp"
-namespace dpnp::kernels::kaiser
+namespace dpnp::tensor::kernels::kaiser
{
template
class KaiserFunctor
@@ -52,7 +52,7 @@ class KaiserFunctor
void operator()(sycl::id<1> id) const
{
- using dpnp::kernels::i0::cyl_bessel_i0;
+ using dpnp::tensor::kernels::i0::cyl_bessel_i0;
const auto i = id.get(0);
const T alpha = (N - 1) / T(2);
@@ -61,4 +61,4 @@ class KaiserFunctor
cyl_bessel_i0(beta);
}
};
-} // namespace dpnp::kernels::kaiser
+} // namespace dpnp::tensor::kernels::kaiser
diff --git a/dpnp/tensor/libtensor/include/utils/indexing_utils.hpp b/dpnp/libtensor/include/utils/indexing_utils.hpp
similarity index 100%
rename from dpnp/tensor/libtensor/include/utils/indexing_utils.hpp
rename to dpnp/libtensor/include/utils/indexing_utils.hpp
diff --git a/dpnp/tensor/libtensor/include/utils/math_utils.hpp b/dpnp/libtensor/include/utils/math_utils.hpp
similarity index 100%
rename from dpnp/tensor/libtensor/include/utils/math_utils.hpp
rename to dpnp/libtensor/include/utils/math_utils.hpp
diff --git a/dpnp/tensor/libtensor/include/utils/memory_overlap.hpp b/dpnp/libtensor/include/utils/memory_overlap.hpp
similarity index 100%
rename from dpnp/tensor/libtensor/include/utils/memory_overlap.hpp
rename to dpnp/libtensor/include/utils/memory_overlap.hpp
diff --git a/dpnp/tensor/libtensor/include/utils/offset_utils.hpp b/dpnp/libtensor/include/utils/offset_utils.hpp
similarity index 87%
rename from dpnp/tensor/libtensor/include/utils/offset_utils.hpp
rename to dpnp/libtensor/include/utils/offset_utils.hpp
index e6e2179bdf8a..05ae82657168 100644
--- a/dpnp/tensor/libtensor/include/utils/offset_utils.hpp
+++ b/dpnp/libtensor/include/utils/offset_utils.hpp
@@ -602,18 +602,6 @@ struct FourOffsets_StridedIndexer
static_assert(sycl::is_device_copyable_v);
-struct FourZeroOffsets_Indexer
-{
- constexpr FourZeroOffsets_Indexer() {}
-
- constexpr FourOffsets operator()(ssize_t) const
- {
- return FourOffsets();
- }
-};
-
-static_assert(sycl::is_device_copyable_v);
-
struct NthStrideOffset
{
NthStrideOffset(int common_nd,
@@ -644,40 +632,6 @@ struct NthStrideOffset
static_assert(sycl::is_device_copyable_v);
-template
-struct FixedDimStridedIndexer
-{
- FixedDimStridedIndexer(const std::array &_shape,
- const std::array &_strides,
- ssize_t _offset)
- : _ind(_shape), strides(_strides), starting_offset(_offset)
- {
- }
- std::size_t operator()(std::size_t gid) const
- {
- dpnp::tensor::strides::CIndexer_array local_indexer(
- std::move(_ind));
- local_indexer.set(gid);
- auto mi = local_indexer.get();
-
- ssize_t relative_offset = 0;
-
-#pragma unroll
- for (int i = 0; i < nd; ++i) {
- relative_offset += mi[i] * strides[i];
- }
- return starting_offset + relative_offset;
- }
-
-private:
- dpnp::tensor::strides::CIndexer_array _ind;
-
- std::array strides;
- ssize_t starting_offset;
-};
-
-static_assert(sycl::is_device_copyable_v>);
-
template
struct TwoOffsets_FixedDimStridedIndexer
{
@@ -724,65 +678,4 @@ struct TwoOffsets_FixedDimStridedIndexer
};
static_assert(sycl::is_device_copyable_v>);
-
-template
-struct ThreeOffsets_FixedDimStridedIndexer
-{
- ThreeOffsets_FixedDimStridedIndexer(
- const std::array &_shape,
- const std::array &_strides1,
- const std::array &_strides2,
- const std::array &_strides3,
- ssize_t _offset1,
- ssize_t _offset2,
- ssize_t _offset3)
- : _ind(_shape), strides1(_strides1), strides2(_strides2),
- strides3(_strides3), starting_offset1(_offset1),
- starting_offset2(_offset2), starting_offset3(_offset3)
- {
- }
-
- ThreeOffsets operator()(std::size_t gid) const
- {
- dpnp::tensor::strides::CIndexer_array local_indexer(
- std::move(_ind));
- local_indexer.set(gid);
- auto mi = local_indexer.get();
-
- ssize_t relative_offset1 = 0;
-#pragma unroll
- for (int i = 0; i < nd; ++i) {
- relative_offset1 += mi[i] * strides1[i];
- }
-
- ssize_t relative_offset2 = 0;
-#pragma unroll
- for (int i = 0; i < nd; ++i) {
- relative_offset2 += mi[i] * strides2[i];
- }
-
- ssize_t relative_offset3 = 0;
-#pragma unroll
- for (int i = 0; i < nd; ++i) {
- relative_offset3 += mi[i] * strides3[i];
- }
-
- return ThreeOffsets(starting_offset1 + relative_offset1,
- starting_offset2 + relative_offset2,
- starting_offset3 + relative_offset3);
- }
-
-private:
- dpnp::tensor::strides::CIndexer_array _ind;
-
- std::array strides1;
- std::array strides2;
- std::array strides3;
- ssize_t starting_offset1;
- ssize_t starting_offset2;
- ssize_t starting_offset3;
-};
-
-static_assert(
- sycl::is_device_copyable_v>);
} // namespace dpnp::tensor::offset_utils
diff --git a/dpnp/tensor/libtensor/include/utils/output_validation.hpp b/dpnp/libtensor/include/utils/output_validation.hpp
similarity index 100%
rename from dpnp/tensor/libtensor/include/utils/output_validation.hpp
rename to dpnp/libtensor/include/utils/output_validation.hpp
diff --git a/dpnp/tensor/libtensor/include/utils/rich_comparisons.hpp b/dpnp/libtensor/include/utils/rich_comparisons.hpp
similarity index 98%
rename from dpnp/tensor/libtensor/include/utils/rich_comparisons.hpp
rename to dpnp/libtensor/include/utils/rich_comparisons.hpp
index 93029b9d4107..3eea91bf2a29 100644
--- a/dpnp/tensor/libtensor/include/utils/rich_comparisons.hpp
+++ b/dpnp/libtensor/include/utils/rich_comparisons.hpp
@@ -27,7 +27,7 @@
//*****************************************************************************
///
/// \file
-/// This file defines functions of dpnp.tensor._tensor_sorting_impl
+/// This file defines functions of dpnp.libtensor._tensor_sorting_impl
/// extension.
//===---------------------------------------------------------------------===//
diff --git a/dpnp/tensor/libtensor/include/utils/strided_iters.hpp b/dpnp/libtensor/include/utils/strided_iters.hpp
similarity index 100%
rename from dpnp/tensor/libtensor/include/utils/strided_iters.hpp
rename to dpnp/libtensor/include/utils/strided_iters.hpp
diff --git a/dpnp/tensor/libtensor/include/utils/sycl_alloc_utils.hpp b/dpnp/libtensor/include/utils/sycl_alloc_utils.hpp
similarity index 100%
rename from dpnp/tensor/libtensor/include/utils/sycl_alloc_utils.hpp
rename to dpnp/libtensor/include/utils/sycl_alloc_utils.hpp
diff --git a/dpnp/tensor/libtensor/include/utils/sycl_utils.hpp b/dpnp/libtensor/include/utils/sycl_utils.hpp
similarity index 100%
rename from dpnp/tensor/libtensor/include/utils/sycl_utils.hpp
rename to dpnp/libtensor/include/utils/sycl_utils.hpp
diff --git a/dpnp/tensor/libtensor/include/utils/type_dispatch.hpp b/dpnp/libtensor/include/utils/type_dispatch.hpp
similarity index 100%
rename from dpnp/tensor/libtensor/include/utils/type_dispatch.hpp
rename to dpnp/libtensor/include/utils/type_dispatch.hpp
diff --git a/dpnp/tensor/libtensor/include/utils/type_dispatch_building.hpp b/dpnp/libtensor/include/utils/type_dispatch_building.hpp
similarity index 90%
rename from dpnp/tensor/libtensor/include/utils/type_dispatch_building.hpp
rename to dpnp/libtensor/include/utils/type_dispatch_building.hpp
index ec89c9ad4eab..33bcd2b68487 100644
--- a/dpnp/tensor/libtensor/include/utils/type_dispatch_building.hpp
+++ b/dpnp/libtensor/include/utils/type_dispatch_building.hpp
@@ -191,6 +191,49 @@ struct DefaultResultEntry : std::true_type
using result_type = Ty;
};
+/**
+ * Extends TypeMapResultEntry helper structure
+ * with support of the two result types.
+ */
+template
+struct TypeMapTwoResultsEntry : std::bool_constant>
+{
+ using result_type1 = ResTy1;
+ using result_type2 = ResTy2;
+};
+
+/**
+ * Extends BinaryTypeMapResultEntry helper structure with support of the two
+ * result types.
+ */
+template
+struct BinaryTypeMapTwoResultsEntry
+ : std::bool_constant,
+ std::is_same>>
+{
+ using result_type1 = ResTy1;
+ using result_type2 = ResTy2;
+};
+
+/**
+ * Extends DefaultResultEntry helper structure
+ * with support of the two result types.
+ */
+template
+struct DefaultTwoResultsEntry : std::true_type
+{
+ using result_type1 = Ty;
+ using result_type2 = Ty;
+};
+
/*! @brief Utility struct to convert C++ type into typeid integer */
template
struct GetTypeid
diff --git a/dpnp/tensor/libtensor/include/utils/type_utils.hpp b/dpnp/libtensor/include/utils/type_utils.hpp
similarity index 100%
rename from dpnp/tensor/libtensor/include/utils/type_utils.hpp
rename to dpnp/libtensor/include/utils/type_utils.hpp
diff --git a/dpnp/libtensor/source/CMakeLists.txt b/dpnp/libtensor/source/CMakeLists.txt
new file mode 100644
index 000000000000..7ac3c740f716
--- /dev/null
+++ b/dpnp/libtensor/source/CMakeLists.txt
@@ -0,0 +1,439 @@
+# -*- coding: utf-8 -*-
+# *****************************************************************************
+# 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.
+# *****************************************************************************
+
+# Builds the pybind11 modules of libtensor. All of them are installed into
+# dpnp/libtensor, next to the MKL-based extensions.
+
+include(${CMAKE_SOURCE_DIR}/dpnp/cmake/tensor_build_flags.cmake)
+
+get_filename_component(
+ _libtensor_include_dir
+ ${CMAKE_CURRENT_SOURCE_DIR}/../include
+ ABSOLUTE
+)
+
+# Sources of the functions dpnp implements beyond the array API. They are
+# compiled into the same modules as the libtensor functions but keep the
+# floating-point and coverage settings of the former dpnp extensions.
+# They come first in each module: the linker keeps the first copy of an inline
+# function both groups instantiate, so coverage builds keep the instrumented one.
+set(_dpnp_elementwise_sources
+ ${CMAKE_CURRENT_SOURCE_DIR}/elementwise_functions/bitwise_count.cpp
+ ${CMAKE_CURRENT_SOURCE_DIR}/elementwise_functions/degrees.cpp
+ ${CMAKE_CURRENT_SOURCE_DIR}/elementwise_functions/divmod.cpp
+ ${CMAKE_CURRENT_SOURCE_DIR}/elementwise_functions/erf_funcs.cpp
+ ${CMAKE_CURRENT_SOURCE_DIR}/elementwise_functions/fabs.cpp
+ ${CMAKE_CURRENT_SOURCE_DIR}/elementwise_functions/float_power.cpp
+ ${CMAKE_CURRENT_SOURCE_DIR}/elementwise_functions/fmax.cpp
+ ${CMAKE_CURRENT_SOURCE_DIR}/elementwise_functions/fmin.cpp
+ ${CMAKE_CURRENT_SOURCE_DIR}/elementwise_functions/fmod.cpp
+ ${CMAKE_CURRENT_SOURCE_DIR}/elementwise_functions/frexp.cpp
+ ${CMAKE_CURRENT_SOURCE_DIR}/elementwise_functions/gcd.cpp
+ ${CMAKE_CURRENT_SOURCE_DIR}/elementwise_functions/heaviside.cpp
+ ${CMAKE_CURRENT_SOURCE_DIR}/elementwise_functions/i0.cpp
+ ${CMAKE_CURRENT_SOURCE_DIR}/elementwise_functions/interpolate.cpp
+ ${CMAKE_CURRENT_SOURCE_DIR}/elementwise_functions/isclose.cpp
+ ${CMAKE_CURRENT_SOURCE_DIR}/elementwise_functions/lcm.cpp
+ ${CMAKE_CURRENT_SOURCE_DIR}/elementwise_functions/ldexp.cpp
+ ${CMAKE_CURRENT_SOURCE_DIR}/elementwise_functions/logaddexp2.cpp
+ ${CMAKE_CURRENT_SOURCE_DIR}/elementwise_functions/modf.cpp
+ ${CMAKE_CURRENT_SOURCE_DIR}/elementwise_functions/nan_to_num.cpp
+ ${CMAKE_CURRENT_SOURCE_DIR}/elementwise_functions/radians.cpp
+ ${CMAKE_CURRENT_SOURCE_DIR}/elementwise_functions/sinc.cpp
+ ${CMAKE_CURRENT_SOURCE_DIR}/elementwise_functions/spacing.cpp
+)
+set(_dpnp_indexing_sources
+ ${CMAKE_CURRENT_SOURCE_DIR}/choose.cpp
+ ${CMAKE_CURRENT_SOURCE_DIR}/putmask.cpp
+)
+set(_statistics_impl_sources
+ ${CMAKE_CURRENT_SOURCE_DIR}/statistics/bincount.cpp
+ ${CMAKE_CURRENT_SOURCE_DIR}/statistics/histogram.cpp
+ ${CMAKE_CURRENT_SOURCE_DIR}/statistics/histogramdd.cpp
+ ${CMAKE_CURRENT_SOURCE_DIR}/statistics/histogram_common.cpp
+ ${CMAKE_CURRENT_SOURCE_DIR}/statistics/sliding_dot_product1d.cpp
+ ${CMAKE_CURRENT_SOURCE_DIR}/statistics/sliding_window1d.cpp
+ ${CMAKE_CURRENT_SOURCE_DIR}/statistics/statistics_py.cpp
+)
+set(_window_impl_sources
+ ${CMAKE_CURRENT_SOURCE_DIR}/window/kaiser.cpp
+ ${CMAKE_CURRENT_SOURCE_DIR}/window/window_py.cpp
+)
+set(_dpnp_sources
+ ${_dpnp_elementwise_sources}
+ ${_dpnp_indexing_sources}
+ ${_statistics_impl_sources}
+ ${_window_impl_sources}
+)
+
+set(_static_lib_sources ${CMAKE_CURRENT_SOURCE_DIR}/simplify_iteration_space.cpp)
+set(_tensor_impl_sources
+ ${_dpnp_indexing_sources}
+ ${CMAKE_CURRENT_SOURCE_DIR}/tensor_ctors.cpp
+ ${CMAKE_CURRENT_SOURCE_DIR}/accumulators.cpp
+ ${CMAKE_CURRENT_SOURCE_DIR}/copy_and_cast_usm_to_usm.cpp
+ ${CMAKE_CURRENT_SOURCE_DIR}/copy_as_contig.cpp
+ ${CMAKE_CURRENT_SOURCE_DIR}/copy_numpy_ndarray_into_usm_ndarray.cpp
+ ${CMAKE_CURRENT_SOURCE_DIR}/copy_for_reshape.cpp
+ ${CMAKE_CURRENT_SOURCE_DIR}/copy_for_roll.cpp
+ ${CMAKE_CURRENT_SOURCE_DIR}/linear_sequences.cpp
+ ${CMAKE_CURRENT_SOURCE_DIR}/integer_advanced_indexing.cpp
+ ${CMAKE_CURRENT_SOURCE_DIR}/boolean_advanced_indexing.cpp
+ ${CMAKE_CURRENT_SOURCE_DIR}/eye_ctor.cpp
+ ${CMAKE_CURRENT_SOURCE_DIR}/full_ctor.cpp
+ ${CMAKE_CURRENT_SOURCE_DIR}/zeros_ctor.cpp
+ ${CMAKE_CURRENT_SOURCE_DIR}/triul_ctor.cpp
+ ${CMAKE_CURRENT_SOURCE_DIR}/where.cpp
+ ${CMAKE_CURRENT_SOURCE_DIR}/device_support_queries.cpp
+ ${CMAKE_CURRENT_SOURCE_DIR}/repeat.cpp
+ ${CMAKE_CURRENT_SOURCE_DIR}/clip.cpp
+)
+set(_accumulator_sources
+ ${CMAKE_CURRENT_SOURCE_DIR}/accumulators/accumulators_common.cpp
+ ${CMAKE_CURRENT_SOURCE_DIR}/accumulators/cumulative_logsumexp.cpp
+ ${CMAKE_CURRENT_SOURCE_DIR}/accumulators/cumulative_prod.cpp
+ ${CMAKE_CURRENT_SOURCE_DIR}/accumulators/cumulative_sum.cpp
+)
+set(_elementwise_sources
+ ${CMAKE_CURRENT_SOURCE_DIR}/elementwise_functions/elementwise_common.cpp
+ ${CMAKE_CURRENT_SOURCE_DIR}/elementwise_functions/elementwise_functions_type_utils.cpp
+ ${CMAKE_CURRENT_SOURCE_DIR}/elementwise_functions/abs.cpp
+ ${CMAKE_CURRENT_SOURCE_DIR}/elementwise_functions/acos.cpp
+ ${CMAKE_CURRENT_SOURCE_DIR}/elementwise_functions/acosh.cpp
+ ${CMAKE_CURRENT_SOURCE_DIR}/elementwise_functions/add.cpp
+ ${CMAKE_CURRENT_SOURCE_DIR}/elementwise_functions/angle.cpp
+ ${CMAKE_CURRENT_SOURCE_DIR}/elementwise_functions/asin.cpp
+ ${CMAKE_CURRENT_SOURCE_DIR}/elementwise_functions/asinh.cpp
+ ${CMAKE_CURRENT_SOURCE_DIR}/elementwise_functions/atan.cpp
+ ${CMAKE_CURRENT_SOURCE_DIR}/elementwise_functions/atan2.cpp
+ ${CMAKE_CURRENT_SOURCE_DIR}/elementwise_functions/atanh.cpp
+ ${CMAKE_CURRENT_SOURCE_DIR}/elementwise_functions/bitwise_and.cpp
+ ${CMAKE_CURRENT_SOURCE_DIR}/elementwise_functions/bitwise_invert.cpp
+ ${CMAKE_CURRENT_SOURCE_DIR}/elementwise_functions/bitwise_left_shift.cpp
+ ${CMAKE_CURRENT_SOURCE_DIR}/elementwise_functions/bitwise_or.cpp
+ ${CMAKE_CURRENT_SOURCE_DIR}/elementwise_functions/bitwise_right_shift.cpp
+ ${CMAKE_CURRENT_SOURCE_DIR}/elementwise_functions/bitwise_xor.cpp
+ ${CMAKE_CURRENT_SOURCE_DIR}/elementwise_functions/cbrt.cpp
+ ${CMAKE_CURRENT_SOURCE_DIR}/elementwise_functions/ceil.cpp
+ ${CMAKE_CURRENT_SOURCE_DIR}/elementwise_functions/conj.cpp
+ ${CMAKE_CURRENT_SOURCE_DIR}/elementwise_functions/copysign.cpp
+ ${CMAKE_CURRENT_SOURCE_DIR}/elementwise_functions/cos.cpp
+ ${CMAKE_CURRENT_SOURCE_DIR}/elementwise_functions/cosh.cpp
+ ${CMAKE_CURRENT_SOURCE_DIR}/elementwise_functions/equal.cpp
+ ${CMAKE_CURRENT_SOURCE_DIR}/elementwise_functions/exp.cpp
+ ${CMAKE_CURRENT_SOURCE_DIR}/elementwise_functions/exp2.cpp
+ ${CMAKE_CURRENT_SOURCE_DIR}/elementwise_functions/expm1.cpp
+ ${CMAKE_CURRENT_SOURCE_DIR}/elementwise_functions/floor_divide.cpp
+ ${CMAKE_CURRENT_SOURCE_DIR}/elementwise_functions/floor.cpp
+ ${CMAKE_CURRENT_SOURCE_DIR}/elementwise_functions/greater_equal.cpp
+ ${CMAKE_CURRENT_SOURCE_DIR}/elementwise_functions/greater.cpp
+ ${CMAKE_CURRENT_SOURCE_DIR}/elementwise_functions/hypot.cpp
+ ${CMAKE_CURRENT_SOURCE_DIR}/elementwise_functions/imag.cpp
+ ${CMAKE_CURRENT_SOURCE_DIR}/elementwise_functions/isfinite.cpp
+ ${CMAKE_CURRENT_SOURCE_DIR}/elementwise_functions/isinf.cpp
+ ${CMAKE_CURRENT_SOURCE_DIR}/elementwise_functions/isnan.cpp
+ ${CMAKE_CURRENT_SOURCE_DIR}/elementwise_functions/less_equal.cpp
+ ${CMAKE_CURRENT_SOURCE_DIR}/elementwise_functions/less.cpp
+ ${CMAKE_CURRENT_SOURCE_DIR}/elementwise_functions/log.cpp
+ ${CMAKE_CURRENT_SOURCE_DIR}/elementwise_functions/log1p.cpp
+ ${CMAKE_CURRENT_SOURCE_DIR}/elementwise_functions/log2.cpp
+ ${CMAKE_CURRENT_SOURCE_DIR}/elementwise_functions/log10.cpp
+ ${CMAKE_CURRENT_SOURCE_DIR}/elementwise_functions/logaddexp.cpp
+ ${CMAKE_CURRENT_SOURCE_DIR}/elementwise_functions/logical_and.cpp
+ ${CMAKE_CURRENT_SOURCE_DIR}/elementwise_functions/logical_not.cpp
+ ${CMAKE_CURRENT_SOURCE_DIR}/elementwise_functions/logical_or.cpp
+ ${CMAKE_CURRENT_SOURCE_DIR}/elementwise_functions/logical_xor.cpp
+ ${CMAKE_CURRENT_SOURCE_DIR}/elementwise_functions/maximum.cpp
+ ${CMAKE_CURRENT_SOURCE_DIR}/elementwise_functions/minimum.cpp
+ ${CMAKE_CURRENT_SOURCE_DIR}/elementwise_functions/multiply.cpp
+ ${CMAKE_CURRENT_SOURCE_DIR}/elementwise_functions/negative.cpp
+ ${CMAKE_CURRENT_SOURCE_DIR}/elementwise_functions/nextafter.cpp
+ ${CMAKE_CURRENT_SOURCE_DIR}/elementwise_functions/not_equal.cpp
+ ${CMAKE_CURRENT_SOURCE_DIR}/elementwise_functions/positive.cpp
+ ${CMAKE_CURRENT_SOURCE_DIR}/elementwise_functions/pow.cpp
+ ${CMAKE_CURRENT_SOURCE_DIR}/elementwise_functions/proj.cpp
+ ${CMAKE_CURRENT_SOURCE_DIR}/elementwise_functions/real.cpp
+ ${CMAKE_CURRENT_SOURCE_DIR}/elementwise_functions/reciprocal.cpp
+ ${CMAKE_CURRENT_SOURCE_DIR}/elementwise_functions/remainder.cpp
+ ${CMAKE_CURRENT_SOURCE_DIR}/elementwise_functions/round.cpp
+ ${CMAKE_CURRENT_SOURCE_DIR}/elementwise_functions/rsqrt.cpp
+ ${CMAKE_CURRENT_SOURCE_DIR}/elementwise_functions/sign.cpp
+ ${CMAKE_CURRENT_SOURCE_DIR}/elementwise_functions/signbit.cpp
+ ${CMAKE_CURRENT_SOURCE_DIR}/elementwise_functions/sin.cpp
+ ${CMAKE_CURRENT_SOURCE_DIR}/elementwise_functions/sinh.cpp
+ ${CMAKE_CURRENT_SOURCE_DIR}/elementwise_functions/sqrt.cpp
+ ${CMAKE_CURRENT_SOURCE_DIR}/elementwise_functions/square.cpp
+ ${CMAKE_CURRENT_SOURCE_DIR}/elementwise_functions/subtract.cpp
+ ${CMAKE_CURRENT_SOURCE_DIR}/elementwise_functions/tan.cpp
+ ${CMAKE_CURRENT_SOURCE_DIR}/elementwise_functions/tanh.cpp
+ ${CMAKE_CURRENT_SOURCE_DIR}/elementwise_functions/true_divide.cpp
+ ${CMAKE_CURRENT_SOURCE_DIR}/elementwise_functions/trunc.cpp
+)
+set(_reduction_sources
+ ${CMAKE_CURRENT_SOURCE_DIR}/reductions/reduction_common.cpp
+ ${CMAKE_CURRENT_SOURCE_DIR}/reductions/all.cpp
+ ${CMAKE_CURRENT_SOURCE_DIR}/reductions/any.cpp
+ ${CMAKE_CURRENT_SOURCE_DIR}/reductions/argmax.cpp
+ ${CMAKE_CURRENT_SOURCE_DIR}/reductions/argmin.cpp
+ ${CMAKE_CURRENT_SOURCE_DIR}/reductions/logsumexp.cpp
+ ${CMAKE_CURRENT_SOURCE_DIR}/reductions/max.cpp
+ ${CMAKE_CURRENT_SOURCE_DIR}/reductions/min.cpp
+ ${CMAKE_CURRENT_SOURCE_DIR}/reductions/prod.cpp
+ ${CMAKE_CURRENT_SOURCE_DIR}/reductions/reduce_hypot.cpp
+ ${CMAKE_CURRENT_SOURCE_DIR}/reductions/sum.cpp
+)
+set(_sorting_sources
+ ${CMAKE_CURRENT_SOURCE_DIR}/sorting/isin.cpp
+ ${CMAKE_CURRENT_SOURCE_DIR}/sorting/merge_sort.cpp
+ ${CMAKE_CURRENT_SOURCE_DIR}/sorting/merge_argsort.cpp
+ ${CMAKE_CURRENT_SOURCE_DIR}/sorting/radix_sort.cpp
+ ${CMAKE_CURRENT_SOURCE_DIR}/sorting/radix_argsort.cpp
+ ${CMAKE_CURRENT_SOURCE_DIR}/sorting/searchsorted.cpp
+ ${CMAKE_CURRENT_SOURCE_DIR}/sorting/topk.cpp
+)
+set(_linalg_sources
+ ${CMAKE_CURRENT_SOURCE_DIR}/elementwise_functions/elementwise_functions_type_utils.cpp
+ ${CMAKE_CURRENT_SOURCE_DIR}/linalg_functions/dot.cpp
+)
+set(_tensor_accumulation_impl_sources
+ ${CMAKE_CURRENT_SOURCE_DIR}/tensor_accumulation.cpp
+ ${_accumulator_sources}
+)
+set(_tensor_elementwise_impl_sources
+ ${_dpnp_elementwise_sources}
+ ${CMAKE_CURRENT_SOURCE_DIR}/tensor_elementwise.cpp
+ ${_elementwise_sources}
+)
+set(_tensor_reductions_impl_sources
+ ${CMAKE_CURRENT_SOURCE_DIR}/tensor_reductions.cpp
+ ${_reduction_sources}
+)
+set(_tensor_sorting_impl_sources
+ ${CMAKE_CURRENT_SOURCE_DIR}/tensor_sorting.cpp
+ ${_sorting_sources}
+)
+set(_tensor_linalg_impl_sources
+ ${CMAKE_CURRENT_SOURCE_DIR}/tensor_linalg.cpp
+ ${_linalg_sources}
+)
+
+set(_static_lib_trgt simplify_iteration_space)
+
+add_library(${_static_lib_trgt} STATIC ${_static_lib_sources})
+target_include_directories(${_static_lib_trgt} PRIVATE ${_libtensor_include_dir})
+target_link_libraries(${_static_lib_trgt} PRIVATE pybind11::headers Python::Module)
+set_target_properties(${_static_lib_trgt} PROPERTIES POSITION_INDEPENDENT_CODE ON)
+
+set(_py_trgts)
+
+set(python_module_name _tensor_impl)
+pybind11_add_module(${python_module_name} MODULE ${_tensor_impl_sources})
+add_sycl_to_target(TARGET ${python_module_name} SOURCES ${_tensor_impl_sources})
+target_link_libraries(${python_module_name} PRIVATE ${_static_lib_trgt})
+list(APPEND _py_trgts ${python_module_name})
+
+set(python_module_name _tensor_accumulation_impl)
+pybind11_add_module(${python_module_name} MODULE ${_tensor_accumulation_impl_sources})
+add_sycl_to_target(TARGET ${python_module_name} SOURCES ${_tensor_accumulation_impl_sources})
+target_link_libraries(${python_module_name} PRIVATE ${_static_lib_trgt})
+list(APPEND _py_trgts ${python_module_name})
+
+set(python_module_name _tensor_elementwise_impl)
+pybind11_add_module(${python_module_name} MODULE ${_tensor_elementwise_impl_sources})
+add_sycl_to_target(TARGET ${python_module_name} SOURCES ${_tensor_elementwise_impl_sources})
+target_link_libraries(${python_module_name} PRIVATE ${_static_lib_trgt})
+list(APPEND _py_trgts ${python_module_name})
+
+set(python_module_name _tensor_reductions_impl)
+pybind11_add_module(${python_module_name} MODULE ${_tensor_reductions_impl_sources})
+add_sycl_to_target(TARGET ${python_module_name} SOURCES ${_tensor_reductions_impl_sources})
+target_link_libraries(${python_module_name} PRIVATE ${_static_lib_trgt})
+list(APPEND _py_trgts ${python_module_name})
+
+set(python_module_name _tensor_sorting_impl)
+pybind11_add_module(${python_module_name} MODULE ${_tensor_sorting_impl_sources})
+add_sycl_to_target(TARGET ${python_module_name} SOURCES ${_tensor_sorting_impl_sources})
+target_link_libraries(${python_module_name} PRIVATE ${_static_lib_trgt})
+list(APPEND _py_trgts ${python_module_name})
+
+set(python_module_name _tensor_linalg_impl)
+pybind11_add_module(${python_module_name} MODULE ${_tensor_linalg_impl_sources})
+add_sycl_to_target(TARGET ${python_module_name} SOURCES ${_tensor_linalg_impl_sources})
+target_link_libraries(${python_module_name} PRIVATE ${_static_lib_trgt})
+list(APPEND _py_trgts ${python_module_name})
+
+set(python_module_name _statistics_impl)
+pybind11_add_module(${python_module_name} MODULE ${_statistics_impl_sources})
+add_sycl_to_target(TARGET ${python_module_name} SOURCES ${_statistics_impl_sources})
+list(APPEND _py_trgts ${python_module_name})
+
+set(python_module_name _window_impl)
+pybind11_add_module(${python_module_name} MODULE ${_window_impl_sources})
+add_sycl_to_target(TARGET ${python_module_name} SOURCES ${_window_impl_sources})
+list(APPEND _py_trgts ${python_module_name})
+
+set(_clang_prefix "")
+if(WIN32)
+ set(_clang_prefix "/clang:")
+endif()
+
+set(_no_fast_math_sources
+ ${CMAKE_CURRENT_SOURCE_DIR}/copy_and_cast_usm_to_usm.cpp
+ ${CMAKE_CURRENT_SOURCE_DIR}/full_ctor.cpp
+ ${CMAKE_CURRENT_SOURCE_DIR}/linear_sequences.cpp
+ ${CMAKE_CURRENT_SOURCE_DIR}/clip.cpp
+ ${CMAKE_CURRENT_SOURCE_DIR}/where.cpp
+)
+list(
+ APPEND _no_fast_math_sources
+ ${_elementwise_sources}
+ ${_reduction_sources}
+ ${_sorting_sources}
+ ${_linalg_sources}
+ ${_accumulator_sources}
+)
+# elementwise_functions_type_utils.cpp is in both the elementwise and linalg lists
+list(REMOVE_DUPLICATES _no_fast_math_sources)
+
+foreach(_src_fn ${_no_fast_math_sources})
+ get_source_file_property(_cmpl_options_prop ${_src_fn} COMPILE_OPTIONS)
+ set(_combined_options_prop ${_cmpl_options_prop} "${_clang_prefix}-fno-fast-math")
+ set_source_files_properties(
+ ${_src_fn}
+ PROPERTIES COMPILE_OPTIONS "${_combined_options_prop}"
+ )
+endforeach()
+
+# The two groups of sources are compiled with different floating-point flags.
+# 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.
+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)
+ list(
+ APPEND _combined_options_prop
+ -fprofile-instr-generate
+ -fcoverage-mapping
+ -fno-sycl-use-footer
+ )
+ endif()
+ set_source_files_properties(
+ ${_src_fn}
+ PROPERTIES COMPILE_OPTIONS "${_combined_options_prop}"
+ )
+endforeach()
+
+if(DPNP_GENERATE_COVERAGE)
+ # libtensor code the dpnp functions use, measured like the dpnp sources
+ target_compile_options(
+ ${_static_lib_trgt}
+ PRIVATE -fprofile-instr-generate -fcoverage-mapping
+ )
+ set_property(
+ SOURCE
+ ${CMAKE_CURRENT_SOURCE_DIR}/elementwise_functions/elementwise_functions_type_utils.cpp
+ APPEND
+ PROPERTY
+ COMPILE_OPTIONS
+ -fprofile-instr-generate
+ -fcoverage-mapping
+ -fno-sycl-use-footer
+ )
+endif()
+
+set(_linker_options "LINKER:${DPNP_LDFLAGS}")
+foreach(python_module_name ${_py_trgts})
+ target_compile_options(
+ ${python_module_name}
+ PRIVATE -fno-sycl-id-queries-fit-in-int
+ )
+ target_link_options(
+ ${python_module_name}
+ PRIVATE -fsycl-device-code-split=per_kernel -fno-sycl-id-queries-fit-in-int
+ )
+ if(DPNP_TENSOR_OFFLOAD_COMPRESS)
+ target_link_options(${python_module_name} PRIVATE --offload-compress)
+ endif()
+
+ target_include_directories(
+ ${python_module_name}
+ PRIVATE
+ ${CMAKE_SOURCE_DIR}/dpnp/include
+ ${_libtensor_include_dir}
+ ${CMAKE_CURRENT_SOURCE_DIR}/
+ )
+
+ 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})
+ if(DPNP_GENERATE_COVERAGE)
+ if(DPNP_TENSOR_GENERATE_COVERAGE_FOR_PYBIND11_EXTENSIONS)
+ target_compile_options(
+ ${python_module_name}
+ PRIVATE -fprofile-instr-generate -fcoverage-mapping
+ )
+ endif()
+ target_link_options(
+ ${python_module_name}
+ PRIVATE -fprofile-instr-generate -fcoverage-mapping
+ )
+ endif()
+ if(_dpnp_sycl_targets)
+ # make fat binary
+ target_compile_options(
+ ${python_module_name}
+ PRIVATE ${_dpnp_sycl_target_compile_options}
+ )
+ target_link_options(
+ ${python_module_name}
+ PRIVATE ${_dpnp_sycl_target_link_options}
+ )
+ endif()
+ # Ensure Cython modules build first so _usmarray.h exists
+ add_dependencies(${python_module_name} _usmarray)
+ if(DPNP_WITH_REDIST)
+ set_target_properties(
+ ${python_module_name}
+ PROPERTIES INSTALL_RPATH "$ORIGIN/../../../.."
+ )
+ endif()
+ install(TARGETS ${python_module_name} DESTINATION "dpnp/libtensor")
+endforeach()
diff --git a/dpnp/tensor/libtensor/source/accumulators.cpp b/dpnp/libtensor/source/accumulators.cpp
similarity index 99%
rename from dpnp/tensor/libtensor/source/accumulators.cpp
rename to dpnp/libtensor/source/accumulators.cpp
index 8605496087ff..e4341698ffac 100644
--- a/dpnp/tensor/libtensor/source/accumulators.cpp
+++ b/dpnp/libtensor/source/accumulators.cpp
@@ -29,7 +29,7 @@
//===----------------------------------------------------------------------===//
///
/// \file
-/// This file defines functions of dpnp.tensor._tensor_impl extensions
+/// This file defines functions of dpnp.libtensor._tensor_impl extensions
//===----------------------------------------------------------------------===//
#include
diff --git a/dpnp/tensor/libtensor/source/accumulators.hpp b/dpnp/libtensor/source/accumulators.hpp
similarity index 97%
rename from dpnp/tensor/libtensor/source/accumulators.hpp
rename to dpnp/libtensor/source/accumulators.hpp
index 0f9539437d21..731182b06a82 100644
--- a/dpnp/tensor/libtensor/source/accumulators.hpp
+++ b/dpnp/libtensor/source/accumulators.hpp
@@ -29,7 +29,7 @@
//===----------------------------------------------------------------------===//
///
/// \file
-/// This file defines functions of dpnp.tensor._tensor_impl extensions
+/// This file defines functions of dpnp.libtensor._tensor_impl extensions
//===----------------------------------------------------------------------===//
#pragma once
diff --git a/dpnp/tensor/libtensor/source/accumulators/accumulate_over_axis.hpp b/dpnp/libtensor/source/accumulators/accumulate_over_axis.hpp
similarity index 99%
rename from dpnp/tensor/libtensor/source/accumulators/accumulate_over_axis.hpp
rename to dpnp/libtensor/source/accumulators/accumulate_over_axis.hpp
index 9810c82016f1..d842d031eaa2 100644
--- a/dpnp/tensor/libtensor/source/accumulators/accumulate_over_axis.hpp
+++ b/dpnp/libtensor/source/accumulators/accumulate_over_axis.hpp
@@ -29,7 +29,7 @@
//===----------------------------------------------------------------------===//
///
/// \file
-/// This file defines functions of dpnp.tensor._tensor_accumulation_impl
+/// This file defines functions of dpnp.libtensor._tensor_accumulation_impl
// extensions
//===----------------------------------------------------------------------===//
diff --git a/dpnp/tensor/libtensor/source/accumulators/accumulators_common.cpp b/dpnp/libtensor/source/accumulators/accumulators_common.cpp
similarity index 96%
rename from dpnp/tensor/libtensor/source/accumulators/accumulators_common.cpp
rename to dpnp/libtensor/source/accumulators/accumulators_common.cpp
index 6a95ef01beec..a76ab47eb99a 100644
--- a/dpnp/tensor/libtensor/source/accumulators/accumulators_common.cpp
+++ b/dpnp/libtensor/source/accumulators/accumulators_common.cpp
@@ -29,7 +29,7 @@
//===----------------------------------------------------------------------===//
///
/// \file
-/// This file defines functions of dpnp.tensor._tensor_accumulation_impl
+/// This file defines functions of dpnp.libtensor._tensor_accumulation_impl
// extensions
//===----------------------------------------------------------------------===//
diff --git a/dpnp/tensor/libtensor/source/accumulators/accumulators_common.hpp b/dpnp/libtensor/source/accumulators/accumulators_common.hpp
similarity index 96%
rename from dpnp/tensor/libtensor/source/accumulators/accumulators_common.hpp
rename to dpnp/libtensor/source/accumulators/accumulators_common.hpp
index d33cc7f1d84c..e6a798bdcadd 100644
--- a/dpnp/tensor/libtensor/source/accumulators/accumulators_common.hpp
+++ b/dpnp/libtensor/source/accumulators/accumulators_common.hpp
@@ -29,7 +29,7 @@
//===----------------------------------------------------------------------===//
///
/// \file
-/// This file defines functions of dpnp.tensor._tensor_accumulation_impl
+/// This file defines functions of dpnp.libtensor._tensor_accumulation_impl
// extensions
//===----------------------------------------------------------------------===//
diff --git a/dpnp/tensor/libtensor/source/accumulators/cumulative_logsumexp.cpp b/dpnp/libtensor/source/accumulators/cumulative_logsumexp.cpp
similarity index 99%
rename from dpnp/tensor/libtensor/source/accumulators/cumulative_logsumexp.cpp
rename to dpnp/libtensor/source/accumulators/cumulative_logsumexp.cpp
index 5f8611499ff0..a786f423dec5 100644
--- a/dpnp/tensor/libtensor/source/accumulators/cumulative_logsumexp.cpp
+++ b/dpnp/libtensor/source/accumulators/cumulative_logsumexp.cpp
@@ -29,7 +29,7 @@
//===----------------------------------------------------------------------===//
///
/// \file
-/// This file defines functions of dpnp.tensor._tensor_accumulation_impl
+/// This file defines functions of dpnp.libtensor._tensor_accumulation_impl
// extensions
//===----------------------------------------------------------------------===//
diff --git a/dpnp/tensor/libtensor/source/accumulators/cumulative_logsumexp.hpp b/dpnp/libtensor/source/accumulators/cumulative_logsumexp.hpp
similarity index 96%
rename from dpnp/tensor/libtensor/source/accumulators/cumulative_logsumexp.hpp
rename to dpnp/libtensor/source/accumulators/cumulative_logsumexp.hpp
index 967712e1b57c..6c6275199f29 100644
--- a/dpnp/tensor/libtensor/source/accumulators/cumulative_logsumexp.hpp
+++ b/dpnp/libtensor/source/accumulators/cumulative_logsumexp.hpp
@@ -29,7 +29,7 @@
//===----------------------------------------------------------------------===//
///
/// \file
-/// This file defines functions of dpnp.tensor._tensor_accumulation_impl
+/// This file defines functions of dpnp.libtensor._tensor_accumulation_impl
// extensions
//===----------------------------------------------------------------------===//
diff --git a/dpnp/tensor/libtensor/source/accumulators/cumulative_prod.cpp b/dpnp/libtensor/source/accumulators/cumulative_prod.cpp
similarity index 99%
rename from dpnp/tensor/libtensor/source/accumulators/cumulative_prod.cpp
rename to dpnp/libtensor/source/accumulators/cumulative_prod.cpp
index 20828a80e476..a1b762feec32 100644
--- a/dpnp/tensor/libtensor/source/accumulators/cumulative_prod.cpp
+++ b/dpnp/libtensor/source/accumulators/cumulative_prod.cpp
@@ -29,7 +29,7 @@
//===----------------------------------------------------------------------===//
///
/// \file
-/// This file defines functions of dpnp.tensor._tensor_accumulation_impl
+/// This file defines functions of dpnp.libtensor._tensor_accumulation_impl
// extensions
//===----------------------------------------------------------------------===//
diff --git a/dpnp/tensor/libtensor/source/accumulators/cumulative_prod.hpp b/dpnp/libtensor/source/accumulators/cumulative_prod.hpp
similarity index 96%
rename from dpnp/tensor/libtensor/source/accumulators/cumulative_prod.hpp
rename to dpnp/libtensor/source/accumulators/cumulative_prod.hpp
index 177f933800f7..1ef6f40dc50a 100644
--- a/dpnp/tensor/libtensor/source/accumulators/cumulative_prod.hpp
+++ b/dpnp/libtensor/source/accumulators/cumulative_prod.hpp
@@ -29,7 +29,7 @@
//===----------------------------------------------------------------------===//
///
/// \file
-/// This file defines functions of dpnp.tensor._tensor_accumulation_impl
+/// This file defines functions of dpnp.libtensor._tensor_accumulation_impl
// extensions
//===----------------------------------------------------------------------===//
diff --git a/dpnp/tensor/libtensor/source/accumulators/cumulative_sum.cpp b/dpnp/libtensor/source/accumulators/cumulative_sum.cpp
similarity index 99%
rename from dpnp/tensor/libtensor/source/accumulators/cumulative_sum.cpp
rename to dpnp/libtensor/source/accumulators/cumulative_sum.cpp
index 69b538eb2c1f..c451722d2833 100644
--- a/dpnp/tensor/libtensor/source/accumulators/cumulative_sum.cpp
+++ b/dpnp/libtensor/source/accumulators/cumulative_sum.cpp
@@ -29,7 +29,7 @@
//===----------------------------------------------------------------------===//
///
/// \file
-/// This file defines functions of dpnp.tensor._tensor_accumulation_impl
+/// This file defines functions of dpnp.libtensor._tensor_accumulation_impl
// extensions
//===----------------------------------------------------------------------===//
diff --git a/dpnp/tensor/libtensor/source/accumulators/cumulative_sum.hpp b/dpnp/libtensor/source/accumulators/cumulative_sum.hpp
similarity index 96%
rename from dpnp/tensor/libtensor/source/accumulators/cumulative_sum.hpp
rename to dpnp/libtensor/source/accumulators/cumulative_sum.hpp
index 056d02c74ab8..4e4b8aaf602a 100644
--- a/dpnp/tensor/libtensor/source/accumulators/cumulative_sum.hpp
+++ b/dpnp/libtensor/source/accumulators/cumulative_sum.hpp
@@ -29,7 +29,7 @@
//===----------------------------------------------------------------------===//
///
/// \file
-/// This file defines functions of dpnp.tensor._tensor_accumulation_impl
+/// This file defines functions of dpnp.libtensor._tensor_accumulation_impl
// extensions
//===----------------------------------------------------------------------===//
diff --git a/dpnp/tensor/libtensor/source/boolean_advanced_indexing.cpp b/dpnp/libtensor/source/boolean_advanced_indexing.cpp
similarity index 100%
rename from dpnp/tensor/libtensor/source/boolean_advanced_indexing.cpp
rename to dpnp/libtensor/source/boolean_advanced_indexing.cpp
diff --git a/dpnp/tensor/libtensor/source/boolean_advanced_indexing.hpp b/dpnp/libtensor/source/boolean_advanced_indexing.hpp
similarity index 97%
rename from dpnp/tensor/libtensor/source/boolean_advanced_indexing.hpp
rename to dpnp/libtensor/source/boolean_advanced_indexing.hpp
index e8231178bdb3..dbcfe9f171eb 100644
--- a/dpnp/tensor/libtensor/source/boolean_advanced_indexing.hpp
+++ b/dpnp/libtensor/source/boolean_advanced_indexing.hpp
@@ -29,7 +29,7 @@
//===----------------------------------------------------------------------===//
///
/// \file
-/// This file defines functions of dpnp.tensor._tensor_impl extensions
+/// This file defines functions of dpnp.libtensor._tensor_impl extensions
//===----------------------------------------------------------------------===//
#pragma once
diff --git a/dpnp/backend/extensions/indexing/choose.cpp b/dpnp/libtensor/source/choose.cpp
similarity index 98%
rename from dpnp/backend/extensions/indexing/choose.cpp
rename to dpnp/libtensor/source/choose.cpp
index cffc376233d7..015fd5140abc 100644
--- a/dpnp/backend/extensions/indexing/choose.cpp
+++ b/dpnp/libtensor/source/choose.cpp
@@ -45,7 +45,7 @@
#include "dpnp4pybind11.hpp"
#include "ext/common.hpp"
-#include "kernels/indexing/choose.hpp"
+#include "kernels/choose.hpp"
// dpnp tensor headers
#include "utils/indexing_utils.hpp"
@@ -56,7 +56,7 @@
#include "utils/type_dispatch.hpp"
#include "utils/type_utils.hpp"
-namespace dpnp::extensions::indexing
+namespace dpnp::tensor::py_internal
{
namespace py = pybind11;
@@ -112,13 +112,12 @@ sycl::event choose_impl(sycl::queue &q,
shape_and_strides};
using NthChoiceIndexerT =
- dpnp::kernels::choose::strides::NthStrideOffsetUnpacked;
+ dpnp::tensor::kernels::choose::strides::NthStrideOffsetUnpacked;
const NthChoiceIndexerT choices_indexer{
nd, chc_offsets, shape_and_strides, shape_and_strides + 3 * nd};
- using ChooseFunc =
- dpnp::kernels::choose::ChooseFunctor;
+ using ChooseFunc = dpnp::tensor::kernels::choose::ChooseFunctor<
+ ProjectorT, InOutIndexerT, NthChoiceIndexerT, indTy, Ty>;
cgh.parallel_for(sycl::range<1>(nelems),
ChooseFunc(ind_tp, dst_tp, chcs_cp, n_chcs,
@@ -525,4 +524,4 @@ void init_choose(py::module_ m)
return;
}
-} // namespace dpnp::extensions::indexing
+} // namespace dpnp::tensor::py_internal
diff --git a/dpnp/backend/extensions/indexing/choose.hpp b/dpnp/libtensor/source/choose.hpp
similarity index 95%
rename from dpnp/backend/extensions/indexing/choose.hpp
rename to dpnp/libtensor/source/choose.hpp
index 2861e1c33d8a..b8594af081ef 100644
--- a/dpnp/backend/extensions/indexing/choose.hpp
+++ b/dpnp/libtensor/source/choose.hpp
@@ -32,7 +32,7 @@
namespace py = pybind11;
-namespace dpnp::extensions::indexing
+namespace dpnp::tensor::py_internal
{
void init_choose(py::module_ m);
-} // namespace dpnp::extensions::indexing
+} // namespace dpnp::tensor::py_internal
diff --git a/dpnp/tensor/libtensor/source/clip.cpp b/dpnp/libtensor/source/clip.cpp
similarity index 100%
rename from dpnp/tensor/libtensor/source/clip.cpp
rename to dpnp/libtensor/source/clip.cpp
diff --git a/dpnp/tensor/libtensor/source/clip.hpp b/dpnp/libtensor/source/clip.hpp
similarity index 100%
rename from dpnp/tensor/libtensor/source/clip.hpp
rename to dpnp/libtensor/source/clip.hpp
diff --git a/dpnp/tensor/libtensor/source/copy_and_cast_usm_to_usm.cpp b/dpnp/libtensor/source/copy_and_cast_usm_to_usm.cpp
similarity index 99%
rename from dpnp/tensor/libtensor/source/copy_and_cast_usm_to_usm.cpp
rename to dpnp/libtensor/source/copy_and_cast_usm_to_usm.cpp
index 85bb9e6947e3..d39db9aba2ca 100644
--- a/dpnp/tensor/libtensor/source/copy_and_cast_usm_to_usm.cpp
+++ b/dpnp/libtensor/source/copy_and_cast_usm_to_usm.cpp
@@ -29,7 +29,7 @@
//===----------------------------------------------------------------------===//
///
/// \file
-/// This file defines functions of dpnp.tensor._tensor_impl extensions
+/// This file defines functions of dpnp.libtensor._tensor_impl extensions
//===----------------------------------------------------------------------===//
#include
diff --git a/dpnp/tensor/libtensor/source/copy_and_cast_usm_to_usm.hpp b/dpnp/libtensor/source/copy_and_cast_usm_to_usm.hpp
similarity index 96%
rename from dpnp/tensor/libtensor/source/copy_and_cast_usm_to_usm.hpp
rename to dpnp/libtensor/source/copy_and_cast_usm_to_usm.hpp
index 0183d2ebc18c..704107b54881 100644
--- a/dpnp/tensor/libtensor/source/copy_and_cast_usm_to_usm.hpp
+++ b/dpnp/libtensor/source/copy_and_cast_usm_to_usm.hpp
@@ -29,7 +29,7 @@
//===----------------------------------------------------------------------===//
///
/// \file
-/// This file defines functions of dpnp.tensor._tensor_impl extensions
+/// This file defines functions of dpnp.libtensor._tensor_impl extensions
//===----------------------------------------------------------------------===//
#pragma once
diff --git a/dpnp/tensor/libtensor/source/copy_as_contig.cpp b/dpnp/libtensor/source/copy_as_contig.cpp
similarity index 99%
rename from dpnp/tensor/libtensor/source/copy_as_contig.cpp
rename to dpnp/libtensor/source/copy_as_contig.cpp
index 66ace2138032..43b3b9517559 100644
--- a/dpnp/tensor/libtensor/source/copy_as_contig.cpp
+++ b/dpnp/libtensor/source/copy_as_contig.cpp
@@ -29,7 +29,7 @@
//===----------------------------------------------------------------------===//
///
/// \file
-/// This file defines functions of dpnp.tensor._tensor_impl extensions
+/// This file defines functions of dpnp.libtensor._tensor_impl extensions
//===----------------------------------------------------------------------===//
#include
diff --git a/dpnp/tensor/libtensor/source/copy_as_contig.hpp b/dpnp/libtensor/source/copy_as_contig.hpp
similarity index 100%
rename from dpnp/tensor/libtensor/source/copy_as_contig.hpp
rename to dpnp/libtensor/source/copy_as_contig.hpp
diff --git a/dpnp/tensor/libtensor/source/copy_for_reshape.cpp b/dpnp/libtensor/source/copy_for_reshape.cpp
similarity index 98%
rename from dpnp/tensor/libtensor/source/copy_for_reshape.cpp
rename to dpnp/libtensor/source/copy_for_reshape.cpp
index 688a5763c551..4ccd91c848bc 100644
--- a/dpnp/tensor/libtensor/source/copy_for_reshape.cpp
+++ b/dpnp/libtensor/source/copy_for_reshape.cpp
@@ -29,7 +29,7 @@
//===----------------------------------------------------------------------===//
///
/// \file
-/// This file defines functions of dpnp.tensor._tensor_impl extensions
+/// This file defines functions of dpnp.libtensor._tensor_impl extensions
//===----------------------------------------------------------------------===//
#include
diff --git a/dpnp/tensor/libtensor/source/copy_for_reshape.hpp b/dpnp/libtensor/source/copy_for_reshape.hpp
similarity index 97%
rename from dpnp/tensor/libtensor/source/copy_for_reshape.hpp
rename to dpnp/libtensor/source/copy_for_reshape.hpp
index 843183ed5b95..c80d6acd01a7 100644
--- a/dpnp/tensor/libtensor/source/copy_for_reshape.hpp
+++ b/dpnp/libtensor/source/copy_for_reshape.hpp
@@ -29,7 +29,7 @@
//===----------------------------------------------------------------------===//
///
/// \file
-/// This file defines functions of dpnp.tensor._tensor_impl extensions
+/// This file defines functions of dpnp.libtensor._tensor_impl extensions
//===----------------------------------------------------------------------===//
#pragma once
diff --git a/dpnp/tensor/libtensor/source/copy_for_roll.cpp b/dpnp/libtensor/source/copy_for_roll.cpp
similarity index 99%
rename from dpnp/tensor/libtensor/source/copy_for_roll.cpp
rename to dpnp/libtensor/source/copy_for_roll.cpp
index 4ff6cca14e48..3a397540e28d 100644
--- a/dpnp/tensor/libtensor/source/copy_for_roll.cpp
+++ b/dpnp/libtensor/source/copy_for_roll.cpp
@@ -29,7 +29,7 @@
//===----------------------------------------------------------------------===//
///
/// \file
-/// This file defines functions of dpnp.tensor._tensor_impl extensions
+/// This file defines functions of dpnp.libtensor._tensor_impl extensions
//===----------------------------------------------------------------------===//
#include
diff --git a/dpnp/tensor/libtensor/source/copy_for_roll.hpp b/dpnp/libtensor/source/copy_for_roll.hpp
similarity index 97%
rename from dpnp/tensor/libtensor/source/copy_for_roll.hpp
rename to dpnp/libtensor/source/copy_for_roll.hpp
index 9b14e98ba38d..8befe8709733 100644
--- a/dpnp/tensor/libtensor/source/copy_for_roll.hpp
+++ b/dpnp/libtensor/source/copy_for_roll.hpp
@@ -29,7 +29,7 @@
//===----------------------------------------------------------------------===//
///
/// \file
-/// This file defines functions of dpnp.tensor._tensor_impl extensions
+/// This file defines functions of dpnp.libtensor._tensor_impl extensions
//===----------------------------------------------------------------------===//
#pragma once
diff --git a/dpnp/tensor/libtensor/source/copy_numpy_ndarray_into_usm_ndarray.cpp b/dpnp/libtensor/source/copy_numpy_ndarray_into_usm_ndarray.cpp
similarity index 99%
rename from dpnp/tensor/libtensor/source/copy_numpy_ndarray_into_usm_ndarray.cpp
rename to dpnp/libtensor/source/copy_numpy_ndarray_into_usm_ndarray.cpp
index 8785e51258f5..2b89bc2098a6 100644
--- a/dpnp/tensor/libtensor/source/copy_numpy_ndarray_into_usm_ndarray.cpp
+++ b/dpnp/libtensor/source/copy_numpy_ndarray_into_usm_ndarray.cpp
@@ -29,7 +29,7 @@
//===----------------------------------------------------------------------===//
///
/// \file
-/// This file defines functions of dpnp.tensor._tensor_impl extensions
+/// This file defines functions of dpnp.libtensor._tensor_impl extensions
//===----------------------------------------------------------------------===//
#include
diff --git a/dpnp/tensor/libtensor/source/copy_numpy_ndarray_into_usm_ndarray.hpp b/dpnp/libtensor/source/copy_numpy_ndarray_into_usm_ndarray.hpp
similarity index 97%
rename from dpnp/tensor/libtensor/source/copy_numpy_ndarray_into_usm_ndarray.hpp
rename to dpnp/libtensor/source/copy_numpy_ndarray_into_usm_ndarray.hpp
index 9871e7d68eb2..7b549dbe13f6 100644
--- a/dpnp/tensor/libtensor/source/copy_numpy_ndarray_into_usm_ndarray.hpp
+++ b/dpnp/libtensor/source/copy_numpy_ndarray_into_usm_ndarray.hpp
@@ -29,7 +29,7 @@
//===----------------------------------------------------------------------===//
///
/// \file
-/// This file defines functions of dpnp.tensor._tensor_impl extensions
+/// This file defines functions of dpnp.libtensor._tensor_impl extensions
//===----------------------------------------------------------------------===//
#pragma once
diff --git a/dpnp/tensor/libtensor/source/device_support_queries.cpp b/dpnp/libtensor/source/device_support_queries.cpp
similarity index 98%
rename from dpnp/tensor/libtensor/source/device_support_queries.cpp
rename to dpnp/libtensor/source/device_support_queries.cpp
index 530dde211635..fa11e22a7a65 100644
--- a/dpnp/tensor/libtensor/source/device_support_queries.cpp
+++ b/dpnp/libtensor/source/device_support_queries.cpp
@@ -29,7 +29,7 @@
//===--------------------------------------------------------------------===//
///
/// \file
-/// This file defines functions of dpnp.tensor._tensor_impl extensions
+/// This file defines functions of dpnp.libtensor._tensor_impl extensions
//===--------------------------------------------------------------------===//
#include
diff --git a/dpnp/tensor/libtensor/source/device_support_queries.hpp b/dpnp/libtensor/source/device_support_queries.hpp
similarity index 97%
rename from dpnp/tensor/libtensor/source/device_support_queries.hpp
rename to dpnp/libtensor/source/device_support_queries.hpp
index ccb8d66aede3..b41fc874bf0b 100644
--- a/dpnp/tensor/libtensor/source/device_support_queries.hpp
+++ b/dpnp/libtensor/source/device_support_queries.hpp
@@ -28,7 +28,7 @@
//===--------------------------------------------------------------------===//
///
/// \file
-/// This file defines functions of dpnp.tensor._tensor_impl extensions
+/// This file defines functions of dpnp.libtensor._tensor_impl extensions
//===--------------------------------------------------------------------===//
#pragma once
diff --git a/dpnp/tensor/libtensor/source/elementwise_functions/abs.cpp b/dpnp/libtensor/source/elementwise_functions/abs.cpp
similarity index 98%
rename from dpnp/tensor/libtensor/source/elementwise_functions/abs.cpp
rename to dpnp/libtensor/source/elementwise_functions/abs.cpp
index e0487e89f52d..fc24d16f1a24 100644
--- a/dpnp/tensor/libtensor/source/elementwise_functions/abs.cpp
+++ b/dpnp/libtensor/source/elementwise_functions/abs.cpp
@@ -29,7 +29,7 @@
//===---------------------------------------------------------------------===//
///
/// \file
-/// This file defines functions of dpnp.tensor._tensor_elementwise_impl
+/// This file defines functions of dpnp.libtensor._tensor_elementwise_impl
/// extension, specifically functions for elementwise operations.
//===---------------------------------------------------------------------===//
diff --git a/dpnp/tensor/libtensor/source/elementwise_functions/abs.hpp b/dpnp/libtensor/source/elementwise_functions/abs.hpp
similarity index 96%
rename from dpnp/tensor/libtensor/source/elementwise_functions/abs.hpp
rename to dpnp/libtensor/source/elementwise_functions/abs.hpp
index 1504f28d0199..858a52127084 100644
--- a/dpnp/tensor/libtensor/source/elementwise_functions/abs.hpp
+++ b/dpnp/libtensor/source/elementwise_functions/abs.hpp
@@ -29,7 +29,7 @@
//===---------------------------------------------------------------------===//
///
/// \file
-/// This file defines functions of dpnp.tensor._tensor_elementwise_impl
+/// This file defines functions of dpnp.libtensor._tensor_elementwise_impl
/// extension, specifically functions for elementwise operations.
//===---------------------------------------------------------------------===//
diff --git a/dpnp/tensor/libtensor/source/elementwise_functions/acos.cpp b/dpnp/libtensor/source/elementwise_functions/acos.cpp
similarity index 98%
rename from dpnp/tensor/libtensor/source/elementwise_functions/acos.cpp
rename to dpnp/libtensor/source/elementwise_functions/acos.cpp
index 0cfd711d711e..67e729dba379 100644
--- a/dpnp/tensor/libtensor/source/elementwise_functions/acos.cpp
+++ b/dpnp/libtensor/source/elementwise_functions/acos.cpp
@@ -29,7 +29,7 @@
//===---------------------------------------------------------------------===//
///
/// \file
-/// This file defines functions of dpnp.tensor._tensor_elementwise_impl
+/// This file defines functions of dpnp.libtensor._tensor_elementwise_impl
/// extension, specifically functions for elementwise operations.
//===---------------------------------------------------------------------===//
diff --git a/dpnp/tensor/libtensor/source/elementwise_functions/acos.hpp b/dpnp/libtensor/source/elementwise_functions/acos.hpp
similarity index 96%
rename from dpnp/tensor/libtensor/source/elementwise_functions/acos.hpp
rename to dpnp/libtensor/source/elementwise_functions/acos.hpp
index 517bee921fb4..9af7f8dbd00c 100644
--- a/dpnp/tensor/libtensor/source/elementwise_functions/acos.hpp
+++ b/dpnp/libtensor/source/elementwise_functions/acos.hpp
@@ -29,7 +29,7 @@
//===---------------------------------------------------------------------===//
///
/// \file
-/// This file defines functions of dpnp.tensor._tensor_elementwise_impl
+/// This file defines functions of dpnp.libtensor._tensor_elementwise_impl
/// extension, specifically functions for elementwise operations.
//===---------------------------------------------------------------------===//
diff --git a/dpnp/tensor/libtensor/source/elementwise_functions/acosh.cpp b/dpnp/libtensor/source/elementwise_functions/acosh.cpp
similarity index 98%
rename from dpnp/tensor/libtensor/source/elementwise_functions/acosh.cpp
rename to dpnp/libtensor/source/elementwise_functions/acosh.cpp
index c7334736f510..6679796c8fb9 100644
--- a/dpnp/tensor/libtensor/source/elementwise_functions/acosh.cpp
+++ b/dpnp/libtensor/source/elementwise_functions/acosh.cpp
@@ -29,7 +29,7 @@
//===---------------------------------------------------------------------===//
///
/// \file
-/// This file defines functions of dpnp.tensor._tensor_elementwise_impl
+/// This file defines functions of dpnp.libtensor._tensor_elementwise_impl
/// extension, specifically functions for elementwise operations.
//===---------------------------------------------------------------------===//
diff --git a/dpnp/tensor/libtensor/source/elementwise_functions/acosh.hpp b/dpnp/libtensor/source/elementwise_functions/acosh.hpp
similarity index 96%
rename from dpnp/tensor/libtensor/source/elementwise_functions/acosh.hpp
rename to dpnp/libtensor/source/elementwise_functions/acosh.hpp
index 5a9d4dd8e5b9..c29f1e5d8aa9 100644
--- a/dpnp/tensor/libtensor/source/elementwise_functions/acosh.hpp
+++ b/dpnp/libtensor/source/elementwise_functions/acosh.hpp
@@ -29,7 +29,7 @@
//===---------------------------------------------------------------------===//
///
/// \file
-/// This file defines functions of dpnp.tensor._tensor_elementwise_impl
+/// This file defines functions of dpnp.libtensor._tensor_elementwise_impl
/// extension, specifically functions for elementwise operations.
//===---------------------------------------------------------------------===//
diff --git a/dpnp/tensor/libtensor/source/elementwise_functions/add.cpp b/dpnp/libtensor/source/elementwise_functions/add.cpp
similarity index 99%
rename from dpnp/tensor/libtensor/source/elementwise_functions/add.cpp
rename to dpnp/libtensor/source/elementwise_functions/add.cpp
index 7ba2fd8a37f3..878a77c3559b 100644
--- a/dpnp/tensor/libtensor/source/elementwise_functions/add.cpp
+++ b/dpnp/libtensor/source/elementwise_functions/add.cpp
@@ -29,7 +29,7 @@
//===---------------------------------------------------------------------===//
///
/// \file
-/// This file defines functions of dpnp.tensor._tensor_elementwise_impl
+/// This file defines functions of dpnp.libtensor._tensor_elementwise_impl
/// extension, specifically functions for elementwise operations.
//===---------------------------------------------------------------------===//
diff --git a/dpnp/tensor/libtensor/source/elementwise_functions/add.hpp b/dpnp/libtensor/source/elementwise_functions/add.hpp
similarity index 96%
rename from dpnp/tensor/libtensor/source/elementwise_functions/add.hpp
rename to dpnp/libtensor/source/elementwise_functions/add.hpp
index 2d668184a523..906ad8727d56 100644
--- a/dpnp/tensor/libtensor/source/elementwise_functions/add.hpp
+++ b/dpnp/libtensor/source/elementwise_functions/add.hpp
@@ -29,7 +29,7 @@
//===---------------------------------------------------------------------===//
///
/// \file
-/// This file defines functions of dpnp.tensor._tensor_elementwise_impl
+/// This file defines functions of dpnp.libtensor._tensor_elementwise_impl
/// extension, specifically functions for elementwise operations.
//===---------------------------------------------------------------------===//
diff --git a/dpnp/tensor/libtensor/source/elementwise_functions/angle.cpp b/dpnp/libtensor/source/elementwise_functions/angle.cpp
similarity index 98%
rename from dpnp/tensor/libtensor/source/elementwise_functions/angle.cpp
rename to dpnp/libtensor/source/elementwise_functions/angle.cpp
index 8d3336796ad4..57b4820025aa 100644
--- a/dpnp/tensor/libtensor/source/elementwise_functions/angle.cpp
+++ b/dpnp/libtensor/source/elementwise_functions/angle.cpp
@@ -29,7 +29,7 @@
//===---------------------------------------------------------------------===//
///
/// \file
-/// This file defines functions of dpnp.tensor._tensor_elementwise_impl
+/// This file defines functions of dpnp.libtensor._tensor_elementwise_impl
/// extension, specifically functions for elementwise operations.
//===---------------------------------------------------------------------===//
diff --git a/dpnp/tensor/libtensor/source/elementwise_functions/angle.hpp b/dpnp/libtensor/source/elementwise_functions/angle.hpp
similarity index 96%
rename from dpnp/tensor/libtensor/source/elementwise_functions/angle.hpp
rename to dpnp/libtensor/source/elementwise_functions/angle.hpp
index 630e8dbbc077..d4fae26ab6bc 100644
--- a/dpnp/tensor/libtensor/source/elementwise_functions/angle.hpp
+++ b/dpnp/libtensor/source/elementwise_functions/angle.hpp
@@ -29,7 +29,7 @@
//===---------------------------------------------------------------------===//
///
/// \file
-/// This file defines functions of dpnp.tensor._tensor_elementwise_impl
+/// This file defines functions of dpnp.libtensor._tensor_elementwise_impl
/// extension, specifically functions for elementwise operations.
//===---------------------------------------------------------------------===//
diff --git a/dpnp/tensor/libtensor/source/elementwise_functions/asin.cpp b/dpnp/libtensor/source/elementwise_functions/asin.cpp
similarity index 98%
rename from dpnp/tensor/libtensor/source/elementwise_functions/asin.cpp
rename to dpnp/libtensor/source/elementwise_functions/asin.cpp
index 7c62285af510..1f2a111cc20b 100644
--- a/dpnp/tensor/libtensor/source/elementwise_functions/asin.cpp
+++ b/dpnp/libtensor/source/elementwise_functions/asin.cpp
@@ -29,7 +29,7 @@
//===---------------------------------------------------------------------===//
///
/// \file
-/// This file defines functions of dpnp.tensor._tensor_elementwise_impl
+/// This file defines functions of dpnp.libtensor._tensor_elementwise_impl
/// extension, specifically functions for elementwise operations.
//===---------------------------------------------------------------------===//
diff --git a/dpnp/tensor/libtensor/source/elementwise_functions/asin.hpp b/dpnp/libtensor/source/elementwise_functions/asin.hpp
similarity index 96%
rename from dpnp/tensor/libtensor/source/elementwise_functions/asin.hpp
rename to dpnp/libtensor/source/elementwise_functions/asin.hpp
index 260ed3232e80..cc12a1bb2282 100644
--- a/dpnp/tensor/libtensor/source/elementwise_functions/asin.hpp
+++ b/dpnp/libtensor/source/elementwise_functions/asin.hpp
@@ -29,7 +29,7 @@
//===---------------------------------------------------------------------===//
///
/// \file
-/// This file defines functions of dpnp.tensor._tensor_elementwise_impl
+/// This file defines functions of dpnp.libtensor._tensor_elementwise_impl
/// extension, specifically functions for elementwise operations.
//===---------------------------------------------------------------------===//
diff --git a/dpnp/tensor/libtensor/source/elementwise_functions/asinh.cpp b/dpnp/libtensor/source/elementwise_functions/asinh.cpp
similarity index 98%
rename from dpnp/tensor/libtensor/source/elementwise_functions/asinh.cpp
rename to dpnp/libtensor/source/elementwise_functions/asinh.cpp
index e560dc3330bf..05e57e3350c1 100644
--- a/dpnp/tensor/libtensor/source/elementwise_functions/asinh.cpp
+++ b/dpnp/libtensor/source/elementwise_functions/asinh.cpp
@@ -29,7 +29,7 @@
//===---------------------------------------------------------------------===//
///
/// \file
-/// This file defines functions of dpnp.tensor._tensor_elementwise_impl
+/// This file defines functions of dpnp.libtensor._tensor_elementwise_impl
/// extension, specifically functions for elementwise operations.
//===---------------------------------------------------------------------===//
diff --git a/dpnp/tensor/libtensor/source/elementwise_functions/asinh.hpp b/dpnp/libtensor/source/elementwise_functions/asinh.hpp
similarity index 96%
rename from dpnp/tensor/libtensor/source/elementwise_functions/asinh.hpp
rename to dpnp/libtensor/source/elementwise_functions/asinh.hpp
index 1c5ac0bbf125..f99071086fe0 100644
--- a/dpnp/tensor/libtensor/source/elementwise_functions/asinh.hpp
+++ b/dpnp/libtensor/source/elementwise_functions/asinh.hpp
@@ -29,7 +29,7 @@
//===---------------------------------------------------------------------===//
///
/// \file
-/// This file defines functions of dpnp.tensor._tensor_elementwise_impl
+/// This file defines functions of dpnp.libtensor._tensor_elementwise_impl
/// extension, specifically functions for elementwise operations.
//===---------------------------------------------------------------------===//
diff --git a/dpnp/tensor/libtensor/source/elementwise_functions/atan.cpp b/dpnp/libtensor/source/elementwise_functions/atan.cpp
similarity index 98%
rename from dpnp/tensor/libtensor/source/elementwise_functions/atan.cpp
rename to dpnp/libtensor/source/elementwise_functions/atan.cpp
index b72a3437524b..61b9645b0648 100644
--- a/dpnp/tensor/libtensor/source/elementwise_functions/atan.cpp
+++ b/dpnp/libtensor/source/elementwise_functions/atan.cpp
@@ -29,7 +29,7 @@
//===---------------------------------------------------------------------===//
///
/// \file
-/// This file defines functions of dpnp.tensor._tensor_elementwise_impl
+/// This file defines functions of dpnp.libtensor._tensor_elementwise_impl
/// extension, specifically functions for elementwise operations.
//===---------------------------------------------------------------------===//
diff --git a/dpnp/tensor/libtensor/source/elementwise_functions/atan.hpp b/dpnp/libtensor/source/elementwise_functions/atan.hpp
similarity index 96%
rename from dpnp/tensor/libtensor/source/elementwise_functions/atan.hpp
rename to dpnp/libtensor/source/elementwise_functions/atan.hpp
index be69279f28c1..4f4c0ea88030 100644
--- a/dpnp/tensor/libtensor/source/elementwise_functions/atan.hpp
+++ b/dpnp/libtensor/source/elementwise_functions/atan.hpp
@@ -29,7 +29,7 @@
//===---------------------------------------------------------------------===//
///
/// \file
-/// This file defines functions of dpnp.tensor._tensor_elementwise_impl
+/// This file defines functions of dpnp.libtensor._tensor_elementwise_impl
/// extension, specifically functions for elementwise operations.
//===---------------------------------------------------------------------===//
diff --git a/dpnp/tensor/libtensor/source/elementwise_functions/atan2.cpp b/dpnp/libtensor/source/elementwise_functions/atan2.cpp
similarity index 98%
rename from dpnp/tensor/libtensor/source/elementwise_functions/atan2.cpp
rename to dpnp/libtensor/source/elementwise_functions/atan2.cpp
index aaef3bdd45d7..6f77d8b27de8 100644
--- a/dpnp/tensor/libtensor/source/elementwise_functions/atan2.cpp
+++ b/dpnp/libtensor/source/elementwise_functions/atan2.cpp
@@ -29,7 +29,7 @@
//===---------------------------------------------------------------------===//
///
/// \file
-/// This file defines functions of dpnp.tensor._tensor_elementwise_impl
+/// This file defines functions of dpnp.libtensor._tensor_elementwise_impl
/// extension, specifically functions for elementwise operations.
//===---------------------------------------------------------------------===//
diff --git a/dpnp/tensor/libtensor/source/elementwise_functions/atan2.hpp b/dpnp/libtensor/source/elementwise_functions/atan2.hpp
similarity index 96%
rename from dpnp/tensor/libtensor/source/elementwise_functions/atan2.hpp
rename to dpnp/libtensor/source/elementwise_functions/atan2.hpp
index 0bf08fedb770..1ebcc3ff53be 100644
--- a/dpnp/tensor/libtensor/source/elementwise_functions/atan2.hpp
+++ b/dpnp/libtensor/source/elementwise_functions/atan2.hpp
@@ -29,7 +29,7 @@
//===---------------------------------------------------------------------===//
///
/// \file
-/// This file defines functions of dpnp.tensor._tensor_elementwise_impl
+/// This file defines functions of dpnp.libtensor._tensor_elementwise_impl
/// extension, specifically functions for elementwise operations.
//===---------------------------------------------------------------------===//
diff --git a/dpnp/tensor/libtensor/source/elementwise_functions/atanh.cpp b/dpnp/libtensor/source/elementwise_functions/atanh.cpp
similarity index 98%
rename from dpnp/tensor/libtensor/source/elementwise_functions/atanh.cpp
rename to dpnp/libtensor/source/elementwise_functions/atanh.cpp
index 0d8dd64a1e3d..1761cba61c38 100644
--- a/dpnp/tensor/libtensor/source/elementwise_functions/atanh.cpp
+++ b/dpnp/libtensor/source/elementwise_functions/atanh.cpp
@@ -29,7 +29,7 @@
//===---------------------------------------------------------------------===//
///
/// \file
-/// This file defines functions of dpnp.tensor._tensor_elementwise_impl
+/// This file defines functions of dpnp.libtensor._tensor_elementwise_impl
/// extension, specifically functions for elementwise operations.
//===---------------------------------------------------------------------===//
diff --git a/dpnp/tensor/libtensor/source/elementwise_functions/atanh.hpp b/dpnp/libtensor/source/elementwise_functions/atanh.hpp
similarity index 96%
rename from dpnp/tensor/libtensor/source/elementwise_functions/atanh.hpp
rename to dpnp/libtensor/source/elementwise_functions/atanh.hpp
index 20a09d584f1f..3f5faf71ea1e 100644
--- a/dpnp/tensor/libtensor/source/elementwise_functions/atanh.hpp
+++ b/dpnp/libtensor/source/elementwise_functions/atanh.hpp
@@ -29,7 +29,7 @@
//===---------------------------------------------------------------------===//
///
/// \file
-/// This file defines functions of dpnp.tensor._tensor_elementwise_impl
+/// This file defines functions of dpnp.libtensor._tensor_elementwise_impl
/// extension, specifically functions for elementwise operations.
//===---------------------------------------------------------------------===//
diff --git a/dpnp/tensor/libtensor/source/elementwise_functions/bitwise_and.cpp b/dpnp/libtensor/source/elementwise_functions/bitwise_and.cpp
similarity index 99%
rename from dpnp/tensor/libtensor/source/elementwise_functions/bitwise_and.cpp
rename to dpnp/libtensor/source/elementwise_functions/bitwise_and.cpp
index 43fd70e46be4..b0df866c649d 100644
--- a/dpnp/tensor/libtensor/source/elementwise_functions/bitwise_and.cpp
+++ b/dpnp/libtensor/source/elementwise_functions/bitwise_and.cpp
@@ -29,7 +29,7 @@
//===---------------------------------------------------------------------===//
///
/// \file
-/// This file defines functions of dpnp.tensor._tensor_elementwise_impl
+/// This file defines functions of dpnp.libtensor._tensor_elementwise_impl
/// extension, specifically functions for elementwise operations.
//===---------------------------------------------------------------------===//
diff --git a/dpnp/tensor/libtensor/source/elementwise_functions/bitwise_and.hpp b/dpnp/libtensor/source/elementwise_functions/bitwise_and.hpp
similarity index 96%
rename from dpnp/tensor/libtensor/source/elementwise_functions/bitwise_and.hpp
rename to dpnp/libtensor/source/elementwise_functions/bitwise_and.hpp
index 14dae1aa5a49..afe58590a832 100644
--- a/dpnp/tensor/libtensor/source/elementwise_functions/bitwise_and.hpp
+++ b/dpnp/libtensor/source/elementwise_functions/bitwise_and.hpp
@@ -29,7 +29,7 @@
//===---------------------------------------------------------------------===//
///
/// \file
-/// This file defines functions of dpnp.tensor._tensor_elementwise_impl
+/// This file defines functions of dpnp.libtensor._tensor_elementwise_impl
/// extension, specifically functions for elementwise operations.
//===---------------------------------------------------------------------===//
diff --git a/dpnp/backend/extensions/ufunc/elementwise_functions/bitwise_count.cpp b/dpnp/libtensor/source/elementwise_functions/bitwise_count.cpp
similarity index 87%
rename from dpnp/backend/extensions/ufunc/elementwise_functions/bitwise_count.cpp
rename to dpnp/libtensor/source/elementwise_functions/bitwise_count.cpp
index eb0b7edd6d6d..1a77d9652e65 100644
--- a/dpnp/backend/extensions/ufunc/elementwise_functions/bitwise_count.cpp
+++ b/dpnp/libtensor/source/elementwise_functions/bitwise_count.cpp
@@ -42,19 +42,15 @@
#include "kernels/elementwise_functions/bitwise_count.hpp"
#include "populate.hpp"
-// include a local copy of elementwise common header from dpnp tensor:
-// dpnp/tensor/libtensor/source/elementwise_functions/elementwise_functions.hpp
-// TODO: replace by consolidating with tensor post-migration
-#include "../../elementwise_functions/elementwise_functions.hpp"
+#include "elementwise_functions.hpp"
// dpnp tensor headers
#include "kernels/elementwise_functions/common.hpp"
#include "utils/type_dispatch.hpp"
-namespace dpnp::extensions::ufunc
+namespace dpnp::tensor::py_internal
{
namespace py = pybind11;
-namespace py_int = dpnp::extensions::py_internal;
namespace impl
{
@@ -82,7 +78,7 @@ struct OutputType
td_ns::DefaultResultEntry>::result_type;
};
-using dpnp::kernels::bitwise_count::BitwiseCountFunctor;
+using dpnp::tensor::kernels::bitwise_count::BitwiseCountFunctor;
template >::result_type;
};
-using dpnp::kernels::degrees::DegreesFunctor;
+using dpnp::tensor::kernels::degrees::DegreesFunctor;
template
struct OutputType
{
using table_type = typename std::disjunction< // disjunction is C++17
// feature, supported by DPC++
- td_int_ns::
- BinaryTypeMapTwoResultsEntry,
- td_int_ns::
- BinaryTypeMapTwoResultsEntry,
- td_int_ns::
+ td_ns::BinaryTypeMapTwoResultsEntry