diff --git a/dpnp/backend/extensions/blas/blas_py.cpp b/dpnp/backend/extensions/blas/blas_py.cpp index d5738727c322..3e8ca01ebd8d 100644 --- a/dpnp/backend/extensions/blas/blas_py.cpp +++ b/dpnp/backend/extensions/blas/blas_py.cpp @@ -60,15 +60,15 @@ void init_dispatch_vectors_tables(void) blas_ns::init_syrk_dispatch_vector(); } -static dot_impl_fn_ptr_t dot_dispatch_vector[dpctl_td_ns::num_types]; -static dot_impl_fn_ptr_t dotc_dispatch_vector[dpctl_td_ns::num_types]; -static dot_impl_fn_ptr_t dotu_dispatch_vector[dpctl_td_ns::num_types]; +static dot_impl_fn_ptr_t dot_dispatch_vector[dpnp_td_ns::num_types]; +static dot_impl_fn_ptr_t dotc_dispatch_vector[dpnp_td_ns::num_types]; +static dot_impl_fn_ptr_t dotu_dispatch_vector[dpnp_td_ns::num_types]; PYBIND11_MODULE(_blas_impl, m) { init_dispatch_vectors_tables(); - using arrayT = dpctl::tensor::usm_ndarray; + using arrayT = dpnp::tensor::usm_ndarray; using event_vecT = std::vector; { diff --git a/dpnp/backend/extensions/blas/dot.hpp b/dpnp/backend/extensions/blas/dot.hpp index 833de60a5fed..300a5348c53e 100644 --- a/dpnp/backend/extensions/blas/dot.hpp +++ b/dpnp/backend/extensions/blas/dot.hpp @@ -35,7 +35,7 @@ namespace dpnp::extensions::blas { namespace mkl_blas = oneapi::mkl::blas; -namespace type_utils = dpctl::tensor::type_utils; +namespace type_utils = dpnp::tensor::type_utils; template static sycl::event dot_impl(sycl::queue &exec_q, diff --git a/dpnp/backend/extensions/blas/dot_common.hpp b/dpnp/backend/extensions/blas/dot_common.hpp index d9c3ae7f1c87..d4819be74036 100644 --- a/dpnp/backend/extensions/blas/dot_common.hpp +++ b/dpnp/backend/extensions/blas/dot_common.hpp @@ -32,7 +32,7 @@ #include -// dpctl tensor headers +// dpnp tensor headers #include "utils/memory_overlap.hpp" #include "utils/output_validation.hpp" #include "utils/type_dispatch.hpp" @@ -51,14 +51,14 @@ typedef sycl::event (*dot_impl_fn_ptr_t)(sycl::queue &, char *, const std::vector &); -namespace dpctl_td_ns = dpctl::tensor::type_dispatch; +namespace dpnp_td_ns = dpnp::tensor::type_dispatch; namespace py = pybind11; std::pair dot_func(sycl::queue &exec_q, - const dpctl::tensor::usm_ndarray &vectorX, - const dpctl::tensor::usm_ndarray &vectorY, - const dpctl::tensor::usm_ndarray &result, + const dpnp::tensor::usm_ndarray &vectorX, + const dpnp::tensor::usm_ndarray &vectorY, + const dpnp::tensor::usm_ndarray &result, const std::vector &depends, const dot_impl_fn_ptr_t *dot_dispatch_vector) { @@ -84,7 +84,7 @@ std::pair ", but a 0-dimensional array is expected."); } - auto const &overlap = dpctl::tensor::overlap::MemoryOverlap(); + auto const &overlap = dpnp::tensor::overlap::MemoryOverlap(); if (overlap(vectorX, result)) { throw py::value_error( "The first input array and output array are overlapping " @@ -96,7 +96,7 @@ std::pair "segments of memory"); } - if (!dpctl::utils::queues_are_compatible( + if (!dpnp::utils::queues_are_compatible( exec_q, {vectorX.get_queue(), vectorY.get_queue(), result.get_queue()})) { throw py::value_error( @@ -104,9 +104,9 @@ std::pair } const int src_nelems = 1; - dpctl::tensor::validation::CheckWritable::throw_if_not_writable(result); - dpctl::tensor::validation::AmpleMemory::throw_if_not_ample(result, - src_nelems); + dpnp::tensor::validation::CheckWritable::throw_if_not_writable(result); + dpnp::tensor::validation::AmpleMemory::throw_if_not_ample(result, + src_nelems); const py::ssize_t x_size = vectorX.get_size(); const py::ssize_t y_size = vectorY.get_size(); @@ -125,7 +125,7 @@ std::pair throw py::value_error("Given arrays must be of the same type."); } - auto array_types = dpctl_td_ns::usm_ndarray_types(); + auto array_types = dpnp_td_ns::usm_ndarray_types(); const int type_id = array_types.typenum_to_lookup_id(vectorX_typenum); dot_impl_fn_ptr_t dot_fn = dot_dispatch_vector[type_id]; @@ -163,7 +163,7 @@ std::pair sycl::event dot_ev = dot_fn(exec_q, n, x_typeless_ptr, incx, y_typeless_ptr, incy, r_typeless_ptr, depends); - sycl::event args_ev = dpctl::utils::keep_args_alive( + sycl::event args_ev = dpnp::utils::keep_args_alive( exec_q, {vectorX, vectorY, result}, {dot_ev}); return std::make_pair(args_ev, dot_ev); diff --git a/dpnp/backend/extensions/blas/dotc.hpp b/dpnp/backend/extensions/blas/dotc.hpp index 71ac1fd8df85..535f79156fb5 100644 --- a/dpnp/backend/extensions/blas/dotc.hpp +++ b/dpnp/backend/extensions/blas/dotc.hpp @@ -35,7 +35,7 @@ namespace dpnp::extensions::blas { namespace mkl_blas = oneapi::mkl::blas; -namespace type_utils = dpctl::tensor::type_utils; +namespace type_utils = dpnp::tensor::type_utils; template static sycl::event dotc_impl(sycl::queue &exec_q, diff --git a/dpnp/backend/extensions/blas/dotu.hpp b/dpnp/backend/extensions/blas/dotu.hpp index 7a1952234559..aafe9721339f 100644 --- a/dpnp/backend/extensions/blas/dotu.hpp +++ b/dpnp/backend/extensions/blas/dotu.hpp @@ -35,7 +35,7 @@ namespace dpnp::extensions::blas { namespace mkl_blas = oneapi::mkl::blas; -namespace type_utils = dpctl::tensor::type_utils; +namespace type_utils = dpnp::tensor::type_utils; template static sycl::event dotu_impl(sycl::queue &exec_q, diff --git a/dpnp/backend/extensions/blas/gemm.cpp b/dpnp/backend/extensions/blas/gemm.cpp index 86f751baf2e0..bf91f5cfb0bf 100644 --- a/dpnp/backend/extensions/blas/gemm.cpp +++ b/dpnp/backend/extensions/blas/gemm.cpp @@ -33,7 +33,7 @@ // utils extension header #include "ext/common.hpp" -// dpctl tensor headers +// dpnp tensor headers #include "utils/memory_overlap.hpp" #include "utils/output_validation.hpp" #include "utils/type_utils.hpp" @@ -45,7 +45,7 @@ namespace dpnp::extensions::blas { namespace mkl_blas = oneapi::mkl::blas; namespace py = pybind11; -namespace type_utils = dpctl::tensor::type_utils; +namespace type_utils = dpnp::tensor::type_utils; using ext::common::init_dispatch_table; @@ -64,8 +64,8 @@ typedef sycl::event (*gemm_impl_fn_ptr_t)(sycl::queue &, const bool, const std::vector &); -static gemm_impl_fn_ptr_t gemm_dispatch_table[dpctl_td_ns::num_types] - [dpctl_td_ns::num_types]; +static gemm_impl_fn_ptr_t gemm_dispatch_table[dpnp_td_ns::num_types] + [dpnp_td_ns::num_types]; template static sycl::event gemm_impl(sycl::queue &exec_q, @@ -153,9 +153,9 @@ static sycl::event gemm_impl(sycl::queue &exec_q, std::tuple gemm(sycl::queue &exec_q, - const dpctl::tensor::usm_ndarray &matrixA, - const dpctl::tensor::usm_ndarray &matrixB, - const dpctl::tensor::usm_ndarray &resultC, + const dpnp::tensor::usm_ndarray &matrixA, + const dpnp::tensor::usm_ndarray &matrixB, + const dpnp::tensor::usm_ndarray &resultC, const std::vector &depends) { const int matrixA_nd = matrixA.get_ndim(); @@ -167,7 +167,7 @@ std::tuple "Input and output matrices must be two-dimensional."); } - auto const &overlap = dpctl::tensor::overlap::MemoryOverlap(); + auto const &overlap = dpnp::tensor::overlap::MemoryOverlap(); if (overlap(matrixA, resultC)) { throw py::value_error( "The first input array and output array are overlapping " @@ -179,7 +179,7 @@ std::tuple "segments of memory"); } - if (!dpctl::utils::queues_are_compatible( + if (!dpnp::utils::queues_are_compatible( exec_q, {matrixA.get_queue(), matrixB.get_queue(), resultC.get_queue()})) { throw py::value_error( @@ -206,9 +206,9 @@ std::tuple } const std::size_t src_nelems = m * n; - dpctl::tensor::validation::CheckWritable::throw_if_not_writable(resultC); - dpctl::tensor::validation::AmpleMemory::throw_if_not_ample(resultC, - src_nelems); + dpnp::tensor::validation::CheckWritable::throw_if_not_writable(resultC); + dpnp::tensor::validation::AmpleMemory::throw_if_not_ample(resultC, + src_nelems); const bool is_matrixA_f_contig = matrixA.is_f_contiguous(); const bool is_matrixB_f_contig = matrixB.is_f_contiguous(); @@ -300,7 +300,7 @@ std::tuple throw py::value_error("matrixA and matrixB must be of the same type."); } - auto array_types = dpctl_td_ns::usm_ndarray_types(); + auto array_types = dpnp_td_ns::usm_ndarray_types(); const int matrixAB_type_id = array_types.typenum_to_lookup_id(matrixA_typenum); const int resultC_type_id = @@ -322,7 +322,7 @@ std::tuple a_typeless_ptr, lda, b_typeless_ptr, ldb, r_typeless_ptr, ldc, is_row_major, depends); - sycl::event args_ev = dpctl::utils::keep_args_alive( + sycl::event args_ev = dpnp::utils::keep_args_alive( exec_q, {matrixA, matrixB, resultC}, {gemm_ev}); return std::make_tuple(args_ev, gemm_ev, is_row_major); diff --git a/dpnp/backend/extensions/blas/gemm.hpp b/dpnp/backend/extensions/blas/gemm.hpp index 59a3d911d885..8475e4120c61 100644 --- a/dpnp/backend/extensions/blas/gemm.hpp +++ b/dpnp/backend/extensions/blas/gemm.hpp @@ -37,16 +37,16 @@ namespace dpnp::extensions::blas { extern std::tuple gemm(sycl::queue &exec_q, - const dpctl::tensor::usm_ndarray &matrixA, - const dpctl::tensor::usm_ndarray &matrixB, - const dpctl::tensor::usm_ndarray &resultC, + const dpnp::tensor::usm_ndarray &matrixA, + const dpnp::tensor::usm_ndarray &matrixB, + const dpnp::tensor::usm_ndarray &resultC, const std::vector &depends); extern std::tuple gemm_batch(sycl::queue &exec_q, - const dpctl::tensor::usm_ndarray &matrixA, - const dpctl::tensor::usm_ndarray &matrixB, - const dpctl::tensor::usm_ndarray &resultC, + const dpnp::tensor::usm_ndarray &matrixA, + const dpnp::tensor::usm_ndarray &matrixB, + const dpnp::tensor::usm_ndarray &resultC, const std::vector &depends); extern void init_gemm_dispatch_table(void); diff --git a/dpnp/backend/extensions/blas/gemm_batch.cpp b/dpnp/backend/extensions/blas/gemm_batch.cpp index d02b035922c0..f1bc9f30b5dd 100644 --- a/dpnp/backend/extensions/blas/gemm_batch.cpp +++ b/dpnp/backend/extensions/blas/gemm_batch.cpp @@ -33,7 +33,7 @@ // utils extension header #include "ext/common.hpp" -// dpctl tensor headers +// dpnp tensor headers #include "utils/memory_overlap.hpp" #include "utils/output_validation.hpp" #include "utils/type_utils.hpp" @@ -45,7 +45,7 @@ namespace dpnp::extensions::blas { namespace mkl_blas = oneapi::mkl::blas; namespace py = pybind11; -namespace type_utils = dpctl::tensor::type_utils; +namespace type_utils = dpnp::tensor::type_utils; using ext::common::init_dispatch_table; @@ -70,7 +70,7 @@ typedef sycl::event (*gemm_batch_impl_fn_ptr_t)( const std::vector &); static gemm_batch_impl_fn_ptr_t - gemm_batch_dispatch_table[dpctl_td_ns::num_types][dpctl_td_ns::num_types]; + gemm_batch_dispatch_table[dpnp_td_ns::num_types][dpnp_td_ns::num_types]; template static sycl::event gemm_batch_impl(sycl::queue &exec_q, @@ -212,9 +212,9 @@ void standardize_strides_to_zero(std::vector &strides, std::tuple gemm_batch(sycl::queue &exec_q, - const dpctl::tensor::usm_ndarray &matrixA, - const dpctl::tensor::usm_ndarray &matrixB, - const dpctl::tensor::usm_ndarray &resultC, + const dpnp::tensor::usm_ndarray &matrixA, + const dpnp::tensor::usm_ndarray &matrixB, + const dpnp::tensor::usm_ndarray &resultC, const std::vector &depends = {}) { const int matrixA_nd = matrixA.get_ndim(); @@ -225,7 +225,7 @@ std::tuple throw py::value_error("The given arrays have incorrect dimensions."); } - auto const &overlap = dpctl::tensor::overlap::MemoryOverlap(); + auto const &overlap = dpnp::tensor::overlap::MemoryOverlap(); if (overlap(matrixA, resultC)) { throw py::value_error("Input array 1 and output array are overlapping " "segments of memory"); @@ -235,7 +235,7 @@ std::tuple "segments of memory"); } - if (!dpctl::utils::queues_are_compatible( + if (!dpnp::utils::queues_are_compatible( exec_q, {matrixA.get_queue(), matrixB.get_queue(), resultC.get_queue()})) { throw py::value_error( @@ -262,9 +262,9 @@ std::tuple "the number of columns in result array."); } const std::int64_t src_nelems = batch_size * m * n; - dpctl::tensor::validation::CheckWritable::throw_if_not_writable(resultC); - dpctl::tensor::validation::AmpleMemory::throw_if_not_ample(resultC, - src_nelems); + dpnp::tensor::validation::CheckWritable::throw_if_not_writable(resultC); + dpnp::tensor::validation::AmpleMemory::throw_if_not_ample(resultC, + src_nelems); std::vector a_stride = matrixA.get_strides_vector(); std::vector b_stride = matrixB.get_strides_vector(); @@ -374,7 +374,7 @@ std::tuple throw py::value_error("matrixA and matrixB must be of the same type."); } - auto array_types = dpctl_td_ns::usm_ndarray_types(); + auto array_types = dpnp_td_ns::usm_ndarray_types(); const int matrixAB_type_id = array_types.typenum_to_lookup_id(matrixA_typenum); const int resultC_type_id = @@ -397,7 +397,7 @@ std::tuple strideb, stridec, transA, transB, a_typeless_ptr, b_typeless_ptr, r_typeless_ptr, is_row_major, depends); - sycl::event args_ev = dpctl::utils::keep_args_alive( + sycl::event args_ev = dpnp::utils::keep_args_alive( exec_q, {matrixA, matrixB, resultC}, {gemm_batch_ev}); return std::make_tuple(args_ev, gemm_batch_ev, is_row_major); diff --git a/dpnp/backend/extensions/blas/gemv.cpp b/dpnp/backend/extensions/blas/gemv.cpp index 0b6ae78bc76e..bb447c51997d 100644 --- a/dpnp/backend/extensions/blas/gemv.cpp +++ b/dpnp/backend/extensions/blas/gemv.cpp @@ -33,7 +33,7 @@ // utils extension header #include "ext/common.hpp" -// dpctl tensor headers +// dpnp tensor headers #include "utils/memory_overlap.hpp" #include "utils/output_validation.hpp" #include "utils/type_utils.hpp" @@ -45,7 +45,7 @@ namespace dpnp::extensions::blas { namespace mkl_blas = oneapi::mkl::blas; namespace py = pybind11; -namespace type_utils = dpctl::tensor::type_utils; +namespace type_utils = dpnp::tensor::type_utils; using ext::common::init_dispatch_vector; @@ -62,7 +62,7 @@ typedef sycl::event (*gemv_impl_fn_ptr_t)(sycl::queue &, const bool, const std::vector &); -static gemv_impl_fn_ptr_t gemv_dispatch_vector[dpctl_td_ns::num_types]; +static gemv_impl_fn_ptr_t gemv_dispatch_vector[dpnp_td_ns::num_types]; template static sycl::event gemv_impl(sycl::queue &exec_q, @@ -143,9 +143,9 @@ static sycl::event gemv_impl(sycl::queue &exec_q, std::pair gemv(sycl::queue &exec_q, - const dpctl::tensor::usm_ndarray &matrixA, - const dpctl::tensor::usm_ndarray &vectorX, - const dpctl::tensor::usm_ndarray &vectorY, + const dpnp::tensor::usm_ndarray &matrixA, + const dpnp::tensor::usm_ndarray &vectorX, + const dpnp::tensor::usm_ndarray &vectorY, const bool transpose, const std::vector &depends) { @@ -157,7 +157,7 @@ std::pair throw py::value_error("The arrays have incorrect dimensions."); } - auto const &overlap = dpctl::tensor::overlap::MemoryOverlap(); + auto const &overlap = dpnp::tensor::overlap::MemoryOverlap(); if (overlap(matrixA, vectorY)) { throw py::value_error("Input matrix and output vector are overlapping " "segments of memory"); @@ -167,7 +167,7 @@ std::pair "segments of memory"); } - if (!dpctl::utils::queues_are_compatible( + if (!dpnp::utils::queues_are_compatible( exec_q, {matrixA.get_queue(), vectorX.get_queue(), vectorY.get_queue()})) { throw py::value_error( @@ -259,9 +259,9 @@ std::pair #endif // USE_ONEMATH_CUBLAS const std::int64_t lda = is_row_major ? n : m; - dpctl::tensor::validation::CheckWritable::throw_if_not_writable(vectorY); - dpctl::tensor::validation::AmpleMemory::throw_if_not_ample(vectorY, - src_nelems); + dpnp::tensor::validation::CheckWritable::throw_if_not_writable(vectorY); + dpnp::tensor::validation::AmpleMemory::throw_if_not_ample(vectorY, + src_nelems); const int matrixA_typenum = matrixA.get_typenum(); const int vectorX_typenum = vectorX.get_typenum(); @@ -272,7 +272,7 @@ std::pair throw py::value_error("Given arrays must be of the same type."); } - auto array_types = dpctl_td_ns::usm_ndarray_types(); + auto array_types = dpnp_td_ns::usm_ndarray_types(); const int type_id = array_types.typenum_to_lookup_id(matrixA_typenum); gemv_impl_fn_ptr_t gemv_fn = gemv_dispatch_vector[type_id]; @@ -303,7 +303,7 @@ std::pair gemv_fn(exec_q, transA, m, n, a_typeless_ptr, lda, x_typeless_ptr, incx, y_typeless_ptr, incy, is_row_major, depends); - sycl::event args_ev = dpctl::utils::keep_args_alive( + sycl::event args_ev = dpnp::utils::keep_args_alive( exec_q, {matrixA, vectorX, vectorY}, {gemv_ev}); return std::make_pair(args_ev, gemv_ev); diff --git a/dpnp/backend/extensions/blas/gemv.hpp b/dpnp/backend/extensions/blas/gemv.hpp index 6da71ed0964f..c3e1c503fde8 100644 --- a/dpnp/backend/extensions/blas/gemv.hpp +++ b/dpnp/backend/extensions/blas/gemv.hpp @@ -37,9 +37,9 @@ namespace dpnp::extensions::blas { extern std::pair gemv(sycl::queue &exec_q, - const dpctl::tensor::usm_ndarray &matrixA, - const dpctl::tensor::usm_ndarray &vectorX, - const dpctl::tensor::usm_ndarray &vectorY, + const dpnp::tensor::usm_ndarray &matrixA, + const dpnp::tensor::usm_ndarray &vectorX, + const dpnp::tensor::usm_ndarray &vectorY, const bool transpose, const std::vector &depends); diff --git a/dpnp/backend/extensions/blas/syrk.cpp b/dpnp/backend/extensions/blas/syrk.cpp index 9668e72b57f6..ad16fc399370 100644 --- a/dpnp/backend/extensions/blas/syrk.cpp +++ b/dpnp/backend/extensions/blas/syrk.cpp @@ -34,7 +34,7 @@ // utils extension header #include "ext/common.hpp" -// dpctl tensor headers +// dpnp tensor headers #include "utils/memory_overlap.hpp" #include "utils/output_validation.hpp" #include "utils/type_utils.hpp" @@ -48,7 +48,7 @@ namespace dpnp::extensions::blas { namespace mkl_blas = oneapi::mkl::blas; namespace py = pybind11; -namespace type_utils = dpctl::tensor::type_utils; +namespace type_utils = dpnp::tensor::type_utils; using ext::common::init_dispatch_vector; @@ -63,7 +63,7 @@ typedef sycl::event (*syrk_impl_fn_ptr_t)(sycl::queue &, const bool, const std::vector &); -static syrk_impl_fn_ptr_t syrk_dispatch_vector[dpctl_td_ns::num_types]; +static syrk_impl_fn_ptr_t syrk_dispatch_vector[dpnp_td_ns::num_types]; template constexpr void copy_to_lower_triangle(T *res, @@ -230,8 +230,8 @@ static sycl::event syrk_impl(sycl::queue &exec_q, std::pair syrk(sycl::queue &exec_q, - const dpctl::tensor::usm_ndarray &matrixA, - const dpctl::tensor::usm_ndarray &resultC, + const dpnp::tensor::usm_ndarray &matrixA, + const dpnp::tensor::usm_ndarray &resultC, const std::vector &depends) { const int matrixA_nd = matrixA.get_ndim(); @@ -241,13 +241,13 @@ std::pair throw py::value_error("The given arrays have incorrect dimensions."); } - auto const &overlap = dpctl::tensor::overlap::MemoryOverlap(); + auto const &overlap = dpnp::tensor::overlap::MemoryOverlap(); if (overlap(matrixA, resultC)) { throw py::value_error("Input and output matrices are overlapping " "segments of memory"); } - if (!dpctl::utils::queues_are_compatible( + if (!dpnp::utils::queues_are_compatible( exec_q, {matrixA.get_queue(), resultC.get_queue()})) { throw py::value_error( "USM allocations are not compatible with the execution queue."); @@ -305,9 +305,9 @@ std::pair const std::int64_t lda = is_row_major ? k : n; const std::int64_t ldc = n; - dpctl::tensor::validation::CheckWritable::throw_if_not_writable(resultC); - dpctl::tensor::validation::AmpleMemory::throw_if_not_ample(resultC, - src_nelems); + dpnp::tensor::validation::CheckWritable::throw_if_not_writable(resultC); + dpnp::tensor::validation::AmpleMemory::throw_if_not_ample(resultC, + src_nelems); const int matrixA_typenum = matrixA.get_typenum(); const int resultC_typenum = resultC.get_typenum(); @@ -315,7 +315,7 @@ std::pair throw py::value_error("Given arrays must be of the same type."); } - auto array_types = dpctl_td_ns::usm_ndarray_types(); + auto array_types = dpnp_td_ns::usm_ndarray_types(); const int type_id = array_types.typenum_to_lookup_id(matrixA_typenum); syrk_impl_fn_ptr_t syrk_fn = syrk_dispatch_vector[type_id]; if (syrk_fn == nullptr) { @@ -331,7 +331,7 @@ std::pair r_typeless_ptr, ldc, is_row_major, depends); sycl::event args_ev = - dpctl::utils::keep_args_alive(exec_q, {matrixA, resultC}, {syrk_ev}); + dpnp::utils::keep_args_alive(exec_q, {matrixA, resultC}, {syrk_ev}); return std::make_pair(args_ev, syrk_ev); } diff --git a/dpnp/backend/extensions/blas/syrk.hpp b/dpnp/backend/extensions/blas/syrk.hpp index f6cec189489a..9ffe1b024951 100644 --- a/dpnp/backend/extensions/blas/syrk.hpp +++ b/dpnp/backend/extensions/blas/syrk.hpp @@ -37,8 +37,8 @@ namespace dpnp::extensions::blas { extern std::pair syrk(sycl::queue &exec_q, - const dpctl::tensor::usm_ndarray &matrixA, - const dpctl::tensor::usm_ndarray &resultC, + const dpnp::tensor::usm_ndarray &matrixA, + const dpnp::tensor::usm_ndarray &resultC, const std::vector &depends); extern void init_syrk_dispatch_vector(void); diff --git a/dpnp/backend/extensions/blas/types_matrix.hpp b/dpnp/backend/extensions/blas/types_matrix.hpp index 463319a968af..5751b5634777 100644 --- a/dpnp/backend/extensions/blas/types_matrix.hpp +++ b/dpnp/backend/extensions/blas/types_matrix.hpp @@ -30,11 +30,11 @@ #include -// dpctl tensor headers +// dpnp tensor headers #include "utils/type_dispatch.hpp" -// dpctl namespace for operations with types -namespace dpctl_td_ns = dpctl::tensor::type_dispatch; +// namespace for operations with types +namespace dpnp_td_ns = dpnp::tensor::type_dispatch; namespace dpnp::extensions::blas::types { @@ -48,11 +48,11 @@ namespace dpnp::extensions::blas::types template struct DotTypePairSupportFactory { - static constexpr bool is_defined = std::disjunction< - dpctl_td_ns::TypePairDefinedEntry, - dpctl_td_ns::TypePairDefinedEntry, - // fall-through - dpctl_td_ns::NotDefinedEntry>::is_defined; + static constexpr bool is_defined = + std::disjunction, + dpnp_td_ns::TypePairDefinedEntry, + // fall-through + dpnp_td_ns::NotDefinedEntry>::is_defined; }; /** @@ -65,17 +65,17 @@ struct DotTypePairSupportFactory template struct DotcTypePairSupportFactory { - static constexpr bool is_defined = std::disjunction< - dpctl_td_ns::TypePairDefinedEntry, - T, - std::complex>, - dpctl_td_ns::TypePairDefinedEntry, - T, - std::complex>, - // fall-through - dpctl_td_ns::NotDefinedEntry>::is_defined; + static constexpr bool is_defined = + std::disjunction, + T, + std::complex>, + dpnp_td_ns::TypePairDefinedEntry, + T, + std::complex>, + // fall-through + dpnp_td_ns::NotDefinedEntry>::is_defined; }; /** @@ -88,17 +88,17 @@ struct DotcTypePairSupportFactory template struct DotuTypePairSupportFactory { - static constexpr bool is_defined = std::disjunction< - dpctl_td_ns::TypePairDefinedEntry, - T, - std::complex>, - dpctl_td_ns::TypePairDefinedEntry, - T, - std::complex>, - // fall-through - dpctl_td_ns::NotDefinedEntry>::is_defined; + static constexpr bool is_defined = + std::disjunction, + T, + std::complex>, + dpnp_td_ns::TypePairDefinedEntry, + T, + std::complex>, + // fall-through + dpnp_td_ns::NotDefinedEntry>::is_defined; }; /** @@ -114,23 +114,23 @@ struct GemmTypePairSupportFactory { static constexpr bool is_defined = std::disjunction< #if !defined(USE_ONEMATH) - dpctl_td_ns::TypePairDefinedEntry, - dpctl_td_ns::TypePairDefinedEntry, + dpnp_td_ns::TypePairDefinedEntry, + dpnp_td_ns::TypePairDefinedEntry, #endif // USE_ONEMATH - dpctl_td_ns::TypePairDefinedEntry, - dpctl_td_ns::TypePairDefinedEntry, - dpctl_td_ns::TypePairDefinedEntry, - dpctl_td_ns::TypePairDefinedEntry, - dpctl_td_ns::TypePairDefinedEntry, - Tc, - std::complex>, - dpctl_td_ns::TypePairDefinedEntry, - Tc, - std::complex>, + dpnp_td_ns::TypePairDefinedEntry, + dpnp_td_ns::TypePairDefinedEntry, + dpnp_td_ns::TypePairDefinedEntry, + dpnp_td_ns::TypePairDefinedEntry, + dpnp_td_ns::TypePairDefinedEntry, + Tc, + std::complex>, + dpnp_td_ns::TypePairDefinedEntry, + Tc, + std::complex>, // fall-through - dpctl_td_ns::NotDefinedEntry>::is_defined; + dpnp_td_ns::NotDefinedEntry>::is_defined; }; /** @@ -146,23 +146,23 @@ struct GemmBatchTypePairSupportFactory { static constexpr bool is_defined = std::disjunction< #if !defined(USE_ONEMATH) - dpctl_td_ns::TypePairDefinedEntry, - dpctl_td_ns::TypePairDefinedEntry, + dpnp_td_ns::TypePairDefinedEntry, + dpnp_td_ns::TypePairDefinedEntry, #endif // USE_ONEMATH - dpctl_td_ns::TypePairDefinedEntry, - dpctl_td_ns::TypePairDefinedEntry, - dpctl_td_ns::TypePairDefinedEntry, - dpctl_td_ns::TypePairDefinedEntry, - dpctl_td_ns::TypePairDefinedEntry, - Tc, - std::complex>, - dpctl_td_ns::TypePairDefinedEntry, - Tc, - std::complex>, + dpnp_td_ns::TypePairDefinedEntry, + dpnp_td_ns::TypePairDefinedEntry, + dpnp_td_ns::TypePairDefinedEntry, + dpnp_td_ns::TypePairDefinedEntry, + dpnp_td_ns::TypePairDefinedEntry, + Tc, + std::complex>, + dpnp_td_ns::TypePairDefinedEntry, + Tc, + std::complex>, // fall-through - dpctl_td_ns::NotDefinedEntry>::is_defined; + dpnp_td_ns::NotDefinedEntry>::is_defined; }; /** @@ -175,19 +175,19 @@ struct GemmBatchTypePairSupportFactory template struct GemvTypePairSupportFactory { - static constexpr bool is_defined = std::disjunction< - dpctl_td_ns::TypePairDefinedEntry, - dpctl_td_ns::TypePairDefinedEntry, - dpctl_td_ns::TypePairDefinedEntry, - T, - std::complex>, - dpctl_td_ns::TypePairDefinedEntry, - T, - std::complex>, - // fall-through - dpctl_td_ns::NotDefinedEntry>::is_defined; + static constexpr bool is_defined = + std::disjunction, + dpnp_td_ns::TypePairDefinedEntry, + dpnp_td_ns::TypePairDefinedEntry, + T, + std::complex>, + dpnp_td_ns::TypePairDefinedEntry, + T, + std::complex>, + // fall-through + dpnp_td_ns::NotDefinedEntry>::is_defined; }; /** @@ -200,18 +200,18 @@ struct GemvTypePairSupportFactory template struct SyrkTypePairSupportFactory { - static constexpr bool is_defined = std::disjunction< - dpctl_td_ns::TypePairDefinedEntry, - dpctl_td_ns::TypePairDefinedEntry, - dpctl_td_ns::TypePairDefinedEntry, - T, - std::complex>, - dpctl_td_ns::TypePairDefinedEntry, - T, - std::complex>, - // fall-through - dpctl_td_ns::NotDefinedEntry>::is_defined; + static constexpr bool is_defined = + std::disjunction, + dpnp_td_ns::TypePairDefinedEntry, + dpnp_td_ns::TypePairDefinedEntry, + T, + std::complex>, + dpnp_td_ns::TypePairDefinedEntry, + T, + std::complex>, + // fall-through + dpnp_td_ns::NotDefinedEntry>::is_defined; }; } // namespace dpnp::extensions::blas::types diff --git a/dpnp/backend/extensions/common/ext/common.hpp b/dpnp/backend/extensions/common/ext/common.hpp index 3c82fb10ec16..6b9a42a87d8e 100644 --- a/dpnp/backend/extensions/common/ext/common.hpp +++ b/dpnp/backend/extensions/common/ext/common.hpp @@ -35,13 +35,13 @@ #include -// dpctl tensor headers +// dpnp tensor headers #include "utils/math_utils.hpp" #include "utils/type_dispatch.hpp" #include "utils/type_utils.hpp" -namespace type_utils = dpctl::tensor::type_utils; -namespace type_dispatch = dpctl::tensor::type_dispatch; +namespace type_utils = dpnp::tensor::type_utils; +namespace type_dispatch = dpnp::tensor::type_dispatch; namespace ext::common { @@ -84,7 +84,7 @@ struct Less bool operator()(const T &lhs, const T &rhs) const { if constexpr (type_utils::is_complex_v) { - return dpctl::tensor::math_utils::less_complex(lhs, rhs); + return dpnp::tensor::math_utils::less_complex(lhs, rhs); } else { return std::less{}(lhs, rhs); @@ -210,8 +210,9 @@ sycl::nd_range make_ndrange(const sycl::range &global_range, sycl::nd_range<1> make_ndrange(size_t global_size, size_t local_range, size_t work_per_item); -// This function is a copy from dpctl because it is not available in the public -// headers of dpctl. +// This function was a copy from dpctl because it was not available in the +// public headers of dpctl. +// TODO: consolidate with tensor post-migration pybind11::dtype dtype_from_typenum(int dst_typenum); template (dst_typenum); + dpnp_td_ns::typenum_t dst_typenum_t = + static_cast(dst_typenum); switch (dst_typenum_t) { - case dpctl_td_ns::typenum_t::BOOL: + case dpnp_td_ns::typenum_t::BOOL: return py::dtype("?"); - case dpctl_td_ns::typenum_t::INT8: + case dpnp_td_ns::typenum_t::INT8: return py::dtype("i1"); - case dpctl_td_ns::typenum_t::UINT8: + case dpnp_td_ns::typenum_t::UINT8: return py::dtype("u1"); - case dpctl_td_ns::typenum_t::INT16: + case dpnp_td_ns::typenum_t::INT16: return py::dtype("i2"); - case dpctl_td_ns::typenum_t::UINT16: + case dpnp_td_ns::typenum_t::UINT16: return py::dtype("u2"); - case dpctl_td_ns::typenum_t::INT32: + case dpnp_td_ns::typenum_t::INT32: return py::dtype("i4"); - case dpctl_td_ns::typenum_t::UINT32: + case dpnp_td_ns::typenum_t::UINT32: return py::dtype("u4"); - case dpctl_td_ns::typenum_t::INT64: + case dpnp_td_ns::typenum_t::INT64: return py::dtype("i8"); - case dpctl_td_ns::typenum_t::UINT64: + case dpnp_td_ns::typenum_t::UINT64: return py::dtype("u8"); - case dpctl_td_ns::typenum_t::HALF: + case dpnp_td_ns::typenum_t::HALF: return py::dtype("f2"); - case dpctl_td_ns::typenum_t::FLOAT: + case dpnp_td_ns::typenum_t::FLOAT: return py::dtype("f4"); - case dpctl_td_ns::typenum_t::DOUBLE: + case dpnp_td_ns::typenum_t::DOUBLE: return py::dtype("f8"); - case dpctl_td_ns::typenum_t::CFLOAT: + case dpnp_td_ns::typenum_t::CFLOAT: return py::dtype("c8"); - case dpctl_td_ns::typenum_t::CDOUBLE: + case dpnp_td_ns::typenum_t::CDOUBLE: return py::dtype("c16"); default: throw py::value_error("Unrecognized dst_typeid"); diff --git a/dpnp/backend/extensions/common/ext/details/validation_utils_internal.hpp b/dpnp/backend/extensions/common/ext/details/validation_utils_internal.hpp index 4c70d2d0d413..6a46c97293f3 100644 --- a/dpnp/backend/extensions/common/ext/details/validation_utils_internal.hpp +++ b/dpnp/backend/extensions/common/ext/details/validation_utils_internal.hpp @@ -36,7 +36,7 @@ #include "ext/validation_utils.hpp" #include "utils/memory_overlap.hpp" -namespace td_ns = dpctl::tensor::type_dispatch; +namespace td_ns = dpnp::tensor::type_dispatch; namespace common = ext::common; namespace ext::validation @@ -118,9 +118,9 @@ inline void check_no_overlap(const array_ptr &input, return; } - const auto &overlap = dpctl::tensor::overlap::MemoryOverlap(); + const auto &overlap = dpnp::tensor::overlap::MemoryOverlap(); const auto &same_logical_tensors = - dpctl::tensor::overlap::SameLogicalTensors(); + dpnp::tensor::overlap::SameLogicalTensors(); if (overlap(*input, *output) && !same_logical_tensors(*input, *output)) { throw py::value_error(name_of(input, names) + diff --git a/dpnp/backend/extensions/common/ext/dispatch_table.hpp b/dpnp/backend/extensions/common/ext/dispatch_table.hpp index 6655f054f355..44437fb1a40f 100644 --- a/dpnp/backend/extensions/common/ext/dispatch_table.hpp +++ b/dpnp/backend/extensions/common/ext/dispatch_table.hpp @@ -39,7 +39,7 @@ #include "ext/common.hpp" -namespace dpctl_td_ns = dpctl::tensor::type_dispatch; +namespace dpnp_td_ns = dpnp::tensor::type_dispatch; namespace py = pybind11; namespace ext::common @@ -69,9 +69,9 @@ template constexpr bool one_of_v = one_of::value; template -using Table = FnT[dpctl_td_ns::num_types]; +using Table = FnT[dpnp_td_ns::num_types]; template -using Table2 = Table[dpctl_td_ns::num_types]; +using Table2 = Table[dpnp_td_ns::num_types]; using TypeId = int32_t; using TypesPair = std::pair; @@ -119,7 +119,7 @@ struct TableBuilder }; using type = - dpctl_td_ns::DispatchVectorBuilder; + dpnp_td_ns::DispatchVectorBuilder; }; template ; + dpnp_td_ns::DispatchTableBuilder; }; template @@ -166,7 +166,7 @@ class DispatchTable FnT get_unsafe(int _typenum) const { - auto array_types = dpctl_td_ns::usm_ndarray_types(); + auto array_types = dpnp_td_ns::usm_ndarray_types(); const int type_id = array_types.typenum_to_lookup_id(_typenum); return table[type_id]; @@ -177,7 +177,7 @@ class DispatchTable auto fn = get_unsafe(_typenum); if (fn == nullptr) { - auto array_types = dpctl_td_ns::usm_ndarray_types(); + auto array_types = dpnp_td_ns::usm_ndarray_types(); const int _type_id = array_types.typenum_to_lookup_id(_typenum); py::dtype _dtype = dtype_from_typenum(_type_id); @@ -208,7 +208,7 @@ class DispatchTable private: void populate_supported_types() { - for (int i = 0; i < dpctl_td_ns::num_types; ++i) { + for (int i = 0; i < dpnp_td_ns::num_types; ++i) { if (table[i] != nullptr) { supported_types.emplace_back(dtype_from_typenum(i)); } @@ -242,7 +242,7 @@ class DispatchTable2 FnT get_unsafe(int first_typenum, int second_typenum) const { - auto array_types = dpctl_td_ns::usm_ndarray_types(); + auto array_types = dpnp_td_ns::usm_ndarray_types(); const int first_type_id = array_types.typenum_to_lookup_id(first_typenum); const int second_type_id = @@ -256,7 +256,7 @@ class DispatchTable2 auto fn = get_unsafe(first_typenum, second_typenum); if (fn == nullptr) { - auto array_types = dpctl_td_ns::usm_ndarray_types(); + auto array_types = dpnp_td_ns::usm_ndarray_types(); const int first_type_id = array_types.typenum_to_lookup_id(first_typenum); const int second_type_id = @@ -338,8 +338,8 @@ class DispatchTable2 SupportedTypesSet second_supported_types_set; SupportedTypesSet2 all_supported_types_set; - for (int i = 0; i < dpctl_td_ns::num_types; ++i) { - for (int j = 0; j < dpctl_td_ns::num_types; ++j) { + for (int i = 0; i < dpnp_td_ns::num_types; ++i) { + for (int j = 0; j < dpnp_td_ns::num_types; ++j) { if (table[i][j] != nullptr) { all_supported_types_set.emplace(i, j); first_supported_types_set.emplace(i); diff --git a/dpnp/backend/extensions/common/ext/validation_utils.hpp b/dpnp/backend/extensions/common/ext/validation_utils.hpp index 03e0718d4450..fa2f892369cc 100644 --- a/dpnp/backend/extensions/common/ext/validation_utils.hpp +++ b/dpnp/backend/extensions/common/ext/validation_utils.hpp @@ -34,14 +34,14 @@ #include "dpnp4pybind11.hpp" -// dpctl tensor headers +// dpnp tensor headers #include "utils/type_dispatch.hpp" namespace ext::validation { -using array_ptr = const dpctl::tensor::usm_ndarray *; +using array_ptr = const dpnp::tensor::usm_ndarray *; using array_names = std::unordered_map; -using dpctl::tensor::type_dispatch::typenum_t; +using dpnp::tensor::type_dispatch::typenum_t; std::string name_of(const array_ptr &arr, const array_names &names); diff --git a/dpnp/backend/extensions/elementwise_functions/common.hpp b/dpnp/backend/extensions/elementwise_functions/common.hpp index f3b15c8d6774..8cfdb6b46890 100644 --- a/dpnp/backend/extensions/elementwise_functions/common.hpp +++ b/dpnp/backend/extensions/elementwise_functions/common.hpp @@ -36,29 +36,28 @@ #include -// dpctl tensor headers +// 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 { -using dpctl::tensor::kernels::alignment_utils:: - disabled_sg_loadstore_wrapper_krn; -using dpctl::tensor::kernels::alignment_utils::is_aligned; -using dpctl::tensor::kernels::alignment_utils::required_alignment; +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 dpctl::tensor::kernels::elementwise_common::select_lws; +using dpnp::tensor::kernels::elementwise_common::select_lws; -using dpctl::tensor::sycl_utils::sub_group_load; -using dpctl::tensor::sycl_utils::sub_group_store; +using dpnp::tensor::sycl_utils::sub_group_load; +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 - * dpctl::tensor::kernels::elementwise_common namespace. + * dpnp::tensor::kernels::elementwise_common namespace. */ template class UnaryTwoOutputsType, @@ -601,7 +600,7 @@ sycl::event * on strided data. * * @note It extends unary_strided_impl from - * dpctl::tensor::kernels::elementwise_common namespace. + * dpnp::tensor::kernels::elementwise_common namespace. */ template class UnaryTwoOutputsType, @@ -634,7 +633,7 @@ sycl::event unary_two_outputs_strided_impl( using res1Ty = typename UnaryTwoOutputsType::value_type1; using res2Ty = typename UnaryTwoOutputsType::value_type2; using IndexerT = - typename dpctl::tensor::offset_utils::ThreeOffsets_StridedIndexer; + typename dpnp::tensor::offset_utils::ThreeOffsets_StridedIndexer; const IndexerT indexer{nd, arg_offset, res1_offset, res2_offset, shape_and_strides}; @@ -657,7 +656,7 @@ sycl::event unary_two_outputs_strided_impl( * on contiguous arrays. * * @note It extends binary_contig_impl from - * dpctl::tensor::kernels::elementwise_common namespace. + * dpnp::tensor::kernels::elementwise_common namespace. */ template < typename argTy1, @@ -750,7 +749,7 @@ sycl::event * on strided data. * * @note It extends binary_strided_impl from - * dpctl::tensor::kernels::elementwise_common namespace. + * dpnp::tensor::kernels::elementwise_common namespace. */ template ::value_type2; using IndexerT = - typename dpctl::tensor::offset_utils::FourOffsets_StridedIndexer; + typename dpnp::tensor::offset_utils::FourOffsets_StridedIndexer; const IndexerT indexer{nd, arg1_offset, arg2_offset, res1_offset, res2_offset, shape_and_strides}; diff --git a/dpnp/backend/extensions/elementwise_functions/elementwise_functions.hpp b/dpnp/backend/extensions/elementwise_functions/elementwise_functions.hpp index affe2fb5dc49..adaf77a8970e 100644 --- a/dpnp/backend/extensions/elementwise_functions/elementwise_functions.hpp +++ b/dpnp/backend/extensions/elementwise_functions/elementwise_functions.hpp @@ -45,7 +45,7 @@ #include "elementwise_functions_type_utils.hpp" #include "simplify_iteration_space.hpp" -// dpctl tensor headers +// dpnp tensor headers #include "kernels/alignment.hpp" #include "utils/memory_overlap.hpp" #include "utils/offset_utils.hpp" @@ -53,15 +53,15 @@ #include "utils/sycl_alloc_utils.hpp" #include "utils/type_dispatch.hpp" -static_assert(std::is_same_v); +static_assert(std::is_same_v); namespace dpnp::extensions::py_internal { namespace py = pybind11; -namespace td_ns = dpctl::tensor::type_dispatch; +namespace td_ns = dpnp::tensor::type_dispatch; -using dpctl::tensor::kernels::alignment_utils::is_aligned; -using dpctl::tensor::kernels::alignment_utils::required_alignment; +using dpnp::tensor::kernels::alignment_utils::is_aligned; +using dpnp::tensor::kernels::alignment_utils::required_alignment; using type_utils::_result_typeid; @@ -70,8 +70,8 @@ template std::pair - py_unary_ufunc(const dpctl::tensor::usm_ndarray &src, - const dpctl::tensor::usm_ndarray &dst, + py_unary_ufunc(const dpnp::tensor::usm_ndarray &src, + const dpnp::tensor::usm_ndarray &dst, sycl::queue &q, const std::vector &depends, // @@ -95,12 +95,12 @@ std::pair } // check that queues are compatible - if (!dpctl::utils::queues_are_compatible(q, {src, dst})) { + if (!dpnp::utils::queues_are_compatible(q, {src, dst})) { throw py::value_error( "Execution queue is not compatible with allocation queues"); } - dpctl::tensor::validation::CheckWritable::throw_if_not_writable(dst); + dpnp::tensor::validation::CheckWritable::throw_if_not_writable(dst); // check that dimensions are the same int src_nd = src.get_ndim(); @@ -127,12 +127,12 @@ std::pair return std::make_pair(sycl::event(), sycl::event()); } - dpctl::tensor::validation::AmpleMemory::throw_if_not_ample(dst, src_nelems); + dpnp::tensor::validation::AmpleMemory::throw_if_not_ample(dst, src_nelems); // check memory overlap - auto const &overlap = dpctl::tensor::overlap::MemoryOverlap(); + auto const &overlap = dpnp::tensor::overlap::MemoryOverlap(); auto const &same_logical_tensors = - dpctl::tensor::overlap::SameLogicalTensors(); + dpnp::tensor::overlap::SameLogicalTensors(); if (overlap(src, dst) && !same_logical_tensors(src, dst)) { throw py::value_error("Arrays index overlapping segments of memory"); } @@ -161,7 +161,7 @@ std::pair auto comp_ev = contig_fn(q, src_nelems, src_data, dst_data, depends); sycl::event ht_ev = - dpctl::utils::keep_args_alive(q, {src, dst}, {comp_ev}); + dpnp::utils::keep_args_alive(q, {src, dst}, {comp_ev}); return std::make_pair(ht_ev, comp_ev); } @@ -206,7 +206,7 @@ std::pair dst_data + dst_elem_size * dst_offset, depends); sycl::event ht_ev = - dpctl::utils::keep_args_alive(q, {src, dst}, {comp_ev}); + dpnp::utils::keep_args_alive(q, {src, dst}, {comp_ev}); return std::make_pair(ht_ev, comp_ev); } @@ -220,7 +220,7 @@ std::pair std::to_string(src_typeid)); } - using dpctl::tensor::offset_utils::device_allocate_and_pack; + using dpnp::tensor::offset_utils::device_allocate_and_pack; std::vector host_tasks{}; host_tasks.reserve(2); @@ -237,14 +237,13 @@ std::pair dst_data, dst_offset, depends, {copy_shape_ev}); // async free of shape_strides temporary - sycl::event tmp_cleanup_ev = dpctl::tensor::alloc_utils::async_smart_free( + sycl::event tmp_cleanup_ev = dpnp::tensor::alloc_utils::async_smart_free( q, {strided_fn_ev}, shape_strides_owner); host_tasks.push_back(tmp_cleanup_ev); return std::make_pair( - dpctl::utils::keep_args_alive(q, {src, dst}, host_tasks), - strided_fn_ev); + dpnp::utils::keep_args_alive(q, {src, dst}, host_tasks), strided_fn_ev); } /*! @brief Template implementing Python API for querying of type support by @@ -253,7 +252,7 @@ template py::object py_unary_ufunc_result_type(const py::dtype &input_dtype, const output_typesT &output_types) { - int tn = input_dtype.num(); // NumPy type numbers are the same as in dpctl + int tn = input_dtype.num(); // NumPy type numbers are the same as in dpnp int src_typeid = -1; auto array_types = td_ns::usm_ndarray_types(); @@ -287,9 +286,9 @@ template std::pair - py_unary_two_outputs_ufunc(const dpctl::tensor::usm_ndarray &src, - const dpctl::tensor::usm_ndarray &dst1, - const dpctl::tensor::usm_ndarray &dst2, + py_unary_two_outputs_ufunc(const dpnp::tensor::usm_ndarray &src, + const dpnp::tensor::usm_ndarray &dst1, + const dpnp::tensor::usm_ndarray &dst2, sycl::queue &q, const std::vector &depends, // @@ -316,13 +315,13 @@ std::pair } // check that queues are compatible - if (!dpctl::utils::queues_are_compatible(q, {src, dst1, dst2})) { + if (!dpnp::utils::queues_are_compatible(q, {src, dst1, dst2})) { throw py::value_error( "Execution queue is not compatible with allocation queues"); } - dpctl::tensor::validation::CheckWritable::throw_if_not_writable(dst1); - dpctl::tensor::validation::CheckWritable::throw_if_not_writable(dst2); + dpnp::tensor::validation::CheckWritable::throw_if_not_writable(dst1); + dpnp::tensor::validation::CheckWritable::throw_if_not_writable(dst2); // check that dimensions are the same int src_nd = src.get_ndim(); @@ -351,15 +350,13 @@ std::pair return std::make_pair(sycl::event(), sycl::event()); } - dpctl::tensor::validation::AmpleMemory::throw_if_not_ample(dst1, - src_nelems); - dpctl::tensor::validation::AmpleMemory::throw_if_not_ample(dst2, - src_nelems); + dpnp::tensor::validation::AmpleMemory::throw_if_not_ample(dst1, src_nelems); + dpnp::tensor::validation::AmpleMemory::throw_if_not_ample(dst2, src_nelems); // check memory overlap - auto const &overlap = dpctl::tensor::overlap::MemoryOverlap(); + auto const &overlap = dpnp::tensor::overlap::MemoryOverlap(); auto const &same_logical_tensors = - dpctl::tensor::overlap::SameLogicalTensors(); + dpnp::tensor::overlap::SameLogicalTensors(); if ((overlap(src, dst1) && !same_logical_tensors(src, dst1)) || (overlap(src, dst2) && !same_logical_tensors(src, dst2)) || (overlap(dst1, dst2) && !same_logical_tensors(dst1, dst2))) { @@ -397,7 +394,7 @@ std::pair auto comp_ev = contig_fn(q, src_nelems, src_data, dst1_data, dst2_data, depends); sycl::event ht_ev = - dpctl::utils::keep_args_alive(q, {src, dst1, dst2}, {comp_ev}); + dpnp::utils::keep_args_alive(q, {src, dst1, dst2}, {comp_ev}); return std::make_pair(ht_ev, comp_ev); } @@ -448,7 +445,7 @@ std::pair dst2_data + dst2_elem_size * dst2_offset, depends); sycl::event ht_ev = - dpctl::utils::keep_args_alive(q, {src, dst1, dst2}, {comp_ev}); + dpnp::utils::keep_args_alive(q, {src, dst1, dst2}, {comp_ev}); return std::make_pair(ht_ev, comp_ev); } @@ -462,7 +459,7 @@ std::pair std::to_string(src_typeid)); } - using dpctl::tensor::offset_utils::device_allocate_and_pack; + using dpnp::tensor::offset_utils::device_allocate_and_pack; std::vector host_tasks{}; host_tasks.reserve(2); @@ -479,13 +476,13 @@ std::pair dst1_offset, dst2_data, dst2_offset, depends, {copy_shape_ev}); // async free of shape_strides temporary - sycl::event tmp_cleanup_ev = dpctl::tensor::alloc_utils::async_smart_free( + sycl::event tmp_cleanup_ev = dpnp::tensor::alloc_utils::async_smart_free( q, {strided_fn_ev}, shape_strides_owner); host_tasks.push_back(tmp_cleanup_ev); return std::make_pair( - dpctl::utils::keep_args_alive(q, {src, dst1, dst2}, host_tasks), + dpnp::utils::keep_args_alive(q, {src, dst1, dst2}, host_tasks), strided_fn_ev); } @@ -498,7 +495,7 @@ std::pair py_unary_two_outputs_ufunc_result_type(const py::dtype &input_dtype, const output_typesT &output_types) { - int tn = input_dtype.num(); // NumPy type numbers are the same as in dpctl + int tn = input_dtype.num(); // NumPy type numbers are the same as in dpnp int src_typeid = -1; auto array_types = td_ns::usm_ndarray_types(); @@ -550,9 +547,9 @@ template std::pair py_binary_ufunc( - const dpctl::tensor::usm_ndarray &src1, - const dpctl::tensor::usm_ndarray &src2, - const dpctl::tensor::usm_ndarray &dst, // dst = op(src1, src2), elementwise + const dpnp::tensor::usm_ndarray &src1, + const dpnp::tensor::usm_ndarray &src2, + const dpnp::tensor::usm_ndarray &dst, // dst = op(src1, src2), elementwise sycl::queue &exec_q, const std::vector &depends, // @@ -582,12 +579,12 @@ std::pair py_binary_ufunc( } // check that queues are compatible - if (!dpctl::utils::queues_are_compatible(exec_q, {src1, src2, dst})) { + if (!dpnp::utils::queues_are_compatible(exec_q, {src1, src2, dst})) { throw py::value_error( "Execution queue is not compatible with allocation queues"); } - dpctl::tensor::validation::CheckWritable::throw_if_not_writable(dst); + dpnp::tensor::validation::CheckWritable::throw_if_not_writable(dst); // check shapes, broadcasting is assumed done by caller // check that dimensions are the same @@ -617,11 +614,11 @@ std::pair py_binary_ufunc( return std::make_pair(sycl::event(), sycl::event()); } - dpctl::tensor::validation::AmpleMemory::throw_if_not_ample(dst, src_nelems); + dpnp::tensor::validation::AmpleMemory::throw_if_not_ample(dst, src_nelems); - auto const &overlap = dpctl::tensor::overlap::MemoryOverlap(); + auto const &overlap = dpnp::tensor::overlap::MemoryOverlap(); auto const &same_logical_tensors = - dpctl::tensor::overlap::SameLogicalTensors(); + dpnp::tensor::overlap::SameLogicalTensors(); if ((overlap(src1, dst) && !same_logical_tensors(src1, dst)) || (overlap(src2, dst) && !same_logical_tensors(src2, dst))) { throw py::value_error("Arrays index overlapping segments of memory"); @@ -653,7 +650,7 @@ std::pair py_binary_ufunc( if (contig_fn != nullptr) { auto comp_ev = contig_fn(exec_q, src_nelems, src1_data, 0, src2_data, 0, dst_data, 0, depends); - sycl::event ht_ev = dpctl::utils::keep_args_alive( + sycl::event ht_ev = dpnp::utils::keep_args_alive( exec_q, {src1, src2, dst}, {comp_ev}); return std::make_pair(ht_ev, comp_ev); @@ -697,7 +694,7 @@ std::pair py_binary_ufunc( auto comp_ev = contig_fn(exec_q, src_nelems, src1_data, src1_offset, src2_data, src2_offset, dst_data, dst_offset, depends); - sycl::event ht_ev = dpctl::utils::keep_args_alive( + sycl::event ht_ev = dpnp::utils::keep_args_alive( exec_q, {src1, src2, dst}, {comp_ev}); return std::make_pair(ht_ev, comp_ev); @@ -735,7 +732,7 @@ std::pair py_binary_ufunc( depends); return std::make_pair( - dpctl::utils::keep_args_alive( + dpnp::utils::keep_args_alive( exec_q, {src1, src2, dst}, host_tasks), comp_ev); } @@ -767,7 +764,7 @@ std::pair py_binary_ufunc( depends); return std::make_pair( - dpctl::utils::keep_args_alive( + dpnp::utils::keep_args_alive( exec_q, {src1, src2, dst}, host_tasks), comp_ev); } @@ -786,7 +783,7 @@ std::pair py_binary_ufunc( " and src2_typeid=" + std::to_string(src2_typeid)); } - using dpctl::tensor::offset_utils::device_allocate_and_pack; + using dpnp::tensor::offset_utils::device_allocate_and_pack; auto ptr_sz_event_triple_ = device_allocate_and_pack( exec_q, host_tasks, simplified_shape, simplified_src1_strides, simplified_src2_strides, simplified_dst_strides); @@ -800,13 +797,13 @@ std::pair py_binary_ufunc( src2_data, src2_offset, dst_data, dst_offset, depends, {copy_shape_ev}); // async free of shape_strides temporary - sycl::event tmp_cleanup_ev = dpctl::tensor::alloc_utils::async_smart_free( + sycl::event tmp_cleanup_ev = dpnp::tensor::alloc_utils::async_smart_free( exec_q, {strided_fn_ev}, shape_strides_owner); host_tasks.push_back(tmp_cleanup_ev); return std::make_pair( - dpctl::utils::keep_args_alive(exec_q, {src1, src2, dst}, host_tasks), + dpnp::utils::keep_args_alive(exec_q, {src1, src2, dst}, host_tasks), strided_fn_ev); } @@ -816,8 +813,8 @@ py::object py_binary_ufunc_result_type(const py::dtype &input1_dtype, const py::dtype &input2_dtype, const output_typesT &output_types_table) { - int tn1 = input1_dtype.num(); // NumPy type numbers are the same as in dpctl - int tn2 = input2_dtype.num(); // NumPy type numbers are the same as in dpctl + int tn1 = input1_dtype.num(); // NumPy type numbers are the same as in dpnp + int tn2 = input2_dtype.num(); // NumPy type numbers are the same as in dpnp int src1_typeid = -1; int src2_typeid = -1; @@ -856,10 +853,10 @@ template std::pair - py_binary_two_outputs_ufunc(const dpctl::tensor::usm_ndarray &src1, - const dpctl::tensor::usm_ndarray &src2, - const dpctl::tensor::usm_ndarray &dst1, - const dpctl::tensor::usm_ndarray &dst2, + py_binary_two_outputs_ufunc(const dpnp::tensor::usm_ndarray &src1, + const dpnp::tensor::usm_ndarray &src2, + const dpnp::tensor::usm_ndarray &dst1, + const dpnp::tensor::usm_ndarray &dst2, sycl::queue &exec_q, const std::vector &depends, // @@ -889,14 +886,13 @@ std::pair } // check that queues are compatible - if (!dpctl::utils::queues_are_compatible(exec_q, - {src1, src2, dst1, dst2})) { + if (!dpnp::utils::queues_are_compatible(exec_q, {src1, src2, dst1, dst2})) { throw py::value_error( "Execution queue is not compatible with allocation queues"); } - dpctl::tensor::validation::CheckWritable::throw_if_not_writable(dst1); - dpctl::tensor::validation::CheckWritable::throw_if_not_writable(dst2); + dpnp::tensor::validation::CheckWritable::throw_if_not_writable(dst1); + dpnp::tensor::validation::CheckWritable::throw_if_not_writable(dst2); // check shapes, broadcasting is assumed done by caller // check that dimensions are the same @@ -933,15 +929,13 @@ std::pair return std::make_pair(sycl::event(), sycl::event()); } - dpctl::tensor::validation::AmpleMemory::throw_if_not_ample(dst1, - src_nelems); - dpctl::tensor::validation::AmpleMemory::throw_if_not_ample(dst2, - src_nelems); + dpnp::tensor::validation::AmpleMemory::throw_if_not_ample(dst1, src_nelems); + dpnp::tensor::validation::AmpleMemory::throw_if_not_ample(dst2, src_nelems); // check memory overlap - auto const &overlap = dpctl::tensor::overlap::MemoryOverlap(); + auto const &overlap = dpnp::tensor::overlap::MemoryOverlap(); auto const &same_logical_tensors = - dpctl::tensor::overlap::SameLogicalTensors(); + dpnp::tensor::overlap::SameLogicalTensors(); if ((overlap(src1, dst1) && !same_logical_tensors(src1, dst1)) || (overlap(src1, dst2) && !same_logical_tensors(src1, dst2)) || (overlap(src2, dst1) && !same_logical_tensors(src2, dst1)) || @@ -981,7 +975,7 @@ std::pair auto comp_ev = contig_fn(exec_q, src_nelems, src1_data, 0, src2_data, 0, dst1_data, 0, dst2_data, 0, depends); - sycl::event ht_ev = dpctl::utils::keep_args_alive( + sycl::event ht_ev = dpnp::utils::keep_args_alive( exec_q, {src1, src2, dst1, dst2}, {comp_ev}); return std::make_pair(ht_ev, comp_ev); @@ -1029,7 +1023,7 @@ std::pair contig_fn(exec_q, src_nelems, src1_data, src1_offset, src2_data, src2_offset, dst1_data, dst1_offset, dst2_data, dst2_offset, depends); - sycl::event ht_ev = dpctl::utils::keep_args_alive( + sycl::event ht_ev = dpnp::utils::keep_args_alive( exec_q, {src1, src2, dst1, dst2}, {comp_ev}); return std::make_pair(ht_ev, comp_ev); @@ -1046,7 +1040,7 @@ std::pair " and src2_typeid=" + std::to_string(src2_typeid)); } - using dpctl::tensor::offset_utils::device_allocate_and_pack; + using dpnp::tensor::offset_utils::device_allocate_and_pack; auto ptr_sz_event_triple_ = device_allocate_and_pack( exec_q, host_tasks, simplified_shape, simplified_src1_strides, simplified_src2_strides, simplified_dst1_strides, @@ -1062,11 +1056,11 @@ std::pair dst2_data, dst2_offset, depends, {copy_shape_ev}); // async free of shape_strides temporary - sycl::event tmp_cleanup_ev = dpctl::tensor::alloc_utils::async_smart_free( + sycl::event tmp_cleanup_ev = dpnp::tensor::alloc_utils::async_smart_free( exec_q, {strided_fn_ev}, shape_strides_owner); host_tasks.push_back(tmp_cleanup_ev); - return std::make_pair(dpctl::utils::keep_args_alive( + return std::make_pair(dpnp::utils::keep_args_alive( exec_q, {src1, src2, dst1, dst2}, host_tasks), strided_fn_ev); } @@ -1081,8 +1075,8 @@ std::pair py_binary_two_outputs_ufunc_result_type( const py::dtype &input2_dtype, const output_typesT &output_types_table) { - int tn1 = input1_dtype.num(); // NumPy type numbers are the same as in dpctl - int tn2 = input2_dtype.num(); // NumPy type numbers are the same as in dpctl + int tn1 = input1_dtype.num(); // NumPy type numbers are the same as in dpnp + int tn2 = input2_dtype.num(); // NumPy type numbers are the same as in dpnp int src1_typeid = -1; int src2_typeid = -1; @@ -1129,8 +1123,8 @@ template std::pair - py_binary_inplace_ufunc(const dpctl::tensor::usm_ndarray &lhs, - const dpctl::tensor::usm_ndarray &rhs, + py_binary_inplace_ufunc(const dpnp::tensor::usm_ndarray &lhs, + const dpnp::tensor::usm_ndarray &rhs, sycl::queue &exec_q, const std::vector &depends, // @@ -1140,7 +1134,7 @@ std::pair const contig_row_matrix_dispatchT &contig_row_matrix_broadcast_dispatch_table) { - dpctl::tensor::validation::CheckWritable::throw_if_not_writable(lhs); + dpnp::tensor::validation::CheckWritable::throw_if_not_writable(lhs); // check type_nums int rhs_typenum = rhs.get_typenum(); @@ -1158,7 +1152,7 @@ std::pair } // check that queues are compatible - if (!dpctl::utils::queues_are_compatible(exec_q, {rhs, lhs})) { + if (!dpnp::utils::queues_are_compatible(exec_q, {rhs, lhs})) { throw py::value_error( "Execution queue is not compatible with allocation queues"); } @@ -1189,12 +1183,12 @@ std::pair return std::make_pair(sycl::event(), sycl::event()); } - dpctl::tensor::validation::AmpleMemory::throw_if_not_ample(lhs, rhs_nelems); + dpnp::tensor::validation::AmpleMemory::throw_if_not_ample(lhs, rhs_nelems); // check memory overlap auto const &same_logical_tensors = - dpctl::tensor::overlap::SameLogicalTensors(); - auto const &overlap = dpctl::tensor::overlap::MemoryOverlap(); + dpnp::tensor::overlap::SameLogicalTensors(); + auto const &overlap = dpnp::tensor::overlap::MemoryOverlap(); if (overlap(rhs, lhs) && !same_logical_tensors(rhs, lhs)) { throw py::value_error("Arrays index overlapping segments of memory"); } @@ -1220,7 +1214,7 @@ std::pair auto comp_ev = contig_fn(exec_q, rhs_nelems, rhs_data, 0, lhs_data, 0, depends); sycl::event ht_ev = - dpctl::utils::keep_args_alive(exec_q, {rhs, lhs}, {comp_ev}); + dpnp::utils::keep_args_alive(exec_q, {rhs, lhs}, {comp_ev}); return std::make_pair(ht_ev, comp_ev); } @@ -1258,8 +1252,8 @@ std::pair auto comp_ev = contig_fn(exec_q, rhs_nelems, rhs_data, rhs_offset, lhs_data, lhs_offset, depends); - sycl::event ht_ev = dpctl::utils::keep_args_alive( - exec_q, {rhs, lhs}, {comp_ev}); + sycl::event ht_ev = + dpnp::utils::keep_args_alive(exec_q, {rhs, lhs}, {comp_ev}); return std::make_pair(ht_ev, comp_ev); } @@ -1281,7 +1275,7 @@ std::pair exec_q, host_tasks, n0, n1, rhs_data, rhs_offset, lhs_data, lhs_offset, depends); - return std::make_pair(dpctl::utils::keep_args_alive( + return std::make_pair(dpnp::utils::keep_args_alive( exec_q, {lhs, rhs}, host_tasks), comp_ev); } @@ -1299,7 +1293,7 @@ std::pair " and lhs_typeid=" + std::to_string(lhs_typeid)); } - using dpctl::tensor::offset_utils::device_allocate_and_pack; + using dpnp::tensor::offset_utils::device_allocate_and_pack; auto ptr_sz_event_triple_ = device_allocate_and_pack( exec_q, host_tasks, simplified_shape, simplified_rhs_strides, simplified_lhs_strides); @@ -1313,13 +1307,13 @@ std::pair lhs_data, lhs_offset, depends, {copy_shape_ev}); // async free of shape_strides temporary - sycl::event tmp_cleanup_ev = dpctl::tensor::alloc_utils::async_smart_free( + sycl::event tmp_cleanup_ev = dpnp::tensor::alloc_utils::async_smart_free( exec_q, {strided_fn_ev}, shape_strides_owner); host_tasks.push_back(tmp_cleanup_ev); return std::make_pair( - dpctl::utils::keep_args_alive(exec_q, {rhs, lhs}, host_tasks), + dpnp::utils::keep_args_alive(exec_q, {rhs, lhs}, host_tasks), strided_fn_ev); } } // namespace dpnp::extensions::py_internal diff --git a/dpnp/backend/extensions/elementwise_functions/elementwise_functions_type_utils.cpp b/dpnp/backend/extensions/elementwise_functions/elementwise_functions_type_utils.cpp index 7300f938eabb..6a2bc13d7d2b 100644 --- a/dpnp/backend/extensions/elementwise_functions/elementwise_functions_type_utils.cpp +++ b/dpnp/backend/extensions/elementwise_functions/elementwise_functions_type_utils.cpp @@ -35,13 +35,13 @@ #include "elementwise_functions_type_utils.hpp" -// dpctl tensor headers +// dpnp tensor headers #include "utils/type_dispatch.hpp" namespace dpnp::extensions::py_internal::type_utils { namespace py = pybind11; -namespace td_ns = dpctl::tensor::type_dispatch; +namespace td_ns = dpnp::tensor::type_dispatch; py::dtype _dtype_from_typenum(td_ns::typenum_t dst_typenum_t) { diff --git a/dpnp/backend/extensions/elementwise_functions/elementwise_functions_type_utils.hpp b/dpnp/backend/extensions/elementwise_functions/elementwise_functions_type_utils.hpp index 58fe43c01589..ffc0573c7aa1 100644 --- a/dpnp/backend/extensions/elementwise_functions/elementwise_functions_type_utils.hpp +++ b/dpnp/backend/extensions/elementwise_functions/elementwise_functions_type_utils.hpp @@ -33,13 +33,13 @@ #include "dpnp4pybind11.hpp" -// dpctl tensor headers +// dpnp tensor headers #include "utils/type_dispatch.hpp" namespace dpnp::extensions::py_internal::type_utils { namespace py = pybind11; -namespace td_ns = dpctl::tensor::type_dispatch; +namespace td_ns = dpnp::tensor::type_dispatch; /*! @brief Produce dtype from a type number */ extern py::dtype _dtype_from_typenum(td_ns::typenum_t); diff --git a/dpnp/backend/extensions/elementwise_functions/simplify_iteration_space.cpp b/dpnp/backend/extensions/elementwise_functions/simplify_iteration_space.cpp index c60602ccb01d..d489d847e610 100644 --- a/dpnp/backend/extensions/elementwise_functions/simplify_iteration_space.cpp +++ b/dpnp/backend/extensions/elementwise_functions/simplify_iteration_space.cpp @@ -32,13 +32,13 @@ #include "simplify_iteration_space.hpp" -// dpctl tensor headers +// dpnp tensor headers #include "utils/strided_iters.hpp" namespace dpnp::extensions::py_internal { namespace py = pybind11; -namespace st_ns = dpctl::tensor::strides; +namespace st_ns = dpnp::tensor::strides; void simplify_iteration_space(int &nd, const py::ssize_t *const &shape, @@ -227,7 +227,7 @@ void simplify_iteration_space_4( py::ssize_t &src3_offset, py::ssize_t &dst_offset) { - using dpctl::tensor::strides::simplify_iteration_four_strides; + using dpnp::tensor::strides::simplify_iteration_four_strides; if (nd > 1) { // Simplify iteration space to reduce dimensionality // and improve access pattern diff --git a/dpnp/backend/extensions/elementwise_functions/type_dispatch_building.hpp b/dpnp/backend/extensions/elementwise_functions/type_dispatch_building.hpp index aa8fd58b549c..80d4d1f72dde 100644 --- a/dpnp/backend/extensions/elementwise_functions/type_dispatch_building.hpp +++ b/dpnp/backend/extensions/elementwise_functions/type_dispatch_building.hpp @@ -35,7 +35,7 @@ namespace dpnp::extensions::py_internal::type_dispatch { /** - * Extends dpctl::tensor::type_dispatch::TypeMapResultEntry helper structure + * Extends dpnp::tensor::type_dispatch::TypeMapResultEntry helper structure * with support of the two result types. */ template > }; /** - * Extends dpctl::tensor::type_dispatch::BinaryTypeMapResultEntry helper + * Extends dpnp::tensor::type_dispatch::BinaryTypeMapResultEntry helper * structure with support of the two result types. */ template diff --git a/dpnp/backend/extensions/fft/in_place.hpp b/dpnp/backend/extensions/fft/in_place.hpp index bc35201b9b6e..ed0066d29db2 100644 --- a/dpnp/backend/extensions/fft/in_place.hpp +++ b/dpnp/backend/extensions/fft/in_place.hpp @@ -43,7 +43,7 @@ namespace mkl_dft = oneapi::mkl::dft; template std::pair compute_fft_in_place(DescriptorWrapper &descr, - const dpctl::tensor::usm_ndarray &in_out, + const dpnp::tensor::usm_ndarray &in_out, const bool is_forward, const std::vector &depends); diff --git a/dpnp/backend/extensions/fft/in_place.tpp b/dpnp/backend/extensions/fft/in_place.tpp index ace535284de6..fa2ce1e1988b 100644 --- a/dpnp/backend/extensions/fft/in_place.tpp +++ b/dpnp/backend/extensions/fft/in_place.tpp @@ -44,7 +44,7 @@ #include "fft_utils.hpp" #include "in_place.hpp" -// dpctl tensor headers +// dpnp tensor headers #include "utils/output_validation.hpp" namespace dpnp::extensions::fft @@ -56,7 +56,7 @@ namespace py = pybind11; template std::pair compute_fft_in_place(DescriptorWrapper &descr, - const dpctl::tensor::usm_ndarray &in_out, + const dpnp::tensor::usm_ndarray &in_out, const bool is_forward, const std::vector &depends) { @@ -73,12 +73,12 @@ std::pair } sycl::queue exec_q = descr.get_queue(); - if (!dpctl::utils::queues_are_compatible(exec_q, {in_out.get_queue()})) { + if (!dpnp::utils::queues_are_compatible(exec_q, {in_out.get_queue()})) { throw py::value_error("SYCL queue of the descriptor is not compatible " "with the execution queue of input array."); } - dpctl::tensor::validation::CheckWritable::throw_if_not_writable(in_out); + dpnp::tensor::validation::CheckWritable::throw_if_not_writable(in_out); // in-place is only used for c2c FFT at this time, passing true or false is // indifferent @@ -113,7 +113,7 @@ std::pair } sycl::event args_ev = - dpctl::utils::keep_args_alive(exec_q, {in_out}, {fft_event}); + dpnp::utils::keep_args_alive(exec_q, {in_out}, {fft_event}); return std::make_pair(fft_event, args_ev); } diff --git a/dpnp/backend/extensions/fft/out_of_place.hpp b/dpnp/backend/extensions/fft/out_of_place.hpp index 55ca9383baaf..fdfc3644b09a 100644 --- a/dpnp/backend/extensions/fft/out_of_place.hpp +++ b/dpnp/backend/extensions/fft/out_of_place.hpp @@ -43,8 +43,8 @@ namespace mkl_dft = oneapi::mkl::dft; template std::pair compute_fft_out_of_place(DescriptorWrapper &descr, - const dpctl::tensor::usm_ndarray &in, - const dpctl::tensor::usm_ndarray &out, + const dpnp::tensor::usm_ndarray &in, + const dpnp::tensor::usm_ndarray &out, const bool is_forward, const std::vector &depends); diff --git a/dpnp/backend/extensions/fft/out_of_place.tpp b/dpnp/backend/extensions/fft/out_of_place.tpp index aada49c16bda..8ceb5f48c28b 100644 --- a/dpnp/backend/extensions/fft/out_of_place.tpp +++ b/dpnp/backend/extensions/fft/out_of_place.tpp @@ -46,7 +46,7 @@ #include "fft_utils.hpp" #include "out_of_place.hpp" -// dpctl tensor headers +// dpnp tensor headers #include "utils/memory_overlap.hpp" #include "utils/output_validation.hpp" @@ -59,8 +59,8 @@ namespace py = pybind11; template std::pair compute_fft_out_of_place(DescriptorWrapper &descr, - const dpctl::tensor::usm_ndarray &in, - const dpctl::tensor::usm_ndarray &out, + const dpnp::tensor::usm_ndarray &in, + const dpnp::tensor::usm_ndarray &out, const bool is_forward, const std::vector &depends) { @@ -83,16 +83,16 @@ std::pair "The input and output arrays must have the same dimension."); } - auto const &overlap = dpctl::tensor::overlap::MemoryOverlap(); + auto const &overlap = dpnp::tensor::overlap::MemoryOverlap(); auto const &same_logical_tensors = - dpctl::tensor::overlap::SameLogicalTensors(); + dpnp::tensor::overlap::SameLogicalTensors(); if (overlap(in, out) && !same_logical_tensors(in, out)) { throw py::value_error( "The input and output arrays are overlapping segments of memory"); } sycl::queue exec_q = descr.get_queue(); - if (!dpctl::utils::queues_are_compatible( + if (!dpnp::utils::queues_are_compatible( exec_q, {in.get_queue(), out.get_queue()})) { throw py::value_error("USM allocations are not compatible with the " "execution queue of the descriptor."); @@ -135,8 +135,8 @@ std::pair } const std::size_t n_elems = in_size * N; - dpctl::tensor::validation::CheckWritable::throw_if_not_writable(out); - dpctl::tensor::validation::AmpleMemory::throw_if_not_ample(out, n_elems); + dpnp::tensor::validation::CheckWritable::throw_if_not_writable(out); + dpnp::tensor::validation::AmpleMemory::throw_if_not_ample(out, n_elems); sycl::event fft_event = {}; std::stringstream error_msg; @@ -174,7 +174,7 @@ std::pair } sycl::event args_ev = - dpctl::utils::keep_args_alive(exec_q, {in, out}, {fft_event}); + dpnp::utils::keep_args_alive(exec_q, {in, out}, {fft_event}); return std::make_pair(fft_event, args_ev); } diff --git a/dpnp/backend/extensions/indexing/choose.cpp b/dpnp/backend/extensions/indexing/choose.cpp index fafcbe1f2495..cffc376233d7 100644 --- a/dpnp/backend/extensions/indexing/choose.cpp +++ b/dpnp/backend/extensions/indexing/choose.cpp @@ -47,7 +47,7 @@ #include "ext/common.hpp" #include "kernels/indexing/choose.hpp" -// dpctl tensor headers +// dpnp tensor headers #include "utils/indexing_utils.hpp" #include "utils/memory_overlap.hpp" #include "utils/offset_utils.hpp" @@ -62,9 +62,9 @@ namespace py = pybind11; namespace impl { -namespace td_ns = dpctl::tensor::type_dispatch; +namespace td_ns = dpnp::tensor::type_dispatch; -using dpctl::tensor::ssize_t; +using dpnp::tensor::ssize_t; typedef sycl::event (*choose_fn_ptr_t)(sycl::queue &, size_t, @@ -98,7 +98,7 @@ sycl::event choose_impl(sycl::queue &q, const ssize_t *chc_offsets, const std::vector &depends) { - dpctl::tensor::type_utils::validate_type_for_device(q); + dpnp::tensor::type_utils::validate_type_for_device(q); const indTy *ind_tp = reinterpret_cast(ind_cp); Ty *dst_tp = reinterpret_cast(dst_cp); @@ -107,7 +107,7 @@ sycl::event choose_impl(sycl::queue &q, cgh.depends_on(depends); using InOutIndexerT = - dpctl::tensor::offset_utils::TwoOffsets_StridedIndexer; + dpnp::tensor::offset_utils::TwoOffsets_StridedIndexer; const InOutIndexerT ind_out_indexer{nd, ind_offset, dst_offset, shape_and_strides}; @@ -149,7 +149,7 @@ struct ChooseFactory namespace detail { using host_ptrs_allocator_t = - dpctl::tensor::alloc_utils::usm_host_allocator; + dpnp::tensor::alloc_utils::usm_host_allocator; using ptrs_t = std::vector; using host_ptrs_shp_t = std::shared_ptr; @@ -166,7 +166,7 @@ host_ptrs_shp_t make_host_ptrs(sycl::queue &exec_q, } using host_sz_allocator_t = - dpctl::tensor::alloc_utils::usm_host_allocator; + dpnp::tensor::alloc_utils::usm_host_allocator; using sz_t = std::vector; using host_sz_shp_t = std::shared_ptr; @@ -253,19 +253,20 @@ sycl::event async_shp_free(sycl::queue &exec_q, return shared_ptr_cleanup_ev; } -// copied from dpctl, remove if a similar utility is ever exposed -std::vector parse_py_chcs(const sycl::queue &q, - const py::object &py_chcs) +// was copied from dpctl +// TODO: remove by consolidating with tensor post-migration +std::vector parse_py_chcs(const sycl::queue &q, + const py::object &py_chcs) { py::ssize_t chc_count = py::len(py_chcs); - std::vector res; + std::vector res; res.reserve(chc_count); for (py::ssize_t i = 0; i < chc_count; ++i) { py::object el_i = py_chcs[py::cast(i)]; - dpctl::tensor::usm_ndarray arr_i = - py::cast(el_i); - if (!dpctl::utils::queues_are_compatible(q, {arr_i})) { + dpnp::tensor::usm_ndarray arr_i = + py::cast(el_i); + if (!dpnp::utils::queues_are_compatible(q, {arr_i})) { throw py::value_error("Choice allocation queue is not compatible " "with execution queue"); } @@ -277,14 +278,14 @@ std::vector parse_py_chcs(const sycl::queue &q, } // namespace detail std::pair - py_choose(const dpctl::tensor::usm_ndarray &src, + py_choose(const dpnp::tensor::usm_ndarray &src, const py::object &py_chcs, - const dpctl::tensor::usm_ndarray &dst, + const dpnp::tensor::usm_ndarray &dst, uint8_t mode, sycl::queue &exec_q, const std::vector &depends) { - std::vector chcs = + std::vector chcs = detail::parse_py_chcs(exec_q, py_chcs); // Python list max size must fit into py_ssize_t @@ -298,9 +299,9 @@ std::pair throw py::value_error("Mode must be 0 or 1."); } - dpctl::tensor::validation::CheckWritable::throw_if_not_writable(dst); + dpnp::tensor::validation::CheckWritable::throw_if_not_writable(dst); - const dpctl::tensor::usm_ndarray chc_rep = chcs[0]; + const dpnp::tensor::usm_ndarray chc_rep = chcs[0]; int nd = src.get_ndim(); int dst_nd = dst.get_ndim(); @@ -329,12 +330,12 @@ std::pair char *src_data = src.get_data(); char *dst_data = dst.get_data(); - if (!dpctl::utils::queues_are_compatible(exec_q, {src, dst})) { + if (!dpnp::utils::queues_are_compatible(exec_q, {src, dst})) { throw py::value_error( "Execution queue is not compatible with allocation queues"); } - auto const &overlap = dpctl::tensor::overlap::MemoryOverlap(); + auto const &overlap = dpnp::tensor::overlap::MemoryOverlap(); if (overlap(src, dst)) { throw py::value_error("Array memory overlap."); } @@ -357,7 +358,7 @@ std::pair throw py::type_error("Output and choice data types are not the same."); } - dpctl::tensor::validation::AmpleMemory::throw_if_not_ample(dst, nelems); + dpnp::tensor::validation::AmpleMemory::throw_if_not_ample(dst, nelems); std::vector chc_ptrs; chc_ptrs.reserve(n_chcs); @@ -369,7 +370,7 @@ std::pair std::vector chc_strides(n_chcs * sh_nelems, 0); for (auto i = 0; i < n_chcs; ++i) { - dpctl::tensor::usm_ndarray chc_ = chcs[i]; + dpnp::tensor::usm_ndarray chc_ = chcs[i]; // ndim, type, and shape are checked against the first array if (i > 0) { @@ -417,7 +418,7 @@ std::pair } auto packed_chc_ptrs = - dpctl::tensor::alloc_utils::smart_malloc_device(n_chcs, exec_q); + dpnp::tensor::alloc_utils::smart_malloc_device(n_chcs, exec_q); // packed_shapes_strides = [common shape, // src.strides, @@ -426,12 +427,12 @@ std::pair // ..., // chcs[n_chcs].strides] auto packed_shapes_strides = - dpctl::tensor::alloc_utils::smart_malloc_device( + dpnp::tensor::alloc_utils::smart_malloc_device( (3 + n_chcs) * sh_nelems, exec_q); auto packed_chc_offsets = - dpctl::tensor::alloc_utils::smart_malloc_device(n_chcs, - exec_q); + dpnp::tensor::alloc_utils::smart_malloc_device(n_chcs, + exec_q); std::vector host_task_events; host_task_events.reserve(2); @@ -481,21 +482,21 @@ std::pair // async_smart_free releases owners sycl::event temporaries_cleanup_ev = - dpctl::tensor::alloc_utils::async_smart_free( + dpnp::tensor::alloc_utils::async_smart_free( exec_q, {choose_generic_ev}, packed_chc_ptrs, packed_shapes_strides, packed_chc_offsets); host_task_events.push_back(temporaries_cleanup_ev); - using dpctl::utils::keep_args_alive; + using dpnp::utils::keep_args_alive; sycl::event arg_cleanup_ev = keep_args_alive(exec_q, {src, py_chcs, dst}, host_task_events); return std::make_pair(arg_cleanup_ev, choose_generic_ev); } -using dpctl::tensor::indexing_utils::ClipIndex; -using dpctl::tensor::indexing_utils::WrapIndex; +using dpnp::tensor::indexing_utils::ClipIndex; +using dpnp::tensor::indexing_utils::WrapIndex; template using ChooseWrapFactory = ChooseFactory>; diff --git a/dpnp/backend/extensions/lapack/common_helpers.hpp b/dpnp/backend/extensions/lapack/common_helpers.hpp index 308c372681f6..b013838f44a0 100644 --- a/dpnp/backend/extensions/lapack/common_helpers.hpp +++ b/dpnp/backend/extensions/lapack/common_helpers.hpp @@ -37,7 +37,7 @@ #include #include -// dpctl tensor headers +// dpnp tensor headers #include "utils/sycl_alloc_utils.hpp" namespace dpnp::extensions::lapack::helper @@ -87,7 +87,7 @@ inline std::int64_t *alloc_ipiv(const std::int64_t n, sycl::queue &exec_q) } } catch (sycl::exception const &e) { if (ipiv != nullptr) - dpctl::tensor::alloc_utils::sycl_free_noexcept(ipiv, exec_q); + dpnp::tensor::alloc_utils::sycl_free_noexcept(ipiv, exec_q); throw std::runtime_error( std::string( "Unexpected SYCL exception caught during ipiv allocation: ") + @@ -131,7 +131,7 @@ inline T *alloc_scratchpad(std::int64_t scratchpad_size, sycl::queue &exec_q) } } catch (sycl::exception const &e) { if (scratchpad != nullptr) { - dpctl::tensor::alloc_utils::sycl_free_noexcept(scratchpad, exec_q); + dpnp::tensor::alloc_utils::sycl_free_noexcept(scratchpad, exec_q); } throw std::runtime_error(std::string("Unexpected SYCL exception caught " "during scratchpad allocation: ") + diff --git a/dpnp/backend/extensions/lapack/evd_batch_common.hpp b/dpnp/backend/extensions/lapack/evd_batch_common.hpp index d2edffcf520a..088f64a0678e 100644 --- a/dpnp/backend/extensions/lapack/evd_batch_common.hpp +++ b/dpnp/backend/extensions/lapack/evd_batch_common.hpp @@ -31,7 +31,7 @@ #include #include -// dpctl tensor headers +// dpnp tensor headers #include "utils/type_dispatch.hpp" #include "common_helpers.hpp" @@ -50,7 +50,7 @@ typedef sycl::event (*evd_batch_impl_fn_ptr_t)( char *, const std::vector &); -namespace dpctl_td_ns = dpctl::tensor::type_dispatch; +namespace dpnp_td_ns = dpnp::tensor::type_dispatch; namespace py = pybind11; template @@ -58,8 +58,8 @@ std::pair evd_batch_func(sycl::queue &exec_q, const std::int8_t jobz, const std::int8_t upper_lower, - const dpctl::tensor::usm_ndarray &eig_vecs, - const dpctl::tensor::usm_ndarray &eig_vals, + const dpnp::tensor::usm_ndarray &eig_vecs, + const dpnp::tensor::usm_ndarray &eig_vals, const std::vector &depends, const dispatchT &evd_batch_dispatch_table) { @@ -89,7 +89,7 @@ std::pair return std::make_pair(sycl::event(), sycl::event()); } - auto array_types = dpctl_td_ns::usm_ndarray_types(); + auto array_types = dpnp_td_ns::usm_ndarray_types(); const int eig_vecs_type_id = array_types.typenum_to_lookup_id(eig_vecs.get_typenum()); const int eig_vals_type_id = @@ -117,7 +117,7 @@ std::pair evd_batch_fn(exec_q, jobz_val, uplo_val, batch_size, n, eig_vecs_data, eig_vals_data, depends); - sycl::event ht_ev = dpctl::utils::keep_args_alive( + sycl::event ht_ev = dpnp::utils::keep_args_alive( exec_q, {eig_vecs, eig_vals}, {evd_batch_ev}); return std::make_pair(ht_ev, evd_batch_ev); diff --git a/dpnp/backend/extensions/lapack/evd_common.hpp b/dpnp/backend/extensions/lapack/evd_common.hpp index dccad11773f7..cfba50e87722 100644 --- a/dpnp/backend/extensions/lapack/evd_common.hpp +++ b/dpnp/backend/extensions/lapack/evd_common.hpp @@ -31,7 +31,7 @@ #include #include -// dpctl tensor headers +// dpnp tensor headers #include "utils/type_dispatch.hpp" #include "common_helpers.hpp" @@ -50,7 +50,7 @@ typedef sycl::event (*evd_impl_fn_ptr_t)(sycl::queue &, char *, const std::vector &); -namespace dpctl_td_ns = dpctl::tensor::type_dispatch; +namespace dpnp_td_ns = dpnp::tensor::type_dispatch; namespace py = pybind11; template @@ -58,8 +58,8 @@ std::pair evd_func(sycl::queue &exec_q, const std::int8_t jobz, const std::int8_t upper_lower, - const dpctl::tensor::usm_ndarray &eig_vecs, - const dpctl::tensor::usm_ndarray &eig_vals, + const dpnp::tensor::usm_ndarray &eig_vecs, + const dpnp::tensor::usm_ndarray &eig_vals, const std::vector &depends, const dispatchT &evd_dispatch_table) { @@ -84,7 +84,7 @@ std::pair return std::make_pair(sycl::event(), sycl::event()); } - auto array_types = dpctl_td_ns::usm_ndarray_types(); + auto array_types = dpnp_td_ns::usm_ndarray_types(); const int eig_vecs_type_id = array_types.typenum_to_lookup_id(eig_vecs.get_typenum()); const int eig_vals_type_id = @@ -110,7 +110,7 @@ std::pair eig_vals_data, depends); sycl::event ht_ev = - dpctl::utils::keep_args_alive(exec_q, {eig_vecs, eig_vals}, {evd_ev}); + dpnp::utils::keep_args_alive(exec_q, {eig_vecs, eig_vals}, {evd_ev}); return std::make_pair(ht_ev, evd_ev); } diff --git a/dpnp/backend/extensions/lapack/evd_common_utils.hpp b/dpnp/backend/extensions/lapack/evd_common_utils.hpp index 8b37c77ea20c..ab792d47c08c 100644 --- a/dpnp/backend/extensions/lapack/evd_common_utils.hpp +++ b/dpnp/backend/extensions/lapack/evd_common_utils.hpp @@ -30,7 +30,7 @@ #include -// dpctl tensor headers +// dpnp tensor headers #include "utils/memory_overlap.hpp" #include "utils/output_validation.hpp" @@ -39,8 +39,8 @@ namespace dpnp::extensions::lapack::evd namespace py = pybind11; inline void common_evd_checks(sycl::queue &exec_q, - const dpctl::tensor::usm_ndarray &eig_vecs, - const dpctl::tensor::usm_ndarray &eig_vals, + const dpnp::tensor::usm_ndarray &eig_vecs, + const dpnp::tensor::usm_ndarray &eig_vals, const py::ssize_t *eig_vecs_shape, const int expected_eig_vecs_nd, const int expected_eig_vals_nd) @@ -65,16 +65,16 @@ inline void common_evd_checks(sycl::queue &exec_q, throw py::value_error("Output array with eigenvectors must be square"); } - dpctl::tensor::validation::CheckWritable::throw_if_not_writable(eig_vecs); - dpctl::tensor::validation::CheckWritable::throw_if_not_writable(eig_vals); + dpnp::tensor::validation::CheckWritable::throw_if_not_writable(eig_vecs); + dpnp::tensor::validation::CheckWritable::throw_if_not_writable(eig_vals); // check compatibility of execution queue and allocation queue - if (!dpctl::utils::queues_are_compatible(exec_q, {eig_vecs, eig_vals})) { + if (!dpnp::utils::queues_are_compatible(exec_q, {eig_vecs, eig_vals})) { throw py::value_error( "Execution queue is not compatible with allocation queues"); } - auto const &overlap = dpctl::tensor::overlap::MemoryOverlap(); + auto const &overlap = dpnp::tensor::overlap::MemoryOverlap(); if (overlap(eig_vecs, eig_vals)) { throw py::value_error("Arrays with eigenvectors and eigenvalues are " "overlapping segments of memory"); diff --git a/dpnp/backend/extensions/lapack/geqrf.cpp b/dpnp/backend/extensions/lapack/geqrf.cpp index 45ce3e0e90a8..083c408ea3d4 100644 --- a/dpnp/backend/extensions/lapack/geqrf.cpp +++ b/dpnp/backend/extensions/lapack/geqrf.cpp @@ -34,7 +34,7 @@ // utils extension header #include "ext/common.hpp" -// dpctl tensor headers +// dpnp tensor headers #include "utils/memory_overlap.hpp" #include "utils/sycl_alloc_utils.hpp" #include "utils/type_utils.hpp" @@ -46,7 +46,7 @@ namespace dpnp::extensions::lapack { namespace mkl_lapack = oneapi::mkl::lapack; namespace py = pybind11; -namespace type_utils = dpctl::tensor::type_utils; +namespace type_utils = dpnp::tensor::type_utils; using ext::common::init_dispatch_vector; @@ -59,7 +59,7 @@ typedef sycl::event (*geqrf_impl_fn_ptr_t)(sycl::queue &, std::vector &, const std::vector &); -static geqrf_impl_fn_ptr_t geqrf_dispatch_vector[dpctl_td_ns::num_types]; +static geqrf_impl_fn_ptr_t geqrf_dispatch_vector[dpnp_td_ns::num_types]; template static sycl::event geqrf_impl(sycl::queue &exec_q, @@ -127,7 +127,7 @@ static sycl::event geqrf_impl(sycl::queue &exec_q, if (is_exception_caught) // an unexpected error occurs { if (scratchpad != nullptr) { - dpctl::tensor::alloc_utils::sycl_free_noexcept(scratchpad, exec_q); + dpnp::tensor::alloc_utils::sycl_free_noexcept(scratchpad, exec_q); } throw std::runtime_error(error_msg.str()); } @@ -136,7 +136,7 @@ static sycl::event geqrf_impl(sycl::queue &exec_q, cgh.depends_on(geqrf_event); auto ctx = exec_q.get_context(); cgh.host_task([ctx, scratchpad]() { - dpctl::tensor::alloc_utils::sycl_free_noexcept(scratchpad, ctx); + dpnp::tensor::alloc_utils::sycl_free_noexcept(scratchpad, ctx); }); }); host_task_events.push_back(clean_up_event); @@ -146,8 +146,8 @@ static sycl::event geqrf_impl(sycl::queue &exec_q, std::pair geqrf(sycl::queue &exec_q, - const dpctl::tensor::usm_ndarray &a_array, - const dpctl::tensor::usm_ndarray &tau_array, + const dpnp::tensor::usm_ndarray &a_array, + const dpnp::tensor::usm_ndarray &tau_array, const std::vector &depends) { const int a_array_nd = a_array.get_ndim(); @@ -166,12 +166,12 @@ std::pair } // check compatibility of execution queue and allocation queue - if (!dpctl::utils::queues_are_compatible(exec_q, {a_array, tau_array})) { + if (!dpnp::utils::queues_are_compatible(exec_q, {a_array, tau_array})) { throw py::value_error( "Execution queue is not compatible with allocation queues"); } - auto const &overlap = dpctl::tensor::overlap::MemoryOverlap(); + auto const &overlap = dpnp::tensor::overlap::MemoryOverlap(); if (overlap(a_array, tau_array)) { throw py::value_error( "The input array and the array of Householder scalars " @@ -192,7 +192,7 @@ std::pair "must be contiguous"); } - auto array_types = dpctl_td_ns::usm_ndarray_types(); + auto array_types = dpnp_td_ns::usm_ndarray_types(); int a_array_type_id = array_types.typenum_to_lookup_id(a_array.get_typenum()); int tau_array_type_id = @@ -235,7 +235,7 @@ std::pair sycl::event geqrf_ev = geqrf_fn(exec_q, m, n, a_array_data, lda, tau_array_data, host_task_events, depends); - sycl::event args_ev = dpctl::utils::keep_args_alive( + sycl::event args_ev = dpnp::utils::keep_args_alive( exec_q, {a_array, tau_array}, host_task_events); return std::make_pair(args_ev, geqrf_ev); diff --git a/dpnp/backend/extensions/lapack/geqrf.hpp b/dpnp/backend/extensions/lapack/geqrf.hpp index 7be1fee971cf..a2a25126a27c 100644 --- a/dpnp/backend/extensions/lapack/geqrf.hpp +++ b/dpnp/backend/extensions/lapack/geqrf.hpp @@ -37,14 +37,14 @@ namespace dpnp::extensions::lapack { extern std::pair geqrf(sycl::queue &exec_q, - const dpctl::tensor::usm_ndarray &a_array, - const dpctl::tensor::usm_ndarray &tau_array, + const dpnp::tensor::usm_ndarray &a_array, + const dpnp::tensor::usm_ndarray &tau_array, const std::vector &depends = {}); extern std::pair geqrf_batch(sycl::queue &exec_q, - const dpctl::tensor::usm_ndarray &a_array, - const dpctl::tensor::usm_ndarray &tau_array, + const dpnp::tensor::usm_ndarray &a_array, + const dpnp::tensor::usm_ndarray &tau_array, std::int64_t m, std::int64_t n, std::int64_t stride_a, diff --git a/dpnp/backend/extensions/lapack/geqrf_batch.cpp b/dpnp/backend/extensions/lapack/geqrf_batch.cpp index 033c3db01b10..6e62d4dde336 100644 --- a/dpnp/backend/extensions/lapack/geqrf_batch.cpp +++ b/dpnp/backend/extensions/lapack/geqrf_batch.cpp @@ -33,7 +33,7 @@ // utils extension header #include "ext/common.hpp" -// dpctl tensor headers +// dpnp tensor headers #include "utils/memory_overlap.hpp" #include "utils/sycl_alloc_utils.hpp" #include "utils/type_utils.hpp" @@ -45,7 +45,7 @@ namespace dpnp::extensions::lapack { namespace mkl_lapack = oneapi::mkl::lapack; namespace py = pybind11; -namespace type_utils = dpctl::tensor::type_utils; +namespace type_utils = dpnp::tensor::type_utils; using ext::common::init_dispatch_vector; @@ -63,7 +63,7 @@ typedef sycl::event (*geqrf_batch_impl_fn_ptr_t)( const std::vector &); static geqrf_batch_impl_fn_ptr_t - geqrf_batch_dispatch_vector[dpctl_td_ns::num_types]; + geqrf_batch_dispatch_vector[dpnp_td_ns::num_types]; template static sycl::event geqrf_batch_impl(sycl::queue &exec_q, @@ -147,7 +147,7 @@ static sycl::event geqrf_batch_impl(sycl::queue &exec_q, if (is_exception_caught) // an unexpected error occurs { if (scratchpad != nullptr) { - dpctl::tensor::alloc_utils::sycl_free_noexcept(scratchpad, exec_q); + dpnp::tensor::alloc_utils::sycl_free_noexcept(scratchpad, exec_q); } throw std::runtime_error(error_msg.str()); @@ -157,7 +157,7 @@ static sycl::event geqrf_batch_impl(sycl::queue &exec_q, cgh.depends_on(geqrf_batch_event); auto ctx = exec_q.get_context(); cgh.host_task([ctx, scratchpad]() { - dpctl::tensor::alloc_utils::sycl_free_noexcept(scratchpad, ctx); + dpnp::tensor::alloc_utils::sycl_free_noexcept(scratchpad, ctx); }); }); host_task_events.push_back(clean_up_event); @@ -166,8 +166,8 @@ static sycl::event geqrf_batch_impl(sycl::queue &exec_q, std::pair geqrf_batch(sycl::queue &exec_q, - const dpctl::tensor::usm_ndarray &a_array, - const dpctl::tensor::usm_ndarray &tau_array, + const dpnp::tensor::usm_ndarray &a_array, + const dpnp::tensor::usm_ndarray &tau_array, std::int64_t m, std::int64_t n, std::int64_t stride_a, @@ -191,12 +191,12 @@ std::pair } // check compatibility of execution queue and allocation queue - if (!dpctl::utils::queues_are_compatible(exec_q, {a_array, tau_array})) { + if (!dpnp::utils::queues_are_compatible(exec_q, {a_array, tau_array})) { throw py::value_error( "Execution queue is not compatible with allocation queues"); } - auto const &overlap = dpctl::tensor::overlap::MemoryOverlap(); + auto const &overlap = dpnp::tensor::overlap::MemoryOverlap(); if (overlap(a_array, tau_array)) { throw py::value_error( "The input array and the array of Householder scalars " @@ -214,7 +214,7 @@ std::pair "must be C-contiguous"); } - auto array_types = dpctl_td_ns::usm_ndarray_types(); + auto array_types = dpnp_td_ns::usm_ndarray_types(); int a_array_type_id = array_types.typenum_to_lookup_id(a_array.get_typenum()); int tau_array_type_id = @@ -244,7 +244,7 @@ std::pair exec_q, m, n, a_array_data, lda, stride_a, tau_array_data, stride_tau, batch_size, host_task_events, depends); - sycl::event args_ev = dpctl::utils::keep_args_alive( + sycl::event args_ev = dpnp::utils::keep_args_alive( exec_q, {a_array, tau_array}, host_task_events); return std::make_pair(args_ev, geqrf_batch_ev); diff --git a/dpnp/backend/extensions/lapack/gesv.cpp b/dpnp/backend/extensions/lapack/gesv.cpp index bec24db585a6..072efd169c87 100644 --- a/dpnp/backend/extensions/lapack/gesv.cpp +++ b/dpnp/backend/extensions/lapack/gesv.cpp @@ -34,7 +34,7 @@ // utils extension header #include "ext/common.hpp" -// dpctl tensor headers +// dpnp tensor headers #include "utils/type_utils.hpp" #include "common_helpers.hpp" @@ -46,9 +46,9 @@ namespace dpnp::extensions::lapack { namespace mkl_lapack = oneapi::mkl::lapack; namespace py = pybind11; -namespace type_utils = dpctl::tensor::type_utils; +namespace type_utils = dpnp::tensor::type_utils; -using dpctl::tensor::alloc_utils::sycl_free_noexcept; +using dpnp::tensor::alloc_utils::sycl_free_noexcept; using ext::common::init_dispatch_vector; typedef sycl::event (*gesv_impl_fn_ptr_t)(sycl::queue &, @@ -58,7 +58,7 @@ typedef sycl::event (*gesv_impl_fn_ptr_t)(sycl::queue &, char *, const std::vector &); -static gesv_impl_fn_ptr_t gesv_dispatch_vector[dpctl_td_ns::num_types]; +static gesv_impl_fn_ptr_t gesv_dispatch_vector[dpnp_td_ns::num_types]; template static sycl::event gesv_impl(sycl::queue &exec_q, @@ -220,8 +220,8 @@ static sycl::event gesv_impl(sycl::queue &exec_q, std::pair gesv(sycl::queue &exec_q, - const dpctl::tensor::usm_ndarray &coeff_matrix, - const dpctl::tensor::usm_ndarray &dependent_vals, + const dpnp::tensor::usm_ndarray &coeff_matrix, + const dpnp::tensor::usm_ndarray &dependent_vals, const std::vector &depends) { const int coeff_matrix_nd = coeff_matrix.get_ndim(); @@ -247,7 +247,7 @@ std::pair return std::make_pair(sycl::event(), sycl::event()); } - auto array_types = dpctl_td_ns::usm_ndarray_types(); + auto array_types = dpnp_td_ns::usm_ndarray_types(); const int coeff_matrix_type_id = array_types.typenum_to_lookup_id(coeff_matrix.get_typenum()); @@ -268,7 +268,7 @@ std::pair sycl::event gesv_ev = gesv_fn(exec_q, n, nrhs, coeff_matrix_data, dependent_vals_data, depends); - sycl::event ht_ev = dpctl::utils::keep_args_alive( + sycl::event ht_ev = dpnp::utils::keep_args_alive( exec_q, {coeff_matrix, dependent_vals}, {gesv_ev}); return std::make_pair(ht_ev, gesv_ev); diff --git a/dpnp/backend/extensions/lapack/gesv.hpp b/dpnp/backend/extensions/lapack/gesv.hpp index a86039c9b72e..a0cbe25b1b73 100644 --- a/dpnp/backend/extensions/lapack/gesv.hpp +++ b/dpnp/backend/extensions/lapack/gesv.hpp @@ -37,19 +37,19 @@ namespace dpnp::extensions::lapack { extern std::pair gesv(sycl::queue &exec_q, - const dpctl::tensor::usm_ndarray &coeff_matrix, - const dpctl::tensor::usm_ndarray &dependent_vals, + const dpnp::tensor::usm_ndarray &coeff_matrix, + const dpnp::tensor::usm_ndarray &dependent_vals, const std::vector &depends); extern std::pair gesv_batch(sycl::queue &exec_q, - const dpctl::tensor::usm_ndarray &coeff_matrix, - const dpctl::tensor::usm_ndarray &dependent_vals, + const dpnp::tensor::usm_ndarray &coeff_matrix, + const dpnp::tensor::usm_ndarray &dependent_vals, const std::vector &depends); extern void common_gesv_checks(sycl::queue &exec_q, - const dpctl::tensor::usm_ndarray &coeff_matrix, - const dpctl::tensor::usm_ndarray &dependent_vals, + const dpnp::tensor::usm_ndarray &coeff_matrix, + const dpnp::tensor::usm_ndarray &dependent_vals, const py::ssize_t *coeff_matrix_shape, const py::ssize_t *dependent_vals_shape, const int expected_coeff_matrix_ndim, diff --git a/dpnp/backend/extensions/lapack/gesv_batch.cpp b/dpnp/backend/extensions/lapack/gesv_batch.cpp index 893279245344..63101e8db56d 100644 --- a/dpnp/backend/extensions/lapack/gesv_batch.cpp +++ b/dpnp/backend/extensions/lapack/gesv_batch.cpp @@ -34,7 +34,7 @@ // utils extension header #include "ext/common.hpp" -// dpctl tensor headers +// dpnp tensor headers #include "utils/type_utils.hpp" #include "common_helpers.hpp" @@ -46,9 +46,9 @@ namespace dpnp::extensions::lapack { namespace mkl_lapack = oneapi::mkl::lapack; namespace py = pybind11; -namespace type_utils = dpctl::tensor::type_utils; +namespace type_utils = dpnp::tensor::type_utils; -using dpctl::tensor::alloc_utils::sycl_free_noexcept; +using dpnp::tensor::alloc_utils::sycl_free_noexcept; using ext::common::init_dispatch_vector; typedef sycl::event (*gesv_batch_impl_fn_ptr_t)( @@ -65,7 +65,7 @@ typedef sycl::event (*gesv_batch_impl_fn_ptr_t)( const std::vector &); static gesv_batch_impl_fn_ptr_t - gesv_batch_dispatch_vector[dpctl_td_ns::num_types]; + gesv_batch_dispatch_vector[dpnp_td_ns::num_types]; template static sycl::event gesv_batch_impl(sycl::queue &exec_q, @@ -319,8 +319,8 @@ static sycl::event gesv_batch_impl(sycl::queue &exec_q, std::pair gesv_batch(sycl::queue &exec_q, - const dpctl::tensor::usm_ndarray &coeff_matrix, - const dpctl::tensor::usm_ndarray &dependent_vals, + const dpnp::tensor::usm_ndarray &coeff_matrix, + const dpnp::tensor::usm_ndarray &dependent_vals, const std::vector &depends) { const int coeff_matrix_nd = coeff_matrix.get_ndim(); @@ -367,7 +367,7 @@ std::pair } } - auto array_types = dpctl_td_ns::usm_ndarray_types(); + auto array_types = dpnp_td_ns::usm_ndarray_types(); const int coeff_matrix_type_id = array_types.typenum_to_lookup_id(coeff_matrix.get_typenum()); @@ -409,7 +409,7 @@ std::pair dependent_vals_data, depends); #endif // USE_ONEMATH - sycl::event ht_ev = dpctl::utils::keep_args_alive( + sycl::event ht_ev = dpnp::utils::keep_args_alive( exec_q, {coeff_matrix, dependent_vals}, {gesv_ev}); return std::make_pair(ht_ev, gesv_ev); diff --git a/dpnp/backend/extensions/lapack/gesv_common_utils.hpp b/dpnp/backend/extensions/lapack/gesv_common_utils.hpp index 62f1e9589a0b..44bfbffd7181 100644 --- a/dpnp/backend/extensions/lapack/gesv_common_utils.hpp +++ b/dpnp/backend/extensions/lapack/gesv_common_utils.hpp @@ -30,7 +30,7 @@ #include -// dpctl tensor headers +// dpnp tensor headers #include "utils/memory_overlap.hpp" #include "utils/output_validation.hpp" #include "utils/sycl_alloc_utils.hpp" @@ -41,12 +41,12 @@ namespace dpnp::extensions::lapack::gesv_utils { -namespace dpctl_td_ns = dpctl::tensor::type_dispatch; +namespace dpnp_td_ns = dpnp::tensor::type_dispatch; namespace py = pybind11; inline void common_gesv_checks(sycl::queue &exec_q, - const dpctl::tensor::usm_ndarray &coeff_matrix, - const dpctl::tensor::usm_ndarray &dependent_vals, + const dpnp::tensor::usm_ndarray &coeff_matrix, + const dpnp::tensor::usm_ndarray &dependent_vals, const py::ssize_t *coeff_matrix_shape, const py::ssize_t *dependent_vals_shape, const int expected_coeff_matrix_ndim, @@ -93,20 +93,20 @@ inline void common_gesv_checks(sycl::queue &exec_q, } // check compatibility of execution queue and allocation queue - if (!dpctl::utils::queues_are_compatible(exec_q, - {coeff_matrix, dependent_vals})) { + if (!dpnp::utils::queues_are_compatible(exec_q, + {coeff_matrix, dependent_vals})) { throw py::value_error( "Execution queue is not compatible with allocation queues."); } - auto const &overlap = dpctl::tensor::overlap::MemoryOverlap(); + auto const &overlap = dpnp::tensor::overlap::MemoryOverlap(); if (overlap(coeff_matrix, dependent_vals)) { throw py::value_error( "The arrays of coefficients and dependent variables " "are overlapping segments of memory."); } - dpctl::tensor::validation::CheckWritable::throw_if_not_writable( + dpnp::tensor::validation::CheckWritable::throw_if_not_writable( dependent_vals); const bool is_coeff_matrix_f_contig = coeff_matrix.is_f_contiguous(); @@ -121,7 +121,7 @@ inline void common_gesv_checks(sycl::queue &exec_q, "must be F-contiguous."); } - auto array_types = dpctl_td_ns::usm_ndarray_types(); + auto array_types = dpnp_td_ns::usm_ndarray_types(); const int coeff_matrix_type_id = array_types.typenum_to_lookup_id(coeff_matrix.get_typenum()); const int dependent_vals_type_id = @@ -161,7 +161,7 @@ inline void handle_lapack_exc(sycl::queue &exec_q, const auto threshold = std::numeric_limits::epsilon() * 100; if (std::abs(host_U) < threshold) { - using dpctl::tensor::alloc_utils::sycl_free_noexcept; + using dpnp::tensor::alloc_utils::sycl_free_noexcept; if (scratchpad != nullptr) sycl_free_noexcept(scratchpad, exec_q); diff --git a/dpnp/backend/extensions/lapack/gesvd.cpp b/dpnp/backend/extensions/lapack/gesvd.cpp index e347837e3cfe..ebc6000671b0 100644 --- a/dpnp/backend/extensions/lapack/gesvd.cpp +++ b/dpnp/backend/extensions/lapack/gesvd.cpp @@ -33,7 +33,7 @@ // utils extension header #include "ext/common.hpp" -// dpctl tensor headers +// dpnp tensor headers #include "utils/type_utils.hpp" #include "common_helpers.hpp" @@ -45,7 +45,7 @@ namespace dpnp::extensions::lapack { namespace mkl_lapack = oneapi::mkl::lapack; namespace py = pybind11; -namespace type_utils = dpctl::tensor::type_utils; +namespace type_utils = dpnp::tensor::type_utils; using ext::common::init_dispatch_table; @@ -63,8 +63,8 @@ typedef sycl::event (*gesvd_impl_fn_ptr_t)(sycl::queue &, const std::int64_t, const std::vector &); -static gesvd_impl_fn_ptr_t gesvd_dispatch_table[dpctl_td_ns::num_types] - [dpctl_td_ns::num_types]; +static gesvd_impl_fn_ptr_t gesvd_dispatch_table[dpnp_td_ns::num_types] + [dpnp_td_ns::num_types]; template static sycl::event gesvd_impl(sycl::queue &exec_q, @@ -135,7 +135,7 @@ static sycl::event gesvd_impl(sycl::queue &exec_q, if (is_exception_caught) // an unexpected error occurs { if (scratchpad != nullptr) { - dpctl::tensor::alloc_utils::sycl_free_noexcept(scratchpad, exec_q); + dpnp::tensor::alloc_utils::sycl_free_noexcept(scratchpad, exec_q); } throw std::runtime_error(error_msg.str()); } @@ -144,7 +144,7 @@ static sycl::event gesvd_impl(sycl::queue &exec_q, cgh.depends_on(gesvd_event); auto ctx = exec_q.get_context(); cgh.host_task([ctx, scratchpad]() { - dpctl::tensor::alloc_utils::sycl_free_noexcept(scratchpad, ctx); + dpnp::tensor::alloc_utils::sycl_free_noexcept(scratchpad, ctx); }); }); @@ -155,10 +155,10 @@ std::pair gesvd(sycl::queue &exec_q, const std::int8_t jobu_val, const std::int8_t jobvt_val, - const dpctl::tensor::usm_ndarray &a_array, - const dpctl::tensor::usm_ndarray &out_s, - const dpctl::tensor::usm_ndarray &out_u, - const dpctl::tensor::usm_ndarray &out_vt, + const dpnp::tensor::usm_ndarray &a_array, + const dpnp::tensor::usm_ndarray &out_s, + const dpnp::tensor::usm_ndarray &out_u, + const dpnp::tensor::usm_ndarray &out_vt, const std::vector &depends) { constexpr int expected_a_u_vt_ndim = 2; @@ -176,7 +176,7 @@ std::pair return std::make_pair(sycl::event(), sycl::event()); } - auto array_types = dpctl_td_ns::usm_ndarray_types(); + auto array_types = dpnp_td_ns::usm_ndarray_types(); const int a_array_type_id = array_types.typenum_to_lookup_id(a_array.get_typenum()); const int out_s_type_id = @@ -211,7 +211,7 @@ std::pair gesvd_fn(exec_q, jobu, jobvt, m, n, a_array_data, lda, out_s_data, out_u_data, ldu, out_vt_data, ldvt, depends); - sycl::event ht_ev = dpctl::utils::keep_args_alive( + sycl::event ht_ev = dpnp::utils::keep_args_alive( exec_q, {a_array, out_s, out_u, out_vt}, {gesvd_ev}); return std::make_pair(ht_ev, gesvd_ev); diff --git a/dpnp/backend/extensions/lapack/gesvd.hpp b/dpnp/backend/extensions/lapack/gesvd.hpp index b2fea5e47299..921352a0ef70 100644 --- a/dpnp/backend/extensions/lapack/gesvd.hpp +++ b/dpnp/backend/extensions/lapack/gesvd.hpp @@ -39,20 +39,20 @@ extern std::pair gesvd(sycl::queue &exec_q, const std::int8_t jobu_val, const std::int8_t jobvt_val, - const dpctl::tensor::usm_ndarray &a_array, - const dpctl::tensor::usm_ndarray &out_s, - const dpctl::tensor::usm_ndarray &out_u, - const dpctl::tensor::usm_ndarray &out_vt, + const dpnp::tensor::usm_ndarray &a_array, + const dpnp::tensor::usm_ndarray &out_s, + const dpnp::tensor::usm_ndarray &out_u, + const dpnp::tensor::usm_ndarray &out_vt, const std::vector &depends); extern std::pair gesvd_batch(sycl::queue &exec_q, const std::int8_t jobu_val, const std::int8_t jobvt_val, - const dpctl::tensor::usm_ndarray &a_array, - const dpctl::tensor::usm_ndarray &out_s, - const dpctl::tensor::usm_ndarray &out_u, - const dpctl::tensor::usm_ndarray &out_vt, + const dpnp::tensor::usm_ndarray &a_array, + const dpnp::tensor::usm_ndarray &out_s, + const dpnp::tensor::usm_ndarray &out_u, + const dpnp::tensor::usm_ndarray &out_vt, const std::vector &depends); extern void init_gesvd_dispatch_table(void); diff --git a/dpnp/backend/extensions/lapack/gesvd_batch.cpp b/dpnp/backend/extensions/lapack/gesvd_batch.cpp index 868facc200e2..cb114c44a255 100644 --- a/dpnp/backend/extensions/lapack/gesvd_batch.cpp +++ b/dpnp/backend/extensions/lapack/gesvd_batch.cpp @@ -34,7 +34,7 @@ // utils extension header #include "ext/common.hpp" -// dpctl tensor headers +// dpnp tensor headers #include "utils/type_utils.hpp" #include "common_helpers.hpp" @@ -46,7 +46,7 @@ namespace dpnp::extensions::lapack { namespace mkl_lapack = oneapi::mkl::lapack; namespace py = pybind11; -namespace type_utils = dpctl::tensor::type_utils; +namespace type_utils = dpnp::tensor::type_utils; using ext::common::init_dispatch_table; @@ -67,7 +67,7 @@ typedef sycl::event (*gesvd_batch_impl_fn_ptr_t)( const std::vector &); static gesvd_batch_impl_fn_ptr_t - gesvd_batch_dispatch_table[dpctl_td_ns::num_types][dpctl_td_ns::num_types]; + gesvd_batch_dispatch_table[dpnp_td_ns::num_types][dpnp_td_ns::num_types]; template static sycl::event gesvd_batch_impl(sycl::queue &exec_q, @@ -199,7 +199,7 @@ static sycl::event gesvd_batch_impl(sycl::queue &exec_q, if (is_exception_caught) // an unexpected error occurs { if (scratchpad != nullptr) { - dpctl::tensor::alloc_utils::sycl_free_noexcept(scratchpad, exec_q); + dpnp::tensor::alloc_utils::sycl_free_noexcept(scratchpad, exec_q); } throw std::runtime_error(error_msg.str()); } @@ -210,7 +210,7 @@ static sycl::event gesvd_batch_impl(sycl::queue &exec_q, } auto ctx = exec_q.get_context(); cgh.host_task([ctx, scratchpad]() { - dpctl::tensor::alloc_utils::sycl_free_noexcept(scratchpad, ctx); + dpnp::tensor::alloc_utils::sycl_free_noexcept(scratchpad, ctx); }); }); @@ -221,10 +221,10 @@ std::pair gesvd_batch(sycl::queue &exec_q, const std::int8_t jobu_val, const std::int8_t jobvt_val, - const dpctl::tensor::usm_ndarray &a_array, - const dpctl::tensor::usm_ndarray &out_s, - const dpctl::tensor::usm_ndarray &out_u, - const dpctl::tensor::usm_ndarray &out_vt, + const dpnp::tensor::usm_ndarray &a_array, + const dpnp::tensor::usm_ndarray &out_s, + const dpnp::tensor::usm_ndarray &out_u, + const dpnp::tensor::usm_ndarray &out_vt, const std::vector &depends) { constexpr int expected_a_u_vt_ndim = 3; @@ -242,7 +242,7 @@ std::pair return std::make_pair(sycl::event(), sycl::event()); } - auto array_types = dpctl_td_ns::usm_ndarray_types(); + auto array_types = dpnp_td_ns::usm_ndarray_types(); const int a_array_type_id = array_types.typenum_to_lookup_id(a_array.get_typenum()); const int out_s_type_id = @@ -280,7 +280,7 @@ std::pair gesvd_batch_fn(exec_q, jobu, jobvt, m, n, batch_size, a_array_data, lda, out_s_data, out_u_data, ldu, out_vt_data, ldvt, depends); - sycl::event ht_ev = dpctl::utils::keep_args_alive( + sycl::event ht_ev = dpnp::utils::keep_args_alive( exec_q, {a_array, out_s, out_u, out_vt}, {gesvd_ev}); return std::make_pair(ht_ev, gesvd_ev); diff --git a/dpnp/backend/extensions/lapack/gesvd_common_utils.hpp b/dpnp/backend/extensions/lapack/gesvd_common_utils.hpp index 1cd2c8ac4997..201cd5212e06 100644 --- a/dpnp/backend/extensions/lapack/gesvd_common_utils.hpp +++ b/dpnp/backend/extensions/lapack/gesvd_common_utils.hpp @@ -30,7 +30,7 @@ #include #include -// dpctl tensor headers +// dpnp tensor headers #include "utils/memory_overlap.hpp" #include "utils/output_validation.hpp" #include "utils/type_dispatch.hpp" @@ -39,7 +39,7 @@ namespace dpnp::extensions::lapack::gesvd_utils { -namespace dpctl_td_ns = dpctl::tensor::type_dispatch; +namespace dpnp_td_ns = dpnp::tensor::type_dispatch; namespace py = pybind11; // Converts a given character code (ord) to the corresponding @@ -61,10 +61,10 @@ inline oneapi::mkl::jobsvd process_job(const std::int8_t job_val) } inline void common_gesvd_checks(sycl::queue &exec_q, - const dpctl::tensor::usm_ndarray &a_array, - const dpctl::tensor::usm_ndarray &out_s, - const dpctl::tensor::usm_ndarray &out_u, - const dpctl::tensor::usm_ndarray &out_vt, + const dpnp::tensor::usm_ndarray &a_array, + const dpnp::tensor::usm_ndarray &out_s, + const dpnp::tensor::usm_ndarray &out_u, + const dpnp::tensor::usm_ndarray &out_vt, const std::int8_t jobu_val, const std::int8_t jobvt_val, const int expected_a_u_vt_ndim, @@ -121,23 +121,23 @@ inline void common_gesvd_checks(sycl::queue &exec_q, } // check compatibility of execution queue and allocation queue - if (!dpctl::utils::queues_are_compatible(exec_q, - {a_array, out_s, out_u, out_vt})) { + if (!dpnp::utils::queues_are_compatible(exec_q, + {a_array, out_s, out_u, out_vt})) { throw py::value_error( "Execution queue is not compatible with allocation queues."); } - auto const &overlap = dpctl::tensor::overlap::MemoryOverlap(); + auto const &overlap = dpnp::tensor::overlap::MemoryOverlap(); if (overlap(a_array, out_s) || overlap(a_array, out_u) || overlap(a_array, out_vt) || overlap(out_s, out_u) || overlap(out_s, out_vt) || overlap(out_u, out_vt)) { throw py::value_error("Arrays have overlapping segments of memory"); } - dpctl::tensor::validation::CheckWritable::throw_if_not_writable(a_array); - dpctl::tensor::validation::CheckWritable::throw_if_not_writable(out_s); - dpctl::tensor::validation::CheckWritable::throw_if_not_writable(out_u); - dpctl::tensor::validation::CheckWritable::throw_if_not_writable(out_vt); + dpnp::tensor::validation::CheckWritable::throw_if_not_writable(a_array); + dpnp::tensor::validation::CheckWritable::throw_if_not_writable(out_s); + dpnp::tensor::validation::CheckWritable::throw_if_not_writable(out_u); + dpnp::tensor::validation::CheckWritable::throw_if_not_writable(out_vt); const bool is_a_array_f_contig = a_array.is_f_contiguous(); if (!is_a_array_f_contig) { @@ -159,7 +159,7 @@ inline void common_gesvd_checks(sycl::queue &exec_q, "must be C-contiguous"); } - auto array_types = dpctl_td_ns::usm_ndarray_types(); + auto array_types = dpnp_td_ns::usm_ndarray_types(); const int a_array_type_id = array_types.typenum_to_lookup_id(a_array.get_typenum()); const int out_u_type_id = @@ -176,10 +176,10 @@ inline void common_gesvd_checks(sycl::queue &exec_q, } // Check if the shape of input arrays for gesvd has any non-zero dimension. -inline bool check_zeros_shape_gesvd(const dpctl::tensor::usm_ndarray &a_array, - const dpctl::tensor::usm_ndarray &out_s, - const dpctl::tensor::usm_ndarray &out_u, - const dpctl::tensor::usm_ndarray &out_vt, +inline bool check_zeros_shape_gesvd(const dpnp::tensor::usm_ndarray &a_array, + const dpnp::tensor::usm_ndarray &out_s, + const dpnp::tensor::usm_ndarray &out_u, + const dpnp::tensor::usm_ndarray &out_vt, const std::int8_t jobu_val, const std::int8_t jobvt_val) { diff --git a/dpnp/backend/extensions/lapack/getrf.cpp b/dpnp/backend/extensions/lapack/getrf.cpp index 870ccc8e811a..42021639d63f 100644 --- a/dpnp/backend/extensions/lapack/getrf.cpp +++ b/dpnp/backend/extensions/lapack/getrf.cpp @@ -34,7 +34,7 @@ // utils extension header #include "ext/common.hpp" -// dpctl tensor headers +// dpnp tensor headers #include "utils/memory_overlap.hpp" #include "utils/sycl_alloc_utils.hpp" #include "utils/type_utils.hpp" @@ -46,7 +46,7 @@ namespace dpnp::extensions::lapack { namespace mkl_lapack = oneapi::mkl::lapack; namespace py = pybind11; -namespace type_utils = dpctl::tensor::type_utils; +namespace type_utils = dpnp::tensor::type_utils; using ext::common::init_dispatch_vector; @@ -60,7 +60,7 @@ typedef sycl::event (*getrf_impl_fn_ptr_t)(sycl::queue &, std::vector &, const std::vector &); -static getrf_impl_fn_ptr_t getrf_dispatch_vector[dpctl_td_ns::num_types]; +static getrf_impl_fn_ptr_t getrf_dispatch_vector[dpnp_td_ns::num_types]; template static sycl::event getrf_impl(sycl::queue &exec_q, @@ -147,7 +147,7 @@ static sycl::event getrf_impl(sycl::queue &exec_q, if (is_exception_caught) // an unexpected error occurs { if (scratchpad != nullptr) { - dpctl::tensor::alloc_utils::sycl_free_noexcept(scratchpad, exec_q); + dpnp::tensor::alloc_utils::sycl_free_noexcept(scratchpad, exec_q); } throw std::runtime_error(error_msg.str()); @@ -157,7 +157,7 @@ static sycl::event getrf_impl(sycl::queue &exec_q, cgh.depends_on(getrf_event); auto ctx = exec_q.get_context(); cgh.host_task([ctx, scratchpad]() { - dpctl::tensor::alloc_utils::sycl_free_noexcept(scratchpad, ctx); + dpnp::tensor::alloc_utils::sycl_free_noexcept(scratchpad, ctx); }); }); host_task_events.push_back(clean_up_event); @@ -166,8 +166,8 @@ static sycl::event getrf_impl(sycl::queue &exec_q, std::pair getrf(sycl::queue &exec_q, - const dpctl::tensor::usm_ndarray &a_array, - const dpctl::tensor::usm_ndarray &ipiv_array, + const dpnp::tensor::usm_ndarray &a_array, + const dpnp::tensor::usm_ndarray &ipiv_array, py::list dev_info, const std::vector &depends) { @@ -187,12 +187,12 @@ std::pair } // check compatibility of execution queue and allocation queue - if (!dpctl::utils::queues_are_compatible(exec_q, {a_array, ipiv_array})) { + if (!dpnp::utils::queues_are_compatible(exec_q, {a_array, ipiv_array})) { throw py::value_error( "Execution queue is not compatible with allocation queues"); } - auto const &overlap = dpctl::tensor::overlap::MemoryOverlap(); + auto const &overlap = dpnp::tensor::overlap::MemoryOverlap(); if (overlap(a_array, ipiv_array)) { throw py::value_error("The input array and the array of pivot indices " "are overlapping segments of memory"); @@ -210,7 +210,7 @@ std::pair "must be C-contiguous"); } - auto array_types = dpctl_td_ns::usm_ndarray_types(); + auto array_types = dpnp_td_ns::usm_ndarray_types(); int a_array_type_id = array_types.typenum_to_lookup_id(a_array.get_typenum()); @@ -221,11 +221,11 @@ std::pair "of the input matrix"); } - auto ipiv_types = dpctl_td_ns::usm_ndarray_types(); + auto ipiv_types = dpnp_td_ns::usm_ndarray_types(); int ipiv_array_type_id = ipiv_types.typenum_to_lookup_id(ipiv_array.get_typenum()); - if (ipiv_array_type_id != static_cast(dpctl_td_ns::typenum_t::INT64)) { + if (ipiv_array_type_id != static_cast(dpnp_td_ns::typenum_t::INT64)) { throw py::value_error("The type of 'ipiv_array' must be int64"); } @@ -247,7 +247,7 @@ std::pair sycl::event getrf_ev = getrf_fn(exec_q, m, n, a_array_data, lda, d_ipiv, dev_info, host_task_events, depends); - sycl::event args_ev = dpctl::utils::keep_args_alive( + sycl::event args_ev = dpnp::utils::keep_args_alive( exec_q, {a_array, ipiv_array}, host_task_events); return std::make_pair(args_ev, getrf_ev); diff --git a/dpnp/backend/extensions/lapack/getrf.hpp b/dpnp/backend/extensions/lapack/getrf.hpp index ce6dc3e788b5..df19cb866ff6 100644 --- a/dpnp/backend/extensions/lapack/getrf.hpp +++ b/dpnp/backend/extensions/lapack/getrf.hpp @@ -37,15 +37,15 @@ namespace dpnp::extensions::lapack { extern std::pair getrf(sycl::queue &exec_q, - const dpctl::tensor::usm_ndarray &a_array, - const dpctl::tensor::usm_ndarray &ipiv_array, + const dpnp::tensor::usm_ndarray &a_array, + const dpnp::tensor::usm_ndarray &ipiv_array, py::list dev_info, const std::vector &depends = {}); extern std::pair getrf_batch(sycl::queue &exec_q, - const dpctl::tensor::usm_ndarray &a_array, - const dpctl::tensor::usm_ndarray &ipiv_array, + const dpnp::tensor::usm_ndarray &a_array, + const dpnp::tensor::usm_ndarray &ipiv_array, py::list dev_info, std::int64_t m, std::int64_t n, diff --git a/dpnp/backend/extensions/lapack/getrf_batch.cpp b/dpnp/backend/extensions/lapack/getrf_batch.cpp index 1927736fc454..b4e30dae57d3 100644 --- a/dpnp/backend/extensions/lapack/getrf_batch.cpp +++ b/dpnp/backend/extensions/lapack/getrf_batch.cpp @@ -34,7 +34,7 @@ // utils extension header #include "ext/common.hpp" -// dpctl tensor headers +// dpnp tensor headers #include "utils/memory_overlap.hpp" #include "utils/sycl_alloc_utils.hpp" #include "utils/type_utils.hpp" @@ -46,7 +46,7 @@ namespace dpnp::extensions::lapack { namespace mkl_lapack = oneapi::mkl::lapack; namespace py = pybind11; -namespace type_utils = dpctl::tensor::type_utils; +namespace type_utils = dpnp::tensor::type_utils; using ext::common::init_dispatch_vector; @@ -65,7 +65,7 @@ typedef sycl::event (*getrf_batch_impl_fn_ptr_t)( const std::vector &); static getrf_batch_impl_fn_ptr_t - getrf_batch_dispatch_vector[dpctl_td_ns::num_types]; + getrf_batch_dispatch_vector[dpnp_td_ns::num_types]; template static sycl::event getrf_batch_impl(sycl::queue &exec_q, @@ -166,7 +166,7 @@ static sycl::event getrf_batch_impl(sycl::queue &exec_q, if (is_exception_caught) // an unexpected error occurs { if (scratchpad != nullptr) { - dpctl::tensor::alloc_utils::sycl_free_noexcept(scratchpad, exec_q); + dpnp::tensor::alloc_utils::sycl_free_noexcept(scratchpad, exec_q); } throw std::runtime_error(error_msg.str()); @@ -176,7 +176,7 @@ static sycl::event getrf_batch_impl(sycl::queue &exec_q, cgh.depends_on(getrf_batch_event); auto ctx = exec_q.get_context(); cgh.host_task([ctx, scratchpad]() { - dpctl::tensor::alloc_utils::sycl_free_noexcept(scratchpad, ctx); + dpnp::tensor::alloc_utils::sycl_free_noexcept(scratchpad, ctx); }); }); host_task_events.push_back(clean_up_event); @@ -185,8 +185,8 @@ static sycl::event getrf_batch_impl(sycl::queue &exec_q, std::pair getrf_batch(sycl::queue &exec_q, - const dpctl::tensor::usm_ndarray &a_array, - const dpctl::tensor::usm_ndarray &ipiv_array, + const dpnp::tensor::usm_ndarray &a_array, + const dpnp::tensor::usm_ndarray &ipiv_array, py::list dev_info, std::int64_t m, std::int64_t n, @@ -219,12 +219,12 @@ std::pair } // check compatibility of execution queue and allocation queue - if (!dpctl::utils::queues_are_compatible(exec_q, {a_array, ipiv_array})) { + if (!dpnp::utils::queues_are_compatible(exec_q, {a_array, ipiv_array})) { throw py::value_error( "Execution queue is not compatible with allocation queues"); } - auto const &overlap = dpctl::tensor::overlap::MemoryOverlap(); + auto const &overlap = dpnp::tensor::overlap::MemoryOverlap(); if (overlap(a_array, ipiv_array)) { throw py::value_error("The input array and the array of pivot indices " "are overlapping segments of memory"); @@ -242,7 +242,7 @@ std::pair "must be C-contiguous"); } - auto array_types = dpctl_td_ns::usm_ndarray_types(); + auto array_types = dpnp_td_ns::usm_ndarray_types(); int a_array_type_id = array_types.typenum_to_lookup_id(a_array.get_typenum()); @@ -254,11 +254,11 @@ std::pair "of the input matrix"); } - auto ipiv_types = dpctl_td_ns::usm_ndarray_types(); + auto ipiv_types = dpnp_td_ns::usm_ndarray_types(); int ipiv_array_type_id = ipiv_types.typenum_to_lookup_id(ipiv_array.get_typenum()); - if (ipiv_array_type_id != static_cast(dpctl_td_ns::typenum_t::INT64)) { + if (ipiv_array_type_id != static_cast(dpnp_td_ns::typenum_t::INT64)) { throw py::value_error("The type of 'ipiv_array' must be int64"); } @@ -280,7 +280,7 @@ std::pair exec_q, m, n, a_array_data, lda, stride_a, d_ipiv, stride_ipiv, batch_size, dev_info, host_task_events, depends); - sycl::event args_ev = dpctl::utils::keep_args_alive( + sycl::event args_ev = dpnp::utils::keep_args_alive( exec_q, {a_array, ipiv_array}, host_task_events); return std::make_pair(args_ev, getrf_batch_ev); diff --git a/dpnp/backend/extensions/lapack/getri.hpp b/dpnp/backend/extensions/lapack/getri.hpp index 728af4a77e01..e20d8181ac92 100644 --- a/dpnp/backend/extensions/lapack/getri.hpp +++ b/dpnp/backend/extensions/lapack/getri.hpp @@ -37,8 +37,8 @@ namespace dpnp::extensions::lapack { extern std::pair getri_batch(sycl::queue &exec_q, - const dpctl::tensor::usm_ndarray &a_array, - const dpctl::tensor::usm_ndarray &ipiv_array, + const dpnp::tensor::usm_ndarray &a_array, + const dpnp::tensor::usm_ndarray &ipiv_array, py::list dev_info, std::int64_t n, std::int64_t stride_a, diff --git a/dpnp/backend/extensions/lapack/getri_batch.cpp b/dpnp/backend/extensions/lapack/getri_batch.cpp index 54cbeb8fd898..1b5e2c94065f 100644 --- a/dpnp/backend/extensions/lapack/getri_batch.cpp +++ b/dpnp/backend/extensions/lapack/getri_batch.cpp @@ -33,7 +33,7 @@ // utils extension header #include "ext/common.hpp" -// dpctl tensor headers +// dpnp tensor headers #include "utils/memory_overlap.hpp" #include "utils/sycl_alloc_utils.hpp" #include "utils/type_utils.hpp" @@ -45,7 +45,7 @@ namespace dpnp::extensions::lapack { namespace mkl_lapack = oneapi::mkl::lapack; namespace py = pybind11; -namespace type_utils = dpctl::tensor::type_utils; +namespace type_utils = dpnp::tensor::type_utils; using ext::common::init_dispatch_vector; @@ -63,7 +63,7 @@ typedef sycl::event (*getri_batch_impl_fn_ptr_t)( const std::vector &); static getri_batch_impl_fn_ptr_t - getri_batch_dispatch_vector[dpctl_td_ns::num_types]; + getri_batch_dispatch_vector[dpnp_td_ns::num_types]; template static sycl::event getri_batch_impl(sycl::queue &exec_q, @@ -161,7 +161,7 @@ static sycl::event getri_batch_impl(sycl::queue &exec_q, if (is_exception_caught) // an unexpected error occurs { if (scratchpad != nullptr) { - dpctl::tensor::alloc_utils::sycl_free_noexcept(scratchpad, exec_q); + dpnp::tensor::alloc_utils::sycl_free_noexcept(scratchpad, exec_q); } throw std::runtime_error(error_msg.str()); @@ -171,7 +171,7 @@ static sycl::event getri_batch_impl(sycl::queue &exec_q, cgh.depends_on(getri_batch_event); auto ctx = exec_q.get_context(); cgh.host_task([ctx, scratchpad]() { - dpctl::tensor::alloc_utils::sycl_free_noexcept(scratchpad, ctx); + dpnp::tensor::alloc_utils::sycl_free_noexcept(scratchpad, ctx); }); }); host_task_events.push_back(clean_up_event); @@ -180,8 +180,8 @@ static sycl::event getri_batch_impl(sycl::queue &exec_q, std::pair getri_batch(sycl::queue &exec_q, - const dpctl::tensor::usm_ndarray &a_array, - const dpctl::tensor::usm_ndarray &ipiv_array, + const dpnp::tensor::usm_ndarray &a_array, + const dpnp::tensor::usm_ndarray &ipiv_array, py::list dev_info, std::int64_t n, std::int64_t stride_a, @@ -213,12 +213,12 @@ std::pair } // check compatibility of execution queue and allocation queue - if (!dpctl::utils::queues_are_compatible(exec_q, {a_array, ipiv_array})) { + if (!dpnp::utils::queues_are_compatible(exec_q, {a_array, ipiv_array})) { throw py::value_error( "Execution queue is not compatible with allocation queues"); } - auto const &overlap = dpctl::tensor::overlap::MemoryOverlap(); + auto const &overlap = dpnp::tensor::overlap::MemoryOverlap(); if (overlap(a_array, ipiv_array)) { throw py::value_error("The input array and the array of pivot indices " "are overlapping segments of memory"); @@ -235,7 +235,7 @@ std::pair "must be C-contiguous"); } - auto array_types = dpctl_td_ns::usm_ndarray_types(); + auto array_types = dpnp_td_ns::usm_ndarray_types(); int a_array_type_id = array_types.typenum_to_lookup_id(a_array.get_typenum()); @@ -247,11 +247,11 @@ std::pair "of the input matrix."); } - auto ipiv_types = dpctl_td_ns::usm_ndarray_types(); + auto ipiv_types = dpnp_td_ns::usm_ndarray_types(); int ipiv_array_type_id = ipiv_types.typenum_to_lookup_id(ipiv_array.get_typenum()); - if (ipiv_array_type_id != static_cast(dpctl_td_ns::typenum_t::INT64)) { + if (ipiv_array_type_id != static_cast(dpnp_td_ns::typenum_t::INT64)) { throw py::value_error("The type of 'ipiv_array' must be int64."); } @@ -266,7 +266,7 @@ std::pair exec_q, n, a_array_data, lda, stride_a, d_ipiv, stride_ipiv, batch_size, dev_info, host_task_events, depends); - sycl::event args_ev = dpctl::utils::keep_args_alive( + sycl::event args_ev = dpnp::utils::keep_args_alive( exec_q, {a_array, ipiv_array}, host_task_events); return std::make_pair(args_ev, getri_batch_ev); diff --git a/dpnp/backend/extensions/lapack/getrs.cpp b/dpnp/backend/extensions/lapack/getrs.cpp index 94e1a1027898..b4d745d230a0 100644 --- a/dpnp/backend/extensions/lapack/getrs.cpp +++ b/dpnp/backend/extensions/lapack/getrs.cpp @@ -33,7 +33,7 @@ // utils extension header #include "ext/common.hpp" -// dpctl tensor headers +// dpnp tensor headers #include "utils/memory_overlap.hpp" #include "utils/sycl_alloc_utils.hpp" #include "utils/type_utils.hpp" @@ -46,7 +46,7 @@ namespace dpnp::extensions::lapack { namespace mkl_lapack = oneapi::mkl::lapack; namespace py = pybind11; -namespace type_utils = dpctl::tensor::type_utils; +namespace type_utils = dpnp::tensor::type_utils; using ext::common::init_dispatch_vector; @@ -62,7 +62,7 @@ typedef sycl::event (*getrs_impl_fn_ptr_t)(sycl::queue &, std::vector &, const std::vector &); -static getrs_impl_fn_ptr_t getrs_dispatch_vector[dpctl_td_ns::num_types]; +static getrs_impl_fn_ptr_t getrs_dispatch_vector[dpnp_td_ns::num_types]; template static sycl::event getrs_impl(sycl::queue &exec_q, @@ -131,8 +131,8 @@ static sycl::event getrs_impl(sycl::queue &exec_q, else if (info > 0) { is_exception_caught = false; if (scratchpad != nullptr) { - dpctl::tensor::alloc_utils::sycl_free_noexcept(scratchpad, - exec_q); + dpnp::tensor::alloc_utils::sycl_free_noexcept(scratchpad, + exec_q); } throw LinAlgError("The solve could not be completed."); } @@ -150,7 +150,7 @@ static sycl::event getrs_impl(sycl::queue &exec_q, if (is_exception_caught) // an unexpected error occurs { if (scratchpad != nullptr) { - dpctl::tensor::alloc_utils::sycl_free_noexcept(scratchpad, exec_q); + dpnp::tensor::alloc_utils::sycl_free_noexcept(scratchpad, exec_q); } throw std::runtime_error(error_msg.str()); @@ -160,7 +160,7 @@ static sycl::event getrs_impl(sycl::queue &exec_q, cgh.depends_on(getrs_event); auto ctx = exec_q.get_context(); cgh.host_task([ctx, scratchpad]() { - dpctl::tensor::alloc_utils::sycl_free_noexcept(scratchpad, ctx); + dpnp::tensor::alloc_utils::sycl_free_noexcept(scratchpad, ctx); }); }); host_task_events.push_back(clean_up_event); @@ -169,9 +169,9 @@ static sycl::event getrs_impl(sycl::queue &exec_q, std::pair getrs(sycl::queue &exec_q, - const dpctl::tensor::usm_ndarray &a_array, - const dpctl::tensor::usm_ndarray &ipiv_array, - const dpctl::tensor::usm_ndarray &b_array, + const dpnp::tensor::usm_ndarray &a_array, + const dpnp::tensor::usm_ndarray &ipiv_array, + const dpnp::tensor::usm_ndarray &b_array, oneapi::mkl::transpose trans, const std::vector &depends) { @@ -207,13 +207,13 @@ std::pair } // check compatibility of execution queue and allocation queue - if (!dpctl::utils::queues_are_compatible(exec_q, - {a_array, b_array, ipiv_array})) { + if (!dpnp::utils::queues_are_compatible(exec_q, + {a_array, b_array, ipiv_array})) { throw py::value_error( "Execution queue is not compatible with allocation queues"); } - auto const &overlap = dpctl::tensor::overlap::MemoryOverlap(); + auto const &overlap = dpnp::tensor::overlap::MemoryOverlap(); if (overlap(a_array, b_array)) { throw py::value_error("The LU-factorized and right-hand sides arrays " "are overlapping segments of memory"); @@ -238,7 +238,7 @@ std::pair "must be contiguous"); } - auto array_types = dpctl_td_ns::usm_ndarray_types(); + auto array_types = dpnp_td_ns::usm_ndarray_types(); int a_array_type_id = array_types.typenum_to_lookup_id(a_array.get_typenum()); int b_array_type_id = @@ -256,11 +256,11 @@ std::pair "of the input matrix."); } - auto ipiv_types = dpctl_td_ns::usm_ndarray_types(); + auto ipiv_types = dpnp_td_ns::usm_ndarray_types(); int ipiv_array_type_id = ipiv_types.typenum_to_lookup_id(ipiv_array.get_typenum()); - if (ipiv_array_type_id != static_cast(dpctl_td_ns::typenum_t::INT64)) { + if (ipiv_array_type_id != static_cast(dpnp_td_ns::typenum_t::INT64)) { throw py::value_error("The type of 'ipiv_array' must be int64."); } @@ -281,7 +281,7 @@ std::pair getrs_fn(exec_q, trans, n, nrhs, a_array_data, lda, ipiv, b_array_data, ldb, host_task_events, depends); - sycl::event args_ev = dpctl::utils::keep_args_alive( + sycl::event args_ev = dpnp::utils::keep_args_alive( exec_q, {a_array, b_array, ipiv_array}, host_task_events); return std::make_pair(args_ev, getrs_ev); diff --git a/dpnp/backend/extensions/lapack/getrs.hpp b/dpnp/backend/extensions/lapack/getrs.hpp index 2728b0c4e04a..02b014fc317d 100644 --- a/dpnp/backend/extensions/lapack/getrs.hpp +++ b/dpnp/backend/extensions/lapack/getrs.hpp @@ -37,17 +37,17 @@ namespace dpnp::extensions::lapack { extern std::pair getrs(sycl::queue &exec_q, - const dpctl::tensor::usm_ndarray &a_array, - const dpctl::tensor::usm_ndarray &ipiv_array, - const dpctl::tensor::usm_ndarray &b_array, + const dpnp::tensor::usm_ndarray &a_array, + const dpnp::tensor::usm_ndarray &ipiv_array, + const dpnp::tensor::usm_ndarray &b_array, const oneapi::mkl::transpose trans, const std::vector &depends = {}); extern std::pair getrs_batch(sycl::queue &exec_q, - const dpctl::tensor::usm_ndarray &a_array, - const dpctl::tensor::usm_ndarray &ipiv_array, - const dpctl::tensor::usm_ndarray &b_array, + const dpnp::tensor::usm_ndarray &a_array, + const dpnp::tensor::usm_ndarray &ipiv_array, + const dpnp::tensor::usm_ndarray &b_array, const oneapi::mkl::transpose trans, const std::int64_t n, const std::int64_t nrhs, diff --git a/dpnp/backend/extensions/lapack/getrs_batch.cpp b/dpnp/backend/extensions/lapack/getrs_batch.cpp index f4fb446c328d..8e9c69833097 100644 --- a/dpnp/backend/extensions/lapack/getrs_batch.cpp +++ b/dpnp/backend/extensions/lapack/getrs_batch.cpp @@ -36,7 +36,7 @@ // utils extension header #include "ext/common.hpp" -// dpctl tensor headers +// dpnp tensor headers #include "utils/memory_overlap.hpp" #include "utils/sycl_alloc_utils.hpp" #include "utils/type_utils.hpp" @@ -49,7 +49,7 @@ namespace dpnp::extensions::lapack { namespace mkl_lapack = oneapi::mkl::lapack; namespace py = pybind11; -namespace type_utils = dpctl::tensor::type_utils; +namespace type_utils = dpnp::tensor::type_utils; using ext::common::init_dispatch_vector; @@ -71,7 +71,7 @@ typedef sycl::event (*getrs_batch_impl_fn_ptr_t)( const std::vector &); static getrs_batch_impl_fn_ptr_t - getrs_batch_dispatch_vector[dpctl_td_ns::num_types]; + getrs_batch_dispatch_vector[dpnp_td_ns::num_types]; template static sycl::event getrs_batch_impl(sycl::queue &exec_q, @@ -146,7 +146,7 @@ static sycl::event getrs_batch_impl(sycl::queue &exec_q, // consistent with non-batched LAPACK behavior. is_exception_caught = false; if (scratchpad != nullptr) { - dpctl::tensor::alloc_utils::sycl_free_noexcept(scratchpad, exec_q); + dpnp::tensor::alloc_utils::sycl_free_noexcept(scratchpad, exec_q); } throw LinAlgError("The solve could not be completed."); } catch (mkl_lapack::exception const &e) { @@ -165,8 +165,8 @@ static sycl::event getrs_batch_impl(sycl::queue &exec_q, else if (info > 0) { is_exception_caught = false; if (scratchpad != nullptr) { - dpctl::tensor::alloc_utils::sycl_free_noexcept(scratchpad, - exec_q); + dpnp::tensor::alloc_utils::sycl_free_noexcept(scratchpad, + exec_q); } throw LinAlgError("The solve could not be completed."); } @@ -184,7 +184,7 @@ static sycl::event getrs_batch_impl(sycl::queue &exec_q, if (is_exception_caught) // an unexpected error occurs { if (scratchpad != nullptr) { - dpctl::tensor::alloc_utils::sycl_free_noexcept(scratchpad, exec_q); + dpnp::tensor::alloc_utils::sycl_free_noexcept(scratchpad, exec_q); } throw std::runtime_error(error_msg.str()); @@ -194,7 +194,7 @@ static sycl::event getrs_batch_impl(sycl::queue &exec_q, cgh.depends_on(getrs_batch_event); auto ctx = exec_q.get_context(); cgh.host_task([ctx, scratchpad]() { - dpctl::tensor::alloc_utils::sycl_free_noexcept(scratchpad, ctx); + dpnp::tensor::alloc_utils::sycl_free_noexcept(scratchpad, ctx); }); }); host_task_events.push_back(clean_up_event); @@ -203,9 +203,9 @@ static sycl::event getrs_batch_impl(sycl::queue &exec_q, std::pair getrs_batch(sycl::queue &exec_q, - const dpctl::tensor::usm_ndarray &a_array, - const dpctl::tensor::usm_ndarray &ipiv_array, - const dpctl::tensor::usm_ndarray &b_array, + const dpnp::tensor::usm_ndarray &a_array, + const dpnp::tensor::usm_ndarray &ipiv_array, + const dpnp::tensor::usm_ndarray &b_array, oneapi::mkl::transpose trans, std::int64_t n, std::int64_t nrhs, @@ -252,13 +252,13 @@ std::pair } // check compatibility of execution queue and allocation queue - if (!dpctl::utils::queues_are_compatible(exec_q, - {a_array, b_array, ipiv_array})) { + if (!dpnp::utils::queues_are_compatible(exec_q, + {a_array, b_array, ipiv_array})) { throw py::value_error( "Execution queue is not compatible with allocation queues"); } - auto const &overlap = dpctl::tensor::overlap::MemoryOverlap(); + auto const &overlap = dpnp::tensor::overlap::MemoryOverlap(); if (overlap(a_array, b_array)) { throw py::value_error("The LU-factorized and right-hand sides arrays " "are overlapping segments of memory"); @@ -283,7 +283,7 @@ std::pair "must be contiguous"); } - auto array_types = dpctl_td_ns::usm_ndarray_types(); + auto array_types = dpnp_td_ns::usm_ndarray_types(); int a_array_type_id = array_types.typenum_to_lookup_id(a_array.get_typenum()); int b_array_type_id = @@ -302,11 +302,11 @@ std::pair "of the input matrix"); } - auto ipiv_types = dpctl_td_ns::usm_ndarray_types(); + auto ipiv_types = dpnp_td_ns::usm_ndarray_types(); int ipiv_array_type_id = ipiv_types.typenum_to_lookup_id(ipiv_array.get_typenum()); - if (ipiv_array_type_id != static_cast(dpctl_td_ns::typenum_t::INT64)) { + if (ipiv_array_type_id != static_cast(dpnp_td_ns::typenum_t::INT64)) { throw py::value_error("The type of 'ipiv_array' must be int64"); } @@ -324,7 +324,7 @@ std::pair exec_q, trans, n, nrhs, a_array_data, lda, stride_a, ipiv, stride_ipiv, b_array_data, ldb, stride_b, batch_size, host_task_events, depends); - sycl::event args_ev = dpctl::utils::keep_args_alive( + sycl::event args_ev = dpnp::utils::keep_args_alive( exec_q, {a_array, b_array, ipiv_array}, host_task_events); return std::make_pair(args_ev, getrs_batch_ev); diff --git a/dpnp/backend/extensions/lapack/heevd.cpp b/dpnp/backend/extensions/lapack/heevd.cpp index ecad85f468ef..002a7ad2ef89 100644 --- a/dpnp/backend/extensions/lapack/heevd.cpp +++ b/dpnp/backend/extensions/lapack/heevd.cpp @@ -37,13 +37,13 @@ // utils extension header #include "ext/common.hpp" -// dpctl tensor headers +// dpnp tensor headers #include "utils/type_utils.hpp" namespace dpnp::extensions::lapack { namespace mkl_lapack = oneapi::mkl::lapack; -namespace type_utils = dpctl::tensor::type_utils; +namespace type_utils = dpnp::tensor::type_utils; using ext::common::init_dispatch_table; @@ -104,7 +104,7 @@ static sycl::event heevd_impl(sycl::queue &exec_q, if (info != 0) // an unexpected error occurs { if (scratchpad != nullptr) { - dpctl::tensor::alloc_utils::sycl_free_noexcept(scratchpad, exec_q); + dpnp::tensor::alloc_utils::sycl_free_noexcept(scratchpad, exec_q); } throw std::runtime_error(error_msg.str()); } @@ -113,7 +113,7 @@ static sycl::event heevd_impl(sycl::queue &exec_q, cgh.depends_on(heevd_event); auto ctx = exec_q.get_context(); cgh.host_task([ctx, scratchpad]() { - dpctl::tensor::alloc_utils::sycl_free_noexcept(scratchpad, ctx); + dpnp::tensor::alloc_utils::sycl_free_noexcept(scratchpad, ctx); }); }); @@ -139,11 +139,11 @@ using evd::evd_impl_fn_ptr_t; void init_heevd(py::module_ m) { - using arrayT = dpctl::tensor::usm_ndarray; + using arrayT = dpnp::tensor::usm_ndarray; using event_vecT = std::vector; - static evd_impl_fn_ptr_t heevd_dispatch_table[dpctl_td_ns::num_types] - [dpctl_td_ns::num_types]; + static evd_impl_fn_ptr_t heevd_dispatch_table[dpnp_td_ns::num_types] + [dpnp_td_ns::num_types]; { init_dispatch_table( diff --git a/dpnp/backend/extensions/lapack/heevd_batch.cpp b/dpnp/backend/extensions/lapack/heevd_batch.cpp index 54521136127a..0b23e06c4415 100644 --- a/dpnp/backend/extensions/lapack/heevd_batch.cpp +++ b/dpnp/backend/extensions/lapack/heevd_batch.cpp @@ -38,13 +38,13 @@ // utils extension header #include "ext/common.hpp" -// dpctl tensor headers +// dpnp tensor headers #include "utils/type_utils.hpp" namespace dpnp::extensions::lapack { namespace mkl_lapack = oneapi::mkl::lapack; -namespace type_utils = dpctl::tensor::type_utils; +namespace type_utils = dpnp::tensor::type_utils; using ext::common::init_dispatch_table; @@ -139,7 +139,7 @@ static sycl::event heevd_batch_impl(sycl::queue &exec_q, if (info != 0) // an unexpected error occurs { if (scratchpad != nullptr) { - dpctl::tensor::alloc_utils::sycl_free_noexcept(scratchpad, exec_q); + dpnp::tensor::alloc_utils::sycl_free_noexcept(scratchpad, exec_q); } throw std::runtime_error(error_msg.str()); } @@ -150,7 +150,7 @@ static sycl::event heevd_batch_impl(sycl::queue &exec_q, } auto ctx = exec_q.get_context(); cgh.host_task([ctx, scratchpad]() { - dpctl::tensor::alloc_utils::sycl_free_noexcept(scratchpad, ctx); + dpnp::tensor::alloc_utils::sycl_free_noexcept(scratchpad, ctx); }); }); @@ -176,12 +176,12 @@ using evd::evd_batch_impl_fn_ptr_t; void init_heevd_batch(py::module_ m) { - using arrayT = dpctl::tensor::usm_ndarray; + using arrayT = dpnp::tensor::usm_ndarray; using event_vecT = std::vector; static evd_batch_impl_fn_ptr_t - heevd_batch_dispatch_table[dpctl_td_ns::num_types] - [dpctl_td_ns::num_types]; + heevd_batch_dispatch_table[dpnp_td_ns::num_types] + [dpnp_td_ns::num_types]; { init_dispatch_table( diff --git a/dpnp/backend/extensions/lapack/orgqr.cpp b/dpnp/backend/extensions/lapack/orgqr.cpp index e421b9dd791a..2297d759ea8d 100644 --- a/dpnp/backend/extensions/lapack/orgqr.cpp +++ b/dpnp/backend/extensions/lapack/orgqr.cpp @@ -33,7 +33,7 @@ // utils extension header #include "ext/common.hpp" -// dpctl tensor headers +// dpnp tensor headers #include "utils/memory_overlap.hpp" #include "utils/sycl_alloc_utils.hpp" #include "utils/type_utils.hpp" @@ -45,7 +45,7 @@ namespace dpnp::extensions::lapack { namespace mkl_lapack = oneapi::mkl::lapack; namespace py = pybind11; -namespace type_utils = dpctl::tensor::type_utils; +namespace type_utils = dpnp::tensor::type_utils; using ext::common::init_dispatch_vector; @@ -59,7 +59,7 @@ typedef sycl::event (*orgqr_impl_fn_ptr_t)(sycl::queue &, std::vector &, const std::vector &); -static orgqr_impl_fn_ptr_t orgqr_dispatch_vector[dpctl_td_ns::num_types]; +static orgqr_impl_fn_ptr_t orgqr_dispatch_vector[dpnp_td_ns::num_types]; template static sycl::event orgqr_impl(sycl::queue &exec_q, @@ -130,7 +130,7 @@ static sycl::event orgqr_impl(sycl::queue &exec_q, if (is_exception_caught) // an unexpected error occurs { if (scratchpad != nullptr) { - dpctl::tensor::alloc_utils::sycl_free_noexcept(scratchpad, exec_q); + dpnp::tensor::alloc_utils::sycl_free_noexcept(scratchpad, exec_q); } throw std::runtime_error(error_msg.str()); } @@ -139,7 +139,7 @@ static sycl::event orgqr_impl(sycl::queue &exec_q, cgh.depends_on(orgqr_event); auto ctx = exec_q.get_context(); cgh.host_task([ctx, scratchpad]() { - dpctl::tensor::alloc_utils::sycl_free_noexcept(scratchpad, ctx); + dpnp::tensor::alloc_utils::sycl_free_noexcept(scratchpad, ctx); }); }); host_task_events.push_back(clean_up_event); @@ -152,8 +152,8 @@ std::pair const std::int64_t m, const std::int64_t n, const std::int64_t k, - const dpctl::tensor::usm_ndarray &a_array, - const dpctl::tensor::usm_ndarray &tau_array, + const dpnp::tensor::usm_ndarray &a_array, + const dpnp::tensor::usm_ndarray &tau_array, const std::vector &depends) { const int a_array_nd = a_array.get_ndim(); @@ -172,12 +172,12 @@ std::pair } // check compatibility of execution queue and allocation queue - if (!dpctl::utils::queues_are_compatible(exec_q, {a_array, tau_array})) { + if (!dpnp::utils::queues_are_compatible(exec_q, {a_array, tau_array})) { throw py::value_error( "Execution queue is not compatible with allocation queues"); } - auto const &overlap = dpctl::tensor::overlap::MemoryOverlap(); + auto const &overlap = dpnp::tensor::overlap::MemoryOverlap(); if (overlap(a_array, tau_array)) { throw py::value_error( "The input array and the array of Householder scalars " @@ -207,7 +207,7 @@ std::pair " is expected."); } - auto array_types = dpctl_td_ns::usm_ndarray_types(); + auto array_types = dpnp_td_ns::usm_ndarray_types(); int a_array_type_id = array_types.typenum_to_lookup_id(a_array.get_typenum()); int tau_array_type_id = @@ -235,7 +235,7 @@ std::pair sycl::event orgqr_ev = orgqr_fn(exec_q, m, n, k, a_array_data, lda, tau_array_data, host_task_events, depends); - sycl::event args_ev = dpctl::utils::keep_args_alive( + sycl::event args_ev = dpnp::utils::keep_args_alive( exec_q, {a_array, tau_array}, host_task_events); return std::make_pair(args_ev, orgqr_ev); diff --git a/dpnp/backend/extensions/lapack/orgqr.hpp b/dpnp/backend/extensions/lapack/orgqr.hpp index 2502fe567a1f..ade4507c639b 100644 --- a/dpnp/backend/extensions/lapack/orgqr.hpp +++ b/dpnp/backend/extensions/lapack/orgqr.hpp @@ -40,14 +40,14 @@ extern std::pair const std::int64_t m, const std::int64_t n, const std::int64_t k, - const dpctl::tensor::usm_ndarray &a_array, - const dpctl::tensor::usm_ndarray &tau_array, + const dpnp::tensor::usm_ndarray &a_array, + const dpnp::tensor::usm_ndarray &tau_array, const std::vector &depends = {}); extern std::pair orgqr_batch(sycl::queue &exec_q, - const dpctl::tensor::usm_ndarray &a_array, - const dpctl::tensor::usm_ndarray &tau_array, + const dpnp::tensor::usm_ndarray &a_array, + const dpnp::tensor::usm_ndarray &tau_array, std::int64_t m, std::int64_t n, std::int64_t k, diff --git a/dpnp/backend/extensions/lapack/orgqr_batch.cpp b/dpnp/backend/extensions/lapack/orgqr_batch.cpp index a29fe9b342fc..840ef82a09b6 100644 --- a/dpnp/backend/extensions/lapack/orgqr_batch.cpp +++ b/dpnp/backend/extensions/lapack/orgqr_batch.cpp @@ -33,7 +33,7 @@ // utils extension header #include "ext/common.hpp" -// dpctl tensor headers +// dpnp tensor headers #include "utils/memory_overlap.hpp" #include "utils/sycl_alloc_utils.hpp" #include "utils/type_utils.hpp" @@ -45,7 +45,7 @@ namespace dpnp::extensions::lapack { namespace mkl_lapack = oneapi::mkl::lapack; namespace py = pybind11; -namespace type_utils = dpctl::tensor::type_utils; +namespace type_utils = dpnp::tensor::type_utils; using ext::common::init_dispatch_vector; @@ -64,7 +64,7 @@ typedef sycl::event (*orgqr_batch_impl_fn_ptr_t)( const std::vector &); static orgqr_batch_impl_fn_ptr_t - orgqr_batch_dispatch_vector[dpctl_td_ns::num_types]; + orgqr_batch_dispatch_vector[dpnp_td_ns::num_types]; template static sycl::event orgqr_batch_impl(sycl::queue &exec_q, @@ -151,7 +151,7 @@ static sycl::event orgqr_batch_impl(sycl::queue &exec_q, if (is_exception_caught) // an unexpected error occurs { if (scratchpad != nullptr) { - dpctl::tensor::alloc_utils::sycl_free_noexcept(scratchpad, exec_q); + dpnp::tensor::alloc_utils::sycl_free_noexcept(scratchpad, exec_q); } throw std::runtime_error(error_msg.str()); @@ -161,7 +161,7 @@ static sycl::event orgqr_batch_impl(sycl::queue &exec_q, cgh.depends_on(orgqr_batch_event); auto ctx = exec_q.get_context(); cgh.host_task([ctx, scratchpad]() { - dpctl::tensor::alloc_utils::sycl_free_noexcept(scratchpad, ctx); + dpnp::tensor::alloc_utils::sycl_free_noexcept(scratchpad, ctx); }); }); host_task_events.push_back(clean_up_event); @@ -170,8 +170,8 @@ static sycl::event orgqr_batch_impl(sycl::queue &exec_q, std::pair orgqr_batch(sycl::queue &exec_q, - const dpctl::tensor::usm_ndarray &a_array, - const dpctl::tensor::usm_ndarray &tau_array, + const dpnp::tensor::usm_ndarray &a_array, + const dpnp::tensor::usm_ndarray &tau_array, std::int64_t m, std::int64_t n, std::int64_t k, @@ -196,12 +196,12 @@ std::pair } // check compatibility of execution queue and allocation queue - if (!dpctl::utils::queues_are_compatible(exec_q, {a_array, tau_array})) { + if (!dpnp::utils::queues_are_compatible(exec_q, {a_array, tau_array})) { throw py::value_error( "Execution queue is not compatible with allocation queues"); } - auto const &overlap = dpctl::tensor::overlap::MemoryOverlap(); + auto const &overlap = dpnp::tensor::overlap::MemoryOverlap(); if (overlap(a_array, tau_array)) { throw py::value_error( "The input array and the array of Householder scalars " @@ -219,7 +219,7 @@ std::pair "must be C-contiguous"); } - auto array_types = dpctl_td_ns::usm_ndarray_types(); + auto array_types = dpnp_td_ns::usm_ndarray_types(); int a_array_type_id = array_types.typenum_to_lookup_id(a_array.get_typenum()); int tau_array_type_id = @@ -249,7 +249,7 @@ std::pair exec_q, m, n, k, a_array_data, lda, stride_a, tau_array_data, stride_tau, batch_size, host_task_events, depends); - sycl::event args_ev = dpctl::utils::keep_args_alive( + sycl::event args_ev = dpnp::utils::keep_args_alive( exec_q, {a_array, tau_array}, host_task_events); return std::make_pair(args_ev, orgqr_batch_ev); diff --git a/dpnp/backend/extensions/lapack/potrf.cpp b/dpnp/backend/extensions/lapack/potrf.cpp index a5037ae5e00e..d7edc2d244f6 100644 --- a/dpnp/backend/extensions/lapack/potrf.cpp +++ b/dpnp/backend/extensions/lapack/potrf.cpp @@ -33,7 +33,7 @@ // utils extension header #include "ext/common.hpp" -// dpctl tensor headers +// dpnp tensor headers #include "utils/memory_overlap.hpp" #include "utils/sycl_alloc_utils.hpp" #include "utils/type_utils.hpp" @@ -46,7 +46,7 @@ namespace dpnp::extensions::lapack { namespace mkl_lapack = oneapi::mkl::lapack; namespace py = pybind11; -namespace type_utils = dpctl::tensor::type_utils; +namespace type_utils = dpnp::tensor::type_utils; using ext::common::init_dispatch_vector; @@ -58,7 +58,7 @@ typedef sycl::event (*potrf_impl_fn_ptr_t)(sycl::queue &, std::vector &, const std::vector &); -static potrf_impl_fn_ptr_t potrf_dispatch_vector[dpctl_td_ns::num_types]; +static potrf_impl_fn_ptr_t potrf_dispatch_vector[dpnp_td_ns::num_types]; template static sycl::event potrf_impl(sycl::queue &exec_q, @@ -110,7 +110,7 @@ static sycl::event potrf_impl(sycl::queue &exec_q, << e.detail(); } else if (info > 0 && e.detail() == 0) { - dpctl::tensor::alloc_utils::sycl_free_noexcept(scratchpad, exec_q); + dpnp::tensor::alloc_utils::sycl_free_noexcept(scratchpad, exec_q); throw LinAlgError("Matrix is not positive definite."); } else { @@ -127,7 +127,7 @@ static sycl::event potrf_impl(sycl::queue &exec_q, if (is_exception_caught) // an unexpected error occurs { if (scratchpad != nullptr) { - dpctl::tensor::alloc_utils::sycl_free_noexcept(scratchpad, exec_q); + dpnp::tensor::alloc_utils::sycl_free_noexcept(scratchpad, exec_q); } throw std::runtime_error(error_msg.str()); } @@ -136,7 +136,7 @@ static sycl::event potrf_impl(sycl::queue &exec_q, cgh.depends_on(potrf_event); auto ctx = exec_q.get_context(); cgh.host_task([ctx, scratchpad]() { - dpctl::tensor::alloc_utils::sycl_free_noexcept(scratchpad, ctx); + dpnp::tensor::alloc_utils::sycl_free_noexcept(scratchpad, ctx); }); }); host_task_events.push_back(clean_up_event); @@ -145,7 +145,7 @@ static sycl::event potrf_impl(sycl::queue &exec_q, std::pair potrf(sycl::queue &exec_q, - const dpctl::tensor::usm_ndarray &a_array, + const dpnp::tensor::usm_ndarray &a_array, const std::int8_t upper_lower, const std::vector &depends) { @@ -172,7 +172,7 @@ std::pair "must be C-contiguous"); } - auto array_types = dpctl_td_ns::usm_ndarray_types(); + auto array_types = dpnp_td_ns::usm_ndarray_types(); int a_array_type_id = array_types.typenum_to_lookup_id(a_array.get_typenum()); @@ -194,7 +194,7 @@ std::pair host_task_events, depends); sycl::event args_ev = - dpctl::utils::keep_args_alive(exec_q, {a_array}, host_task_events); + dpnp::utils::keep_args_alive(exec_q, {a_array}, host_task_events); return std::make_pair(args_ev, potrf_ev); } diff --git a/dpnp/backend/extensions/lapack/potrf.hpp b/dpnp/backend/extensions/lapack/potrf.hpp index 02faf2c04fde..52bdbbd970ff 100644 --- a/dpnp/backend/extensions/lapack/potrf.hpp +++ b/dpnp/backend/extensions/lapack/potrf.hpp @@ -37,13 +37,13 @@ namespace dpnp::extensions::lapack { extern std::pair potrf(sycl::queue &exec_q, - const dpctl::tensor::usm_ndarray &a_array, + const dpnp::tensor::usm_ndarray &a_array, const std::int8_t upper_lower, const std::vector &depends = {}); extern std::pair potrf_batch(sycl::queue &exec_q, - const dpctl::tensor::usm_ndarray &a_array, + const dpnp::tensor::usm_ndarray &a_array, const std::int8_t upper_lower, const std::int64_t n, const std::int64_t stride_a, diff --git a/dpnp/backend/extensions/lapack/potrf_batch.cpp b/dpnp/backend/extensions/lapack/potrf_batch.cpp index e1363d0a8445..58bdad462930 100644 --- a/dpnp/backend/extensions/lapack/potrf_batch.cpp +++ b/dpnp/backend/extensions/lapack/potrf_batch.cpp @@ -33,7 +33,7 @@ // utils extension header #include "ext/common.hpp" -// dpctl tensor headers +// dpnp tensor headers #include "utils/memory_overlap.hpp" #include "utils/sycl_alloc_utils.hpp" #include "utils/type_utils.hpp" @@ -46,7 +46,7 @@ namespace dpnp::extensions::lapack { namespace mkl_lapack = oneapi::mkl::lapack; namespace py = pybind11; -namespace type_utils = dpctl::tensor::type_utils; +namespace type_utils = dpnp::tensor::type_utils; using ext::common::init_dispatch_vector; @@ -62,7 +62,7 @@ typedef sycl::event (*potrf_batch_impl_fn_ptr_t)( const std::vector &); static potrf_batch_impl_fn_ptr_t - potrf_batch_dispatch_vector[dpctl_td_ns::num_types]; + potrf_batch_dispatch_vector[dpnp_td_ns::num_types]; template static sycl::event potrf_batch_impl(sycl::queue &exec_q, @@ -122,7 +122,7 @@ static sycl::event potrf_batch_impl(sycl::queue &exec_q, } error_msg << "."; - dpctl::tensor::alloc_utils::sycl_free_noexcept(scratchpad, exec_q); + dpnp::tensor::alloc_utils::sycl_free_noexcept(scratchpad, exec_q); throw LinAlgError(error_msg.str().c_str()); } catch (mkl_lapack::exception const &e) { is_exception_caught = true; @@ -157,7 +157,7 @@ static sycl::event potrf_batch_impl(sycl::queue &exec_q, if (is_exception_caught) // an unexpected error occurs { if (scratchpad != nullptr) { - dpctl::tensor::alloc_utils::sycl_free_noexcept(scratchpad, exec_q); + dpnp::tensor::alloc_utils::sycl_free_noexcept(scratchpad, exec_q); } throw std::runtime_error(error_msg.str()); } @@ -166,7 +166,7 @@ static sycl::event potrf_batch_impl(sycl::queue &exec_q, cgh.depends_on(potrf_batch_event); auto ctx = exec_q.get_context(); cgh.host_task([ctx, scratchpad]() { - dpctl::tensor::alloc_utils::sycl_free_noexcept(scratchpad, ctx); + dpnp::tensor::alloc_utils::sycl_free_noexcept(scratchpad, ctx); }); }); host_task_events.push_back(clean_up_event); @@ -175,7 +175,7 @@ static sycl::event potrf_batch_impl(sycl::queue &exec_q, std::pair potrf_batch(sycl::queue &exec_q, - const dpctl::tensor::usm_ndarray &a_array, + const dpnp::tensor::usm_ndarray &a_array, const std::int8_t upper_lower, const std::int64_t n, const std::int64_t stride_a, @@ -206,7 +206,7 @@ std::pair "must be C-contiguous"); } - auto array_types = dpctl_td_ns::usm_ndarray_types(); + auto array_types = dpnp_td_ns::usm_ndarray_types(); int a_array_type_id = array_types.typenum_to_lookup_id(a_array.get_typenum()); @@ -229,7 +229,7 @@ std::pair batch_size, host_task_events, depends); sycl::event args_ev = - dpctl::utils::keep_args_alive(exec_q, {a_array}, host_task_events); + dpnp::utils::keep_args_alive(exec_q, {a_array}, host_task_events); return std::make_pair(args_ev, potrf_batch_ev); } diff --git a/dpnp/backend/extensions/lapack/syevd.cpp b/dpnp/backend/extensions/lapack/syevd.cpp index 60dae80e90c6..7280e415f271 100644 --- a/dpnp/backend/extensions/lapack/syevd.cpp +++ b/dpnp/backend/extensions/lapack/syevd.cpp @@ -37,13 +37,13 @@ // utils extension header #include "ext/common.hpp" -// dpctl tensor headers +// dpnp tensor headers #include "utils/type_utils.hpp" namespace dpnp::extensions::lapack { namespace mkl_lapack = oneapi::mkl::lapack; -namespace type_utils = dpctl::tensor::type_utils; +namespace type_utils = dpnp::tensor::type_utils; using ext::common::init_dispatch_table; @@ -104,7 +104,7 @@ static sycl::event syevd_impl(sycl::queue &exec_q, if (info != 0) // an unexpected error occurs { if (scratchpad != nullptr) { - dpctl::tensor::alloc_utils::sycl_free_noexcept(scratchpad, exec_q); + dpnp::tensor::alloc_utils::sycl_free_noexcept(scratchpad, exec_q); } throw std::runtime_error(error_msg.str()); } @@ -113,7 +113,7 @@ static sycl::event syevd_impl(sycl::queue &exec_q, cgh.depends_on(syevd_event); auto ctx = exec_q.get_context(); cgh.host_task([ctx, scratchpad]() { - dpctl::tensor::alloc_utils::sycl_free_noexcept(scratchpad, ctx); + dpnp::tensor::alloc_utils::sycl_free_noexcept(scratchpad, ctx); }); }); @@ -139,11 +139,11 @@ using evd::evd_impl_fn_ptr_t; void init_syevd(py::module_ m) { - using arrayT = dpctl::tensor::usm_ndarray; + using arrayT = dpnp::tensor::usm_ndarray; using event_vecT = std::vector; - static evd_impl_fn_ptr_t syevd_dispatch_table[dpctl_td_ns::num_types] - [dpctl_td_ns::num_types]; + static evd_impl_fn_ptr_t syevd_dispatch_table[dpnp_td_ns::num_types] + [dpnp_td_ns::num_types]; { init_dispatch_table( diff --git a/dpnp/backend/extensions/lapack/syevd_batch.cpp b/dpnp/backend/extensions/lapack/syevd_batch.cpp index 884b6045f418..c88f22e909c3 100644 --- a/dpnp/backend/extensions/lapack/syevd_batch.cpp +++ b/dpnp/backend/extensions/lapack/syevd_batch.cpp @@ -38,13 +38,13 @@ // utils extension header #include "ext/common.hpp" -// dpctl tensor headers +// dpnp tensor headers #include "utils/type_utils.hpp" namespace dpnp::extensions::lapack { namespace mkl_lapack = oneapi::mkl::lapack; -namespace type_utils = dpctl::tensor::type_utils; +namespace type_utils = dpnp::tensor::type_utils; using ext::common::init_dispatch_table; @@ -139,7 +139,7 @@ static sycl::event syevd_batch_impl(sycl::queue &exec_q, if (info != 0) // an unexpected error occurs { if (scratchpad != nullptr) { - dpctl::tensor::alloc_utils::sycl_free_noexcept(scratchpad, exec_q); + dpnp::tensor::alloc_utils::sycl_free_noexcept(scratchpad, exec_q); } throw std::runtime_error(error_msg.str()); } @@ -150,7 +150,7 @@ static sycl::event syevd_batch_impl(sycl::queue &exec_q, } auto ctx = exec_q.get_context(); cgh.host_task([ctx, scratchpad]() { - dpctl::tensor::alloc_utils::sycl_free_noexcept(scratchpad, ctx); + dpnp::tensor::alloc_utils::sycl_free_noexcept(scratchpad, ctx); }); }); @@ -176,12 +176,12 @@ using evd::evd_batch_impl_fn_ptr_t; void init_syevd_batch(py::module_ m) { - using arrayT = dpctl::tensor::usm_ndarray; + using arrayT = dpnp::tensor::usm_ndarray; using event_vecT = std::vector; static evd_batch_impl_fn_ptr_t - syevd_batch_dispatch_table[dpctl_td_ns::num_types] - [dpctl_td_ns::num_types]; + syevd_batch_dispatch_table[dpnp_td_ns::num_types] + [dpnp_td_ns::num_types]; { init_dispatch_table( diff --git a/dpnp/backend/extensions/lapack/types_matrix.hpp b/dpnp/backend/extensions/lapack/types_matrix.hpp index 3d7b5e1b9df6..ea000bea5c88 100644 --- a/dpnp/backend/extensions/lapack/types_matrix.hpp +++ b/dpnp/backend/extensions/lapack/types_matrix.hpp @@ -30,11 +30,11 @@ #include -// dpctl tensor headers +// dpnp tensor headers #include "utils/type_dispatch.hpp" -// dpctl namespace for operations with types -namespace dpctl_td_ns = dpctl::tensor::type_dispatch; +// namespace for operations with types +namespace dpnp_td_ns = dpnp::tensor::type_dispatch; namespace dpnp::extensions::lapack::types { @@ -51,19 +51,19 @@ namespace dpnp::extensions::lapack::types template struct GeqrfBatchTypePairSupportFactory { - static constexpr bool is_defined = std::disjunction< - dpctl_td_ns::TypePairDefinedEntry, - dpctl_td_ns::TypePairDefinedEntry, - dpctl_td_ns::TypePairDefinedEntry, - T, - std::complex>, - dpctl_td_ns::TypePairDefinedEntry, - T, - std::complex>, - // fall-through - dpctl_td_ns::NotDefinedEntry>::is_defined; + static constexpr bool is_defined = + std::disjunction, + dpnp_td_ns::TypePairDefinedEntry, + dpnp_td_ns::TypePairDefinedEntry, + T, + std::complex>, + dpnp_td_ns::TypePairDefinedEntry, + T, + std::complex>, + // fall-through + dpnp_td_ns::NotDefinedEntry>::is_defined; }; /** @@ -78,19 +78,19 @@ struct GeqrfBatchTypePairSupportFactory template struct GeqrfTypePairSupportFactory { - static constexpr bool is_defined = std::disjunction< - dpctl_td_ns::TypePairDefinedEntry, - dpctl_td_ns::TypePairDefinedEntry, - dpctl_td_ns::TypePairDefinedEntry, - T, - std::complex>, - dpctl_td_ns::TypePairDefinedEntry, - T, - std::complex>, - // fall-through - dpctl_td_ns::NotDefinedEntry>::is_defined; + static constexpr bool is_defined = + std::disjunction, + dpnp_td_ns::TypePairDefinedEntry, + dpnp_td_ns::TypePairDefinedEntry, + T, + std::complex>, + dpnp_td_ns::TypePairDefinedEntry, + T, + std::complex>, + // fall-through + dpnp_td_ns::NotDefinedEntry>::is_defined; }; /** @@ -105,19 +105,19 @@ struct GeqrfTypePairSupportFactory template struct GesvTypePairSupportFactory { - static constexpr bool is_defined = std::disjunction< - dpctl_td_ns::TypePairDefinedEntry, - dpctl_td_ns::TypePairDefinedEntry, - dpctl_td_ns::TypePairDefinedEntry, - T, - std::complex>, - dpctl_td_ns::TypePairDefinedEntry, - T, - std::complex>, - // fall-through - dpctl_td_ns::NotDefinedEntry>::is_defined; + static constexpr bool is_defined = + std::disjunction, + dpnp_td_ns::TypePairDefinedEntry, + dpnp_td_ns::TypePairDefinedEntry, + T, + std::complex>, + dpnp_td_ns::TypePairDefinedEntry, + T, + std::complex>, + // fall-through + dpnp_td_ns::NotDefinedEntry>::is_defined; }; /** @@ -133,13 +133,13 @@ template struct GesvdTypePairSupportFactory { static constexpr bool is_defined = std::disjunction< - dpctl_td_ns::TypePairDefinedEntry, - dpctl_td_ns::TypePairDefinedEntry, - dpctl_td_ns::TypePairDefinedEntry, RealT, float>, - dpctl_td_ns:: + dpnp_td_ns::TypePairDefinedEntry, + dpnp_td_ns::TypePairDefinedEntry, + dpnp_td_ns::TypePairDefinedEntry, RealT, float>, + dpnp_td_ns:: TypePairDefinedEntry, RealT, double>, // fall-through - dpctl_td_ns::NotDefinedEntry>::is_defined; + dpnp_td_ns::NotDefinedEntry>::is_defined; }; /** @@ -153,19 +153,19 @@ struct GesvdTypePairSupportFactory template struct GetrfTypePairSupportFactory { - static constexpr bool is_defined = std::disjunction< - dpctl_td_ns::TypePairDefinedEntry, - dpctl_td_ns::TypePairDefinedEntry, - dpctl_td_ns::TypePairDefinedEntry, - T, - std::complex>, - dpctl_td_ns::TypePairDefinedEntry, - T, - std::complex>, - // fall-through - dpctl_td_ns::NotDefinedEntry>::is_defined; + static constexpr bool is_defined = + std::disjunction, + dpnp_td_ns::TypePairDefinedEntry, + dpnp_td_ns::TypePairDefinedEntry, + T, + std::complex>, + dpnp_td_ns::TypePairDefinedEntry, + T, + std::complex>, + // fall-through + dpnp_td_ns::NotDefinedEntry>::is_defined; }; /** @@ -179,19 +179,19 @@ struct GetrfTypePairSupportFactory template struct GetrfBatchTypePairSupportFactory { - static constexpr bool is_defined = std::disjunction< - dpctl_td_ns::TypePairDefinedEntry, - dpctl_td_ns::TypePairDefinedEntry, - dpctl_td_ns::TypePairDefinedEntry, - T, - std::complex>, - dpctl_td_ns::TypePairDefinedEntry, - T, - std::complex>, - // fall-through - dpctl_td_ns::NotDefinedEntry>::is_defined; + static constexpr bool is_defined = + std::disjunction, + dpnp_td_ns::TypePairDefinedEntry, + dpnp_td_ns::TypePairDefinedEntry, + T, + std::complex>, + dpnp_td_ns::TypePairDefinedEntry, + T, + std::complex>, + // fall-through + dpnp_td_ns::NotDefinedEntry>::is_defined; }; /** @@ -205,19 +205,19 @@ struct GetrfBatchTypePairSupportFactory template struct GetriBatchTypePairSupportFactory { - static constexpr bool is_defined = std::disjunction< - dpctl_td_ns::TypePairDefinedEntry, - dpctl_td_ns::TypePairDefinedEntry, - dpctl_td_ns::TypePairDefinedEntry, - T, - std::complex>, - dpctl_td_ns::TypePairDefinedEntry, - T, - std::complex>, - // fall-through - dpctl_td_ns::NotDefinedEntry>::is_defined; + static constexpr bool is_defined = + std::disjunction, + dpnp_td_ns::TypePairDefinedEntry, + dpnp_td_ns::TypePairDefinedEntry, + T, + std::complex>, + dpnp_td_ns::TypePairDefinedEntry, + T, + std::complex>, + // fall-through + dpnp_td_ns::NotDefinedEntry>::is_defined; }; /** @@ -233,19 +233,19 @@ struct GetriBatchTypePairSupportFactory template struct GetrsTypePairSupportFactory { - static constexpr bool is_defined = std::disjunction< - dpctl_td_ns::TypePairDefinedEntry, - dpctl_td_ns::TypePairDefinedEntry, - dpctl_td_ns::TypePairDefinedEntry, - T, - std::complex>, - dpctl_td_ns::TypePairDefinedEntry, - T, - std::complex>, - // fall-through - dpctl_td_ns::NotDefinedEntry>::is_defined; + static constexpr bool is_defined = + std::disjunction, + dpnp_td_ns::TypePairDefinedEntry, + dpnp_td_ns::TypePairDefinedEntry, + T, + std::complex>, + dpnp_td_ns::TypePairDefinedEntry, + T, + std::complex>, + // fall-through + dpnp_td_ns::NotDefinedEntry>::is_defined; }; /** @@ -261,19 +261,19 @@ struct GetrsTypePairSupportFactory template struct GetrsBatchTypePairSupportFactory { - static constexpr bool is_defined = std::disjunction< - dpctl_td_ns::TypePairDefinedEntry, - dpctl_td_ns::TypePairDefinedEntry, - dpctl_td_ns::TypePairDefinedEntry, - T, - std::complex>, - dpctl_td_ns::TypePairDefinedEntry, - T, - std::complex>, - // fall-through - dpctl_td_ns::NotDefinedEntry>::is_defined; + static constexpr bool is_defined = + std::disjunction, + dpnp_td_ns::TypePairDefinedEntry, + dpnp_td_ns::TypePairDefinedEntry, + T, + std::complex>, + dpnp_td_ns::TypePairDefinedEntry, + T, + std::complex>, + // fall-through + dpnp_td_ns::NotDefinedEntry>::is_defined; }; /** @@ -289,11 +289,11 @@ template struct HeevdTypePairSupportFactory { static constexpr bool is_defined = std::disjunction< - dpctl_td_ns:: + dpnp_td_ns:: TypePairDefinedEntry, RealT, double>, - dpctl_td_ns::TypePairDefinedEntry, RealT, float>, + dpnp_td_ns::TypePairDefinedEntry, RealT, float>, // fall-through - dpctl_td_ns::NotDefinedEntry>::is_defined; + dpnp_td_ns::NotDefinedEntry>::is_defined; }; /** @@ -310,11 +310,11 @@ struct HeevdTypePairSupportFactory template struct OrgqrBatchTypePairSupportFactory { - static constexpr bool is_defined = std::disjunction< - dpctl_td_ns::TypePairDefinedEntry, - dpctl_td_ns::TypePairDefinedEntry, - // fall-through - dpctl_td_ns::NotDefinedEntry>::is_defined; + static constexpr bool is_defined = + std::disjunction, + dpnp_td_ns::TypePairDefinedEntry, + // fall-through + dpnp_td_ns::NotDefinedEntry>::is_defined; }; /** @@ -329,11 +329,11 @@ struct OrgqrBatchTypePairSupportFactory template struct OrgqrTypePairSupportFactory { - static constexpr bool is_defined = std::disjunction< - dpctl_td_ns::TypePairDefinedEntry, - dpctl_td_ns::TypePairDefinedEntry, - // fall-through - dpctl_td_ns::NotDefinedEntry>::is_defined; + static constexpr bool is_defined = + std::disjunction, + dpnp_td_ns::TypePairDefinedEntry, + // fall-through + dpnp_td_ns::NotDefinedEntry>::is_defined; }; /** @@ -347,19 +347,19 @@ struct OrgqrTypePairSupportFactory template struct PotrfTypePairSupportFactory { - static constexpr bool is_defined = std::disjunction< - dpctl_td_ns::TypePairDefinedEntry, - dpctl_td_ns::TypePairDefinedEntry, - dpctl_td_ns::TypePairDefinedEntry, - T, - std::complex>, - dpctl_td_ns::TypePairDefinedEntry, - T, - std::complex>, - // fall-through - dpctl_td_ns::NotDefinedEntry>::is_defined; + static constexpr bool is_defined = + std::disjunction, + dpnp_td_ns::TypePairDefinedEntry, + dpnp_td_ns::TypePairDefinedEntry, + T, + std::complex>, + dpnp_td_ns::TypePairDefinedEntry, + T, + std::complex>, + // fall-through + dpnp_td_ns::NotDefinedEntry>::is_defined; }; /** @@ -373,19 +373,19 @@ struct PotrfTypePairSupportFactory template struct PotrfBatchTypePairSupportFactory { - static constexpr bool is_defined = std::disjunction< - dpctl_td_ns::TypePairDefinedEntry, - dpctl_td_ns::TypePairDefinedEntry, - dpctl_td_ns::TypePairDefinedEntry, - T, - std::complex>, - dpctl_td_ns::TypePairDefinedEntry, - T, - std::complex>, - // fall-through - dpctl_td_ns::NotDefinedEntry>::is_defined; + static constexpr bool is_defined = + std::disjunction, + dpnp_td_ns::TypePairDefinedEntry, + dpnp_td_ns::TypePairDefinedEntry, + T, + std::complex>, + dpnp_td_ns::TypePairDefinedEntry, + T, + std::complex>, + // fall-through + dpnp_td_ns::NotDefinedEntry>::is_defined; }; /** @@ -400,10 +400,10 @@ template struct SyevdTypePairSupportFactory { static constexpr bool is_defined = std::disjunction< - dpctl_td_ns::TypePairDefinedEntry, - dpctl_td_ns::TypePairDefinedEntry, + dpnp_td_ns::TypePairDefinedEntry, + dpnp_td_ns::TypePairDefinedEntry, // fall-through - dpctl_td_ns::NotDefinedEntry>::is_defined; + dpnp_td_ns::NotDefinedEntry>::is_defined; }; /** @@ -420,17 +420,17 @@ struct SyevdTypePairSupportFactory template struct UngqrBatchTypePairSupportFactory { - static constexpr bool is_defined = std::disjunction< - dpctl_td_ns::TypePairDefinedEntry, - T, - std::complex>, - dpctl_td_ns::TypePairDefinedEntry, - T, - std::complex>, - // fall-through - dpctl_td_ns::NotDefinedEntry>::is_defined; + static constexpr bool is_defined = + std::disjunction, + T, + std::complex>, + dpnp_td_ns::TypePairDefinedEntry, + T, + std::complex>, + // fall-through + dpnp_td_ns::NotDefinedEntry>::is_defined; }; /** @@ -445,16 +445,16 @@ struct UngqrBatchTypePairSupportFactory template struct UngqrTypePairSupportFactory { - static constexpr bool is_defined = std::disjunction< - dpctl_td_ns::TypePairDefinedEntry, - T, - std::complex>, - dpctl_td_ns::TypePairDefinedEntry, - T, - std::complex>, - // fall-through - dpctl_td_ns::NotDefinedEntry>::is_defined; + static constexpr bool is_defined = + std::disjunction, + T, + std::complex>, + dpnp_td_ns::TypePairDefinedEntry, + T, + std::complex>, + // fall-through + dpnp_td_ns::NotDefinedEntry>::is_defined; }; } // namespace dpnp::extensions::lapack::types diff --git a/dpnp/backend/extensions/lapack/ungqr.cpp b/dpnp/backend/extensions/lapack/ungqr.cpp index 0c1856975c9c..7bea568f048e 100644 --- a/dpnp/backend/extensions/lapack/ungqr.cpp +++ b/dpnp/backend/extensions/lapack/ungqr.cpp @@ -33,7 +33,7 @@ // utils extension header #include "ext/common.hpp" -// dpctl tensor headers +// dpnp tensor headers #include "utils/memory_overlap.hpp" #include "utils/sycl_alloc_utils.hpp" #include "utils/type_utils.hpp" @@ -45,7 +45,7 @@ namespace dpnp::extensions::lapack { namespace mkl_lapack = oneapi::mkl::lapack; namespace py = pybind11; -namespace type_utils = dpctl::tensor::type_utils; +namespace type_utils = dpnp::tensor::type_utils; using ext::common::init_dispatch_vector; @@ -59,7 +59,7 @@ typedef sycl::event (*ungqr_impl_fn_ptr_t)(sycl::queue &, std::vector &, const std::vector &); -static ungqr_impl_fn_ptr_t ungqr_dispatch_vector[dpctl_td_ns::num_types]; +static ungqr_impl_fn_ptr_t ungqr_dispatch_vector[dpnp_td_ns::num_types]; template static sycl::event ungqr_impl(sycl::queue &exec_q, @@ -130,7 +130,7 @@ static sycl::event ungqr_impl(sycl::queue &exec_q, if (is_exception_caught) // an unexpected error occurs { if (scratchpad != nullptr) { - dpctl::tensor::alloc_utils::sycl_free_noexcept(scratchpad, exec_q); + dpnp::tensor::alloc_utils::sycl_free_noexcept(scratchpad, exec_q); } throw std::runtime_error(error_msg.str()); } @@ -139,7 +139,7 @@ static sycl::event ungqr_impl(sycl::queue &exec_q, cgh.depends_on(ungqr_event); auto ctx = exec_q.get_context(); cgh.host_task([ctx, scratchpad]() { - dpctl::tensor::alloc_utils::sycl_free_noexcept(scratchpad, ctx); + dpnp::tensor::alloc_utils::sycl_free_noexcept(scratchpad, ctx); }); }); host_task_events.push_back(clean_up_event); @@ -152,8 +152,8 @@ std::pair const std::int64_t m, const std::int64_t n, const std::int64_t k, - const dpctl::tensor::usm_ndarray &a_array, - const dpctl::tensor::usm_ndarray &tau_array, + const dpnp::tensor::usm_ndarray &a_array, + const dpnp::tensor::usm_ndarray &tau_array, const std::vector &depends) { const int a_array_nd = a_array.get_ndim(); @@ -172,12 +172,12 @@ std::pair } // check compatibility of execution queue and allocation queue - if (!dpctl::utils::queues_are_compatible(exec_q, {a_array, tau_array})) { + if (!dpnp::utils::queues_are_compatible(exec_q, {a_array, tau_array})) { throw py::value_error( "Execution queue is not compatible with allocation queues"); } - auto const &overlap = dpctl::tensor::overlap::MemoryOverlap(); + auto const &overlap = dpnp::tensor::overlap::MemoryOverlap(); if (overlap(a_array, tau_array)) { throw py::value_error( "The input array and the array of Householder scalars " @@ -207,7 +207,7 @@ std::pair " is expected."); } - auto array_types = dpctl_td_ns::usm_ndarray_types(); + auto array_types = dpnp_td_ns::usm_ndarray_types(); int a_array_type_id = array_types.typenum_to_lookup_id(a_array.get_typenum()); int tau_array_type_id = @@ -235,7 +235,7 @@ std::pair sycl::event ungqr_ev = ungqr_fn(exec_q, m, n, k, a_array_data, lda, tau_array_data, host_task_events, depends); - sycl::event args_ev = dpctl::utils::keep_args_alive( + sycl::event args_ev = dpnp::utils::keep_args_alive( exec_q, {a_array, tau_array}, host_task_events); return std::make_pair(args_ev, ungqr_ev); diff --git a/dpnp/backend/extensions/lapack/ungqr.hpp b/dpnp/backend/extensions/lapack/ungqr.hpp index 8c9a36b3f4a6..bb518824cad2 100644 --- a/dpnp/backend/extensions/lapack/ungqr.hpp +++ b/dpnp/backend/extensions/lapack/ungqr.hpp @@ -40,14 +40,14 @@ extern std::pair const std::int64_t m, const std::int64_t n, const std::int64_t k, - const dpctl::tensor::usm_ndarray &a_array, - const dpctl::tensor::usm_ndarray &tau_array, + const dpnp::tensor::usm_ndarray &a_array, + const dpnp::tensor::usm_ndarray &tau_array, const std::vector &depends = {}); extern std::pair ungqr_batch(sycl::queue &exec_q, - const dpctl::tensor::usm_ndarray &a_array, - const dpctl::tensor::usm_ndarray &tau_array, + const dpnp::tensor::usm_ndarray &a_array, + const dpnp::tensor::usm_ndarray &tau_array, std::int64_t m, std::int64_t n, std::int64_t k, diff --git a/dpnp/backend/extensions/lapack/ungqr_batch.cpp b/dpnp/backend/extensions/lapack/ungqr_batch.cpp index 04de27cb257c..6452a30e2a86 100644 --- a/dpnp/backend/extensions/lapack/ungqr_batch.cpp +++ b/dpnp/backend/extensions/lapack/ungqr_batch.cpp @@ -33,7 +33,7 @@ // utils extension header #include "ext/common.hpp" -// dpctl tensor headers +// dpnp tensor headers #include "utils/memory_overlap.hpp" #include "utils/sycl_alloc_utils.hpp" #include "utils/type_utils.hpp" @@ -45,7 +45,7 @@ namespace dpnp::extensions::lapack { namespace mkl_lapack = oneapi::mkl::lapack; namespace py = pybind11; -namespace type_utils = dpctl::tensor::type_utils; +namespace type_utils = dpnp::tensor::type_utils; using ext::common::init_dispatch_vector; @@ -64,7 +64,7 @@ typedef sycl::event (*ungqr_batch_impl_fn_ptr_t)( const std::vector &); static ungqr_batch_impl_fn_ptr_t - ungqr_batch_dispatch_vector[dpctl_td_ns::num_types]; + ungqr_batch_dispatch_vector[dpnp_td_ns::num_types]; template static sycl::event ungqr_batch_impl(sycl::queue &exec_q, @@ -151,7 +151,7 @@ static sycl::event ungqr_batch_impl(sycl::queue &exec_q, if (is_exception_caught) // an unexpected error occurs { if (scratchpad != nullptr) { - dpctl::tensor::alloc_utils::sycl_free_noexcept(scratchpad, exec_q); + dpnp::tensor::alloc_utils::sycl_free_noexcept(scratchpad, exec_q); } throw std::runtime_error(error_msg.str()); @@ -161,7 +161,7 @@ static sycl::event ungqr_batch_impl(sycl::queue &exec_q, cgh.depends_on(ungqr_batch_event); auto ctx = exec_q.get_context(); cgh.host_task([ctx, scratchpad]() { - dpctl::tensor::alloc_utils::sycl_free_noexcept(scratchpad, ctx); + dpnp::tensor::alloc_utils::sycl_free_noexcept(scratchpad, ctx); }); }); host_task_events.push_back(clean_up_event); @@ -170,8 +170,8 @@ static sycl::event ungqr_batch_impl(sycl::queue &exec_q, std::pair ungqr_batch(sycl::queue &exec_q, - const dpctl::tensor::usm_ndarray &a_array, - const dpctl::tensor::usm_ndarray &tau_array, + const dpnp::tensor::usm_ndarray &a_array, + const dpnp::tensor::usm_ndarray &tau_array, std::int64_t m, std::int64_t n, std::int64_t k, @@ -196,12 +196,12 @@ std::pair } // check compatibility of execution queue and allocation queue - if (!dpctl::utils::queues_are_compatible(exec_q, {a_array, tau_array})) { + if (!dpnp::utils::queues_are_compatible(exec_q, {a_array, tau_array})) { throw py::value_error( "Execution queue is not compatible with allocation queues"); } - auto const &overlap = dpctl::tensor::overlap::MemoryOverlap(); + auto const &overlap = dpnp::tensor::overlap::MemoryOverlap(); if (overlap(a_array, tau_array)) { throw py::value_error( "The input array and the array of Householder scalars " @@ -219,7 +219,7 @@ std::pair "must be C-contiguous"); } - auto array_types = dpctl_td_ns::usm_ndarray_types(); + auto array_types = dpnp_td_ns::usm_ndarray_types(); int a_array_type_id = array_types.typenum_to_lookup_id(a_array.get_typenum()); int tau_array_type_id = @@ -249,7 +249,7 @@ std::pair exec_q, m, n, k, a_array_data, lda, stride_a, tau_array_data, stride_tau, batch_size, host_task_events, depends); - sycl::event args_ev = dpctl::utils::keep_args_alive( + sycl::event args_ev = dpnp::utils::keep_args_alive( exec_q, {a_array, tau_array}, host_task_events); return std::make_pair(args_ev, ungqr_batch_ev); diff --git a/dpnp/backend/extensions/statistics/bincount.cpp b/dpnp/backend/extensions/statistics/bincount.cpp index 9bfe5c2a2449..353335c25073 100644 --- a/dpnp/backend/extensions/statistics/bincount.cpp +++ b/dpnp/backend/extensions/statistics/bincount.cpp @@ -34,7 +34,7 @@ #include "bincount.hpp" #include "histogram_common.hpp" -using dpctl::tensor::usm_ndarray; +using dpnp::tensor::usm_ndarray; using namespace statistics::histogram; using namespace ext::common; @@ -161,14 +161,14 @@ Bincount::Bincount() : dispatch_table("sample", "histogram") } std::tuple Bincount::call( - const dpctl::tensor::usm_ndarray &sample, + const dpnp::tensor::usm_ndarray &sample, const uint64_t min, const uint64_t max, - const std::optional &weights, - dpctl::tensor::usm_ndarray &histogram, + const std::optional &weights, + dpnp::tensor::usm_ndarray &histogram, const std::vector &depends) { - validate(sample, std::optional(), weights, + validate(sample, std::optional(), weights, histogram); if (sample.get_size() == 0) { @@ -190,12 +190,12 @@ std::tuple Bincount::call( sycl::event args_ev; if (weights.has_value()) { - args_ev = dpctl::utils::keep_args_alive( + args_ev = dpnp::utils::keep_args_alive( exec_q, {sample, weights.value(), histogram}, {ev}); } else { args_ev = - dpctl::utils::keep_args_alive(exec_q, {sample, histogram}, {ev}); + dpnp::utils::keep_args_alive(exec_q, {sample, histogram}, {ev}); } return {args_ev, ev}; @@ -211,9 +211,9 @@ void statistics::histogram::populate_bincount(py::module_ m) auto bincount_func = [bincountp = bincount.get()]( - const dpctl::tensor::usm_ndarray &sample, int64_t min, int64_t max, - std::optional &weights, - dpctl::tensor::usm_ndarray &histogram, + const dpnp::tensor::usm_ndarray &sample, int64_t min, int64_t max, + std::optional &weights, + dpnp::tensor::usm_ndarray &histogram, const std::vector &depends) { return bincountp->call(sample, min, max, weights, histogram, depends); diff --git a/dpnp/backend/extensions/statistics/bincount.hpp b/dpnp/backend/extensions/statistics/bincount.hpp index 2fc477e71edc..00f5ae47164a 100644 --- a/dpnp/backend/extensions/statistics/bincount.hpp +++ b/dpnp/backend/extensions/statistics/bincount.hpp @@ -35,7 +35,7 @@ #include "ext/dispatch_table.hpp" -namespace dpctl_td_ns = dpctl::tensor::type_dispatch; +namespace dpnp_td_ns = dpnp::tensor::type_dispatch; namespace statistics::histogram { @@ -55,11 +55,11 @@ struct Bincount Bincount(); std::tuple - call(const dpctl::tensor::usm_ndarray &input, + call(const dpnp::tensor::usm_ndarray &input, const uint64_t min, const uint64_t max, - const std::optional &weights, - dpctl::tensor::usm_ndarray &output, + const std::optional &weights, + dpnp::tensor::usm_ndarray &output, const std::vector &depends); }; diff --git a/dpnp/backend/extensions/statistics/histogram.cpp b/dpnp/backend/extensions/statistics/histogram.cpp index afc5d9638f48..24ff95db30fb 100644 --- a/dpnp/backend/extensions/statistics/histogram.cpp +++ b/dpnp/backend/extensions/statistics/histogram.cpp @@ -37,14 +37,14 @@ #include "dpnp4pybind11.hpp" -// dpctl tensor headers +// dpnp tensor headers #include "utils/type_dispatch.hpp" #include "histogram.hpp" #include "histogram_common.hpp" -namespace dpctl_td_ns = dpctl::tensor::type_dispatch; -using dpctl::tensor::usm_ndarray; +namespace dpnp_td_ns = dpnp::tensor::type_dispatch; +using dpnp::tensor::usm_ndarray; using namespace statistics::histogram; using namespace ext::common; @@ -222,10 +222,10 @@ Histogram::Histogram() : dispatch_table("sample", "histogram") } std::tuple - Histogram::call(const dpctl::tensor::usm_ndarray &sample, - const dpctl::tensor::usm_ndarray &bins, - std::optional &weights, - dpctl::tensor::usm_ndarray &histogram, + Histogram::call(const dpnp::tensor::usm_ndarray &sample, + const dpnp::tensor::usm_ndarray &bins, + std::optional &weights, + dpnp::tensor::usm_ndarray &histogram, const std::vector &depends) { validate(sample, bins, weights, histogram); @@ -251,12 +251,12 @@ std::tuple sycl::event args_ev; if (weights.has_value()) { - args_ev = dpctl::utils::keep_args_alive( + args_ev = dpnp::utils::keep_args_alive( exec_q, {sample, bins, weights.value(), histogram}, {ev}); } else { - args_ev = dpctl::utils::keep_args_alive( - exec_q, {sample, bins, histogram}, {ev}); + args_ev = dpnp::utils::keep_args_alive(exec_q, + {sample, bins, histogram}, {ev}); } return {args_ev, ev}; @@ -272,10 +272,10 @@ void statistics::histogram::populate_histogram(py::module_ m) auto hist_func = [histp = hist.get()]( - const dpctl::tensor::usm_ndarray &sample, - const dpctl::tensor::usm_ndarray &bins, - std::optional &weights, - dpctl::tensor::usm_ndarray &histogram, + const dpnp::tensor::usm_ndarray &sample, + const dpnp::tensor::usm_ndarray &bins, + std::optional &weights, + dpnp::tensor::usm_ndarray &histogram, const std::vector &depends) { return histp->call(sample, bins, weights, histogram, depends); }; diff --git a/dpnp/backend/extensions/statistics/histogram.hpp b/dpnp/backend/extensions/statistics/histogram.hpp index d04d8edbf02b..d51f04e5f03e 100644 --- a/dpnp/backend/extensions/statistics/histogram.hpp +++ b/dpnp/backend/extensions/statistics/histogram.hpp @@ -54,10 +54,10 @@ struct Histogram Histogram(); std::tuple - call(const dpctl::tensor::usm_ndarray &input, - const dpctl::tensor::usm_ndarray &bins_edges, - std::optional &weights, - dpctl::tensor::usm_ndarray &output, + call(const dpnp::tensor::usm_ndarray &input, + const dpnp::tensor::usm_ndarray &bins_edges, + std::optional &weights, + dpnp::tensor::usm_ndarray &output, const std::vector &depends); }; diff --git a/dpnp/backend/extensions/statistics/histogram_common.cpp b/dpnp/backend/extensions/statistics/histogram_common.cpp index 252e1cd7c7cc..9a44d7c76261 100644 --- a/dpnp/backend/extensions/statistics/histogram_common.cpp +++ b/dpnp/backend/extensions/statistics/histogram_common.cpp @@ -40,12 +40,12 @@ // utils extension header #include "ext/validation_utils.hpp" -// dpctl tensor headers +// dpnp tensor headers #include "utils/type_dispatch.hpp" -namespace dpctl_td_ns = dpctl::tensor::type_dispatch; -using dpctl::tensor::usm_ndarray; -using dpctl_td_ns::typenum_t; +namespace dpnp_td_ns = dpnp::tensor::type_dispatch; +using dpnp::tensor::usm_ndarray; +using dpnp_td_ns::typenum_t; using ext::common::CeilDiv; @@ -61,8 +61,8 @@ using ext::validation::name_of; namespace statistics::histogram { void validate(const usm_ndarray &sample, - const std::optional &bins, - const std::optional &weights, + const std::optional &bins, + const std::optional &weights, const usm_ndarray &histogram) { auto exec_q = sample.get_queue(); @@ -165,7 +165,7 @@ void validate(const usm_ndarray &sample, std::to_string(histogram.get_size())); } - auto array_types = dpctl_td_ns::usm_ndarray_types(); + auto array_types = dpnp_td_ns::usm_ndarray_types(); auto hist_type = static_cast( array_types.typenum_to_lookup_id(histogram.get_typenum())); if (histogram.get_elemsize() == 8 && hist_type != typenum_t::CFLOAT) { diff --git a/dpnp/backend/extensions/statistics/histogram_common.hpp b/dpnp/backend/extensions/statistics/histogram_common.hpp index 47fef11061f3..165a93bd981b 100644 --- a/dpnp/backend/extensions/statistics/histogram_common.hpp +++ b/dpnp/backend/extensions/statistics/histogram_common.hpp @@ -42,7 +42,7 @@ namespace statistics::histogram { -using dpctl::tensor::usm_ndarray; +using dpnp::tensor::usm_ndarray; using ext::common::AtomicOp; using ext::common::IsNan; @@ -301,8 +301,8 @@ void submit_histogram(const T *in, } void validate(const usm_ndarray &sample, - const std::optional &bins, - const std::optional &weights, + const std::optional &bins, + const std::optional &weights, const usm_ndarray &histogram); std::uint32_t get_local_hist_copies_count(std::uint32_t loc_mem_size_in_items, diff --git a/dpnp/backend/extensions/statistics/histogramdd.cpp b/dpnp/backend/extensions/statistics/histogramdd.cpp index bd2177073333..cf5f9a8662f8 100644 --- a/dpnp/backend/extensions/statistics/histogramdd.cpp +++ b/dpnp/backend/extensions/statistics/histogramdd.cpp @@ -35,7 +35,7 @@ #include "histogram_common.hpp" #include "histogramdd.hpp" -using dpctl::tensor::usm_ndarray; +using dpnp::tensor::usm_ndarray; using namespace statistics::histogram; using namespace ext::common; @@ -273,11 +273,11 @@ Histogramdd::Histogramdd() : dispatch_table("sample", "histogram") } std::tuple Histogramdd::call( - const dpctl::tensor::usm_ndarray &sample, - const dpctl::tensor::usm_ndarray &bins_edges, - const dpctl::tensor::usm_ndarray &bins_edges_count, - const std::optional &weights, - dpctl::tensor::usm_ndarray &histogram, + const dpnp::tensor::usm_ndarray &sample, + const dpnp::tensor::usm_ndarray &bins_edges, + const dpnp::tensor::usm_ndarray &bins_edges_count, + const std::optional &weights, + dpnp::tensor::usm_ndarray &histogram, const std::vector &depends) { validate(sample, bins_edges, weights, histogram); @@ -314,13 +314,13 @@ std::tuple Histogramdd::call( sycl::event args_ev; if (weights.has_value()) { - args_ev = dpctl::utils::keep_args_alive( + args_ev = dpnp::utils::keep_args_alive( exec_q, {sample, bins_edges, bins_edges_count, weights.value(), histogram}, {ev}); } else { - args_ev = dpctl::utils::keep_args_alive( + args_ev = dpnp::utils::keep_args_alive( exec_q, {sample, bins_edges, bins_edges_count, histogram}, {ev}); } @@ -337,11 +337,11 @@ void statistics::histogram::populate_histogramdd(py::module_ m) auto hist_func = [histp = histdd.get()]( - const dpctl::tensor::usm_ndarray &sample, - const dpctl::tensor::usm_ndarray &bins, - const dpctl::tensor::usm_ndarray &bins_count, - const std::optional &weights, - dpctl::tensor::usm_ndarray &histogram, + const dpnp::tensor::usm_ndarray &sample, + const dpnp::tensor::usm_ndarray &bins, + const dpnp::tensor::usm_ndarray &bins_count, + const std::optional &weights, + dpnp::tensor::usm_ndarray &histogram, const std::vector &depends) { return histp->call(sample, bins, bins_count, weights, histogram, depends); diff --git a/dpnp/backend/extensions/statistics/histogramdd.hpp b/dpnp/backend/extensions/statistics/histogramdd.hpp index d7c46ae34b7d..ae58e2a04479 100644 --- a/dpnp/backend/extensions/statistics/histogramdd.hpp +++ b/dpnp/backend/extensions/statistics/histogramdd.hpp @@ -57,11 +57,11 @@ struct Histogramdd Histogramdd(); std::tuple - call(const dpctl::tensor::usm_ndarray &input, - const dpctl::tensor::usm_ndarray &bins_edges, - const dpctl::tensor::usm_ndarray &bins_edges_count, - const std::optional &weights, - dpctl::tensor::usm_ndarray &output, + call(const dpnp::tensor::usm_ndarray &input, + const dpnp::tensor::usm_ndarray &bins_edges, + const dpnp::tensor::usm_ndarray &bins_edges_count, + const std::optional &weights, + dpnp::tensor::usm_ndarray &output, const std::vector &depends); }; diff --git a/dpnp/backend/extensions/statistics/sliding_dot_product1d.cpp b/dpnp/backend/extensions/statistics/sliding_dot_product1d.cpp index 6c0e39a11a19..3c83bbecb940 100644 --- a/dpnp/backend/extensions/statistics/sliding_dot_product1d.cpp +++ b/dpnp/backend/extensions/statistics/sliding_dot_product1d.cpp @@ -38,7 +38,7 @@ // utils extension header #include "ext/common.hpp" -// dpctl tensor headers +// dpnp tensor headers #include "utils/type_dispatch.hpp" #include "sliding_dot_product1d.hpp" @@ -46,8 +46,8 @@ // #include -namespace dpctl_td_ns = dpctl::tensor::type_dispatch; -using dpctl::tensor::usm_ndarray; +namespace dpnp_td_ns = dpnp::tensor::type_dispatch; +using dpnp::tensor::usm_ndarray; using namespace statistics::sliding_window1d; using namespace ext::common; @@ -119,9 +119,9 @@ SlidingDotProduct1d::SlidingDotProduct1d() : dispatch_table("a") } std::tuple - SlidingDotProduct1d::call(const dpctl::tensor::usm_ndarray &a, - const dpctl::tensor::usm_ndarray &v, - dpctl::tensor::usm_ndarray &out, + SlidingDotProduct1d::call(const dpnp::tensor::usm_ndarray &a, + const dpnp::tensor::usm_ndarray &v, + dpnp::tensor::usm_ndarray &out, const size_t l_pad, const size_t r_pad, const std::vector &depends) @@ -138,7 +138,7 @@ std::tuple a.get_shape(0), v.get_shape(0), l_pad, r_pad, depends); sycl::event args_ev; - args_ev = dpctl::utils::keep_args_alive(exec_q, {a, v, out}, {ev}); + args_ev = dpnp::utils::keep_args_alive(exec_q, {a, v, out}, {ev}); return {args_ev, ev}; } @@ -152,9 +152,9 @@ void statistics::sliding_window1d::populate_sliding_dot_product1d(py::module_ m) sdp.reset(new SlidingDotProduct1d()); auto sdp_func = [sdpp = - sdp.get()](const dpctl::tensor::usm_ndarray &a, - const dpctl::tensor::usm_ndarray &v, - dpctl::tensor::usm_ndarray &out, + sdp.get()](const dpnp::tensor::usm_ndarray &a, + const dpnp::tensor::usm_ndarray &v, + dpnp::tensor::usm_ndarray &out, const size_t l_pad, const size_t r_pad, const std::vector &depends) { return sdpp->call(a, v, out, l_pad, r_pad, depends); diff --git a/dpnp/backend/extensions/statistics/sliding_dot_product1d.hpp b/dpnp/backend/extensions/statistics/sliding_dot_product1d.hpp index 7f4ca5656f4b..131469500016 100644 --- a/dpnp/backend/extensions/statistics/sliding_dot_product1d.hpp +++ b/dpnp/backend/extensions/statistics/sliding_dot_product1d.hpp @@ -51,9 +51,9 @@ struct SlidingDotProduct1d SlidingDotProduct1d(); std::tuple - call(const dpctl::tensor::usm_ndarray &a, - const dpctl::tensor::usm_ndarray &v, - dpctl::tensor::usm_ndarray &output, + call(const dpnp::tensor::usm_ndarray &a, + const dpnp::tensor::usm_ndarray &v, + dpnp::tensor::usm_ndarray &output, const size_t l_pad, const size_t r_pad, const std::vector &depends); diff --git a/dpnp/backend/extensions/statistics/sliding_window1d.cpp b/dpnp/backend/extensions/statistics/sliding_window1d.cpp index 81f8ae40104e..214324808361 100644 --- a/dpnp/backend/extensions/statistics/sliding_window1d.cpp +++ b/dpnp/backend/extensions/statistics/sliding_window1d.cpp @@ -36,14 +36,14 @@ // utils extension header #include "ext/validation_utils.hpp" -// dpctl tensor headers +// dpnp tensor headers #include "utils/type_dispatch.hpp" #include "sliding_window1d.hpp" -namespace dpctl_td_ns = dpctl::tensor::type_dispatch; -using dpctl::tensor::usm_ndarray; -using dpctl_td_ns::typenum_t; +namespace dpnp_td_ns = dpnp::tensor::type_dispatch; +using dpnp::tensor::usm_ndarray; +using dpnp_td_ns::typenum_t; using ext::validation::array_names; using ext::validation::array_ptr; diff --git a/dpnp/backend/extensions/statistics/sliding_window1d.hpp b/dpnp/backend/extensions/statistics/sliding_window1d.hpp index a13c1f873e78..df0ba25919d3 100644 --- a/dpnp/backend/extensions/statistics/sliding_window1d.hpp +++ b/dpnp/backend/extensions/statistics/sliding_window1d.hpp @@ -40,7 +40,7 @@ namespace statistics::sliding_window1d { -using dpctl::tensor::usm_ndarray; +using dpnp::tensor::usm_ndarray; template class _RegistryDataStorage diff --git a/dpnp/backend/extensions/ufunc/elementwise_functions/bitwise_count.cpp b/dpnp/backend/extensions/ufunc/elementwise_functions/bitwise_count.cpp index 761bd330a326..eb0b7edd6d6d 100644 --- a/dpnp/backend/extensions/ufunc/elementwise_functions/bitwise_count.cpp +++ b/dpnp/backend/extensions/ufunc/elementwise_functions/bitwise_count.cpp @@ -42,12 +42,12 @@ #include "kernels/elementwise_functions/bitwise_count.hpp" #include "populate.hpp" -// include a local copy of elementwise common header from dpctl tensor: -// dpctl/tensor/libtensor/source/elementwise_functions/elementwise_functions.hpp -// TODO: replace by including dpctl header once available +// 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" -// dpctl tensor headers +// dpnp tensor headers #include "kernels/elementwise_functions/common.hpp" #include "utils/type_dispatch.hpp" @@ -58,8 +58,8 @@ namespace py_int = dpnp::extensions::py_internal; namespace impl { -namespace ew_cmn_ns = dpctl::tensor::kernels::elementwise_common; -namespace td_ns = dpctl::tensor::type_dispatch; +namespace ew_cmn_ns = dpnp::tensor::kernels::elementwise_common; +namespace td_ns = dpnp::tensor::type_dispatch; /** * @brief A factory to define pairs of supported types for which @@ -118,7 +118,7 @@ MACRO_POPULATE_DISPATCH_VECTORS(bitwise_count); void init_bitwise_count(py::module_ m) { - using arrayT = dpctl::tensor::usm_ndarray; + using arrayT = dpnp::tensor::usm_ndarray; using event_vecT = std::vector; { impl::populate_bitwise_count_dispatch_vectors(); diff --git a/dpnp/backend/extensions/ufunc/elementwise_functions/degrees.cpp b/dpnp/backend/extensions/ufunc/elementwise_functions/degrees.cpp index 729fcb576c77..85aeb6f5f785 100644 --- a/dpnp/backend/extensions/ufunc/elementwise_functions/degrees.cpp +++ b/dpnp/backend/extensions/ufunc/elementwise_functions/degrees.cpp @@ -41,12 +41,12 @@ #include "kernels/elementwise_functions/degrees.hpp" #include "populate.hpp" -// include a local copy of elementwise common header from dpctl tensor: -// dpctl/tensor/libtensor/source/elementwise_functions/elementwise_functions.hpp -// TODO: replace by including dpctl header once available +// 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" -// dpctl tensor headers +// dpnp tensor headers #include "kernels/elementwise_functions/common.hpp" #include "utils/type_dispatch.hpp" @@ -57,8 +57,8 @@ namespace py_int = dpnp::extensions::py_internal; namespace impl { -namespace ew_cmn_ns = dpctl::tensor::kernels::elementwise_common; -namespace td_ns = dpctl::tensor::type_dispatch; +namespace ew_cmn_ns = dpnp::tensor::kernels::elementwise_common; +namespace td_ns = dpnp::tensor::type_dispatch; /** * @brief A factory to define pairs of supported types for which @@ -108,7 +108,7 @@ MACRO_POPULATE_DISPATCH_VECTORS(degrees); void init_degrees(py::module_ m) { - using arrayT = dpctl::tensor::usm_ndarray; + using arrayT = dpnp::tensor::usm_ndarray; using event_vecT = std::vector; { impl::populate_degrees_dispatch_vectors(); diff --git a/dpnp/backend/extensions/ufunc/elementwise_functions/divmod.cpp b/dpnp/backend/extensions/ufunc/elementwise_functions/divmod.cpp index 1bb3859a39f4..c4f34c77018f 100644 --- a/dpnp/backend/extensions/ufunc/elementwise_functions/divmod.cpp +++ b/dpnp/backend/extensions/ufunc/elementwise_functions/divmod.cpp @@ -42,9 +42,9 @@ #include "kernels/elementwise_functions/divmod.hpp" #include "populate.hpp" -// include a local copy of elementwise common header from dpctl tensor: -// dpctl/tensor/libtensor/source/elementwise_functions/elementwise_functions.hpp -// TODO: replace by including dpctl header once available +// 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/common.hpp" @@ -53,7 +53,7 @@ // utils extension header #include "ext/common.hpp" -// dpctl tensor headers +// dpnp tensor headers #include "kernels/elementwise_functions/common.hpp" #include "utils/type_dispatch.hpp" @@ -66,7 +66,7 @@ namespace impl { namespace ew_cmn_ns = dpnp::extensions::py_internal::elementwise_common; namespace td_int_ns = py_int::type_dispatch; -namespace td_ns = dpctl::tensor::type_dispatch; +namespace td_ns = dpnp::tensor::type_dispatch; using dpnp::kernels::divmod::DivmodFunctor; @@ -144,7 +144,7 @@ MACRO_POPULATE_DISPATCH_2OUTS_TABLES(divmod); void init_divmod(py::module_ m) { - using arrayT = dpctl::tensor::usm_ndarray; + using arrayT = dpnp::tensor::usm_ndarray; using event_vecT = std::vector; { impl::populate_divmod_dispatch_tables(); diff --git a/dpnp/backend/extensions/ufunc/elementwise_functions/erf_funcs.cpp b/dpnp/backend/extensions/ufunc/elementwise_functions/erf_funcs.cpp index c07989939b70..de28af11c2b7 100644 --- a/dpnp/backend/extensions/ufunc/elementwise_functions/erf_funcs.cpp +++ b/dpnp/backend/extensions/ufunc/elementwise_functions/erf_funcs.cpp @@ -43,12 +43,12 @@ // utils extension header #include "ext/common.hpp" -// include a local copy of elementwise common header from dpctl tensor: -// dpctl/tensor/libtensor/source/elementwise_functions/elementwise_functions.hpp -// TODO: replace by including dpctl header once available +// 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" -// dpctl tensor headers +// dpnp tensor headers #include "kernels/elementwise_functions/common.hpp" #include "utils/type_dispatch.hpp" @@ -61,8 +61,8 @@ using ext::common::init_dispatch_vector; namespace impl { -namespace ew_cmn_ns = dpctl::tensor::kernels::elementwise_common; -namespace td_ns = dpctl::tensor::type_dispatch; +namespace ew_cmn_ns = dpnp::tensor::kernels::elementwise_common; +namespace td_ns = dpnp::tensor::type_dispatch; /** * @brief A factory to define pairs of supported types for which @@ -201,7 +201,7 @@ static void populate(py::module_ m, init_dispatch_vector( strided_dispatch_vector); - using arrayT = dpctl::tensor::usm_ndarray; + using arrayT = dpnp::tensor::usm_ndarray; auto pyapi = [&, contig_dispatch_vector, strided_dispatch_vector]( const arrayT &src, const arrayT &dst, sycl::queue &exec_q, const std::vector &depends = {}) { diff --git a/dpnp/backend/extensions/ufunc/elementwise_functions/fabs.cpp b/dpnp/backend/extensions/ufunc/elementwise_functions/fabs.cpp index f7c2183633af..0a1878d76c06 100644 --- a/dpnp/backend/extensions/ufunc/elementwise_functions/fabs.cpp +++ b/dpnp/backend/extensions/ufunc/elementwise_functions/fabs.cpp @@ -41,12 +41,12 @@ #include "kernels/elementwise_functions/fabs.hpp" #include "populate.hpp" -// include a local copy of elementwise common header from dpctl tensor: -// dpctl/tensor/libtensor/source/elementwise_functions/elementwise_functions.hpp -// TODO: replace by including dpctl header once available +// 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" -// dpctl tensor headers +// dpnp tensor headers #include "kernels/elementwise_functions/common.hpp" #include "utils/type_dispatch.hpp" @@ -57,8 +57,8 @@ namespace py_int = dpnp::extensions::py_internal; namespace impl { -namespace ew_cmn_ns = dpctl::tensor::kernels::elementwise_common; -namespace td_ns = dpctl::tensor::type_dispatch; +namespace ew_cmn_ns = dpnp::tensor::kernels::elementwise_common; +namespace td_ns = dpnp::tensor::type_dispatch; /** * @brief A factory to define pairs of supported types for which @@ -107,7 +107,7 @@ MACRO_POPULATE_DISPATCH_VECTORS(fabs); void init_fabs(py::module_ m) { - using arrayT = dpctl::tensor::usm_ndarray; + using arrayT = dpnp::tensor::usm_ndarray; using event_vecT = std::vector; { impl::populate_fabs_dispatch_vectors(); diff --git a/dpnp/backend/extensions/ufunc/elementwise_functions/float_power.cpp b/dpnp/backend/extensions/ufunc/elementwise_functions/float_power.cpp index 43927eb93806..452bd1a71d4c 100644 --- a/dpnp/backend/extensions/ufunc/elementwise_functions/float_power.cpp +++ b/dpnp/backend/extensions/ufunc/elementwise_functions/float_power.cpp @@ -43,12 +43,12 @@ // utils extension header #include "ext/common.hpp" -// include a local copy of elementwise common header from dpctl tensor: -// dpctl/tensor/libtensor/source/elementwise_functions/elementwise_functions.hpp -// TODO: replace by including dpctl header once available +// 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" -// dpctl tensor headers +// dpnp tensor headers #include "utils/type_dispatch.hpp" namespace dpnp::extensions::ufunc @@ -58,7 +58,7 @@ namespace py_int = dpnp::extensions::py_internal; namespace impl { -namespace td_ns = dpctl::tensor::type_dispatch; +namespace td_ns = dpnp::tensor::type_dispatch; using ext::common::init_dispatch_table; diff --git a/dpnp/backend/extensions/ufunc/elementwise_functions/fmax.cpp b/dpnp/backend/extensions/ufunc/elementwise_functions/fmax.cpp index 9471feaf2166..266da7c3c51c 100644 --- a/dpnp/backend/extensions/ufunc/elementwise_functions/fmax.cpp +++ b/dpnp/backend/extensions/ufunc/elementwise_functions/fmax.cpp @@ -40,12 +40,12 @@ #include "kernels/elementwise_functions/fmax.hpp" #include "populate.hpp" -// include a local copy of elementwise common header from dpctl tensor: -// dpctl/tensor/libtensor/source/elementwise_functions/elementwise_functions.hpp -// TODO: replace by including dpctl header once available +// 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" -// dpctl tensor headers +// dpnp tensor headers #include "kernels/elementwise_functions/common.hpp" #include "kernels/elementwise_functions/maximum.hpp" #include "utils/type_dispatch.hpp" @@ -54,14 +54,15 @@ namespace dpnp::extensions::ufunc { namespace py = pybind11; namespace py_int = dpnp::extensions::py_internal; -namespace td_ns = dpctl::tensor::type_dispatch; +namespace td_ns = dpnp::tensor::type_dispatch; namespace impl { -namespace ew_cmn_ns = dpctl::tensor::kernels::elementwise_common; -namespace max_ns = dpctl::tensor::kernels::maximum; +namespace ew_cmn_ns = dpnp::tensor::kernels::elementwise_common; +namespace max_ns = dpnp::tensor::kernels::maximum; -// Supports the same types table as for maximum function in dpctl +// TODO: remove comment when libtensor and backend are consolidated +// Supports the same types table as for maximum function in tensor template using OutputType = max_ns::MaximumOutputType; @@ -106,7 +107,7 @@ MACRO_POPULATE_DISPATCH_TABLES(fmax); void init_fmax(py::module_ m) { - using arrayT = dpctl::tensor::usm_ndarray; + using arrayT = dpnp::tensor::usm_ndarray; using event_vecT = std::vector; { impl::populate_fmax_dispatch_tables(); diff --git a/dpnp/backend/extensions/ufunc/elementwise_functions/fmin.cpp b/dpnp/backend/extensions/ufunc/elementwise_functions/fmin.cpp index 8e279897f414..9d3a4eef3f7a 100644 --- a/dpnp/backend/extensions/ufunc/elementwise_functions/fmin.cpp +++ b/dpnp/backend/extensions/ufunc/elementwise_functions/fmin.cpp @@ -40,12 +40,12 @@ #include "kernels/elementwise_functions/fmin.hpp" #include "populate.hpp" -// include a local copy of elementwise common header from dpctl tensor: -// dpctl/tensor/libtensor/source/elementwise_functions/elementwise_functions.hpp -// TODO: replace by including dpctl header once available +// 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" -// dpctl tensor headers +// dpnp tensor headers #include "kernels/elementwise_functions/common.hpp" #include "kernels/elementwise_functions/minimum.hpp" #include "utils/type_dispatch.hpp" @@ -54,14 +54,15 @@ namespace dpnp::extensions::ufunc { namespace py = pybind11; namespace py_int = dpnp::extensions::py_internal; -namespace td_ns = dpctl::tensor::type_dispatch; +namespace td_ns = dpnp::tensor::type_dispatch; namespace impl { -namespace ew_cmn_ns = dpctl::tensor::kernels::elementwise_common; -namespace min_ns = dpctl::tensor::kernels::minimum; +namespace ew_cmn_ns = dpnp::tensor::kernels::elementwise_common; +namespace min_ns = dpnp::tensor::kernels::minimum; -// Supports the same types table as for minimum function in dpctl +// TODO: remove comment when libtensor and backend are consolidated +// Supports the same types table as for minimum function in tensor template using OutputType = min_ns::MinimumOutputType; @@ -106,7 +107,7 @@ MACRO_POPULATE_DISPATCH_TABLES(fmin); void init_fmin(py::module_ m) { - using arrayT = dpctl::tensor::usm_ndarray; + using arrayT = dpnp::tensor::usm_ndarray; using event_vecT = std::vector; { impl::populate_fmin_dispatch_tables(); diff --git a/dpnp/backend/extensions/ufunc/elementwise_functions/fmod.cpp b/dpnp/backend/extensions/ufunc/elementwise_functions/fmod.cpp index 83fb750b6907..1fcb4505c9b3 100644 --- a/dpnp/backend/extensions/ufunc/elementwise_functions/fmod.cpp +++ b/dpnp/backend/extensions/ufunc/elementwise_functions/fmod.cpp @@ -42,12 +42,12 @@ #include "kernels/elementwise_functions/fmod.hpp" #include "populate.hpp" -// include a local copy of elementwise common header from dpctl tensor: -// dpctl/tensor/libtensor/source/elementwise_functions/elementwise_functions.hpp -// TODO: replace by including dpctl header once available +// 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" -// dpctl tensor headers +// dpnp tensor headers #include "kernels/elementwise_functions/common.hpp" #include "utils/type_dispatch.hpp" @@ -55,11 +55,11 @@ namespace dpnp::extensions::ufunc { namespace py = pybind11; namespace py_int = dpnp::extensions::py_internal; -namespace td_ns = dpctl::tensor::type_dispatch; +namespace td_ns = dpnp::tensor::type_dispatch; namespace impl { -namespace ew_cmn_ns = dpctl::tensor::kernels::elementwise_common; +namespace ew_cmn_ns = dpnp::tensor::kernels::elementwise_common; /** * @brief A factory to define pairs of supported types for which @@ -164,7 +164,7 @@ MACRO_POPULATE_DISPATCH_TABLES(fmod); void init_fmod(py::module_ m) { - using arrayT = dpctl::tensor::usm_ndarray; + using arrayT = dpnp::tensor::usm_ndarray; using event_vecT = std::vector; { impl::populate_fmod_dispatch_tables(); diff --git a/dpnp/backend/extensions/ufunc/elementwise_functions/frexp.cpp b/dpnp/backend/extensions/ufunc/elementwise_functions/frexp.cpp index 17e09f3ee816..ffcca71c2dfc 100644 --- a/dpnp/backend/extensions/ufunc/elementwise_functions/frexp.cpp +++ b/dpnp/backend/extensions/ufunc/elementwise_functions/frexp.cpp @@ -43,9 +43,9 @@ #include "kernels/elementwise_functions/frexp.hpp" #include "populate.hpp" -// include a local copy of elementwise common header from dpctl tensor: -// dpctl/tensor/libtensor/source/elementwise_functions/elementwise_functions.hpp -// TODO: replace by including dpctl header once available +// 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/common.hpp" @@ -54,7 +54,7 @@ // utils extension header #include "ext/common.hpp" -// dpctl tensor headers +// dpnp tensor headers #include "kernels/elementwise_functions/common.hpp" #include "utils/type_dispatch.hpp" @@ -67,7 +67,7 @@ namespace impl { namespace ew_cmn_ns = dpnp::extensions::py_internal::elementwise_common; namespace td_int_ns = py_int::type_dispatch; -namespace td_ns = dpctl::tensor::type_dispatch; +namespace td_ns = dpnp::tensor::type_dispatch; using dpnp::kernels::frexp::FrexpFunctor; @@ -122,7 +122,7 @@ MACRO_POPULATE_DISPATCH_2OUTS_VECTORS(frexp); void init_frexp(py::module_ m) { - using arrayT = dpctl::tensor::usm_ndarray; + using arrayT = dpnp::tensor::usm_ndarray; using event_vecT = std::vector; { impl::populate_frexp_dispatch_vectors(); diff --git a/dpnp/backend/extensions/ufunc/elementwise_functions/gcd.cpp b/dpnp/backend/extensions/ufunc/elementwise_functions/gcd.cpp index 0481365356ca..ec882f796daf 100644 --- a/dpnp/backend/extensions/ufunc/elementwise_functions/gcd.cpp +++ b/dpnp/backend/extensions/ufunc/elementwise_functions/gcd.cpp @@ -42,12 +42,12 @@ #include "kernels/elementwise_functions/gcd.hpp" #include "populate.hpp" -// include a local copy of elementwise common header from dpctl tensor: -// dpctl/tensor/libtensor/source/elementwise_functions/elementwise_functions.hpp -// TODO: replace by including dpctl header once available +// 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" -// dpctl tensor headers +// dpnp tensor headers #include "kernels/elementwise_functions/common.hpp" #include "utils/type_dispatch.hpp" @@ -55,11 +55,11 @@ namespace dpnp::extensions::ufunc { namespace py = pybind11; namespace py_int = dpnp::extensions::py_internal; -namespace td_ns = dpctl::tensor::type_dispatch; +namespace td_ns = dpnp::tensor::type_dispatch; namespace impl { -namespace ew_cmn_ns = dpctl::tensor::kernels::elementwise_common; +namespace ew_cmn_ns = dpnp::tensor::kernels::elementwise_common; template struct OutputType @@ -150,7 +150,7 @@ MACRO_POPULATE_DISPATCH_TABLES(gcd); void init_gcd(py::module_ m) { - using arrayT = dpctl::tensor::usm_ndarray; + using arrayT = dpnp::tensor::usm_ndarray; using event_vecT = std::vector; { impl::populate_gcd_dispatch_tables(); diff --git a/dpnp/backend/extensions/ufunc/elementwise_functions/heaviside.cpp b/dpnp/backend/extensions/ufunc/elementwise_functions/heaviside.cpp index 62affd206420..a1da9af70b22 100644 --- a/dpnp/backend/extensions/ufunc/elementwise_functions/heaviside.cpp +++ b/dpnp/backend/extensions/ufunc/elementwise_functions/heaviside.cpp @@ -41,12 +41,12 @@ #include "kernels/elementwise_functions/heaviside.hpp" #include "populate.hpp" -// include a local copy of elementwise common header from dpctl tensor: -// dpctl/tensor/libtensor/source/elementwise_functions/elementwise_functions.hpp -// TODO: replace by including dpctl header once available +// 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" -// dpctl tensor headers +// dpnp tensor headers #include "kernels/elementwise_functions/common.hpp" #include "utils/type_dispatch.hpp" @@ -54,11 +54,11 @@ namespace dpnp::extensions::ufunc { namespace py = pybind11; namespace py_int = dpnp::extensions::py_internal; -namespace td_ns = dpctl::tensor::type_dispatch; +namespace td_ns = dpnp::tensor::type_dispatch; namespace impl { -namespace ew_cmn_ns = dpctl::tensor::kernels::elementwise_common; +namespace ew_cmn_ns = dpnp::tensor::kernels::elementwise_common; template struct OutputType @@ -116,7 +116,7 @@ MACRO_POPULATE_DISPATCH_TABLES(heaviside); void init_heaviside(py::module_ m) { - using arrayT = dpctl::tensor::usm_ndarray; + using arrayT = dpnp::tensor::usm_ndarray; using event_vecT = std::vector; { impl::populate_heaviside_dispatch_tables(); diff --git a/dpnp/backend/extensions/ufunc/elementwise_functions/i0.cpp b/dpnp/backend/extensions/ufunc/elementwise_functions/i0.cpp index 53ded341b58b..087f07eabcaa 100644 --- a/dpnp/backend/extensions/ufunc/elementwise_functions/i0.cpp +++ b/dpnp/backend/extensions/ufunc/elementwise_functions/i0.cpp @@ -41,12 +41,12 @@ #include "kernels/elementwise_functions/i0.hpp" #include "populate.hpp" -// include a local copy of elementwise common header from dpctl tensor: -// dpctl/tensor/libtensor/source/elementwise_functions/elementwise_functions.hpp -// TODO: replace by including dpctl header once available +// 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" -// dpctl tensor headers +// dpnp tensor headers #include "kernels/elementwise_functions/common.hpp" #include "utils/type_dispatch.hpp" @@ -57,8 +57,8 @@ namespace py_int = dpnp::extensions::py_internal; namespace impl { -namespace ew_cmn_ns = dpctl::tensor::kernels::elementwise_common; -namespace td_ns = dpctl::tensor::type_dispatch; +namespace ew_cmn_ns = dpnp::tensor::kernels::elementwise_common; +namespace td_ns = dpnp::tensor::type_dispatch; /** * @brief A factory to define pairs of supported types for which @@ -106,7 +106,7 @@ MACRO_POPULATE_DISPATCH_VECTORS(i0); void init_i0(py::module_ m) { - using arrayT = dpctl::tensor::usm_ndarray; + using arrayT = dpnp::tensor::usm_ndarray; using event_vecT = std::vector; { impl::populate_i0_dispatch_vectors(); diff --git a/dpnp/backend/extensions/ufunc/elementwise_functions/interpolate.cpp b/dpnp/backend/extensions/ufunc/elementwise_functions/interpolate.cpp index 36dae50e7b2c..ac2fe72f6149 100644 --- a/dpnp/backend/extensions/ufunc/elementwise_functions/interpolate.cpp +++ b/dpnp/backend/extensions/ufunc/elementwise_functions/interpolate.cpp @@ -45,7 +45,7 @@ #include "kernels/elementwise_functions/interpolate.hpp" -// dpctl tensor headers +// dpnp tensor headers #include "utils/type_dispatch.hpp" #include "utils/type_utils.hpp" @@ -59,8 +59,8 @@ namespace py = pybind11; namespace impl { -namespace td_ns = dpctl::tensor::type_dispatch; -namespace type_utils = dpctl::tensor::type_utils; +namespace td_ns = dpnp::tensor::type_dispatch; +namespace type_utils = dpnp::tensor::type_utils; template using value_type_of_t = typename ext::common::value_type_of::type; @@ -94,7 +94,7 @@ sycl::event interpolate_impl(sycl::queue &q, const std::size_t xp_size, const std::vector &depends) { - dpctl::tensor::type_utils::validate_type_for_device(q); + dpnp::tensor::type_utils::validate_type_for_device(q); using type_utils::is_complex_v; using TCoord = std::conditional_t, value_type_of_t, T>; @@ -163,13 +163,13 @@ using ext::validation::check_same_dtype; using ext::validation::check_same_size; using ext::validation::common_checks; -void validate(const dpctl::tensor::usm_ndarray &x, - const dpctl::tensor::usm_ndarray &idx, - const dpctl::tensor::usm_ndarray &xp, - const dpctl::tensor::usm_ndarray &fp, - const dpctl::tensor::usm_ndarray &out, - const std::optional &left, - const std::optional &right) +void validate(const dpnp::tensor::usm_ndarray &x, + const dpnp::tensor::usm_ndarray &idx, + const dpnp::tensor::usm_ndarray &xp, + const dpnp::tensor::usm_ndarray &fp, + const dpnp::tensor::usm_ndarray &out, + const std::optional &left, + const std::optional &right) { array_names names = {{&x, "x"}, {&xp, "xp"}, {&fp, "fp"}, {&out, "out"}}; @@ -202,13 +202,13 @@ void validate(const dpctl::tensor::usm_ndarray &x, } // namespace detail std::pair - py_interpolate(const dpctl::tensor::usm_ndarray &x, - const dpctl::tensor::usm_ndarray &idx, - const dpctl::tensor::usm_ndarray &xp, - const dpctl::tensor::usm_ndarray &fp, - std::optional &left, - std::optional &right, - dpctl::tensor::usm_ndarray &out, + py_interpolate(const dpnp::tensor::usm_ndarray &x, + const dpnp::tensor::usm_ndarray &idx, + const dpnp::tensor::usm_ndarray &xp, + const dpnp::tensor::usm_ndarray &fp, + std::optional &left, + std::optional &right, + dpnp::tensor::usm_ndarray &out, sycl::queue &exec_q, const std::vector &depends) { @@ -240,17 +240,17 @@ std::pair sycl::event args_ev; if (left && right) { - args_ev = dpctl::utils::keep_args_alive( + args_ev = dpnp::utils::keep_args_alive( exec_q, {x, idx, xp, fp, out, left.value(), right.value()}, {ev}); } else if (left || right) { - args_ev = dpctl::utils::keep_args_alive( + args_ev = dpnp::utils::keep_args_alive( exec_q, {x, idx, xp, fp, out, left ? left.value() : right.value()}, {ev}); } else { args_ev = - dpctl::utils::keep_args_alive(exec_q, {x, idx, xp, fp, out}, {ev}); + dpnp::utils::keep_args_alive(exec_q, {x, idx, xp, fp, out}, {ev}); } return std::make_pair(args_ev, ev); diff --git a/dpnp/backend/extensions/ufunc/elementwise_functions/isclose.cpp b/dpnp/backend/extensions/ufunc/elementwise_functions/isclose.cpp index 3025cbf16586..fa882a6d62ff 100644 --- a/dpnp/backend/extensions/ufunc/elementwise_functions/isclose.cpp +++ b/dpnp/backend/extensions/ufunc/elementwise_functions/isclose.cpp @@ -44,7 +44,7 @@ #include "../../elementwise_functions/simplify_iteration_space.hpp" -// dpctl tensor headers +// dpnp tensor headers #include "utils/offset_utils.hpp" #include "utils/output_validation.hpp" #include "utils/type_dispatch.hpp" @@ -55,7 +55,7 @@ #include "ext/validation_utils.hpp" namespace py = pybind11; -namespace td_ns = dpctl::tensor::type_dispatch; +namespace td_ns = dpnp::tensor::type_dispatch; using ext::common::value_type_of_t; using ext::validation::array_names; @@ -108,7 +108,7 @@ sycl::event isclose_strided_scalar_call(sycl::queue &exec_q, py::ssize_t out_offset, const std::vector &depends) { - using dpctl::tensor::type_utils::is_complex_v; + using dpnp::tensor::type_utils::is_complex_v; using scT = std::conditional_t, value_type_of_t, T>; const scT rtol = py::cast(py_rtol); @@ -142,7 +142,7 @@ sycl::event isclose_contig_scalar_call(sycl::queue &q, char *out_p, const std::vector &depends) { - using dpctl::tensor::type_utils::is_complex_v; + using dpnp::tensor::type_utils::is_complex_v; using scT = std::conditional_t, value_type_of_t, T>; const scT rtol = py::cast(py_rtol); @@ -158,12 +158,12 @@ isclose_strided_scalar_fn_ptr_t isclose_contig_scalar_fn_ptr_t isclose_contig_dispatch_vector[td_ns::num_types]; std::pair - py_isclose_scalar(const dpctl::tensor::usm_ndarray &a, - const dpctl::tensor::usm_ndarray &b, + py_isclose_scalar(const dpnp::tensor::usm_ndarray &a, + const dpnp::tensor::usm_ndarray &b, const py::object &py_rtol, const py::object &py_atol, const py::object &py_equal_nan, - const dpctl::tensor::usm_ndarray &res, + const dpnp::tensor::usm_ndarray &res, sycl::queue &exec_q, const std::vector &depends) { @@ -204,7 +204,7 @@ std::pair return std::make_pair(sycl::event(), sycl::event()); } - dpctl::tensor::validation::AmpleMemory::throw_if_not_ample(res, nelems); + dpnp::tensor::validation::AmpleMemory::throw_if_not_ample(res, nelems); const char *a_data = a.get_data(); const char *b_data = b.get_data(); @@ -238,7 +238,7 @@ std::pair auto comp_ev = contig_fn(exec_q, nelems, py_rtol, py_atol, py_equal_nan, a_data, b_data, res_data, depends); sycl::event ht_ev = - dpctl::utils::keep_args_alive(exec_q, {a, b, res}, {comp_ev}); + dpnp::utils::keep_args_alive(exec_q, {a, b, res}, {comp_ev}); return std::make_pair(ht_ev, comp_ev); } @@ -278,7 +278,7 @@ std::pair "data type"); } - using dpctl::tensor::offset_utils::device_allocate_and_pack; + using dpnp::tensor::offset_utils::device_allocate_and_pack; std::vector host_tasks{}; host_tasks.reserve(2); @@ -300,14 +300,13 @@ std::pair a_data, a_offset, b_data, b_offset, res_data, res_offset, all_deps); // async free of shape_strides temporary - sycl::event tmp_cleanup_ev = dpctl::tensor::alloc_utils::async_smart_free( + sycl::event tmp_cleanup_ev = dpnp::tensor::alloc_utils::async_smart_free( exec_q, {comp_ev}, shape_strides_owner); host_tasks.push_back(tmp_cleanup_ev); return std::make_pair( - dpctl::utils::keep_args_alive(exec_q, {a, b, res}, host_tasks), - comp_ev); + dpnp::utils::keep_args_alive(exec_q, {a, b, res}, host_tasks), comp_ev); } /** diff --git a/dpnp/backend/extensions/ufunc/elementwise_functions/lcm.cpp b/dpnp/backend/extensions/ufunc/elementwise_functions/lcm.cpp index 35138e903eac..0f58d27816d8 100644 --- a/dpnp/backend/extensions/ufunc/elementwise_functions/lcm.cpp +++ b/dpnp/backend/extensions/ufunc/elementwise_functions/lcm.cpp @@ -42,12 +42,12 @@ #include "lcm.hpp" #include "populate.hpp" -// include a local copy of elementwise common header from dpctl tensor: -// dpctl/tensor/libtensor/source/elementwise_functions/elementwise_functions.hpp -// TODO: replace by including dpctl header once available +// 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" -// dpctl tensor headers +// dpnp tensor headers #include "kernels/elementwise_functions/common.hpp" #include "utils/type_dispatch.hpp" @@ -55,11 +55,11 @@ namespace dpnp::extensions::ufunc { namespace py = pybind11; namespace py_int = dpnp::extensions::py_internal; -namespace td_ns = dpctl::tensor::type_dispatch; +namespace td_ns = dpnp::tensor::type_dispatch; namespace impl { -namespace ew_cmn_ns = dpctl::tensor::kernels::elementwise_common; +namespace ew_cmn_ns = dpnp::tensor::kernels::elementwise_common; template struct OutputType @@ -150,7 +150,7 @@ MACRO_POPULATE_DISPATCH_TABLES(lcm); void init_lcm(py::module_ m) { - using arrayT = dpctl::tensor::usm_ndarray; + using arrayT = dpnp::tensor::usm_ndarray; using event_vecT = std::vector; { impl::populate_lcm_dispatch_tables(); diff --git a/dpnp/backend/extensions/ufunc/elementwise_functions/ldexp.cpp b/dpnp/backend/extensions/ufunc/elementwise_functions/ldexp.cpp index 44ef51726a6a..416b7443d276 100644 --- a/dpnp/backend/extensions/ufunc/elementwise_functions/ldexp.cpp +++ b/dpnp/backend/extensions/ufunc/elementwise_functions/ldexp.cpp @@ -42,12 +42,12 @@ #include "ldexp.hpp" #include "populate.hpp" -// include a local copy of elementwise common header from dpctl tensor: -// dpctl/tensor/libtensor/source/elementwise_functions/elementwise_functions.hpp -// TODO: replace by including dpctl header once available +// 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" -// dpctl tensor headers +// dpnp tensor headers #include "kernels/elementwise_functions/common.hpp" #include "utils/type_dispatch.hpp" @@ -55,11 +55,11 @@ namespace dpnp::extensions::ufunc { namespace py = pybind11; namespace py_int = dpnp::extensions::py_internal; -namespace td_ns = dpctl::tensor::type_dispatch; +namespace td_ns = dpnp::tensor::type_dispatch; namespace impl { -namespace ew_cmn_ns = dpctl::tensor::kernels::elementwise_common; +namespace ew_cmn_ns = dpnp::tensor::kernels::elementwise_common; template struct OutputType @@ -138,7 +138,7 @@ MACRO_POPULATE_DISPATCH_TABLES(ldexp); void init_ldexp(py::module_ m) { - using arrayT = dpctl::tensor::usm_ndarray; + using arrayT = dpnp::tensor::usm_ndarray; using event_vecT = std::vector; { impl::populate_ldexp_dispatch_tables(); diff --git a/dpnp/backend/extensions/ufunc/elementwise_functions/logaddexp2.cpp b/dpnp/backend/extensions/ufunc/elementwise_functions/logaddexp2.cpp index e37f13b119d6..54ad4d86af8a 100644 --- a/dpnp/backend/extensions/ufunc/elementwise_functions/logaddexp2.cpp +++ b/dpnp/backend/extensions/ufunc/elementwise_functions/logaddexp2.cpp @@ -40,12 +40,12 @@ #include "logaddexp2.hpp" #include "populate.hpp" -// include a local copy of elementwise common header from dpctl tensor: -// dpctl/tensor/libtensor/source/elementwise_functions/elementwise_functions.hpp -// TODO: replace by including dpctl header once available +// 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" -// dpctl tensor headers +// dpnp tensor headers #include "kernels/elementwise_functions/common.hpp" #include "kernels/elementwise_functions/logaddexp.hpp" #include "utils/type_dispatch.hpp" @@ -54,14 +54,15 @@ namespace dpnp::extensions::ufunc { namespace py = pybind11; namespace py_int = dpnp::extensions::py_internal; -namespace td_ns = dpctl::tensor::type_dispatch; +namespace td_ns = dpnp::tensor::type_dispatch; namespace impl { -namespace ew_cmn_ns = dpctl::tensor::kernels::elementwise_common; -namespace logaddexp_ns = dpctl::tensor::kernels::logaddexp; +namespace ew_cmn_ns = dpnp::tensor::kernels::elementwise_common; +namespace logaddexp_ns = dpnp::tensor::kernels::logaddexp; -// Supports the same types table as for logaddexp function in dpctl +// TODO: remove comment when libtensor and backend are consolidated +// Supports the same types table as for logaddexp function in tensor template using OutputType = logaddexp_ns::LogAddExpOutputType; @@ -106,7 +107,7 @@ MACRO_POPULATE_DISPATCH_TABLES(logaddexp2); void init_logaddexp2(py::module_ m) { - using arrayT = dpctl::tensor::usm_ndarray; + using arrayT = dpnp::tensor::usm_ndarray; using event_vecT = std::vector; { impl::populate_logaddexp2_dispatch_tables(); diff --git a/dpnp/backend/extensions/ufunc/elementwise_functions/modf.cpp b/dpnp/backend/extensions/ufunc/elementwise_functions/modf.cpp index 266103248521..6f855bdc03af 100644 --- a/dpnp/backend/extensions/ufunc/elementwise_functions/modf.cpp +++ b/dpnp/backend/extensions/ufunc/elementwise_functions/modf.cpp @@ -43,9 +43,9 @@ #include "modf.hpp" #include "populate.hpp" -// include a local copy of elementwise common header from dpctl tensor: -// dpctl/tensor/libtensor/source/elementwise_functions/elementwise_functions.hpp -// TODO: replace by including dpctl header once available +// 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/common.hpp" @@ -54,7 +54,7 @@ // utils extension header #include "ext/common.hpp" -// dpctl tensor headers +// dpnp tensor headers #include "kernels/elementwise_functions/common.hpp" #include "utils/type_dispatch.hpp" @@ -67,7 +67,7 @@ namespace impl { namespace ew_cmn_ns = dpnp::extensions::py_internal::elementwise_common; namespace td_int_ns = py_int::type_dispatch; -namespace td_ns = dpctl::tensor::type_dispatch; +namespace td_ns = dpnp::tensor::type_dispatch; using dpnp::kernels::modf::ModfFunctor; @@ -121,7 +121,7 @@ MACRO_POPULATE_DISPATCH_2OUTS_VECTORS(modf); void init_modf(py::module_ m) { - using arrayT = dpctl::tensor::usm_ndarray; + using arrayT = dpnp::tensor::usm_ndarray; using event_vecT = std::vector; { impl::populate_modf_dispatch_vectors(); diff --git a/dpnp/backend/extensions/ufunc/elementwise_functions/nan_to_num.cpp b/dpnp/backend/extensions/ufunc/elementwise_functions/nan_to_num.cpp index c30d388f8afd..b5c3c7aa4f39 100644 --- a/dpnp/backend/extensions/ufunc/elementwise_functions/nan_to_num.cpp +++ b/dpnp/backend/extensions/ufunc/elementwise_functions/nan_to_num.cpp @@ -48,7 +48,7 @@ #include "../../elementwise_functions/simplify_iteration_space.hpp" -// dpctl tensor headers +// dpnp tensor headers #include "utils/memory_overlap.hpp" #include "utils/offset_utils.hpp" #include "utils/output_validation.hpp" @@ -60,7 +60,7 @@ #include "ext/common.hpp" namespace py = pybind11; -namespace td_ns = dpctl::tensor::type_dispatch; +namespace td_ns = dpnp::tensor::type_dispatch; using ext::common::value_type_of; @@ -102,7 +102,7 @@ sycl::event nan_to_num_strided_call(sycl::queue &exec_q, py::ssize_t dst_offset, const std::vector &depends) { - using dpctl::tensor::type_utils::is_complex_v; + using dpnp::tensor::type_utils::is_complex_v; using scT = std::conditional_t, value_type_of_t, T>; const scT nan_v = py::cast(py_nan); @@ -137,7 +137,7 @@ sycl::event nan_to_num_contig_call(sycl::queue &exec_q, char *dst_p, const std::vector &depends) { - using dpctl::tensor::type_utils::is_complex_v; + using dpnp::tensor::type_utils::is_complex_v; using scT = std::conditional_t, value_type_of_t, T>; const scT nan_v = py::cast(py_nan); @@ -151,16 +151,16 @@ sycl::event nan_to_num_contig_call(sycl::queue &exec_q, return to_num_contig_ev; } -namespace td_ns = dpctl::tensor::type_dispatch; +namespace td_ns = dpnp::tensor::type_dispatch; nan_to_num_fn_ptr_t nan_to_num_dispatch_vector[td_ns::num_types]; nan_to_num_contig_fn_ptr_t nan_to_num_contig_dispatch_vector[td_ns::num_types]; std::pair - py_nan_to_num(const dpctl::tensor::usm_ndarray &src, + py_nan_to_num(const dpnp::tensor::usm_ndarray &src, const py::object &py_nan, const py::object &py_posinf, const py::object &py_neginf, - const dpctl::tensor::usm_ndarray &dst, + const dpnp::tensor::usm_ndarray &dst, sycl::queue &q, const std::vector &depends) { @@ -175,12 +175,12 @@ std::pair throw py::value_error("Array data types are not the same."); } - if (!dpctl::utils::queues_are_compatible(q, {src, dst})) { + if (!dpnp::utils::queues_are_compatible(q, {src, dst})) { throw py::value_error( "Execution queue is not compatible with allocation queues"); } - dpctl::tensor::validation::CheckWritable::throw_if_not_writable(dst); + dpnp::tensor::validation::CheckWritable::throw_if_not_writable(dst); const int src_nd = src.get_ndim(); if (src_nd != dst.get_ndim()) { @@ -202,12 +202,12 @@ std::pair return std::make_pair(sycl::event(), sycl::event()); } - dpctl::tensor::validation::AmpleMemory::throw_if_not_ample(dst, nelems); + dpnp::tensor::validation::AmpleMemory::throw_if_not_ample(dst, nelems); // check memory overlap - auto const &overlap = dpctl::tensor::overlap::MemoryOverlap(); + auto const &overlap = dpnp::tensor::overlap::MemoryOverlap(); auto const &same_logical_tensors = - dpctl::tensor::overlap::SameLogicalTensors(); + dpnp::tensor::overlap::SameLogicalTensors(); if (overlap(src, dst) && !same_logical_tensors(src, dst)) { throw py::value_error("Arrays index overlapping segments of memory"); } @@ -237,7 +237,7 @@ std::pair auto comp_ev = contig_fn(q, nelems, py_nan, py_posinf, py_neginf, src_data, dst_data, depends); sycl::event ht_ev = - dpctl::utils::keep_args_alive(q, {src, dst}, {comp_ev}); + dpnp::utils::keep_args_alive(q, {src, dst}, {comp_ev}); return std::make_pair(ht_ev, comp_ev); } @@ -284,7 +284,7 @@ std::pair dst_data + dst_elem_size * dst_offset, depends); sycl::event ht_ev = - dpctl::utils::keep_args_alive(q, {src, dst}, {comp_ev}); + dpnp::utils::keep_args_alive(q, {src, dst}, {comp_ev}); return std::make_pair(ht_ev, comp_ev); } @@ -297,7 +297,7 @@ std::pair std::to_string(src_typeid)); } - using dpctl::tensor::offset_utils::device_allocate_and_pack; + using dpnp::tensor::offset_utils::device_allocate_and_pack; std::vector host_tasks{}; host_tasks.reserve(2); @@ -319,13 +319,13 @@ std::pair src_offset, dst_data, dst_offset, all_deps); // async free of shape_strides temporary - sycl::event tmp_cleanup_ev = dpctl::tensor::alloc_utils::async_smart_free( + sycl::event tmp_cleanup_ev = dpnp::tensor::alloc_utils::async_smart_free( q, {comp_ev}, shape_strides_owner); host_tasks.push_back(tmp_cleanup_ev); return std::make_pair( - dpctl::utils::keep_args_alive(q, {src, dst}, host_tasks), comp_ev); + dpnp::utils::keep_args_alive(q, {src, dst}, host_tasks), comp_ev); } /** diff --git a/dpnp/backend/extensions/ufunc/elementwise_functions/radians.cpp b/dpnp/backend/extensions/ufunc/elementwise_functions/radians.cpp index 0a481fd33d11..10bfe47a3ab2 100644 --- a/dpnp/backend/extensions/ufunc/elementwise_functions/radians.cpp +++ b/dpnp/backend/extensions/ufunc/elementwise_functions/radians.cpp @@ -41,12 +41,12 @@ #include "populate.hpp" #include "radians.hpp" -// include a local copy of elementwise common header from dpctl tensor: -// dpctl/tensor/libtensor/source/elementwise_functions/elementwise_functions.hpp -// TODO: replace by including dpctl header once available +// 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" -// dpctl tensor headers +// dpnp tensor headers #include "kernels/elementwise_functions/common.hpp" #include "utils/type_dispatch.hpp" @@ -57,8 +57,8 @@ namespace py_int = dpnp::extensions::py_internal; namespace impl { -namespace ew_cmn_ns = dpctl::tensor::kernels::elementwise_common; -namespace td_ns = dpctl::tensor::type_dispatch; +namespace ew_cmn_ns = dpnp::tensor::kernels::elementwise_common; +namespace td_ns = dpnp::tensor::type_dispatch; /** * @brief A factory to define pairs of supported types for which @@ -108,7 +108,7 @@ MACRO_POPULATE_DISPATCH_VECTORS(radians); void init_radians(py::module_ m) { - using arrayT = dpctl::tensor::usm_ndarray; + using arrayT = dpnp::tensor::usm_ndarray; using event_vecT = std::vector; { impl::populate_radians_dispatch_vectors(); diff --git a/dpnp/backend/extensions/ufunc/elementwise_functions/sinc.cpp b/dpnp/backend/extensions/ufunc/elementwise_functions/sinc.cpp index 87a911472db2..d0fcbaaa2eee 100644 --- a/dpnp/backend/extensions/ufunc/elementwise_functions/sinc.cpp +++ b/dpnp/backend/extensions/ufunc/elementwise_functions/sinc.cpp @@ -42,12 +42,12 @@ #include "populate.hpp" #include "sinc.hpp" -// include a local copy of elementwise common header from dpctl tensor: -// dpctl/tensor/libtensor/source/elementwise_functions/elementwise_functions.hpp -// TODO: replace by including dpctl header once available +// 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" -// dpctl tensor headers +// dpnp tensor headers #include "kernels/elementwise_functions/common.hpp" #include "utils/type_dispatch.hpp" @@ -58,8 +58,8 @@ namespace py_int = dpnp::extensions::py_internal; namespace impl { -namespace ew_cmn_ns = dpctl::tensor::kernels::elementwise_common; -namespace td_ns = dpctl::tensor::type_dispatch; +namespace ew_cmn_ns = dpnp::tensor::kernels::elementwise_common; +namespace td_ns = dpnp::tensor::type_dispatch; /** * @brief A factory to define pairs of supported types for which @@ -110,7 +110,7 @@ MACRO_POPULATE_DISPATCH_VECTORS(sinc); void init_sinc(py::module_ m) { - using arrayT = dpctl::tensor::usm_ndarray; + using arrayT = dpnp::tensor::usm_ndarray; using event_vecT = std::vector; { impl::populate_sinc_dispatch_vectors(); diff --git a/dpnp/backend/extensions/ufunc/elementwise_functions/spacing.cpp b/dpnp/backend/extensions/ufunc/elementwise_functions/spacing.cpp index 4c14582f30ae..3d3fdf45ffd7 100644 --- a/dpnp/backend/extensions/ufunc/elementwise_functions/spacing.cpp +++ b/dpnp/backend/extensions/ufunc/elementwise_functions/spacing.cpp @@ -41,12 +41,12 @@ #include "populate.hpp" #include "spacing.hpp" -// include a local copy of elementwise common header from dpctl tensor: -// dpctl/tensor/libtensor/source/elementwise_functions/elementwise_functions.hpp -// TODO: replace by including dpctl header once available +// 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" -// dpctl tensor headers +// dpnp tensor headers #include "kernels/elementwise_functions/common.hpp" #include "utils/type_dispatch.hpp" @@ -57,8 +57,8 @@ namespace py_int = dpnp::extensions::py_internal; namespace impl { -namespace ew_cmn_ns = dpctl::tensor::kernels::elementwise_common; -namespace td_ns = dpctl::tensor::type_dispatch; +namespace ew_cmn_ns = dpnp::tensor::kernels::elementwise_common; +namespace td_ns = dpnp::tensor::type_dispatch; /** * @brief A factory to define pairs of supported types for which @@ -108,7 +108,7 @@ MACRO_POPULATE_DISPATCH_VECTORS(spacing); void init_spacing(py::module_ m) { - using arrayT = dpctl::tensor::usm_ndarray; + using arrayT = dpnp::tensor::usm_ndarray; using event_vecT = std::vector; { impl::populate_spacing_dispatch_vectors(); diff --git a/dpnp/backend/extensions/vm/abs.cpp b/dpnp/backend/extensions/vm/abs.cpp index 1dc8143dd5ff..4402dd1c0326 100644 --- a/dpnp/backend/extensions/vm/abs.cpp +++ b/dpnp/backend/extensions/vm/abs.cpp @@ -43,12 +43,12 @@ #include "abs.hpp" #include "common.hpp" -// include a local copy of elementwise common header from dpctl tensor: -// dpctl/tensor/libtensor/source/elementwise_functions/elementwise_functions.hpp -// TODO: replace by including dpctl header once available +// 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" -// dpctl tensor headers +// dpnp tensor headers #include "kernels/elementwise_functions/common.hpp" #include "utils/type_dispatch.hpp" #include "utils/type_utils.hpp" @@ -57,13 +57,13 @@ namespace dpnp::extensions::vm { namespace py = pybind11; namespace py_int = dpnp::extensions::py_internal; -namespace td_ns = dpctl::tensor::type_dispatch; +namespace td_ns = dpnp::tensor::type_dispatch; namespace impl { -namespace ew_cmn_ns = dpctl::tensor::kernels::elementwise_common; +namespace ew_cmn_ns = dpnp::tensor::kernels::elementwise_common; namespace mkl_vm = oneapi::mkl::vm; // OneMKL namespace with VM functions -namespace tu_ns = dpctl::tensor::type_utils; +namespace tu_ns = dpnp::tensor::type_utils; /** * @brief A factory to define pairs of supported types for which @@ -115,7 +115,7 @@ MACRO_POPULATE_DISPATCH_VECTORS(abs); void init_abs(py::module_ m) { - using arrayT = dpctl::tensor::usm_ndarray; + using arrayT = dpnp::tensor::usm_ndarray; using event_vecT = std::vector; impl::populate_dispatch_vectors(); diff --git a/dpnp/backend/extensions/vm/acos.cpp b/dpnp/backend/extensions/vm/acos.cpp index 15b4ce80cc3c..9c66c60da8ca 100644 --- a/dpnp/backend/extensions/vm/acos.cpp +++ b/dpnp/backend/extensions/vm/acos.cpp @@ -43,12 +43,12 @@ #include "acos.hpp" #include "common.hpp" -// include a local copy of elementwise common header from dpctl tensor: -// dpctl/tensor/libtensor/source/elementwise_functions/elementwise_functions.hpp -// TODO: replace by including dpctl header once available +// 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" -// dpctl tensor headers +// dpnp tensor headers #include "kernels/elementwise_functions/common.hpp" #include "utils/type_dispatch.hpp" #include "utils/type_utils.hpp" @@ -57,13 +57,13 @@ namespace dpnp::extensions::vm { namespace py = pybind11; namespace py_int = dpnp::extensions::py_internal; -namespace td_ns = dpctl::tensor::type_dispatch; +namespace td_ns = dpnp::tensor::type_dispatch; namespace impl { -namespace ew_cmn_ns = dpctl::tensor::kernels::elementwise_common; +namespace ew_cmn_ns = dpnp::tensor::kernels::elementwise_common; namespace mkl_vm = oneapi::mkl::vm; // OneMKL namespace with VM functions -namespace tu_ns = dpctl::tensor::type_utils; +namespace tu_ns = dpnp::tensor::type_utils; /** * @brief A factory to define pairs of supported types for which @@ -115,7 +115,7 @@ MACRO_POPULATE_DISPATCH_VECTORS(acos); void init_acos(py::module_ m) { - using arrayT = dpctl::tensor::usm_ndarray; + using arrayT = dpnp::tensor::usm_ndarray; using event_vecT = std::vector; impl::populate_dispatch_vectors(); diff --git a/dpnp/backend/extensions/vm/acosh.cpp b/dpnp/backend/extensions/vm/acosh.cpp index eed835b78e10..5fb1dd1ebcd9 100644 --- a/dpnp/backend/extensions/vm/acosh.cpp +++ b/dpnp/backend/extensions/vm/acosh.cpp @@ -43,12 +43,12 @@ #include "acosh.hpp" #include "common.hpp" -// include a local copy of elementwise common header from dpctl tensor: -// dpctl/tensor/libtensor/source/elementwise_functions/elementwise_functions.hpp -// TODO: replace by including dpctl header once available +// 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" -// dpctl tensor headers +// dpnp tensor headers #include "kernels/elementwise_functions/common.hpp" #include "utils/type_dispatch.hpp" #include "utils/type_utils.hpp" @@ -57,13 +57,13 @@ namespace dpnp::extensions::vm { namespace py = pybind11; namespace py_int = dpnp::extensions::py_internal; -namespace td_ns = dpctl::tensor::type_dispatch; +namespace td_ns = dpnp::tensor::type_dispatch; namespace impl { -namespace ew_cmn_ns = dpctl::tensor::kernels::elementwise_common; +namespace ew_cmn_ns = dpnp::tensor::kernels::elementwise_common; namespace mkl_vm = oneapi::mkl::vm; // OneMKL namespace with VM functions -namespace tu_ns = dpctl::tensor::type_utils; +namespace tu_ns = dpnp::tensor::type_utils; /** * @brief A factory to define pairs of supported types for which @@ -115,7 +115,7 @@ MACRO_POPULATE_DISPATCH_VECTORS(acosh); void init_acosh(py::module_ m) { - using arrayT = dpctl::tensor::usm_ndarray; + using arrayT = dpnp::tensor::usm_ndarray; using event_vecT = std::vector; impl::populate_dispatch_vectors(); diff --git a/dpnp/backend/extensions/vm/add.cpp b/dpnp/backend/extensions/vm/add.cpp index a58aac727cd1..3ac73662a937 100644 --- a/dpnp/backend/extensions/vm/add.cpp +++ b/dpnp/backend/extensions/vm/add.cpp @@ -44,12 +44,12 @@ #include "add.hpp" #include "common.hpp" -// include a local copy of elementwise common header from dpctl tensor: -// dpctl/tensor/libtensor/source/elementwise_functions/elementwise_functions.hpp -// TODO: replace by including dpctl header once available +// 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" -// dpctl tensor headers +// dpnp tensor headers #include "kernels/elementwise_functions/common.hpp" #include "utils/type_dispatch.hpp" #include "utils/type_utils.hpp" @@ -58,13 +58,13 @@ namespace dpnp::extensions::vm { namespace py = pybind11; namespace py_int = dpnp::extensions::py_internal; -namespace td_ns = dpctl::tensor::type_dispatch; +namespace td_ns = dpnp::tensor::type_dispatch; namespace impl { -namespace ew_cmn_ns = dpctl::tensor::kernels::elementwise_common; +namespace ew_cmn_ns = dpnp::tensor::kernels::elementwise_common; namespace mkl_vm = oneapi::mkl::vm; // OneMKL namespace with VM functions -namespace tu_ns = dpctl::tensor::type_utils; +namespace tu_ns = dpnp::tensor::type_utils; /** * @brief A factory to define pairs of supported types for which @@ -138,7 +138,7 @@ MACRO_POPULATE_DISPATCH_TABLES(add); void init_add(py::module_ m) { - using arrayT = dpctl::tensor::usm_ndarray; + using arrayT = dpnp::tensor::usm_ndarray; using event_vecT = std::vector; impl::populate_dispatch_tables(); diff --git a/dpnp/backend/extensions/vm/arg.cpp b/dpnp/backend/extensions/vm/arg.cpp index c50c4a33dee1..1b025662cd8e 100644 --- a/dpnp/backend/extensions/vm/arg.cpp +++ b/dpnp/backend/extensions/vm/arg.cpp @@ -43,12 +43,12 @@ #include "arg.hpp" #include "common.hpp" -// include a local copy of elementwise common header from dpctl tensor: -// dpctl/tensor/libtensor/source/elementwise_functions/elementwise_functions.hpp -// TODO: replace by including dpctl header once available +// 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" -// dpctl tensor headers +// dpnp tensor headers #include "kernels/elementwise_functions/common.hpp" #include "utils/type_dispatch.hpp" #include "utils/type_utils.hpp" @@ -57,13 +57,13 @@ namespace dpnp::extensions::vm { namespace py = pybind11; namespace py_int = dpnp::extensions::py_internal; -namespace td_ns = dpctl::tensor::type_dispatch; +namespace td_ns = dpnp::tensor::type_dispatch; namespace impl { -namespace ew_cmn_ns = dpctl::tensor::kernels::elementwise_common; +namespace ew_cmn_ns = dpnp::tensor::kernels::elementwise_common; namespace mkl_vm = oneapi::mkl::vm; // OneMKL namespace with VM functions -namespace tu_ns = dpctl::tensor::type_utils; +namespace tu_ns = dpnp::tensor::type_utils; /** * @brief A factory to define pairs of supported types for which @@ -113,7 +113,7 @@ MACRO_POPULATE_DISPATCH_VECTORS(arg); void init_arg(py::module_ m) { - using arrayT = dpctl::tensor::usm_ndarray; + using arrayT = dpnp::tensor::usm_ndarray; using event_vecT = std::vector; impl::populate_dispatch_vectors(); diff --git a/dpnp/backend/extensions/vm/asin.cpp b/dpnp/backend/extensions/vm/asin.cpp index 5af7033fed21..93f271e34485 100644 --- a/dpnp/backend/extensions/vm/asin.cpp +++ b/dpnp/backend/extensions/vm/asin.cpp @@ -43,12 +43,12 @@ #include "asin.hpp" #include "common.hpp" -// include a local copy of elementwise common header from dpctl tensor: -// dpctl/tensor/libtensor/source/elementwise_functions/elementwise_functions.hpp -// TODO: replace by including dpctl header once available +// 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" -// dpctl tensor headers +// dpnp tensor headers #include "kernels/elementwise_functions/common.hpp" #include "utils/type_dispatch.hpp" #include "utils/type_utils.hpp" @@ -57,13 +57,13 @@ namespace dpnp::extensions::vm { namespace py = pybind11; namespace py_int = dpnp::extensions::py_internal; -namespace td_ns = dpctl::tensor::type_dispatch; +namespace td_ns = dpnp::tensor::type_dispatch; namespace impl { -namespace ew_cmn_ns = dpctl::tensor::kernels::elementwise_common; +namespace ew_cmn_ns = dpnp::tensor::kernels::elementwise_common; namespace mkl_vm = oneapi::mkl::vm; // OneMKL namespace with VM functions -namespace tu_ns = dpctl::tensor::type_utils; +namespace tu_ns = dpnp::tensor::type_utils; /** * @brief A factory to define pairs of supported types for which @@ -115,7 +115,7 @@ MACRO_POPULATE_DISPATCH_VECTORS(asin); void init_asin(py::module_ m) { - using arrayT = dpctl::tensor::usm_ndarray; + using arrayT = dpnp::tensor::usm_ndarray; using event_vecT = std::vector; impl::populate_dispatch_vectors(); diff --git a/dpnp/backend/extensions/vm/asinh.cpp b/dpnp/backend/extensions/vm/asinh.cpp index 5b0f8ed13106..1ea0c296464a 100644 --- a/dpnp/backend/extensions/vm/asinh.cpp +++ b/dpnp/backend/extensions/vm/asinh.cpp @@ -43,12 +43,12 @@ #include "asinh.hpp" #include "common.hpp" -// include a local copy of elementwise common header from dpctl tensor: -// dpctl/tensor/libtensor/source/elementwise_functions/elementwise_functions.hpp -// TODO: replace by including dpctl header once available +// 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" -// dpctl tensor headers +// dpnp tensor headers #include "kernels/elementwise_functions/common.hpp" #include "utils/type_dispatch.hpp" #include "utils/type_utils.hpp" @@ -57,13 +57,13 @@ namespace dpnp::extensions::vm { namespace py = pybind11; namespace py_int = dpnp::extensions::py_internal; -namespace td_ns = dpctl::tensor::type_dispatch; +namespace td_ns = dpnp::tensor::type_dispatch; namespace impl { -namespace ew_cmn_ns = dpctl::tensor::kernels::elementwise_common; +namespace ew_cmn_ns = dpnp::tensor::kernels::elementwise_common; namespace mkl_vm = oneapi::mkl::vm; // OneMKL namespace with VM functions -namespace tu_ns = dpctl::tensor::type_utils; +namespace tu_ns = dpnp::tensor::type_utils; /** * @brief A factory to define pairs of supported types for which @@ -115,7 +115,7 @@ MACRO_POPULATE_DISPATCH_VECTORS(asinh); void init_asinh(py::module_ m) { - using arrayT = dpctl::tensor::usm_ndarray; + using arrayT = dpnp::tensor::usm_ndarray; using event_vecT = std::vector; impl::populate_dispatch_vectors(); diff --git a/dpnp/backend/extensions/vm/atan.cpp b/dpnp/backend/extensions/vm/atan.cpp index 2255000c1c4b..26a7f7155a14 100644 --- a/dpnp/backend/extensions/vm/atan.cpp +++ b/dpnp/backend/extensions/vm/atan.cpp @@ -43,12 +43,12 @@ #include "atan.hpp" #include "common.hpp" -// include a local copy of elementwise common header from dpctl tensor: -// dpctl/tensor/libtensor/source/elementwise_functions/elementwise_functions.hpp -// TODO: replace by including dpctl header once available +// 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" -// dpctl tensor headers +// dpnp tensor headers #include "kernels/elementwise_functions/common.hpp" #include "utils/type_dispatch.hpp" #include "utils/type_utils.hpp" @@ -57,13 +57,13 @@ namespace dpnp::extensions::vm { namespace py = pybind11; namespace py_int = dpnp::extensions::py_internal; -namespace td_ns = dpctl::tensor::type_dispatch; +namespace td_ns = dpnp::tensor::type_dispatch; namespace impl { -namespace ew_cmn_ns = dpctl::tensor::kernels::elementwise_common; +namespace ew_cmn_ns = dpnp::tensor::kernels::elementwise_common; namespace mkl_vm = oneapi::mkl::vm; // OneMKL namespace with VM functions -namespace tu_ns = dpctl::tensor::type_utils; +namespace tu_ns = dpnp::tensor::type_utils; /** * @brief A factory to define pairs of supported types for which @@ -115,7 +115,7 @@ MACRO_POPULATE_DISPATCH_VECTORS(atan); void init_atan(py::module_ m) { - using arrayT = dpctl::tensor::usm_ndarray; + using arrayT = dpnp::tensor::usm_ndarray; using event_vecT = std::vector; impl::populate_dispatch_vectors(); diff --git a/dpnp/backend/extensions/vm/atan2.cpp b/dpnp/backend/extensions/vm/atan2.cpp index bf29e2921a1d..3ee102d46f3c 100644 --- a/dpnp/backend/extensions/vm/atan2.cpp +++ b/dpnp/backend/extensions/vm/atan2.cpp @@ -43,12 +43,12 @@ #include "atan2.hpp" #include "common.hpp" -// include a local copy of elementwise common header from dpctl tensor: -// dpctl/tensor/libtensor/source/elementwise_functions/elementwise_functions.hpp -// TODO: replace by including dpctl header once available +// 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" -// dpctl tensor headers +// dpnp tensor headers #include "kernels/elementwise_functions/common.hpp" #include "utils/type_dispatch.hpp" #include "utils/type_utils.hpp" @@ -57,13 +57,13 @@ namespace dpnp::extensions::vm { namespace py = pybind11; namespace py_int = dpnp::extensions::py_internal; -namespace td_ns = dpctl::tensor::type_dispatch; +namespace td_ns = dpnp::tensor::type_dispatch; namespace impl { -namespace ew_cmn_ns = dpctl::tensor::kernels::elementwise_common; +namespace ew_cmn_ns = dpnp::tensor::kernels::elementwise_common; namespace mkl_vm = oneapi::mkl::vm; // OneMKL namespace with VM functions -namespace tu_ns = dpctl::tensor::type_utils; +namespace tu_ns = dpnp::tensor::type_utils; /** * @brief A factory to define pairs of supported types for which @@ -127,7 +127,7 @@ MACRO_POPULATE_DISPATCH_TABLES(atan2); void init_atan2(py::module_ m) { - using arrayT = dpctl::tensor::usm_ndarray; + using arrayT = dpnp::tensor::usm_ndarray; using event_vecT = std::vector; impl::populate_dispatch_tables(); diff --git a/dpnp/backend/extensions/vm/atanh.cpp b/dpnp/backend/extensions/vm/atanh.cpp index 9daab09980e6..42d7d3de3278 100644 --- a/dpnp/backend/extensions/vm/atanh.cpp +++ b/dpnp/backend/extensions/vm/atanh.cpp @@ -43,12 +43,12 @@ #include "atanh.hpp" #include "common.hpp" -// include a local copy of elementwise common header from dpctl tensor: -// dpctl/tensor/libtensor/source/elementwise_functions/elementwise_functions.hpp -// TODO: replace by including dpctl header once available +// 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" -// dpctl tensor headers +// dpnp tensor headers #include "kernels/elementwise_functions/common.hpp" #include "utils/type_dispatch.hpp" #include "utils/type_utils.hpp" @@ -57,13 +57,13 @@ namespace dpnp::extensions::vm { namespace py = pybind11; namespace py_int = dpnp::extensions::py_internal; -namespace td_ns = dpctl::tensor::type_dispatch; +namespace td_ns = dpnp::tensor::type_dispatch; namespace impl { -namespace ew_cmn_ns = dpctl::tensor::kernels::elementwise_common; +namespace ew_cmn_ns = dpnp::tensor::kernels::elementwise_common; namespace mkl_vm = oneapi::mkl::vm; // OneMKL namespace with VM functions -namespace tu_ns = dpctl::tensor::type_utils; +namespace tu_ns = dpnp::tensor::type_utils; /** * @brief A factory to define pairs of supported types for which @@ -115,7 +115,7 @@ MACRO_POPULATE_DISPATCH_VECTORS(atanh); void init_atanh(py::module_ m) { - using arrayT = dpctl::tensor::usm_ndarray; + using arrayT = dpnp::tensor::usm_ndarray; using event_vecT = std::vector; impl::populate_dispatch_vectors(); diff --git a/dpnp/backend/extensions/vm/cbrt.cpp b/dpnp/backend/extensions/vm/cbrt.cpp index 34ff8dd913ac..d83e366668f8 100644 --- a/dpnp/backend/extensions/vm/cbrt.cpp +++ b/dpnp/backend/extensions/vm/cbrt.cpp @@ -42,12 +42,12 @@ #include "cbrt.hpp" #include "common.hpp" -// include a local copy of elementwise common header from dpctl tensor: -// dpctl/tensor/libtensor/source/elementwise_functions/elementwise_functions.hpp -// TODO: replace by including dpctl header once available +// 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" -// dpctl tensor headers +// dpnp tensor headers #include "kernels/elementwise_functions/common.hpp" #include "utils/type_dispatch.hpp" #include "utils/type_utils.hpp" @@ -56,13 +56,13 @@ namespace dpnp::extensions::vm { namespace py = pybind11; namespace py_int = dpnp::extensions::py_internal; -namespace td_ns = dpctl::tensor::type_dispatch; +namespace td_ns = dpnp::tensor::type_dispatch; namespace impl { -namespace ew_cmn_ns = dpctl::tensor::kernels::elementwise_common; +namespace ew_cmn_ns = dpnp::tensor::kernels::elementwise_common; namespace mkl_vm = oneapi::mkl::vm; // OneMKL namespace with VM functions -namespace tu_ns = dpctl::tensor::type_utils; +namespace tu_ns = dpnp::tensor::type_utils; /** * @brief A factory to define pairs of supported types for which @@ -112,7 +112,7 @@ MACRO_POPULATE_DISPATCH_VECTORS(cbrt); void init_cbrt(py::module_ m) { - using arrayT = dpctl::tensor::usm_ndarray; + using arrayT = dpnp::tensor::usm_ndarray; using event_vecT = std::vector; impl::populate_dispatch_vectors(); diff --git a/dpnp/backend/extensions/vm/ceil.cpp b/dpnp/backend/extensions/vm/ceil.cpp index e76a30d28317..1f494c4c41b7 100644 --- a/dpnp/backend/extensions/vm/ceil.cpp +++ b/dpnp/backend/extensions/vm/ceil.cpp @@ -42,12 +42,12 @@ #include "ceil.hpp" #include "common.hpp" -// include a local copy of elementwise common header from dpctl tensor: -// dpctl/tensor/libtensor/source/elementwise_functions/elementwise_functions.hpp -// TODO: replace by including dpctl header once available +// 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" -// dpctl tensor headers +// dpnp tensor headers #include "kernels/elementwise_functions/common.hpp" #include "utils/type_dispatch.hpp" #include "utils/type_utils.hpp" @@ -56,13 +56,13 @@ namespace dpnp::extensions::vm { namespace py = pybind11; namespace py_int = dpnp::extensions::py_internal; -namespace td_ns = dpctl::tensor::type_dispatch; +namespace td_ns = dpnp::tensor::type_dispatch; namespace impl { -namespace ew_cmn_ns = dpctl::tensor::kernels::elementwise_common; +namespace ew_cmn_ns = dpnp::tensor::kernels::elementwise_common; namespace mkl_vm = oneapi::mkl::vm; // OneMKL namespace with VM functions -namespace tu_ns = dpctl::tensor::type_utils; +namespace tu_ns = dpnp::tensor::type_utils; /** * @brief A factory to define pairs of supported types for which @@ -112,7 +112,7 @@ MACRO_POPULATE_DISPATCH_VECTORS(ceil); void init_ceil(py::module_ m) { - using arrayT = dpctl::tensor::usm_ndarray; + using arrayT = dpnp::tensor::usm_ndarray; using event_vecT = std::vector; impl::populate_dispatch_vectors(); diff --git a/dpnp/backend/extensions/vm/common.hpp b/dpnp/backend/extensions/vm/common.hpp index 5d2631d5b556..2303adaebc99 100644 --- a/dpnp/backend/extensions/vm/common.hpp +++ b/dpnp/backend/extensions/vm/common.hpp @@ -42,7 +42,7 @@ // utils extension header #include "ext/common.hpp" -// dpctl tensor headers +// dpnp tensor headers #include "utils/memory_overlap.hpp" #include "utils/type_dispatch.hpp" @@ -61,14 +61,14 @@ static_assert(INTEL_MKL_VERSION >= __INTEL_MKL_2023_2_0_VERSION_REQUIRED, namespace ext_ns = ext::common; namespace py = pybind11; -namespace td_ns = dpctl::tensor::type_dispatch; +namespace td_ns = dpnp::tensor::type_dispatch; namespace dpnp::extensions::vm::py_internal { template bool need_to_call_unary_ufunc(sycl::queue &exec_q, - const dpctl::tensor::usm_ndarray &src, - const dpctl::tensor::usm_ndarray &dst, + const dpnp::tensor::usm_ndarray &src, + const dpnp::tensor::usm_ndarray &dst, const output_typesT &output_type_vec, const contig_dispatchT &contig_dispatch_vector) { @@ -92,7 +92,7 @@ bool need_to_call_unary_ufunc(sycl::queue &exec_q, } // check that queues are compatible - if (!dpctl::utils::queues_are_compatible(exec_q, {src, dst})) { + if (!dpnp::utils::queues_are_compatible(exec_q, {src, dst})) { return false; } @@ -137,7 +137,7 @@ bool need_to_call_unary_ufunc(sycl::queue &exec_q, } // check memory overlap - auto const &overlap = dpctl::tensor::overlap::MemoryOverlap(); + auto const &overlap = dpnp::tensor::overlap::MemoryOverlap(); if (overlap(src, dst)) { return false; } @@ -161,9 +161,9 @@ bool need_to_call_unary_ufunc(sycl::queue &exec_q, template bool need_to_call_unary_two_outputs_ufunc( sycl::queue &exec_q, - const dpctl::tensor::usm_ndarray &src, - const dpctl::tensor::usm_ndarray &dst1, - const dpctl::tensor::usm_ndarray &dst2, + const dpnp::tensor::usm_ndarray &src, + const dpnp::tensor::usm_ndarray &dst1, + const dpnp::tensor::usm_ndarray &dst2, const output_typesT &output_type_vec, const contig_dispatchT &contig_dispatch_vector) { @@ -191,7 +191,7 @@ bool need_to_call_unary_two_outputs_ufunc( } // check that queues are compatible - if (!dpctl::utils::queues_are_compatible(exec_q, {src, dst1, dst2})) { + if (!dpnp::utils::queues_are_compatible(exec_q, {src, dst1, dst2})) { return false; } @@ -243,7 +243,7 @@ bool need_to_call_unary_two_outputs_ufunc( } // check memory overlap - auto const &overlap = dpctl::tensor::overlap::MemoryOverlap(); + auto const &overlap = dpnp::tensor::overlap::MemoryOverlap(); if (overlap(src, dst1) || overlap(src, dst2) || overlap(dst1, dst2)) { return false; } @@ -268,9 +268,9 @@ bool need_to_call_unary_two_outputs_ufunc( template bool need_to_call_binary_ufunc(sycl::queue &exec_q, - const dpctl::tensor::usm_ndarray &src1, - const dpctl::tensor::usm_ndarray &src2, - const dpctl::tensor::usm_ndarray &dst, + const dpnp::tensor::usm_ndarray &src1, + const dpnp::tensor::usm_ndarray &src2, + const dpnp::tensor::usm_ndarray &dst, const output_typesT &output_type_table, const contig_dispatchT &contig_dispatch_table) { @@ -301,7 +301,7 @@ bool need_to_call_binary_ufunc(sycl::queue &exec_q, } // check that queues are compatible - if (!dpctl::utils::queues_are_compatible(exec_q, {src1, src2, dst})) { + if (!dpnp::utils::queues_are_compatible(exec_q, {src1, src2, dst})) { return false; } @@ -348,7 +348,7 @@ bool need_to_call_binary_ufunc(sycl::queue &exec_q, } // check memory overlap - auto const &overlap = dpctl::tensor::overlap::MemoryOverlap(); + auto const &overlap = dpnp::tensor::overlap::MemoryOverlap(); if (overlap(src1, dst) || overlap(src2, dst)) { return false; } diff --git a/dpnp/backend/extensions/vm/conj.cpp b/dpnp/backend/extensions/vm/conj.cpp index f77020cf1d55..23ae85be814e 100644 --- a/dpnp/backend/extensions/vm/conj.cpp +++ b/dpnp/backend/extensions/vm/conj.cpp @@ -43,12 +43,12 @@ #include "common.hpp" #include "conj.hpp" -// include a local copy of elementwise common header from dpctl tensor: -// dpctl/tensor/libtensor/source/elementwise_functions/elementwise_functions.hpp -// TODO: replace by including dpctl header once available +// 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" -// dpctl tensor headers +// dpnp tensor headers #include "kernels/elementwise_functions/common.hpp" #include "utils/type_dispatch.hpp" #include "utils/type_utils.hpp" @@ -57,13 +57,13 @@ namespace dpnp::extensions::vm { namespace py = pybind11; namespace py_int = dpnp::extensions::py_internal; -namespace td_ns = dpctl::tensor::type_dispatch; +namespace td_ns = dpnp::tensor::type_dispatch; namespace impl { -namespace ew_cmn_ns = dpctl::tensor::kernels::elementwise_common; +namespace ew_cmn_ns = dpnp::tensor::kernels::elementwise_common; namespace mkl_vm = oneapi::mkl::vm; // OneMKL namespace with VM functions -namespace tu_ns = dpctl::tensor::type_utils; +namespace tu_ns = dpnp::tensor::type_utils; /** * @brief A factory to define pairs of supported types for which @@ -113,7 +113,7 @@ MACRO_POPULATE_DISPATCH_VECTORS(conj); void init_conj(py::module_ m) { - using arrayT = dpctl::tensor::usm_ndarray; + using arrayT = dpnp::tensor::usm_ndarray; using event_vecT = std::vector; impl::populate_dispatch_vectors(); diff --git a/dpnp/backend/extensions/vm/copysign.cpp b/dpnp/backend/extensions/vm/copysign.cpp index 15c0fceec413..543e77d704ab 100644 --- a/dpnp/backend/extensions/vm/copysign.cpp +++ b/dpnp/backend/extensions/vm/copysign.cpp @@ -43,12 +43,12 @@ #include "common.hpp" #include "copysign.hpp" -// include a local copy of elementwise common header from dpctl tensor: -// dpctl/tensor/libtensor/source/elementwise_functions/elementwise_functions.hpp -// TODO: replace by including dpctl header once available +// 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" -// dpctl tensor headers +// dpnp tensor headers #include "kernels/elementwise_functions/common.hpp" #include "utils/type_dispatch.hpp" #include "utils/type_utils.hpp" @@ -57,13 +57,13 @@ namespace dpnp::extensions::vm { namespace py = pybind11; namespace py_int = dpnp::extensions::py_internal; -namespace td_ns = dpctl::tensor::type_dispatch; +namespace td_ns = dpnp::tensor::type_dispatch; namespace impl { -namespace ew_cmn_ns = dpctl::tensor::kernels::elementwise_common; +namespace ew_cmn_ns = dpnp::tensor::kernels::elementwise_common; namespace mkl_vm = oneapi::mkl::vm; // OneMKL namespace with VM functions -namespace tu_ns = dpctl::tensor::type_utils; +namespace tu_ns = dpnp::tensor::type_utils; /** * @brief A factory to define pairs of supported types for which @@ -128,7 +128,7 @@ MACRO_POPULATE_DISPATCH_TABLES(copysign); void init_copysign(py::module_ m) { - using arrayT = dpctl::tensor::usm_ndarray; + using arrayT = dpnp::tensor::usm_ndarray; using event_vecT = std::vector; impl::populate_dispatch_tables(); diff --git a/dpnp/backend/extensions/vm/cos.cpp b/dpnp/backend/extensions/vm/cos.cpp index 7c9b0c35d6ca..90a77b543778 100644 --- a/dpnp/backend/extensions/vm/cos.cpp +++ b/dpnp/backend/extensions/vm/cos.cpp @@ -43,12 +43,12 @@ #include "common.hpp" #include "cos.hpp" -// include a local copy of elementwise common header from dpctl tensor: -// dpctl/tensor/libtensor/source/elementwise_functions/elementwise_functions.hpp -// TODO: replace by including dpctl header once available +// 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" -// dpctl tensor headers +// dpnp tensor headers #include "kernels/elementwise_functions/common.hpp" #include "utils/type_dispatch.hpp" #include "utils/type_utils.hpp" @@ -57,13 +57,13 @@ namespace dpnp::extensions::vm { namespace py = pybind11; namespace py_int = dpnp::extensions::py_internal; -namespace td_ns = dpctl::tensor::type_dispatch; +namespace td_ns = dpnp::tensor::type_dispatch; namespace impl { -namespace ew_cmn_ns = dpctl::tensor::kernels::elementwise_common; +namespace ew_cmn_ns = dpnp::tensor::kernels::elementwise_common; namespace mkl_vm = oneapi::mkl::vm; // OneMKL namespace with VM functions -namespace tu_ns = dpctl::tensor::type_utils; +namespace tu_ns = dpnp::tensor::type_utils; /** * @brief A factory to define pairs of supported types for which @@ -115,7 +115,7 @@ MACRO_POPULATE_DISPATCH_VECTORS(cos); void init_cos(py::module_ m) { - using arrayT = dpctl::tensor::usm_ndarray; + using arrayT = dpnp::tensor::usm_ndarray; using event_vecT = std::vector; impl::populate_dispatch_vectors(); diff --git a/dpnp/backend/extensions/vm/cosh.cpp b/dpnp/backend/extensions/vm/cosh.cpp index a95c7075ba61..8ea80f29145d 100644 --- a/dpnp/backend/extensions/vm/cosh.cpp +++ b/dpnp/backend/extensions/vm/cosh.cpp @@ -43,12 +43,12 @@ #include "common.hpp" #include "cosh.hpp" -// include a local copy of elementwise common header from dpctl tensor: -// dpctl/tensor/libtensor/source/elementwise_functions/elementwise_functions.hpp -// TODO: replace by including dpctl header once available +// 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" -// dpctl tensor headers +// dpnp tensor headers #include "kernels/elementwise_functions/common.hpp" #include "utils/type_dispatch.hpp" #include "utils/type_utils.hpp" @@ -57,13 +57,13 @@ namespace dpnp::extensions::vm { namespace py = pybind11; namespace py_int = dpnp::extensions::py_internal; -namespace td_ns = dpctl::tensor::type_dispatch; +namespace td_ns = dpnp::tensor::type_dispatch; namespace impl { -namespace ew_cmn_ns = dpctl::tensor::kernels::elementwise_common; +namespace ew_cmn_ns = dpnp::tensor::kernels::elementwise_common; namespace mkl_vm = oneapi::mkl::vm; // OneMKL namespace with VM functions -namespace tu_ns = dpctl::tensor::type_utils; +namespace tu_ns = dpnp::tensor::type_utils; /** * @brief A factory to define pairs of supported types for which @@ -115,7 +115,7 @@ MACRO_POPULATE_DISPATCH_VECTORS(cosh); void init_cosh(py::module_ m) { - using arrayT = dpctl::tensor::usm_ndarray; + using arrayT = dpnp::tensor::usm_ndarray; using event_vecT = std::vector; impl::populate_dispatch_vectors(); diff --git a/dpnp/backend/extensions/vm/div.cpp b/dpnp/backend/extensions/vm/div.cpp index 6e0cb4d0439f..386684d11a81 100644 --- a/dpnp/backend/extensions/vm/div.cpp +++ b/dpnp/backend/extensions/vm/div.cpp @@ -44,12 +44,12 @@ #include "common.hpp" #include "div.hpp" -// include a local copy of elementwise common header from dpctl tensor: -// dpctl/tensor/libtensor/source/elementwise_functions/elementwise_functions.hpp -// TODO: replace by including dpctl header once available +// 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" -// dpctl tensor headers +// dpnp tensor headers #include "kernels/elementwise_functions/common.hpp" #include "utils/type_dispatch.hpp" #include "utils/type_utils.hpp" @@ -58,13 +58,13 @@ namespace dpnp::extensions::vm { namespace py = pybind11; namespace py_int = dpnp::extensions::py_internal; -namespace td_ns = dpctl::tensor::type_dispatch; +namespace td_ns = dpnp::tensor::type_dispatch; namespace impl { -namespace ew_cmn_ns = dpctl::tensor::kernels::elementwise_common; +namespace ew_cmn_ns = dpnp::tensor::kernels::elementwise_common; namespace mkl_vm = oneapi::mkl::vm; // OneMKL namespace with VM functions -namespace tu_ns = dpctl::tensor::type_utils; +namespace tu_ns = dpnp::tensor::type_utils; /** * @brief A factory to define pairs of supported types for which @@ -138,7 +138,7 @@ MACRO_POPULATE_DISPATCH_TABLES(div); void init_div(py::module_ m) { - using arrayT = dpctl::tensor::usm_ndarray; + using arrayT = dpnp::tensor::usm_ndarray; using event_vecT = std::vector; impl::populate_dispatch_tables(); diff --git a/dpnp/backend/extensions/vm/erf_funcs.cpp b/dpnp/backend/extensions/vm/erf_funcs.cpp index 7be7f691edcf..7ca642fe2fc5 100644 --- a/dpnp/backend/extensions/vm/erf_funcs.cpp +++ b/dpnp/backend/extensions/vm/erf_funcs.cpp @@ -42,12 +42,12 @@ #include "common.hpp" #include "erf_funcs.hpp" -// include a local copy of elementwise common header from dpctl tensor: -// dpctl/tensor/libtensor/source/elementwise_functions/elementwise_functions.hpp -// TODO: replace by including dpctl header once available +// 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" -// dpctl tensor headers +// dpnp tensor headers #include "kernels/elementwise_functions/common.hpp" #include "utils/type_dispatch.hpp" #include "utils/type_utils.hpp" @@ -56,15 +56,15 @@ namespace dpnp::extensions::vm { namespace py = pybind11; namespace py_int = dpnp::extensions::py_internal; -namespace td_ns = dpctl::tensor::type_dispatch; +namespace td_ns = dpnp::tensor::type_dispatch; using ext::common::init_dispatch_vector; namespace impl { -namespace ew_cmn_ns = dpctl::tensor::kernels::elementwise_common; +namespace ew_cmn_ns = dpnp::tensor::kernels::elementwise_common; namespace mkl_vm = oneapi::mkl::vm; // OneMKL namespace with VM functions -namespace tu_ns = dpctl::tensor::type_utils; +namespace tu_ns = dpnp::tensor::type_utils; /** * @brief A factory to define pairs of supported types for which @@ -149,7 +149,7 @@ static void populate(py::module_ m, init_dispatch_vector( contig_dispatch_vector); - using arrayT = dpctl::tensor::usm_ndarray; + using arrayT = dpnp::tensor::usm_ndarray; auto pyapi = [&, contig_dispatch_vector]( sycl::queue &exec_q, const arrayT &src, const arrayT &dst, const std::vector &depends = {}) { @@ -166,7 +166,7 @@ static void populate(py::module_ m, void init_erf_funcs(py::module_ m) { - using arrayT = dpctl::tensor::usm_ndarray; + using arrayT = dpnp::tensor::usm_ndarray; using impl::output_typeid_vector; init_dispatch_vector(output_typeid_vector); diff --git a/dpnp/backend/extensions/vm/exp.cpp b/dpnp/backend/extensions/vm/exp.cpp index 31f50f36171d..fb765d0d7f2e 100644 --- a/dpnp/backend/extensions/vm/exp.cpp +++ b/dpnp/backend/extensions/vm/exp.cpp @@ -43,12 +43,12 @@ #include "common.hpp" #include "exp.hpp" -// include a local copy of elementwise common header from dpctl tensor: -// dpctl/tensor/libtensor/source/elementwise_functions/elementwise_functions.hpp -// TODO: replace by including dpctl header once available +// 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" -// dpctl tensor headers +// dpnp tensor headers #include "kernels/elementwise_functions/common.hpp" #include "utils/type_dispatch.hpp" #include "utils/type_utils.hpp" @@ -57,13 +57,13 @@ namespace dpnp::extensions::vm { namespace py = pybind11; namespace py_int = dpnp::extensions::py_internal; -namespace td_ns = dpctl::tensor::type_dispatch; +namespace td_ns = dpnp::tensor::type_dispatch; namespace impl { -namespace ew_cmn_ns = dpctl::tensor::kernels::elementwise_common; +namespace ew_cmn_ns = dpnp::tensor::kernels::elementwise_common; namespace mkl_vm = oneapi::mkl::vm; // OneMKL namespace with VM functions -namespace tu_ns = dpctl::tensor::type_utils; +namespace tu_ns = dpnp::tensor::type_utils; /** * @brief A factory to define pairs of supported types for which @@ -115,7 +115,7 @@ MACRO_POPULATE_DISPATCH_VECTORS(exp); void init_exp(py::module_ m) { - using arrayT = dpctl::tensor::usm_ndarray; + using arrayT = dpnp::tensor::usm_ndarray; using event_vecT = std::vector; impl::populate_dispatch_vectors(); diff --git a/dpnp/backend/extensions/vm/exp2.cpp b/dpnp/backend/extensions/vm/exp2.cpp index 41f18351fa7d..3472187f7d4a 100644 --- a/dpnp/backend/extensions/vm/exp2.cpp +++ b/dpnp/backend/extensions/vm/exp2.cpp @@ -42,12 +42,12 @@ #include "common.hpp" #include "exp2.hpp" -// include a local copy of elementwise common header from dpctl tensor: -// dpctl/tensor/libtensor/source/elementwise_functions/elementwise_functions.hpp -// TODO: replace by including dpctl header once available +// 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" -// dpctl tensor headers +// dpnp tensor headers #include "kernels/elementwise_functions/common.hpp" #include "utils/type_dispatch.hpp" #include "utils/type_utils.hpp" @@ -56,13 +56,13 @@ namespace dpnp::extensions::vm { namespace py = pybind11; namespace py_int = dpnp::extensions::py_internal; -namespace td_ns = dpctl::tensor::type_dispatch; +namespace td_ns = dpnp::tensor::type_dispatch; namespace impl { -namespace ew_cmn_ns = dpctl::tensor::kernels::elementwise_common; +namespace ew_cmn_ns = dpnp::tensor::kernels::elementwise_common; namespace mkl_vm = oneapi::mkl::vm; // OneMKL namespace with VM functions -namespace tu_ns = dpctl::tensor::type_utils; +namespace tu_ns = dpnp::tensor::type_utils; /** * @brief A factory to define pairs of supported types for which @@ -112,7 +112,7 @@ MACRO_POPULATE_DISPATCH_VECTORS(exp2); void init_exp2(py::module_ m) { - using arrayT = dpctl::tensor::usm_ndarray; + using arrayT = dpnp::tensor::usm_ndarray; using event_vecT = std::vector; impl::populate_dispatch_vectors(); diff --git a/dpnp/backend/extensions/vm/expm1.cpp b/dpnp/backend/extensions/vm/expm1.cpp index 37440cab9b0c..9ad3db32813b 100644 --- a/dpnp/backend/extensions/vm/expm1.cpp +++ b/dpnp/backend/extensions/vm/expm1.cpp @@ -42,12 +42,12 @@ #include "common.hpp" #include "expm1.hpp" -// include a local copy of elementwise common header from dpctl tensor: -// dpctl/tensor/libtensor/source/elementwise_functions/elementwise_functions.hpp -// TODO: replace by including dpctl header once available +// 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" -// dpctl tensor headers +// dpnp tensor headers #include "kernels/elementwise_functions/common.hpp" #include "utils/type_dispatch.hpp" #include "utils/type_utils.hpp" @@ -56,13 +56,13 @@ namespace dpnp::extensions::vm { namespace py = pybind11; namespace py_int = dpnp::extensions::py_internal; -namespace td_ns = dpctl::tensor::type_dispatch; +namespace td_ns = dpnp::tensor::type_dispatch; namespace impl { -namespace ew_cmn_ns = dpctl::tensor::kernels::elementwise_common; +namespace ew_cmn_ns = dpnp::tensor::kernels::elementwise_common; namespace mkl_vm = oneapi::mkl::vm; // OneMKL namespace with VM functions -namespace tu_ns = dpctl::tensor::type_utils; +namespace tu_ns = dpnp::tensor::type_utils; /** * @brief A factory to define pairs of supported types for which @@ -112,7 +112,7 @@ MACRO_POPULATE_DISPATCH_VECTORS(expm1); void init_expm1(py::module_ m) { - using arrayT = dpctl::tensor::usm_ndarray; + using arrayT = dpnp::tensor::usm_ndarray; using event_vecT = std::vector; impl::populate_dispatch_vectors(); diff --git a/dpnp/backend/extensions/vm/floor.cpp b/dpnp/backend/extensions/vm/floor.cpp index 771d141e7f6a..086097a5db52 100644 --- a/dpnp/backend/extensions/vm/floor.cpp +++ b/dpnp/backend/extensions/vm/floor.cpp @@ -42,12 +42,12 @@ #include "common.hpp" #include "floor.hpp" -// include a local copy of elementwise common header from dpctl tensor: -// dpctl/tensor/libtensor/source/elementwise_functions/elementwise_functions.hpp -// TODO: replace by including dpctl header once available +// 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" -// dpctl tensor headers +// dpnp tensor headers #include "kernels/elementwise_functions/common.hpp" #include "utils/type_dispatch.hpp" #include "utils/type_utils.hpp" @@ -56,13 +56,13 @@ namespace dpnp::extensions::vm { namespace py = pybind11; namespace py_int = dpnp::extensions::py_internal; -namespace td_ns = dpctl::tensor::type_dispatch; +namespace td_ns = dpnp::tensor::type_dispatch; namespace impl { -namespace ew_cmn_ns = dpctl::tensor::kernels::elementwise_common; +namespace ew_cmn_ns = dpnp::tensor::kernels::elementwise_common; namespace mkl_vm = oneapi::mkl::vm; // OneMKL namespace with VM functions -namespace tu_ns = dpctl::tensor::type_utils; +namespace tu_ns = dpnp::tensor::type_utils; /** * @brief A factory to define pairs of supported types for which @@ -112,7 +112,7 @@ MACRO_POPULATE_DISPATCH_VECTORS(floor); void init_floor(py::module_ m) { - using arrayT = dpctl::tensor::usm_ndarray; + using arrayT = dpnp::tensor::usm_ndarray; using event_vecT = std::vector; impl::populate_dispatch_vectors(); diff --git a/dpnp/backend/extensions/vm/fmax.cpp b/dpnp/backend/extensions/vm/fmax.cpp index d01b3ef3dc42..709c96b27080 100644 --- a/dpnp/backend/extensions/vm/fmax.cpp +++ b/dpnp/backend/extensions/vm/fmax.cpp @@ -43,12 +43,12 @@ #include "common.hpp" #include "fmax.hpp" -// include a local copy of elementwise common header from dpctl tensor: -// dpctl/tensor/libtensor/source/elementwise_functions/elementwise_functions.hpp -// TODO: replace by including dpctl header once available +// 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" -// dpctl tensor headers +// dpnp tensor headers #include "kernels/elementwise_functions/common.hpp" #include "utils/type_dispatch.hpp" #include "utils/type_utils.hpp" @@ -57,13 +57,13 @@ namespace dpnp::extensions::vm { namespace py = pybind11; namespace py_int = dpnp::extensions::py_internal; -namespace td_ns = dpctl::tensor::type_dispatch; +namespace td_ns = dpnp::tensor::type_dispatch; namespace impl { -namespace ew_cmn_ns = dpctl::tensor::kernels::elementwise_common; +namespace ew_cmn_ns = dpnp::tensor::kernels::elementwise_common; namespace mkl_vm = oneapi::mkl::vm; // OneMKL namespace with VM functions -namespace tu_ns = dpctl::tensor::type_utils; +namespace tu_ns = dpnp::tensor::type_utils; /** * @brief A factory to define pairs of supported types for which @@ -127,7 +127,7 @@ MACRO_POPULATE_DISPATCH_TABLES(fmax); void init_fmax(py::module_ m) { - using arrayT = dpctl::tensor::usm_ndarray; + using arrayT = dpnp::tensor::usm_ndarray; using event_vecT = std::vector; impl::populate_dispatch_tables(); diff --git a/dpnp/backend/extensions/vm/fmin.cpp b/dpnp/backend/extensions/vm/fmin.cpp index 6fbebba556f8..a20c07136c87 100644 --- a/dpnp/backend/extensions/vm/fmin.cpp +++ b/dpnp/backend/extensions/vm/fmin.cpp @@ -43,12 +43,12 @@ #include "common.hpp" #include "fmin.hpp" -// include a local copy of elementwise common header from dpctl tensor: -// dpctl/tensor/libtensor/source/elementwise_functions/elementwise_functions.hpp -// TODO: replace by including dpctl header once available +// 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" -// dpctl tensor headers +// dpnp tensor headers #include "kernels/elementwise_functions/common.hpp" #include "utils/type_dispatch.hpp" #include "utils/type_utils.hpp" @@ -57,13 +57,13 @@ namespace dpnp::extensions::vm { namespace py = pybind11; namespace py_int = dpnp::extensions::py_internal; -namespace td_ns = dpctl::tensor::type_dispatch; +namespace td_ns = dpnp::tensor::type_dispatch; namespace impl { -namespace ew_cmn_ns = dpctl::tensor::kernels::elementwise_common; +namespace ew_cmn_ns = dpnp::tensor::kernels::elementwise_common; namespace mkl_vm = oneapi::mkl::vm; // OneMKL namespace with VM functions -namespace tu_ns = dpctl::tensor::type_utils; +namespace tu_ns = dpnp::tensor::type_utils; /** * @brief A factory to define pairs of supported types for which @@ -127,7 +127,7 @@ MACRO_POPULATE_DISPATCH_TABLES(fmin); void init_fmin(py::module_ m) { - using arrayT = dpctl::tensor::usm_ndarray; + using arrayT = dpnp::tensor::usm_ndarray; using event_vecT = std::vector; impl::populate_dispatch_tables(); diff --git a/dpnp/backend/extensions/vm/fmod.cpp b/dpnp/backend/extensions/vm/fmod.cpp index 1330453d6f84..a9b66e820da9 100644 --- a/dpnp/backend/extensions/vm/fmod.cpp +++ b/dpnp/backend/extensions/vm/fmod.cpp @@ -43,12 +43,12 @@ #include "common.hpp" #include "fmod.hpp" -// include a local copy of elementwise common header from dpctl tensor: -// dpctl/tensor/libtensor/source/elementwise_functions/elementwise_functions.hpp -// TODO: replace by including dpctl header once available +// 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" -// dpctl tensor headers +// dpnp tensor headers #include "kernels/elementwise_functions/common.hpp" #include "utils/type_dispatch.hpp" #include "utils/type_utils.hpp" @@ -57,13 +57,13 @@ namespace dpnp::extensions::vm { namespace py = pybind11; namespace py_int = dpnp::extensions::py_internal; -namespace td_ns = dpctl::tensor::type_dispatch; +namespace td_ns = dpnp::tensor::type_dispatch; namespace impl { -namespace ew_cmn_ns = dpctl::tensor::kernels::elementwise_common; +namespace ew_cmn_ns = dpnp::tensor::kernels::elementwise_common; namespace mkl_vm = oneapi::mkl::vm; // OneMKL namespace with VM functions -namespace tu_ns = dpctl::tensor::type_utils; +namespace tu_ns = dpnp::tensor::type_utils; /** * @brief A factory to define pairs of supported types for which @@ -127,7 +127,7 @@ MACRO_POPULATE_DISPATCH_TABLES(fmod); void init_fmod(py::module_ m) { - using arrayT = dpctl::tensor::usm_ndarray; + using arrayT = dpnp::tensor::usm_ndarray; using event_vecT = std::vector; impl::populate_dispatch_tables(); diff --git a/dpnp/backend/extensions/vm/hypot.cpp b/dpnp/backend/extensions/vm/hypot.cpp index a9b3d3c12288..d979fc4dcd4a 100644 --- a/dpnp/backend/extensions/vm/hypot.cpp +++ b/dpnp/backend/extensions/vm/hypot.cpp @@ -43,12 +43,12 @@ #include "common.hpp" #include "hypot.hpp" -// include a local copy of elementwise common header from dpctl tensor: -// dpctl/tensor/libtensor/source/elementwise_functions/elementwise_functions.hpp -// TODO: replace by including dpctl header once available +// 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" -// dpctl tensor headers +// dpnp tensor headers #include "kernels/elementwise_functions/common.hpp" #include "utils/type_dispatch.hpp" #include "utils/type_utils.hpp" @@ -57,13 +57,13 @@ namespace dpnp::extensions::vm { namespace py = pybind11; namespace py_int = dpnp::extensions::py_internal; -namespace td_ns = dpctl::tensor::type_dispatch; +namespace td_ns = dpnp::tensor::type_dispatch; namespace impl { -namespace ew_cmn_ns = dpctl::tensor::kernels::elementwise_common; +namespace ew_cmn_ns = dpnp::tensor::kernels::elementwise_common; namespace mkl_vm = oneapi::mkl::vm; // OneMKL namespace with VM functions -namespace tu_ns = dpctl::tensor::type_utils; +namespace tu_ns = dpnp::tensor::type_utils; /** * @brief A factory to define pairs of supported types for which @@ -127,7 +127,7 @@ MACRO_POPULATE_DISPATCH_TABLES(hypot); void init_hypot(py::module_ m) { - using arrayT = dpctl::tensor::usm_ndarray; + using arrayT = dpnp::tensor::usm_ndarray; using event_vecT = std::vector; impl::populate_dispatch_tables(); diff --git a/dpnp/backend/extensions/vm/i0.cpp b/dpnp/backend/extensions/vm/i0.cpp index 50f692ebd958..a2ce992877a2 100644 --- a/dpnp/backend/extensions/vm/i0.cpp +++ b/dpnp/backend/extensions/vm/i0.cpp @@ -42,12 +42,12 @@ #include "common.hpp" #include "i0.hpp" -// include a local copy of elementwise common header from dpctl tensor: -// dpctl/tensor/libtensor/source/elementwise_functions/elementwise_functions.hpp -// TODO: replace by including dpctl header once available +// 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" -// dpctl tensor headers +// dpnp tensor headers #include "kernels/elementwise_functions/common.hpp" #include "utils/type_dispatch.hpp" #include "utils/type_utils.hpp" @@ -56,13 +56,13 @@ namespace dpnp::extensions::vm { namespace py = pybind11; namespace py_int = dpnp::extensions::py_internal; -namespace td_ns = dpctl::tensor::type_dispatch; +namespace td_ns = dpnp::tensor::type_dispatch; namespace impl { -namespace ew_cmn_ns = dpctl::tensor::kernels::elementwise_common; +namespace ew_cmn_ns = dpnp::tensor::kernels::elementwise_common; namespace mkl_vm = oneapi::mkl::vm; // OneMKL namespace with VM functions -namespace tu_ns = dpctl::tensor::type_utils; +namespace tu_ns = dpnp::tensor::type_utils; /** * @brief A factory to define pairs of supported types for which @@ -112,7 +112,7 @@ MACRO_POPULATE_DISPATCH_VECTORS(i0); void init_i0(py::module_ m) { - using arrayT = dpctl::tensor::usm_ndarray; + using arrayT = dpnp::tensor::usm_ndarray; using event_vecT = std::vector; impl::populate_dispatch_vectors(); diff --git a/dpnp/backend/extensions/vm/inv.cpp b/dpnp/backend/extensions/vm/inv.cpp index eda08a6d0cd5..1df30d520ef7 100644 --- a/dpnp/backend/extensions/vm/inv.cpp +++ b/dpnp/backend/extensions/vm/inv.cpp @@ -42,12 +42,12 @@ #include "common.hpp" #include "inv.hpp" -// include a local copy of elementwise common header from dpctl tensor: -// dpctl/tensor/libtensor/source/elementwise_functions/elementwise_functions.hpp -// TODO: replace by including dpctl header once available +// 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" -// dpctl tensor headers +// dpnp tensor headers #include "kernels/elementwise_functions/common.hpp" #include "utils/type_dispatch.hpp" #include "utils/type_utils.hpp" @@ -56,13 +56,13 @@ namespace dpnp::extensions::vm { namespace py = pybind11; namespace py_int = dpnp::extensions::py_internal; -namespace td_ns = dpctl::tensor::type_dispatch; +namespace td_ns = dpnp::tensor::type_dispatch; namespace impl { -namespace ew_cmn_ns = dpctl::tensor::kernels::elementwise_common; +namespace ew_cmn_ns = dpnp::tensor::kernels::elementwise_common; namespace mkl_vm = oneapi::mkl::vm; // OneMKL namespace with VM functions -namespace tu_ns = dpctl::tensor::type_utils; +namespace tu_ns = dpnp::tensor::type_utils; /** * @brief A factory to define pairs of supported types for which @@ -112,7 +112,7 @@ MACRO_POPULATE_DISPATCH_VECTORS(inv); void init_inv(py::module_ m) { - using arrayT = dpctl::tensor::usm_ndarray; + using arrayT = dpnp::tensor::usm_ndarray; using event_vecT = std::vector; impl::populate_dispatch_vectors(); diff --git a/dpnp/backend/extensions/vm/ln.cpp b/dpnp/backend/extensions/vm/ln.cpp index a5365e4d5a8b..029266d38cce 100644 --- a/dpnp/backend/extensions/vm/ln.cpp +++ b/dpnp/backend/extensions/vm/ln.cpp @@ -43,12 +43,12 @@ #include "common.hpp" #include "ln.hpp" -// include a local copy of elementwise common header from dpctl tensor: -// dpctl/tensor/libtensor/source/elementwise_functions/elementwise_functions.hpp -// TODO: replace by including dpctl header once available +// 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" -// dpctl tensor headers +// dpnp tensor headers #include "kernels/elementwise_functions/common.hpp" #include "utils/type_dispatch.hpp" #include "utils/type_utils.hpp" @@ -57,13 +57,13 @@ namespace dpnp::extensions::vm { namespace py = pybind11; namespace py_int = dpnp::extensions::py_internal; -namespace td_ns = dpctl::tensor::type_dispatch; +namespace td_ns = dpnp::tensor::type_dispatch; namespace impl { -namespace ew_cmn_ns = dpctl::tensor::kernels::elementwise_common; +namespace ew_cmn_ns = dpnp::tensor::kernels::elementwise_common; namespace mkl_vm = oneapi::mkl::vm; // OneMKL namespace with VM functions -namespace tu_ns = dpctl::tensor::type_utils; +namespace tu_ns = dpnp::tensor::type_utils; /** * @brief A factory to define pairs of supported types for which @@ -115,7 +115,7 @@ MACRO_POPULATE_DISPATCH_VECTORS(ln); void init_ln(py::module_ m) { - using arrayT = dpctl::tensor::usm_ndarray; + using arrayT = dpnp::tensor::usm_ndarray; using event_vecT = std::vector; impl::populate_dispatch_vectors(); diff --git a/dpnp/backend/extensions/vm/log10.cpp b/dpnp/backend/extensions/vm/log10.cpp index c04fb602f63d..4eb0b4a7781d 100644 --- a/dpnp/backend/extensions/vm/log10.cpp +++ b/dpnp/backend/extensions/vm/log10.cpp @@ -43,12 +43,12 @@ #include "common.hpp" #include "log10.hpp" -// include a local copy of elementwise common header from dpctl tensor: -// dpctl/tensor/libtensor/source/elementwise_functions/elementwise_functions.hpp -// TODO: replace by including dpctl header once available +// 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" -// dpctl tensor headers +// dpnp tensor headers #include "kernels/elementwise_functions/common.hpp" #include "utils/type_dispatch.hpp" #include "utils/type_utils.hpp" @@ -57,13 +57,13 @@ namespace dpnp::extensions::vm { namespace py = pybind11; namespace py_int = dpnp::extensions::py_internal; -namespace td_ns = dpctl::tensor::type_dispatch; +namespace td_ns = dpnp::tensor::type_dispatch; namespace impl { -namespace ew_cmn_ns = dpctl::tensor::kernels::elementwise_common; +namespace ew_cmn_ns = dpnp::tensor::kernels::elementwise_common; namespace mkl_vm = oneapi::mkl::vm; // OneMKL namespace with VM functions -namespace tu_ns = dpctl::tensor::type_utils; +namespace tu_ns = dpnp::tensor::type_utils; /** * @brief A factory to define pairs of supported types for which @@ -115,7 +115,7 @@ MACRO_POPULATE_DISPATCH_VECTORS(log10); void init_log10(py::module_ m) { - using arrayT = dpctl::tensor::usm_ndarray; + using arrayT = dpnp::tensor::usm_ndarray; using event_vecT = std::vector; impl::populate_dispatch_vectors(); diff --git a/dpnp/backend/extensions/vm/log1p.cpp b/dpnp/backend/extensions/vm/log1p.cpp index 04416bf37185..7a1673ad7e0a 100644 --- a/dpnp/backend/extensions/vm/log1p.cpp +++ b/dpnp/backend/extensions/vm/log1p.cpp @@ -42,12 +42,12 @@ #include "common.hpp" #include "log1p.hpp" -// include a local copy of elementwise common header from dpctl tensor: -// dpctl/tensor/libtensor/source/elementwise_functions/elementwise_functions.hpp -// TODO: replace by including dpctl header once available +// 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" -// dpctl tensor headers +// dpnp tensor headers #include "kernels/elementwise_functions/common.hpp" #include "utils/type_dispatch.hpp" #include "utils/type_utils.hpp" @@ -56,13 +56,13 @@ namespace dpnp::extensions::vm { namespace py = pybind11; namespace py_int = dpnp::extensions::py_internal; -namespace td_ns = dpctl::tensor::type_dispatch; +namespace td_ns = dpnp::tensor::type_dispatch; namespace impl { -namespace ew_cmn_ns = dpctl::tensor::kernels::elementwise_common; +namespace ew_cmn_ns = dpnp::tensor::kernels::elementwise_common; namespace mkl_vm = oneapi::mkl::vm; // OneMKL namespace with VM functions -namespace tu_ns = dpctl::tensor::type_utils; +namespace tu_ns = dpnp::tensor::type_utils; /** * @brief A factory to define pairs of supported types for which @@ -112,7 +112,7 @@ MACRO_POPULATE_DISPATCH_VECTORS(log1p); void init_log1p(py::module_ m) { - using arrayT = dpctl::tensor::usm_ndarray; + using arrayT = dpnp::tensor::usm_ndarray; using event_vecT = std::vector; impl::populate_dispatch_vectors(); diff --git a/dpnp/backend/extensions/vm/log2.cpp b/dpnp/backend/extensions/vm/log2.cpp index 752caa261977..95395a069921 100644 --- a/dpnp/backend/extensions/vm/log2.cpp +++ b/dpnp/backend/extensions/vm/log2.cpp @@ -42,12 +42,12 @@ #include "common.hpp" #include "log2.hpp" -// include a local copy of elementwise common header from dpctl tensor: -// dpctl/tensor/libtensor/source/elementwise_functions/elementwise_functions.hpp -// TODO: replace by including dpctl header once available +// 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" -// dpctl tensor headers +// dpnp tensor headers #include "kernels/elementwise_functions/common.hpp" #include "utils/type_dispatch.hpp" #include "utils/type_utils.hpp" @@ -56,13 +56,13 @@ namespace dpnp::extensions::vm { namespace py = pybind11; namespace py_int = dpnp::extensions::py_internal; -namespace td_ns = dpctl::tensor::type_dispatch; +namespace td_ns = dpnp::tensor::type_dispatch; namespace impl { -namespace ew_cmn_ns = dpctl::tensor::kernels::elementwise_common; +namespace ew_cmn_ns = dpnp::tensor::kernels::elementwise_common; namespace mkl_vm = oneapi::mkl::vm; // OneMKL namespace with VM functions -namespace tu_ns = dpctl::tensor::type_utils; +namespace tu_ns = dpnp::tensor::type_utils; /** * @brief A factory to define pairs of supported types for which @@ -112,7 +112,7 @@ MACRO_POPULATE_DISPATCH_VECTORS(log2); void init_log2(py::module_ m) { - using arrayT = dpctl::tensor::usm_ndarray; + using arrayT = dpnp::tensor::usm_ndarray; using event_vecT = std::vector; impl::populate_dispatch_vectors(); diff --git a/dpnp/backend/extensions/vm/modf.cpp b/dpnp/backend/extensions/vm/modf.cpp index 418e4e44f7f7..7ba980462888 100644 --- a/dpnp/backend/extensions/vm/modf.cpp +++ b/dpnp/backend/extensions/vm/modf.cpp @@ -43,15 +43,15 @@ #include "common.hpp" #include "modf.hpp" -// include a local copy of elementwise common header from dpctl tensor: -// dpctl/tensor/libtensor/source/elementwise_functions/elementwise_functions.hpp -// TODO: replace by including dpctl header once available +// 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/common.hpp" #include "../elementwise_functions/type_dispatch_building.hpp" -// dpctl tensor headers +// dpnp tensor headers #include "utils/type_dispatch.hpp" #include "utils/type_utils.hpp" @@ -59,14 +59,14 @@ namespace dpnp::extensions::vm { namespace py = pybind11; namespace py_int = dpnp::extensions::py_internal; -namespace td_ns = dpctl::tensor::type_dispatch; +namespace td_ns = dpnp::tensor::type_dispatch; namespace impl { namespace ew_cmn_ns = dpnp::extensions::py_internal::elementwise_common; namespace mkl_vm = oneapi::mkl::vm; // OneMKL namespace with VM functions namespace td_int_ns = py_int::type_dispatch; -namespace tu_ns = dpctl::tensor::type_utils; +namespace tu_ns = dpnp::tensor::type_utils; /** * @brief A factory to define pairs of supported types for which @@ -124,7 +124,7 @@ MACRO_POPULATE_DISPATCH_2OUTS_VECTORS(modf); void init_modf(py::module_ m) { - using arrayT = dpctl::tensor::usm_ndarray; + using arrayT = dpnp::tensor::usm_ndarray; using event_vecT = std::vector; impl::populate_dispatch_vectors(); diff --git a/dpnp/backend/extensions/vm/mul.cpp b/dpnp/backend/extensions/vm/mul.cpp index 557cfb8882b3..1e48af3c6714 100644 --- a/dpnp/backend/extensions/vm/mul.cpp +++ b/dpnp/backend/extensions/vm/mul.cpp @@ -44,12 +44,12 @@ #include "common.hpp" #include "mul.hpp" -// include a local copy of elementwise common header from dpctl tensor: -// dpctl/tensor/libtensor/source/elementwise_functions/elementwise_functions.hpp -// TODO: replace by including dpctl header once available +// 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" -// dpctl tensor headers +// dpnp tensor headers #include "kernels/elementwise_functions/common.hpp" #include "utils/type_dispatch.hpp" #include "utils/type_utils.hpp" @@ -58,13 +58,13 @@ namespace dpnp::extensions::vm { namespace py = pybind11; namespace py_int = dpnp::extensions::py_internal; -namespace td_ns = dpctl::tensor::type_dispatch; +namespace td_ns = dpnp::tensor::type_dispatch; namespace impl { -namespace ew_cmn_ns = dpctl::tensor::kernels::elementwise_common; +namespace ew_cmn_ns = dpnp::tensor::kernels::elementwise_common; namespace mkl_vm = oneapi::mkl::vm; // OneMKL namespace with VM functions -namespace tu_ns = dpctl::tensor::type_utils; +namespace tu_ns = dpnp::tensor::type_utils; /** * @brief A factory to define pairs of supported types for which @@ -138,7 +138,7 @@ MACRO_POPULATE_DISPATCH_TABLES(mul); void init_mul(py::module_ m) { - using arrayT = dpctl::tensor::usm_ndarray; + using arrayT = dpnp::tensor::usm_ndarray; using event_vecT = std::vector; impl::populate_dispatch_tables(); diff --git a/dpnp/backend/extensions/vm/nextafter.cpp b/dpnp/backend/extensions/vm/nextafter.cpp index a8ff710bda77..eb2d82e23f9b 100644 --- a/dpnp/backend/extensions/vm/nextafter.cpp +++ b/dpnp/backend/extensions/vm/nextafter.cpp @@ -43,12 +43,12 @@ #include "common.hpp" #include "nextafter.hpp" -// include a local copy of elementwise common header from dpctl tensor: -// dpctl/tensor/libtensor/source/elementwise_functions/elementwise_functions.hpp -// TODO: replace by including dpctl header once available +// 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" -// dpctl tensor headers +// dpnp tensor headers #include "kernels/elementwise_functions/common.hpp" #include "utils/type_dispatch.hpp" #include "utils/type_utils.hpp" @@ -57,13 +57,13 @@ namespace dpnp::extensions::vm { namespace py = pybind11; namespace py_int = dpnp::extensions::py_internal; -namespace td_ns = dpctl::tensor::type_dispatch; +namespace td_ns = dpnp::tensor::type_dispatch; namespace impl { -namespace ew_cmn_ns = dpctl::tensor::kernels::elementwise_common; +namespace ew_cmn_ns = dpnp::tensor::kernels::elementwise_common; namespace mkl_vm = oneapi::mkl::vm; // OneMKL namespace with VM functions -namespace tu_ns = dpctl::tensor::type_utils; +namespace tu_ns = dpnp::tensor::type_utils; /** * @brief A factory to define pairs of supported types for which @@ -129,7 +129,7 @@ MACRO_POPULATE_DISPATCH_TABLES(nextafter); void init_nextafter(py::module_ m) { - using arrayT = dpctl::tensor::usm_ndarray; + using arrayT = dpnp::tensor::usm_ndarray; using event_vecT = std::vector; impl::populate_dispatch_tables(); diff --git a/dpnp/backend/extensions/vm/pow.cpp b/dpnp/backend/extensions/vm/pow.cpp index f0db87d1ef48..c970abbbf350 100644 --- a/dpnp/backend/extensions/vm/pow.cpp +++ b/dpnp/backend/extensions/vm/pow.cpp @@ -44,12 +44,12 @@ #include "common.hpp" #include "pow.hpp" -// include a local copy of elementwise common header from dpctl tensor: -// dpctl/tensor/libtensor/source/elementwise_functions/elementwise_functions.hpp -// TODO: replace by including dpctl header once available +// 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" -// dpctl tensor headers +// dpnp tensor headers #include "kernels/elementwise_functions/common.hpp" #include "utils/type_dispatch.hpp" #include "utils/type_utils.hpp" @@ -58,13 +58,13 @@ namespace dpnp::extensions::vm { namespace py = pybind11; namespace py_int = dpnp::extensions::py_internal; -namespace td_ns = dpctl::tensor::type_dispatch; +namespace td_ns = dpnp::tensor::type_dispatch; namespace impl { -namespace ew_cmn_ns = dpctl::tensor::kernels::elementwise_common; +namespace ew_cmn_ns = dpnp::tensor::kernels::elementwise_common; namespace mkl_vm = oneapi::mkl::vm; // OneMKL namespace with VM functions -namespace tu_ns = dpctl::tensor::type_utils; +namespace tu_ns = dpnp::tensor::type_utils; /** * @brief A factory to define pairs of supported types for which @@ -138,7 +138,7 @@ MACRO_POPULATE_DISPATCH_TABLES(pow); void init_pow(py::module_ m) { - using arrayT = dpctl::tensor::usm_ndarray; + using arrayT = dpnp::tensor::usm_ndarray; using event_vecT = std::vector; impl::populate_dispatch_tables(); diff --git a/dpnp/backend/extensions/vm/rint.cpp b/dpnp/backend/extensions/vm/rint.cpp index 86931f259a04..ff333d877a30 100644 --- a/dpnp/backend/extensions/vm/rint.cpp +++ b/dpnp/backend/extensions/vm/rint.cpp @@ -42,12 +42,12 @@ #include "common.hpp" #include "rint.hpp" -// include a local copy of elementwise common header from dpctl tensor: -// dpctl/tensor/libtensor/source/elementwise_functions/elementwise_functions.hpp -// TODO: replace by including dpctl header once available +// 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" -// dpctl tensor headers +// dpnp tensor headers #include "kernels/elementwise_functions/common.hpp" #include "utils/type_dispatch.hpp" #include "utils/type_utils.hpp" @@ -56,13 +56,13 @@ namespace dpnp::extensions::vm { namespace py = pybind11; namespace py_int = dpnp::extensions::py_internal; -namespace td_ns = dpctl::tensor::type_dispatch; +namespace td_ns = dpnp::tensor::type_dispatch; namespace impl { -namespace ew_cmn_ns = dpctl::tensor::kernels::elementwise_common; +namespace ew_cmn_ns = dpnp::tensor::kernels::elementwise_common; namespace mkl_vm = oneapi::mkl::vm; // OneMKL namespace with VM functions -namespace tu_ns = dpctl::tensor::type_utils; +namespace tu_ns = dpnp::tensor::type_utils; /** * @brief A factory to define pairs of supported types for which @@ -112,7 +112,7 @@ MACRO_POPULATE_DISPATCH_VECTORS(rint); void init_rint(py::module_ m) { - using arrayT = dpctl::tensor::usm_ndarray; + using arrayT = dpnp::tensor::usm_ndarray; using event_vecT = std::vector; impl::populate_dispatch_vectors(); diff --git a/dpnp/backend/extensions/vm/sin.cpp b/dpnp/backend/extensions/vm/sin.cpp index 7bb6ec321d2a..cdf7e6b57816 100644 --- a/dpnp/backend/extensions/vm/sin.cpp +++ b/dpnp/backend/extensions/vm/sin.cpp @@ -43,12 +43,12 @@ #include "common.hpp" #include "sin.hpp" -// include a local copy of elementwise common header from dpctl tensor: -// dpctl/tensor/libtensor/source/elementwise_functions/elementwise_functions.hpp -// TODO: replace by including dpctl header once available +// 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" -// dpctl tensor headers +// dpnp tensor headers #include "kernels/elementwise_functions/common.hpp" #include "utils/type_dispatch.hpp" #include "utils/type_utils.hpp" @@ -57,13 +57,13 @@ namespace dpnp::extensions::vm { namespace py = pybind11; namespace py_int = dpnp::extensions::py_internal; -namespace td_ns = dpctl::tensor::type_dispatch; +namespace td_ns = dpnp::tensor::type_dispatch; namespace impl { -namespace ew_cmn_ns = dpctl::tensor::kernels::elementwise_common; +namespace ew_cmn_ns = dpnp::tensor::kernels::elementwise_common; namespace mkl_vm = oneapi::mkl::vm; // OneMKL namespace with VM functions -namespace tu_ns = dpctl::tensor::type_utils; +namespace tu_ns = dpnp::tensor::type_utils; /** * @brief A factory to define pairs of supported types for which @@ -115,7 +115,7 @@ MACRO_POPULATE_DISPATCH_VECTORS(sin); void init_sin(py::module_ m) { - using arrayT = dpctl::tensor::usm_ndarray; + using arrayT = dpnp::tensor::usm_ndarray; using event_vecT = std::vector; impl::populate_dispatch_vectors(); diff --git a/dpnp/backend/extensions/vm/sinh.cpp b/dpnp/backend/extensions/vm/sinh.cpp index 5c351afd3b82..6593c3c907e7 100644 --- a/dpnp/backend/extensions/vm/sinh.cpp +++ b/dpnp/backend/extensions/vm/sinh.cpp @@ -43,12 +43,12 @@ #include "common.hpp" #include "sinh.hpp" -// include a local copy of elementwise common header from dpctl tensor: -// dpctl/tensor/libtensor/source/elementwise_functions/elementwise_functions.hpp -// TODO: replace by including dpctl header once available +// 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" -// dpctl tensor headers +// dpnp tensor headers #include "kernels/elementwise_functions/common.hpp" #include "utils/type_dispatch.hpp" #include "utils/type_utils.hpp" @@ -57,13 +57,13 @@ namespace dpnp::extensions::vm { namespace py = pybind11; namespace py_int = dpnp::extensions::py_internal; -namespace td_ns = dpctl::tensor::type_dispatch; +namespace td_ns = dpnp::tensor::type_dispatch; namespace impl { -namespace ew_cmn_ns = dpctl::tensor::kernels::elementwise_common; +namespace ew_cmn_ns = dpnp::tensor::kernels::elementwise_common; namespace mkl_vm = oneapi::mkl::vm; // OneMKL namespace with VM functions -namespace tu_ns = dpctl::tensor::type_utils; +namespace tu_ns = dpnp::tensor::type_utils; /** * @brief A factory to define pairs of supported types for which @@ -115,7 +115,7 @@ MACRO_POPULATE_DISPATCH_VECTORS(sinh); void init_sinh(py::module_ m) { - using arrayT = dpctl::tensor::usm_ndarray; + using arrayT = dpnp::tensor::usm_ndarray; using event_vecT = std::vector; impl::populate_dispatch_vectors(); diff --git a/dpnp/backend/extensions/vm/sqr.cpp b/dpnp/backend/extensions/vm/sqr.cpp index 9d5cb8af5f2c..e6b8f2180c22 100644 --- a/dpnp/backend/extensions/vm/sqr.cpp +++ b/dpnp/backend/extensions/vm/sqr.cpp @@ -42,12 +42,12 @@ #include "common.hpp" #include "sqr.hpp" -// include a local copy of elementwise common header from dpctl tensor: -// dpctl/tensor/libtensor/source/elementwise_functions/elementwise_functions.hpp -// TODO: replace by including dpctl header once available +// 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" -// dpctl tensor headers +// dpnp tensor headers #include "kernels/elementwise_functions/common.hpp" #include "utils/type_dispatch.hpp" #include "utils/type_utils.hpp" @@ -56,13 +56,13 @@ namespace dpnp::extensions::vm { namespace py = pybind11; namespace py_int = dpnp::extensions::py_internal; -namespace td_ns = dpctl::tensor::type_dispatch; +namespace td_ns = dpnp::tensor::type_dispatch; namespace impl { -namespace ew_cmn_ns = dpctl::tensor::kernels::elementwise_common; +namespace ew_cmn_ns = dpnp::tensor::kernels::elementwise_common; namespace mkl_vm = oneapi::mkl::vm; // OneMKL namespace with VM functions -namespace tu_ns = dpctl::tensor::type_utils; +namespace tu_ns = dpnp::tensor::type_utils; /** * @brief A factory to define pairs of supported types for which @@ -112,7 +112,7 @@ MACRO_POPULATE_DISPATCH_VECTORS(sqr); void init_sqr(py::module_ m) { - using arrayT = dpctl::tensor::usm_ndarray; + using arrayT = dpnp::tensor::usm_ndarray; using event_vecT = std::vector; impl::populate_dispatch_vectors(); diff --git a/dpnp/backend/extensions/vm/sqrt.cpp b/dpnp/backend/extensions/vm/sqrt.cpp index 5ab3489c1288..27bda2a1a912 100644 --- a/dpnp/backend/extensions/vm/sqrt.cpp +++ b/dpnp/backend/extensions/vm/sqrt.cpp @@ -43,12 +43,12 @@ #include "common.hpp" #include "sqrt.hpp" -// include a local copy of elementwise common header from dpctl tensor: -// dpctl/tensor/libtensor/source/elementwise_functions/elementwise_functions.hpp -// TODO: replace by including dpctl header once available +// 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" -// dpctl tensor headers +// dpnp tensor headers #include "kernels/elementwise_functions/common.hpp" #include "utils/type_dispatch.hpp" #include "utils/type_utils.hpp" @@ -57,13 +57,13 @@ namespace dpnp::extensions::vm { namespace py = pybind11; namespace py_int = dpnp::extensions::py_internal; -namespace td_ns = dpctl::tensor::type_dispatch; +namespace td_ns = dpnp::tensor::type_dispatch; namespace impl { -namespace ew_cmn_ns = dpctl::tensor::kernels::elementwise_common; +namespace ew_cmn_ns = dpnp::tensor::kernels::elementwise_common; namespace mkl_vm = oneapi::mkl::vm; // OneMKL namespace with VM functions -namespace tu_ns = dpctl::tensor::type_utils; +namespace tu_ns = dpnp::tensor::type_utils; /** * @brief A factory to define pairs of supported types for which @@ -115,7 +115,7 @@ MACRO_POPULATE_DISPATCH_VECTORS(sqrt); void init_sqrt(py::module_ m) { - using arrayT = dpctl::tensor::usm_ndarray; + using arrayT = dpnp::tensor::usm_ndarray; using event_vecT = std::vector; impl::populate_dispatch_vectors(); diff --git a/dpnp/backend/extensions/vm/sub.cpp b/dpnp/backend/extensions/vm/sub.cpp index 401588d4b65f..099f6d11dc87 100644 --- a/dpnp/backend/extensions/vm/sub.cpp +++ b/dpnp/backend/extensions/vm/sub.cpp @@ -44,12 +44,12 @@ #include "common.hpp" #include "sub.hpp" -// include a local copy of elementwise common header from dpctl tensor: -// dpctl/tensor/libtensor/source/elementwise_functions/elementwise_functions.hpp -// TODO: replace by including dpctl header once available +// 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" -// dpctl tensor headers +// dpnp tensor headers #include "kernels/elementwise_functions/common.hpp" #include "utils/type_dispatch.hpp" #include "utils/type_utils.hpp" @@ -58,13 +58,13 @@ namespace dpnp::extensions::vm { namespace py = pybind11; namespace py_int = dpnp::extensions::py_internal; -namespace td_ns = dpctl::tensor::type_dispatch; +namespace td_ns = dpnp::tensor::type_dispatch; namespace impl { -namespace ew_cmn_ns = dpctl::tensor::kernels::elementwise_common; +namespace ew_cmn_ns = dpnp::tensor::kernels::elementwise_common; namespace mkl_vm = oneapi::mkl::vm; // OneMKL namespace with VM functions -namespace tu_ns = dpctl::tensor::type_utils; +namespace tu_ns = dpnp::tensor::type_utils; /** * @brief A factory to define pairs of supported types for which @@ -138,7 +138,7 @@ MACRO_POPULATE_DISPATCH_TABLES(sub); void init_sub(py::module_ m) { - using arrayT = dpctl::tensor::usm_ndarray; + using arrayT = dpnp::tensor::usm_ndarray; using event_vecT = std::vector; impl::populate_dispatch_tables(); diff --git a/dpnp/backend/extensions/vm/tan.cpp b/dpnp/backend/extensions/vm/tan.cpp index 590320034934..9c1d43011122 100644 --- a/dpnp/backend/extensions/vm/tan.cpp +++ b/dpnp/backend/extensions/vm/tan.cpp @@ -43,12 +43,12 @@ #include "common.hpp" #include "tan.hpp" -// include a local copy of elementwise common header from dpctl tensor: -// dpctl/tensor/libtensor/source/elementwise_functions/elementwise_functions.hpp -// TODO: replace by including dpctl header once available +// 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" -// dpctl tensor headers +// dpnp tensor headers #include "kernels/elementwise_functions/common.hpp" #include "utils/type_dispatch.hpp" #include "utils/type_utils.hpp" @@ -57,13 +57,13 @@ namespace dpnp::extensions::vm { namespace py = pybind11; namespace py_int = dpnp::extensions::py_internal; -namespace td_ns = dpctl::tensor::type_dispatch; +namespace td_ns = dpnp::tensor::type_dispatch; namespace impl { -namespace ew_cmn_ns = dpctl::tensor::kernels::elementwise_common; +namespace ew_cmn_ns = dpnp::tensor::kernels::elementwise_common; namespace mkl_vm = oneapi::mkl::vm; // OneMKL namespace with VM functions -namespace tu_ns = dpctl::tensor::type_utils; +namespace tu_ns = dpnp::tensor::type_utils; /** * @brief A factory to define pairs of supported types for which @@ -115,7 +115,7 @@ MACRO_POPULATE_DISPATCH_VECTORS(tan); void init_tan(py::module_ m) { - using arrayT = dpctl::tensor::usm_ndarray; + using arrayT = dpnp::tensor::usm_ndarray; using event_vecT = std::vector; impl::populate_dispatch_vectors(); diff --git a/dpnp/backend/extensions/vm/tanh.cpp b/dpnp/backend/extensions/vm/tanh.cpp index 8febd94f2ec8..bf8ef3d0b018 100644 --- a/dpnp/backend/extensions/vm/tanh.cpp +++ b/dpnp/backend/extensions/vm/tanh.cpp @@ -43,12 +43,12 @@ #include "common.hpp" #include "tanh.hpp" -// include a local copy of elementwise common header from dpctl tensor: -// dpctl/tensor/libtensor/source/elementwise_functions/elementwise_functions.hpp -// TODO: replace by including dpctl header once available +// 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" -// dpctl tensor headers +// dpnp tensor headers #include "kernels/elementwise_functions/common.hpp" #include "utils/type_dispatch.hpp" #include "utils/type_utils.hpp" @@ -57,13 +57,13 @@ namespace dpnp::extensions::vm { namespace py = pybind11; namespace py_int = dpnp::extensions::py_internal; -namespace td_ns = dpctl::tensor::type_dispatch; +namespace td_ns = dpnp::tensor::type_dispatch; namespace impl { -namespace ew_cmn_ns = dpctl::tensor::kernels::elementwise_common; +namespace ew_cmn_ns = dpnp::tensor::kernels::elementwise_common; namespace mkl_vm = oneapi::mkl::vm; // OneMKL namespace with VM functions -namespace tu_ns = dpctl::tensor::type_utils; +namespace tu_ns = dpnp::tensor::type_utils; /** * @brief A factory to define pairs of supported types for which @@ -115,7 +115,7 @@ MACRO_POPULATE_DISPATCH_VECTORS(tanh); void init_tanh(py::module_ m) { - using arrayT = dpctl::tensor::usm_ndarray; + using arrayT = dpnp::tensor::usm_ndarray; using event_vecT = std::vector; impl::populate_dispatch_vectors(); diff --git a/dpnp/backend/extensions/vm/trunc.cpp b/dpnp/backend/extensions/vm/trunc.cpp index 4ec788ccf949..f04216176373 100644 --- a/dpnp/backend/extensions/vm/trunc.cpp +++ b/dpnp/backend/extensions/vm/trunc.cpp @@ -42,12 +42,12 @@ #include "common.hpp" #include "trunc.hpp" -// include a local copy of elementwise common header from dpctl tensor: -// dpctl/tensor/libtensor/source/elementwise_functions/elementwise_functions.hpp -// TODO: replace by including dpctl header once available +// 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" -// dpctl tensor headers +// dpnp tensor headers #include "kernels/elementwise_functions/common.hpp" #include "utils/type_dispatch.hpp" #include "utils/type_utils.hpp" @@ -56,13 +56,13 @@ namespace dpnp::extensions::vm { namespace py = pybind11; namespace py_int = dpnp::extensions::py_internal; -namespace td_ns = dpctl::tensor::type_dispatch; +namespace td_ns = dpnp::tensor::type_dispatch; namespace impl { -namespace ew_cmn_ns = dpctl::tensor::kernels::elementwise_common; +namespace ew_cmn_ns = dpnp::tensor::kernels::elementwise_common; namespace mkl_vm = oneapi::mkl::vm; // OneMKL namespace with VM functions -namespace tu_ns = dpctl::tensor::type_utils; +namespace tu_ns = dpnp::tensor::type_utils; /** * @brief A factory to define pairs of supported types for which @@ -112,7 +112,7 @@ MACRO_POPULATE_DISPATCH_VECTORS(trunc); void init_trunc(py::module_ m) { - using arrayT = dpctl::tensor::usm_ndarray; + using arrayT = dpnp::tensor::usm_ndarray; using event_vecT = std::vector; impl::populate_dispatch_vectors(); diff --git a/dpnp/backend/extensions/window/common.hpp b/dpnp/backend/extensions/window/common.hpp index fcec281b3948..529b18120acb 100644 --- a/dpnp/backend/extensions/window/common.hpp +++ b/dpnp/backend/extensions/window/common.hpp @@ -41,7 +41,7 @@ #include #include -// dpctl tensor headers +// dpnp tensor headers #include "utils/output_validation.hpp" #include "utils/type_dispatch.hpp" #include "utils/type_utils.hpp" @@ -49,7 +49,7 @@ namespace dpnp::extensions::window { namespace py = pybind11; -namespace td_ns = dpctl::tensor::type_dispatch; +namespace td_ns = dpnp::tensor::type_dispatch; typedef sycl::event (*window_fn_ptr_t)(sycl::queue &, char *, @@ -62,7 +62,7 @@ sycl::event window_impl(sycl::queue &exec_q, const std::size_t nelems, const std::vector &depends) { - dpctl::tensor::type_utils::validate_type_for_device(exec_q); + dpnp::tensor::type_utils::validate_type_for_device(exec_q); T *res = reinterpret_cast(result); @@ -94,17 +94,17 @@ struct Factory template std::tuple window_fn(sycl::queue &exec_q, - const dpctl::tensor::usm_ndarray &result, + const dpnp::tensor::usm_ndarray &result, const funcPtrT *window_dispatch_vector) { - dpctl::tensor::validation::CheckWritable::throw_if_not_writable(result); + dpnp::tensor::validation::CheckWritable::throw_if_not_writable(result); const int nd = result.get_ndim(); if (nd != 1) { throw py::value_error("Array should be 1d"); } - if (!dpctl::utils::queues_are_compatible(exec_q, {result.get_queue()})) { + if (!dpnp::utils::queues_are_compatible(exec_q, {result.get_queue()})) { throw py::value_error( "Execution queue is not compatible with allocation queue."); } @@ -134,7 +134,7 @@ std::tuple inline std::pair py_window(sycl::queue &exec_q, - const dpctl::tensor::usm_ndarray &result, + const dpnp::tensor::usm_ndarray &result, const std::vector &depends, const window_fn_ptr_t *window_dispatch_vector) { @@ -147,7 +147,7 @@ inline std::pair sycl::event window_ev = fn(exec_q, result_typeless_ptr, nelems, depends); sycl::event args_ev = - dpctl::utils::keep_args_alive(exec_q, {result}, {window_ev}); + dpnp::utils::keep_args_alive(exec_q, {result}, {window_ev}); return std::make_pair(args_ev, window_ev); } diff --git a/dpnp/backend/extensions/window/kaiser.cpp b/dpnp/backend/extensions/window/kaiser.cpp index e5c1aa837a64..0b99dbc3947c 100644 --- a/dpnp/backend/extensions/window/kaiser.cpp +++ b/dpnp/backend/extensions/window/kaiser.cpp @@ -36,14 +36,14 @@ // utils extension header #include "ext/common.hpp" -// dpctl tensor headers +// dpnp tensor headers #include "utils/type_dispatch.hpp" #include "utils/type_utils.hpp" namespace dpnp::extensions::window { namespace py = pybind11; -namespace td_ns = dpctl::tensor::type_dispatch; +namespace td_ns = dpnp::tensor::type_dispatch; typedef sycl::event (*kaiser_fn_ptr_t)(sycl::queue &, char *, @@ -62,7 +62,7 @@ sycl::event kaiser_impl(sycl::queue &exec_q, const py::object &py_beta, const std::vector &depends) { - dpctl::tensor::type_utils::validate_type_for_device(exec_q); + dpnp::tensor::type_utils::validate_type_for_device(exec_q); T *res = reinterpret_cast(result); const T beta = py::cast(py_beta); @@ -96,7 +96,7 @@ struct KaiserFactory std::pair py_kaiser(sycl::queue &exec_q, const py::object &py_beta, - const dpctl::tensor::usm_ndarray &result, + const dpnp::tensor::usm_ndarray &result, const std::vector &depends) { auto [nelems, result_typeless_ptr, kaiser_fn] = @@ -109,7 +109,7 @@ std::pair sycl::event kaiser_ev = kaiser_fn(exec_q, result_typeless_ptr, nelems, py_beta, depends); sycl::event args_ev = - dpctl::utils::keep_args_alive(exec_q, {result}, {kaiser_ev}); + dpnp::utils::keep_args_alive(exec_q, {result}, {kaiser_ev}); return std::make_pair(args_ev, kaiser_ev); } diff --git a/dpnp/backend/extensions/window/kaiser.hpp b/dpnp/backend/extensions/window/kaiser.hpp index 9a088e700a2f..d1167292bb06 100644 --- a/dpnp/backend/extensions/window/kaiser.hpp +++ b/dpnp/backend/extensions/window/kaiser.hpp @@ -40,7 +40,7 @@ namespace py = pybind11; extern std::pair py_kaiser(sycl::queue &exec_q, const py::object &beta, - const dpctl::tensor::usm_ndarray &result, + const dpnp::tensor::usm_ndarray &result, const std::vector &depends); extern void init_kaiser_dispatch_vectors(void); diff --git a/dpnp/backend/extensions/window/window_py.cpp b/dpnp/backend/extensions/window/window_py.cpp index 5ae80f4027b5..7c900aa5030b 100644 --- a/dpnp/backend/extensions/window/window_py.cpp +++ b/dpnp/backend/extensions/window/window_py.cpp @@ -50,7 +50,7 @@ namespace py = pybind11; using ext::common::init_dispatch_vector; using window_ns::window_fn_ptr_t; -namespace dpctl_td_ns = dpctl::tensor::type_dispatch; +namespace dpnp_td_ns = dpnp::tensor::type_dispatch; template using BartlettFactory = @@ -68,14 +68,14 @@ template using HanningFactory = window_ns::Factory; -static window_fn_ptr_t bartlett_dispatch_vector[dpctl_td_ns::num_types]; -static window_fn_ptr_t blackman_dispatch_vector[dpctl_td_ns::num_types]; -static window_fn_ptr_t hamming_dispatch_vector[dpctl_td_ns::num_types]; -static window_fn_ptr_t hanning_dispatch_vector[dpctl_td_ns::num_types]; +static window_fn_ptr_t bartlett_dispatch_vector[dpnp_td_ns::num_types]; +static window_fn_ptr_t blackman_dispatch_vector[dpnp_td_ns::num_types]; +static window_fn_ptr_t hamming_dispatch_vector[dpnp_td_ns::num_types]; +static window_fn_ptr_t hanning_dispatch_vector[dpnp_td_ns::num_types]; PYBIND11_MODULE(_window_impl, m) { - using arrayT = dpctl::tensor::usm_ndarray; + using arrayT = dpnp::tensor::usm_ndarray; using event_vecT = std::vector; { diff --git a/dpnp/backend/include/dpnp4pybind11.hpp b/dpnp/backend/include/dpnp4pybind11.hpp index 8bc931a3ca1a..3150d63146f4 100644 --- a/dpnp/backend/include/dpnp4pybind11.hpp +++ b/dpnp/backend/include/dpnp4pybind11.hpp @@ -28,8 +28,8 @@ #pragma once -// Include dpctl C-API headers -#include "dpctl_capi.h" +// Include for dpctl_capi struct and casters +#include "dpctl4pybind11.hpp" // Include generated Cython headers for usm_ndarray // (struct definition and constants only) @@ -38,13 +38,10 @@ #include #include -#include #include // for std::size_t for C++ linkage #include #include -#include // for size_t for C linkage #include -#include #include #include @@ -54,12 +51,13 @@ namespace py = pybind11; -namespace dpctl +namespace dpnp { namespace detail { // Lookup a type according to its size, and return a value corresponding to the // NumPy typenum. + template constexpr int platform_typeid_lookup() { @@ -74,56 +72,10 @@ constexpr int platform_typeid_lookup(int I, Ints... Is) : platform_typeid_lookup(Is...); } -class dpctl_capi +class dpnp_capi { public: - // dpctl type objects - PyTypeObject *Py_SyclDeviceType_; - PyTypeObject *PySyclDeviceType_; - PyTypeObject *Py_SyclContextType_; - PyTypeObject *PySyclContextType_; - PyTypeObject *Py_SyclEventType_; - PyTypeObject *PySyclEventType_; - PyTypeObject *Py_SyclQueueType_; - PyTypeObject *PySyclQueueType_; - PyTypeObject *Py_MemoryType_; - PyTypeObject *PyMemoryUSMDeviceType_; - PyTypeObject *PyMemoryUSMSharedType_; - PyTypeObject *PyMemoryUSMHostType_; PyTypeObject *PyUSMArrayType_; - PyTypeObject *PySyclProgramType_; - PyTypeObject *PySyclKernelType_; - - DPCTLSyclDeviceRef (*SyclDevice_GetDeviceRef_)(PySyclDeviceObject *); - PySyclDeviceObject *(*SyclDevice_Make_)(DPCTLSyclDeviceRef); - - DPCTLSyclContextRef (*SyclContext_GetContextRef_)(PySyclContextObject *); - PySyclContextObject *(*SyclContext_Make_)(DPCTLSyclContextRef); - - DPCTLSyclEventRef (*SyclEvent_GetEventRef_)(PySyclEventObject *); - PySyclEventObject *(*SyclEvent_Make_)(DPCTLSyclEventRef); - - DPCTLSyclQueueRef (*SyclQueue_GetQueueRef_)(PySyclQueueObject *); - PySyclQueueObject *(*SyclQueue_Make_)(DPCTLSyclQueueRef); - - // memory - DPCTLSyclUSMRef (*Memory_GetUsmPointer_)(Py_MemoryObject *); - void *(*Memory_GetOpaquePointer_)(Py_MemoryObject *); - DPCTLSyclContextRef (*Memory_GetContextRef_)(Py_MemoryObject *); - DPCTLSyclQueueRef (*Memory_GetQueueRef_)(Py_MemoryObject *); - size_t (*Memory_GetNumBytes_)(Py_MemoryObject *); - PyObject *(*Memory_Make_)(DPCTLSyclUSMRef, - size_t, - DPCTLSyclQueueRef, - PyObject *); - - // program - DPCTLSyclKernelRef (*SyclKernel_GetKernelRef_)(PySyclKernelObject *); - PySyclKernelObject *(*SyclKernel_Make_)(DPCTLSyclKernelRef, const char *); - - DPCTLSyclKernelBundleRef (*SyclProgram_GetKernelBundleRef_)( - PySyclProgramObject *); - PySyclProgramObject *(*SyclProgram_Make_)(DPCTLSyclKernelBundleRef); int USM_ARRAY_C_CONTIGUOUS_; int USM_ARRAY_F_CONTIGUOUS_; @@ -135,49 +87,15 @@ class dpctl_capi int UAR_INT8_, UAR_UINT8_, UAR_INT16_, UAR_UINT16_, UAR_INT32_, UAR_UINT32_, UAR_INT64_, UAR_UINT64_; - bool PySyclDevice_Check_(PyObject *obj) const - { - return PyObject_TypeCheck(obj, PySyclDeviceType_) != 0; - } - bool PySyclContext_Check_(PyObject *obj) const - { - return PyObject_TypeCheck(obj, PySyclContextType_) != 0; - } - bool PySyclEvent_Check_(PyObject *obj) const - { - return PyObject_TypeCheck(obj, PySyclEventType_) != 0; - } - bool PySyclQueue_Check_(PyObject *obj) const - { - return PyObject_TypeCheck(obj, PySyclQueueType_) != 0; - } - bool PySyclKernel_Check_(PyObject *obj) const - { - return PyObject_TypeCheck(obj, PySyclKernelType_) != 0; - } - bool PySyclProgram_Check_(PyObject *obj) const - { - return PyObject_TypeCheck(obj, PySyclProgramType_) != 0; - } - - ~dpctl_capi() - { - as_usm_memory_.reset(); - default_usm_ndarray_.reset(); - default_usm_memory_.reset(); - default_sycl_queue_.reset(); - }; + ~dpnp_capi() { default_usm_ndarray_.reset(); }; static auto &get() { - static dpctl_capi api{}; + static dpnp_capi api{}; return api; } - py::object default_sycl_queue_pyobj() { return *default_sycl_queue_; } - py::object default_usm_memory_pyobj() { return *default_usm_memory_; } py::object default_usm_ndarray_pyobj() { return *default_usm_ndarray_; } - py::object as_usm_memory_pyobj() { return *as_usm_memory_; } private: struct Deleter @@ -198,29 +116,10 @@ class dpctl_capi } }; - std::shared_ptr default_sycl_queue_; - std::shared_ptr default_usm_memory_; std::shared_ptr default_usm_ndarray_; - std::shared_ptr as_usm_memory_; - - dpctl_capi() - : Py_SyclDeviceType_(nullptr), PySyclDeviceType_(nullptr), - Py_SyclContextType_(nullptr), PySyclContextType_(nullptr), - Py_SyclEventType_(nullptr), PySyclEventType_(nullptr), - Py_SyclQueueType_(nullptr), PySyclQueueType_(nullptr), - Py_MemoryType_(nullptr), PyMemoryUSMDeviceType_(nullptr), - PyMemoryUSMSharedType_(nullptr), PyMemoryUSMHostType_(nullptr), - PyUSMArrayType_(nullptr), PySyclProgramType_(nullptr), - PySyclKernelType_(nullptr), SyclDevice_GetDeviceRef_(nullptr), - SyclDevice_Make_(nullptr), SyclContext_GetContextRef_(nullptr), - SyclContext_Make_(nullptr), SyclEvent_GetEventRef_(nullptr), - SyclEvent_Make_(nullptr), SyclQueue_GetQueueRef_(nullptr), - SyclQueue_Make_(nullptr), Memory_GetUsmPointer_(nullptr), - Memory_GetOpaquePointer_(nullptr), Memory_GetContextRef_(nullptr), - Memory_GetQueueRef_(nullptr), Memory_GetNumBytes_(nullptr), - Memory_Make_(nullptr), SyclKernel_GetKernelRef_(nullptr), - SyclKernel_Make_(nullptr), SyclProgram_GetKernelBundleRef_(nullptr), - SyclProgram_Make_(nullptr), USM_ARRAY_C_CONTIGUOUS_(0), + + dpnp_capi() + : PyUSMArrayType_(nullptr), USM_ARRAY_C_CONTIGUOUS_(0), USM_ARRAY_F_CONTIGUOUS_(0), USM_ARRAY_WRITABLE_(0), UAR_BOOL_(-1), UAR_BYTE_(-1), UAR_UBYTE_(-1), UAR_SHORT_(-1), UAR_USHORT_(-1), UAR_INT_(-1), UAR_UINT_(-1), UAR_LONG_(-1), UAR_ULONG_(-1), @@ -228,62 +127,13 @@ class dpctl_capi UAR_DOUBLE_(-1), UAR_CFLOAT_(-1), UAR_CDOUBLE_(-1), UAR_TYPE_SENTINEL_(-1), UAR_HALF_(-1), UAR_INT8_(-1), UAR_UINT8_(-1), UAR_INT16_(-1), UAR_UINT16_(-1), UAR_INT32_(-1), UAR_UINT32_(-1), - UAR_INT64_(-1), UAR_UINT64_(-1), default_sycl_queue_{}, - default_usm_memory_{}, default_usm_ndarray_{}, as_usm_memory_{} + UAR_INT64_(-1), UAR_UINT64_(-1), default_usm_ndarray_{} { - // Import dpctl C-API - // (device, context, event, queue, memory, program) - import_dpctl(); // Import dpnp tensor module for PyUSMArrayType import_dpnp__tensor___usmarray(); - // Python type objects for classes implemented by dpctl - this->Py_SyclDeviceType_ = &Py_SyclDeviceType; - this->PySyclDeviceType_ = &PySyclDeviceType; - this->Py_SyclContextType_ = &Py_SyclContextType; - this->PySyclContextType_ = &PySyclContextType; - this->Py_SyclEventType_ = &Py_SyclEventType; - this->PySyclEventType_ = &PySyclEventType; - this->Py_SyclQueueType_ = &Py_SyclQueueType; - this->PySyclQueueType_ = &PySyclQueueType; - this->Py_MemoryType_ = &Py_MemoryType; - this->PyMemoryUSMDeviceType_ = &PyMemoryUSMDeviceType; - this->PyMemoryUSMSharedType_ = &PyMemoryUSMSharedType; - this->PyMemoryUSMHostType_ = &PyMemoryUSMHostType; this->PyUSMArrayType_ = &PyUSMArrayType; - this->PySyclProgramType_ = &PySyclProgramType; - this->PySyclKernelType_ = &PySyclKernelType; - - // SyclDevice API - this->SyclDevice_GetDeviceRef_ = SyclDevice_GetDeviceRef; - this->SyclDevice_Make_ = SyclDevice_Make; - - // SyclContext API - this->SyclContext_GetContextRef_ = SyclContext_GetContextRef; - this->SyclContext_Make_ = SyclContext_Make; - - // SyclEvent API - this->SyclEvent_GetEventRef_ = SyclEvent_GetEventRef; - this->SyclEvent_Make_ = SyclEvent_Make; - - // SyclQueue API - this->SyclQueue_GetQueueRef_ = SyclQueue_GetQueueRef; - this->SyclQueue_Make_ = SyclQueue_Make; - - // dpctl.memory API - this->Memory_GetUsmPointer_ = Memory_GetUsmPointer; - this->Memory_GetOpaquePointer_ = Memory_GetOpaquePointer; - this->Memory_GetContextRef_ = Memory_GetContextRef; - this->Memory_GetQueueRef_ = Memory_GetQueueRef; - this->Memory_GetNumBytes_ = Memory_GetNumBytes; - this->Memory_Make_ = Memory_Make; - - // dpctl.program API - this->SyclKernel_GetKernelRef_ = SyclKernel_GetKernelRef; - this->SyclKernel_Make_ = SyclKernel_Make; - this->SyclProgram_GetKernelBundleRef_ = SyclProgram_GetKernelBundleRef; - this->SyclProgram_Make_ = SyclProgram_Make; // constants this->USM_ARRAY_C_CONTIGUOUS_ = USM_ARRAY_C_CONTIGUOUS; @@ -327,27 +177,8 @@ class dpctl_capi unsigned long long, unsigned int>( UAR_ULONG, UAR_ULONGLONG, UAR_UINT); - // create shared pointers to python objects used in type-casters - // for dpctl::memory::usm_memory and dpctl::tensor::usm_ndarray - sycl::queue q_{}; - PySyclQueueObject *py_q_tmp = - SyclQueue_Make(reinterpret_cast(&q_)); - const py::object &py_sycl_queue = py::reinterpret_steal( - reinterpret_cast(py_q_tmp)); - - default_sycl_queue_ = std::shared_ptr( - new py::object(py_sycl_queue), Deleter{}); - - py::module_ mod_memory = py::module_::import("dpctl.memory"); - const py::object &py_as_usm_memory = mod_memory.attr("as_usm_memory"); - as_usm_memory_ = std::shared_ptr( - new py::object{py_as_usm_memory}, Deleter{}); - - auto mem_kl = mod_memory.attr("MemoryUSMHost"); - const py::object &py_default_usm_memory = - mem_kl(1, py::arg("queue") = py_sycl_queue); - default_usm_memory_ = std::shared_ptr( - new py::object{py_default_usm_memory}, Deleter{}); + py::object py_default_usm_memory = + ::dpctl::detail::dpctl_capi::get().default_usm_memory_pyobj(); py::module_ mod_usmarray = py::module_::import("dpnp.tensor._usmarray"); auto tensor_kl = mod_usmarray.attr("usm_ndarray"); @@ -360,478 +191,12 @@ class dpctl_capi new py::object{py_default_usm_ndarray}, Deleter{}); } - dpctl_capi(dpctl_capi const &) = default; - dpctl_capi &operator=(dpctl_capi const &) = default; - dpctl_capi &operator=(dpctl_capi &&) = default; + dpnp_capi(dpnp_capi const &) = default; + dpnp_capi &operator=(dpnp_capi const &) = default; + dpnp_capi &operator=(dpnp_capi &&) = default; -}; // struct dpctl_capi +}; // struct dpnp_capi } // namespace detail -} // namespace dpctl - -namespace pybind11::detail -{ -#define DPCTL_TYPE_CASTER(type, py_name) \ -protected: \ - std::unique_ptr value; \ - \ -public: \ - static constexpr auto name = py_name; \ - template < \ - typename T_, \ - ::pybind11::detail::enable_if_t< \ - std::is_same>::value, \ - int> = 0> \ - static ::pybind11::handle cast(T_ *src, \ - ::pybind11::return_value_policy policy, \ - ::pybind11::handle parent) \ - { \ - if (!src) \ - return ::pybind11::none().release(); \ - if (policy == ::pybind11::return_value_policy::take_ownership) { \ - auto h = cast(std::move(*src), policy, parent); \ - delete src; \ - return h; \ - } \ - return cast(*src, policy, parent); \ - } \ - operator type *() \ - { \ - return value.get(); \ - } /* NOLINT(bugprone-macro-parentheses) */ \ - operator type &() \ - { \ - return *value; \ - } /* NOLINT(bugprone-macro-parentheses) */ \ - operator type &&() && \ - { \ - return std::move(*value); \ - } /* NOLINT(bugprone-macro-parentheses) */ \ - template \ - using cast_op_type = ::pybind11::detail::movable_cast_op_type - -/* This type caster associates ``sycl::queue`` C++ class with - * :class:`dpctl.SyclQueue` for the purposes of generation of - * Python bindings by pybind11. - */ -template <> -struct type_caster -{ -public: - bool load(handle src, bool) - { - PyObject *source = src.ptr(); - auto const &api = ::dpctl::detail::dpctl_capi::get(); - if (api.PySyclQueue_Check_(source)) { - DPCTLSyclQueueRef QRef = api.SyclQueue_GetQueueRef_( - reinterpret_cast(source)); - value = std::make_unique( - *(reinterpret_cast(QRef))); - return true; - } - else { - throw py::type_error( - "Input is of unexpected type, expected dpctl.SyclQueue"); - } - } - - static handle cast(sycl::queue src, return_value_policy, handle) - { - auto const &api = ::dpctl::detail::dpctl_capi::get(); - auto tmp = - api.SyclQueue_Make_(reinterpret_cast(&src)); - return handle(reinterpret_cast(tmp)); - } - - DPCTL_TYPE_CASTER(sycl::queue, _("dpctl.SyclQueue")); -}; - -/* This type caster associates ``sycl::device`` C++ class with - * :class:`dpctl.SyclDevice` for the purposes of generation of - * Python bindings by pybind11. - */ -template <> -struct type_caster -{ -public: - bool load(handle src, bool) - { - PyObject *source = src.ptr(); - auto const &api = ::dpctl::detail::dpctl_capi::get(); - if (api.PySyclDevice_Check_(source)) { - DPCTLSyclDeviceRef DRef = api.SyclDevice_GetDeviceRef_( - reinterpret_cast(source)); - value = std::make_unique( - *(reinterpret_cast(DRef))); - return true; - } - else { - throw py::type_error( - "Input is of unexpected type, expected dpctl.SyclDevice"); - } - } - - static handle cast(sycl::device src, return_value_policy, handle) - { - auto const &api = ::dpctl::detail::dpctl_capi::get(); - auto tmp = - api.SyclDevice_Make_(reinterpret_cast(&src)); - return handle(reinterpret_cast(tmp)); - } - - DPCTL_TYPE_CASTER(sycl::device, _("dpctl.SyclDevice")); -}; - -/* This type caster associates ``sycl::context`` C++ class with - * :class:`dpctl.SyclContext` for the purposes of generation of - * Python bindings by pybind11. - */ -template <> -struct type_caster -{ -public: - bool load(handle src, bool) - { - PyObject *source = src.ptr(); - auto const &api = ::dpctl::detail::dpctl_capi::get(); - if (api.PySyclContext_Check_(source)) { - DPCTLSyclContextRef CRef = api.SyclContext_GetContextRef_( - reinterpret_cast(source)); - value = std::make_unique( - *(reinterpret_cast(CRef))); - return true; - } - else { - throw py::type_error( - "Input is of unexpected type, expected dpctl.SyclContext"); - } - } - - static handle cast(sycl::context src, return_value_policy, handle) - { - auto const &api = ::dpctl::detail::dpctl_capi::get(); - auto tmp = - api.SyclContext_Make_(reinterpret_cast(&src)); - return handle(reinterpret_cast(tmp)); - } - - DPCTL_TYPE_CASTER(sycl::context, _("dpctl.SyclContext")); -}; - -/* This type caster associates ``sycl::event`` C++ class with - * :class:`dpctl.SyclEvent` for the purposes of generation of - * Python bindings by pybind11. - */ -template <> -struct type_caster -{ -public: - bool load(handle src, bool) - { - PyObject *source = src.ptr(); - auto const &api = ::dpctl::detail::dpctl_capi::get(); - if (api.PySyclEvent_Check_(source)) { - DPCTLSyclEventRef ERef = api.SyclEvent_GetEventRef_( - reinterpret_cast(source)); - value = std::make_unique( - *(reinterpret_cast(ERef))); - return true; - } - else { - throw py::type_error( - "Input is of unexpected type, expected dpctl.SyclEvent"); - } - } - - static handle cast(sycl::event src, return_value_policy, handle) - { - auto const &api = ::dpctl::detail::dpctl_capi::get(); - auto tmp = - api.SyclEvent_Make_(reinterpret_cast(&src)); - return handle(reinterpret_cast(tmp)); - } - - DPCTL_TYPE_CASTER(sycl::event, _("dpctl.SyclEvent")); -}; - -/* This type caster associates ``sycl::kernel`` C++ class with - * :class:`dpctl.program.SyclKernel` for the purposes of generation of - * Python bindings by pybind11. - */ -template <> -struct type_caster -{ -public: - bool load(handle src, bool) - { - PyObject *source = src.ptr(); - auto const &api = ::dpctl::detail::dpctl_capi::get(); - if (api.PySyclKernel_Check_(source)) { - DPCTLSyclKernelRef KRef = api.SyclKernel_GetKernelRef_( - reinterpret_cast(source)); - value = std::make_unique( - *(reinterpret_cast(KRef))); - return true; - } - else { - throw py::type_error("Input is of unexpected type, expected " - "dpctl.program.SyclKernel"); - } - } - - static handle cast(sycl::kernel src, return_value_policy, handle) - { - auto const &api = ::dpctl::detail::dpctl_capi::get(); - auto tmp = - api.SyclKernel_Make_(reinterpret_cast(&src), - "dpctl4pybind11_kernel"); - return handle(reinterpret_cast(tmp)); - } - - DPCTL_TYPE_CASTER(sycl::kernel, _("dpctl.program.SyclKernel")); -}; - -/* This type caster associates - * ``sycl::kernel_bundle`` C++ class with - * :class:`dpctl.program.SyclProgram` for the purposes of generation of - * Python bindings by pybind11. - */ -template <> -struct type_caster> -{ -public: - bool load(handle src, bool) - { - PyObject *source = src.ptr(); - auto const &api = ::dpctl::detail::dpctl_capi::get(); - if (api.PySyclProgram_Check_(source)) { - DPCTLSyclKernelBundleRef KBRef = - api.SyclProgram_GetKernelBundleRef_( - reinterpret_cast(source)); - value = std::make_unique< - sycl::kernel_bundle>( - *(reinterpret_cast< - sycl::kernel_bundle *>( - KBRef))); - return true; - } - else { - throw py::type_error("Input is of unexpected type, expected " - "dpctl.program.SyclProgram"); - } - } - - static handle cast(sycl::kernel_bundle src, - return_value_policy, - handle) - { - auto const &api = ::dpctl::detail::dpctl_capi::get(); - auto tmp = api.SyclProgram_Make_( - reinterpret_cast(&src)); - return handle(reinterpret_cast(tmp)); - } - - DPCTL_TYPE_CASTER(sycl::kernel_bundle, - _("dpctl.program.SyclProgram")); -}; - -/* This type caster associates - * ``sycl::half`` C++ class with Python :class:`float` for the purposes - * of generation of Python bindings by pybind11. - */ -template <> -struct type_caster -{ -public: - bool load(handle src, bool convert) - { - double py_value; - - if (!src) { - return false; - } - - PyObject *source = src.ptr(); - - if (convert || PyFloat_Check(source)) { - py_value = PyFloat_AsDouble(source); - } - else { - return false; - } - - bool py_err = (py_value == double(-1)) && PyErr_Occurred(); - - if (py_err) { - PyErr_Clear(); - if (convert && (PyNumber_Check(source) != 0)) { - auto tmp = reinterpret_steal(PyNumber_Float(source)); - return load(tmp, false); - } - return false; - } - value = static_cast(py_value); - return true; - } - - static handle cast(sycl::half src, return_value_policy, handle) - { - return PyFloat_FromDouble(static_cast(src)); - } - - PYBIND11_TYPE_CASTER(sycl::half, _("float")); -}; -} // namespace pybind11::detail - -namespace dpctl -{ -namespace memory -{ -// since PYBIND11_OBJECT_CVT uses error_already_set without namespace, -// this allows to avoid compilation error -using pybind11::error_already_set; - -class usm_memory : public py::object -{ -public: - PYBIND11_OBJECT_CVT( - usm_memory, - py::object, - [](PyObject *o) -> bool { - return PyObject_TypeCheck( - o, ::dpctl::detail::dpctl_capi::get().Py_MemoryType_) != - 0; - }, - [](PyObject *o) -> PyObject * { return as_usm_memory(o); }) - - usm_memory() - : py::object( - ::dpctl::detail::dpctl_capi::get().default_usm_memory_pyobj(), - borrowed_t{}) - { - if (!m_ptr) - throw py::error_already_set(); - } - - /*! @brief Create usm_memory object from shared pointer that manages - * lifetime of the USM allocation. - */ - usm_memory(void *usm_ptr, - std::size_t nbytes, - const sycl::queue &q, - std::shared_ptr shptr) - { - auto const &api = ::dpctl::detail::dpctl_capi::get(); - DPCTLSyclUSMRef usm_ref = reinterpret_cast(usm_ptr); - auto q_uptr = std::make_unique(q); - DPCTLSyclQueueRef QRef = - reinterpret_cast(q_uptr.get()); - - auto vacuous_destructor = []() {}; - py::capsule mock_owner(vacuous_destructor); - - // create memory object owned by mock_owner, it is a new reference - PyObject *_memory = - api.Memory_Make_(usm_ref, nbytes, QRef, mock_owner.ptr()); - auto ref_count_decrementer = [](PyObject *o) noexcept { Py_DECREF(o); }; - - using py_uptrT = - std::unique_ptr; - - if (!_memory) { - throw py::error_already_set(); - } - - auto memory_uptr = py_uptrT(_memory, ref_count_decrementer); - std::shared_ptr *opaque_ptr = new std::shared_ptr(shptr); - - Py_MemoryObject *memobj = reinterpret_cast(_memory); - // replace mock_owner capsule as the owner - memobj->refobj = Py_None; - // set opaque ptr field, usm_memory now knowns that USM is managed - // by smart pointer - memobj->_opaque_ptr = reinterpret_cast(opaque_ptr); - - // _memory will delete created copies of sycl::queue, and - // std::shared_ptr and the deleter of the shared_ptr is - // supposed to free the USM allocation - m_ptr = _memory; - q_uptr.release(); - memory_uptr.release(); - } - - sycl::queue get_queue() const - { - Py_MemoryObject *mem_obj = reinterpret_cast(m_ptr); - auto const &api = ::dpctl::detail::dpctl_capi::get(); - DPCTLSyclQueueRef QRef = api.Memory_GetQueueRef_(mem_obj); - sycl::queue *obj_q = reinterpret_cast(QRef); - return *obj_q; - } - - char *get_pointer() const - { - Py_MemoryObject *mem_obj = reinterpret_cast(m_ptr); - auto const &api = ::dpctl::detail::dpctl_capi::get(); - DPCTLSyclUSMRef MRef = api.Memory_GetUsmPointer_(mem_obj); - return reinterpret_cast(MRef); - } - - std::size_t get_nbytes() const - { - auto const &api = ::dpctl::detail::dpctl_capi::get(); - Py_MemoryObject *mem_obj = reinterpret_cast(m_ptr); - return api.Memory_GetNumBytes_(mem_obj); - } - - bool is_managed_by_smart_ptr() const - { - auto const &api = ::dpctl::detail::dpctl_capi::get(); - Py_MemoryObject *mem_obj = reinterpret_cast(m_ptr); - const void *opaque_ptr = api.Memory_GetOpaquePointer_(mem_obj); - - return bool(opaque_ptr); - } - - const std::shared_ptr &get_smart_ptr_owner() const - { - auto const &api = ::dpctl::detail::dpctl_capi::get(); - Py_MemoryObject *mem_obj = reinterpret_cast(m_ptr); - void *opaque_ptr = api.Memory_GetOpaquePointer_(mem_obj); - - if (opaque_ptr) { - auto shptr_ptr = - reinterpret_cast *>(opaque_ptr); - return *shptr_ptr; - } - else { - throw std::runtime_error( - "Memory object does not have smart pointer " - "managing lifetime of USM allocation"); - } - } - -protected: - static PyObject *as_usm_memory(PyObject *o) - { - if (o == nullptr) { - PyErr_SetString(PyExc_ValueError, - "cannot create a usm_memory from a nullptr"); - return nullptr; - } - - auto converter = - ::dpctl::detail::dpctl_capi::get().as_usm_memory_pyobj(); - - py::object res; - try { - res = converter(py::handle(o)); - } catch (const py::error_already_set &e) { - return nullptr; - } - return res.ptr(); - } -}; -} // end namespace memory namespace tensor { @@ -890,13 +255,12 @@ class usm_ndarray : public py::object public: PYBIND11_OBJECT(usm_ndarray, py::object, [](PyObject *o) -> bool { return PyObject_TypeCheck( - o, ::dpctl::detail::dpctl_capi::get().PyUSMArrayType_) != 0; + o, detail::dpnp_capi::get().PyUSMArrayType_) != 0; }) usm_ndarray() - : py::object( - ::dpctl::detail::dpctl_capi::get().default_usm_ndarray_pyobj(), - borrowed_t{}) + : py::object(detail::dpnp_capi::get().default_usm_ndarray_pyobj(), + borrowed_t{}) { if (!m_ptr) throw py::error_already_set(); @@ -1028,8 +392,8 @@ class usm_ndarray : public py::object Py_MemoryObject *mem_obj = reinterpret_cast(raw_ar->base_); - auto const &api = ::dpctl::detail::dpctl_capi::get(); - DPCTLSyclQueueRef QRef = api.Memory_GetQueueRef_(mem_obj); + auto const &dpctl_api = ::dpctl::detail::dpctl_capi::get(); + DPCTLSyclQueueRef QRef = dpctl_api.Memory_GetQueueRef_(mem_obj); return *(reinterpret_cast(QRef)); } @@ -1039,8 +403,8 @@ class usm_ndarray : public py::object Py_MemoryObject *mem_obj = reinterpret_cast(raw_ar->base_); - auto const &api = ::dpctl::detail::dpctl_capi::get(); - DPCTLSyclQueueRef QRef = api.Memory_GetQueueRef_(mem_obj); + auto const &dpctl_api = ::dpctl::detail::dpctl_capi::get(); + DPCTLSyclQueueRef QRef = dpctl_api.Memory_GetQueueRef_(mem_obj); return reinterpret_cast(QRef)->get_device(); } @@ -1059,7 +423,7 @@ class usm_ndarray : public py::object int get_elemsize() const { int typenum = get_typenum(); - auto const &api = ::dpctl::detail::dpctl_capi::get(); + auto const &api = detail::dpnp_capi::get(); // Lookup table for element sizes based on typenum if (typenum == api.UAR_BOOL_) @@ -1101,21 +465,21 @@ class usm_ndarray : public py::object bool is_c_contiguous() const { int flags = get_flags(); - auto const &api = ::dpctl::detail::dpctl_capi::get(); + auto const &api = detail::dpnp_capi::get(); return static_cast(flags & api.USM_ARRAY_C_CONTIGUOUS_); } bool is_f_contiguous() const { int flags = get_flags(); - auto const &api = ::dpctl::detail::dpctl_capi::get(); + auto const &api = detail::dpnp_capi::get(); return static_cast(flags & api.USM_ARRAY_F_CONTIGUOUS_); } bool is_writable() const { int flags = get_flags(); - auto const &api = ::dpctl::detail::dpctl_capi::get(); + auto const &api = detail::dpnp_capi::get(); return static_cast(flags & api.USM_ARRAY_WRITABLE_); } @@ -1136,14 +500,14 @@ class usm_ndarray : public py::object PyUSMArrayObject *raw_ar = usm_array_ptr(); PyObject *usm_data = raw_ar->base_; - auto const &api = ::dpctl::detail::dpctl_capi::get(); - if (!PyObject_TypeCheck(usm_data, api.Py_MemoryType_)) { + auto const &dpctl_api = ::dpctl::detail::dpctl_capi::get(); + if (!PyObject_TypeCheck(usm_data, dpctl_api.Py_MemoryType_)) { return false; } Py_MemoryObject *mem_obj = reinterpret_cast(usm_data); - const void *opaque_ptr = api.Memory_GetOpaquePointer_(mem_obj); + const void *opaque_ptr = dpctl_api.Memory_GetOpaquePointer_(mem_obj); return bool(opaque_ptr); } @@ -1153,9 +517,9 @@ class usm_ndarray : public py::object PyUSMArrayObject *raw_ar = usm_array_ptr(); PyObject *usm_data = raw_ar->base_; - auto const &api = ::dpctl::detail::dpctl_capi::get(); + auto const &dpctl_api = ::dpctl::detail::dpctl_capi::get(); - if (!PyObject_TypeCheck(usm_data, api.Py_MemoryType_)) { + if (!PyObject_TypeCheck(usm_data, dpctl_api.Py_MemoryType_)) { throw std::runtime_error( "usm_ndarray object does not have Memory object " "managing lifetime of USM allocation"); @@ -1163,7 +527,7 @@ class usm_ndarray : public py::object Py_MemoryObject *mem_obj = reinterpret_cast(usm_data); - void *opaque_ptr = api.Memory_GetOpaquePointer_(mem_obj); + void *opaque_ptr = dpctl_api.Memory_GetOpaquePointer_(mem_obj); if (opaque_ptr) { auto shptr_ptr = @@ -1189,19 +553,24 @@ namespace utils { namespace detail { +// TODO: future version of dpctl will include a more general way of passing +// shared_ptrs to keep_args_alive, so that future overload can be used here +// instead of reimplementing keep_args_alive + struct ManagedMemory { - + // TODO: do we need to check for memory here? Or can we assume only + // dpnp::tensor::usm_ndarray will be passed? static bool is_usm_managed_by_shared_ptr(const py::object &h) { - if (py::isinstance(h)) { + + if (py::isinstance<::dpctl::memory::usm_memory>(h)) { const auto &usm_memory_inst = - py::cast(h); + py::cast<::dpctl::memory::usm_memory>(h); return usm_memory_inst.is_managed_by_smart_ptr(); } - else if (py::isinstance(h)) { - const auto &usm_array_inst = - py::cast(h); + else if (py::isinstance(h)) { + const auto &usm_array_inst = py::cast(h); return usm_array_inst.is_managed_by_smart_ptr(); } @@ -1215,9 +584,8 @@ struct ManagedMemory py::cast(h); return usm_memory_inst.get_smart_ptr_owner(); } - else if (py::isinstance(h)) { - const auto &usm_array_inst = - py::cast(h); + else if (py::isinstance(h)) { + const auto &usm_array_inst = py::cast(h); return usm_array_inst.get_smart_ptr_owner(); } @@ -1295,26 +663,14 @@ sycl::event keep_args_alive(sycl::queue &q, return host_task_ev; } -/*! @brief Check if all allocation queues are the same as the - execution queue */ -template -bool queues_are_compatible(const sycl::queue &exec_q, - const sycl::queue (&alloc_qs)[num]) -{ - for (std::size_t i = 0; i < num; ++i) { - - if (exec_q != alloc_qs[i]) { - return false; - } - } - return true; -} +// add to namespace for convenience +using ::dpctl::utils::queues_are_compatible; -/*! @brief Check if all allocation queues of usm_ndarays are the same as +/*! @brief Check if all allocation queues of usm_ndarrays are the same as the execution queue */ template bool queues_are_compatible(const sycl::queue &exec_q, - const ::dpctl::tensor::usm_ndarray (&arrs)[num]) + const tensor::usm_ndarray (&arrs)[num]) { for (std::size_t i = 0; i < num; ++i) { @@ -1325,4 +681,4 @@ bool queues_are_compatible(const sycl::queue &exec_q, return true; } } // end namespace utils -} // end namespace dpctl +} // end namespace dpnp diff --git a/dpnp/backend/kernels/elementwise_functions/bitwise_count.hpp b/dpnp/backend/kernels/elementwise_functions/bitwise_count.hpp index 09fddb885a4b..d73d9303145e 100644 --- a/dpnp/backend/kernels/elementwise_functions/bitwise_count.hpp +++ b/dpnp/backend/kernels/elementwise_functions/bitwise_count.hpp @@ -30,12 +30,12 @@ #include -// dpctl tensor headers +// dpnp tensor headers #include "utils/type_utils.hpp" namespace dpnp::kernels::bitwise_count { -namespace tu_ns = dpctl::tensor::type_utils; +namespace tu_ns = dpnp::tensor::type_utils; template struct BitwiseCountFunctor diff --git a/dpnp/backend/kernels/elementwise_functions/fmax.hpp b/dpnp/backend/kernels/elementwise_functions/fmax.hpp index ac5f81dbc698..b7521c1367fe 100644 --- a/dpnp/backend/kernels/elementwise_functions/fmax.hpp +++ b/dpnp/backend/kernels/elementwise_functions/fmax.hpp @@ -30,14 +30,14 @@ #include -// dpctl tensor headers +// dpnp tensor headers #include "utils/math_utils.hpp" #include "utils/type_utils.hpp" namespace dpnp::kernels::fmax { -namespace mu_ns = dpctl::tensor::math_utils; -namespace tu_ns = dpctl::tensor::type_utils; +namespace mu_ns = dpnp::tensor::math_utils; +namespace tu_ns = dpnp::tensor::type_utils; template struct FmaxFunctor diff --git a/dpnp/backend/kernels/elementwise_functions/fmin.hpp b/dpnp/backend/kernels/elementwise_functions/fmin.hpp index 0cbc0385ce69..3fdd1a2aa260 100644 --- a/dpnp/backend/kernels/elementwise_functions/fmin.hpp +++ b/dpnp/backend/kernels/elementwise_functions/fmin.hpp @@ -30,14 +30,14 @@ #include -// dpctl tensor headers +// dpnp tensor headers #include "utils/math_utils.hpp" #include "utils/type_utils.hpp" namespace dpnp::kernels::fmin { -namespace mu_ns = dpctl::tensor::math_utils; -namespace tu_ns = dpctl::tensor::type_utils; +namespace mu_ns = dpnp::tensor::math_utils; +namespace tu_ns = dpnp::tensor::type_utils; template struct FminFunctor diff --git a/dpnp/backend/kernels/elementwise_functions/heaviside.hpp b/dpnp/backend/kernels/elementwise_functions/heaviside.hpp index 0c38761b1767..d2f3efbbdcac 100644 --- a/dpnp/backend/kernels/elementwise_functions/heaviside.hpp +++ b/dpnp/backend/kernels/elementwise_functions/heaviside.hpp @@ -30,14 +30,14 @@ #include -// dpctl tensor headers +// dpnp tensor headers #include "utils/math_utils.hpp" #include "utils/type_utils.hpp" namespace dpnp::kernels::heaviside { -namespace mu_ns = dpctl::tensor::math_utils; -namespace tu_ns = dpctl::tensor::type_utils; +namespace mu_ns = dpnp::tensor::math_utils; +namespace tu_ns = dpnp::tensor::type_utils; template struct HeavisideFunctor diff --git a/dpnp/backend/kernels/elementwise_functions/isclose.hpp b/dpnp/backend/kernels/elementwise_functions/isclose.hpp index 179ad1ad8d2a..883d4081f86c 100644 --- a/dpnp/backend/kernels/elementwise_functions/isclose.hpp +++ b/dpnp/backend/kernels/elementwise_functions/isclose.hpp @@ -34,9 +34,9 @@ #include #include -// dpctl tensor headers +// dpnp tensor headers #include "kernels/alignment.hpp" -#include "kernels/dpctl_tensor_types.hpp" +#include "kernels/dpnp_tensor_types.hpp" #include "kernels/elementwise_functions/sycl_complex.hpp" #include "utils/offset_utils.hpp" #include "utils/sycl_utils.hpp" @@ -119,11 +119,11 @@ struct IsCloseStridedScalarFunctor void operator()(sycl::id<1> wid) const { const auto &three_offsets_ = three_offsets_indexer_(wid.get(0)); - const dpctl::tensor::ssize_t &inp1_offset = + const dpnp::tensor::ssize_t &inp1_offset = three_offsets_.get_first_offset(); - const dpctl::tensor::ssize_t &inp2_offset = + const dpnp::tensor::ssize_t &inp2_offset = three_offsets_.get_second_offset(); - const dpctl::tensor::ssize_t &out_offset = + const dpnp::tensor::ssize_t &out_offset = three_offsets_.get_third_offset(); out_[out_offset] = @@ -167,7 +167,7 @@ struct IsCloseContigScalarFunctor /* Each work-item processes vec_sz elements, contiguous in memory */ /* NOTE: work-group size must be divisible by sub-group size */ - using dpctl::tensor::type_utils::is_complex_v; + using dpnp::tensor::type_utils::is_complex_v; if constexpr (enable_sg_loadstore && !is_complex_v) { auto sg = ndit.get_sub_group(); const std::uint16_t sgSize = sg.get_max_local_range()[0]; @@ -176,8 +176,8 @@ struct IsCloseContigScalarFunctor sg.get_group_id()[0] * sgSize); if (base + elems_per_wi * sgSize < nelems_) { - using dpctl::tensor::sycl_utils::sub_group_load; - using dpctl::tensor::sycl_utils::sub_group_store; + using dpnp::tensor::sycl_utils::sub_group_load; + using dpnp::tensor::sycl_utils::sub_group_store; #pragma unroll for (std::uint8_t it = 0; it < elems_per_wi; it += vec_sz) { const std::size_t offset = base + it * sgSize; @@ -234,19 +234,19 @@ sycl::event isclose_strided_scalar_impl(sycl::queue &exec_q, const int nd, std::size_t nelems, - const dpctl::tensor::ssize_t *shape_strides, + const dpnp::tensor::ssize_t *shape_strides, const scT rtol, const scT atol, const bool equal_nan, const char *a_cp, - const dpctl::tensor::ssize_t a_offset, + const dpnp::tensor::ssize_t a_offset, const char *b_cp, - const dpctl::tensor::ssize_t b_offset, + const dpnp::tensor::ssize_t b_offset, char *out_cp, - const dpctl::tensor::ssize_t out_offset, + const dpnp::tensor::ssize_t out_offset, const std::vector &depends) { - dpctl::tensor::type_utils::validate_type_for_device(exec_q); + dpnp::tensor::type_utils::validate_type_for_device(exec_q); const T *a_tp = reinterpret_cast(a_cp); const T *b_tp = reinterpret_cast(b_cp); @@ -255,7 +255,7 @@ sycl::event resTy *out_tp = reinterpret_cast(out_cp); using IndexerT = - typename dpctl::tensor::offset_utils::ThreeOffsets_StridedIndexer; + typename dpnp::tensor::offset_utils::ThreeOffsets_StridedIndexer; const IndexerT indexer{nd, a_offset, b_offset, out_offset, shape_strides}; sycl::event comp_ev = exec_q.submit([&](sycl::handler &cgh) { @@ -306,8 +306,8 @@ sycl::event sycl::event comp_ev = exec_q.submit([&](sycl::handler &cgh) { cgh.depends_on(depends); - using dpctl::tensor::kernels::alignment_utils::is_aligned; - using dpctl::tensor::kernels::alignment_utils::required_alignment; + using dpnp::tensor::kernels::alignment_utils::is_aligned; + using dpnp::tensor::kernels::alignment_utils::required_alignment; if (is_aligned(a_tp) && is_aligned(b_tp) && is_aligned(out_tp)) { diff --git a/dpnp/backend/kernels/elementwise_functions/ldexp.hpp b/dpnp/backend/kernels/elementwise_functions/ldexp.hpp index ec90dee99146..12ecd10e43ae 100644 --- a/dpnp/backend/kernels/elementwise_functions/ldexp.hpp +++ b/dpnp/backend/kernels/elementwise_functions/ldexp.hpp @@ -30,7 +30,7 @@ #include -// dpctl tensor headers +// dpnp tensor headers #include "utils/math_utils.hpp" #include "utils/type_utils.hpp" diff --git a/dpnp/backend/kernels/elementwise_functions/nan_to_num.hpp b/dpnp/backend/kernels/elementwise_functions/nan_to_num.hpp index 07c55feaf944..edbbe7f028b8 100644 --- a/dpnp/backend/kernels/elementwise_functions/nan_to_num.hpp +++ b/dpnp/backend/kernels/elementwise_functions/nan_to_num.hpp @@ -34,9 +34,9 @@ #include #include -// dpctl tensor headers +// dpnp tensor headers #include "kernels/alignment.hpp" -#include "kernels/dpctl_tensor_types.hpp" +#include "kernels/dpnp_tensor_types.hpp" #include "utils/offset_utils.hpp" #include "utils/sycl_utils.hpp" #include "utils/type_utils.hpp" @@ -78,10 +78,10 @@ struct NanToNumFunctor void operator()(sycl::id<1> wid) const { const auto &offsets_ = inp_out_indexer_(wid.get(0)); - const dpctl::tensor::ssize_t &inp_offset = offsets_.get_first_offset(); - const dpctl::tensor::ssize_t &out_offset = offsets_.get_second_offset(); + const dpnp::tensor::ssize_t &inp_offset = offsets_.get_first_offset(); + const dpnp::tensor::ssize_t &out_offset = offsets_.get_second_offset(); - using dpctl::tensor::type_utils::is_complex_v; + using dpnp::tensor::type_utils::is_complex_v; if constexpr (is_complex_v) { using realT = typename T::value_type; static_assert(std::is_same_v); @@ -129,7 +129,7 @@ struct NanToNumContigFunctor /* Each work-item processes vec_sz elements, contiguous in memory */ /* NOTE: work-group size must be divisible by sub-group size */ - using dpctl::tensor::type_utils::is_complex_v; + using dpnp::tensor::type_utils::is_complex_v; if constexpr (enable_sg_loadstore && !is_complex_v) { auto sg = ndit.get_sub_group(); const std::uint16_t sgSize = sg.get_max_local_range()[0]; @@ -138,8 +138,8 @@ struct NanToNumContigFunctor sg.get_group_id()[0] * sgSize); if (base + elems_per_wi * sgSize < nelems_) { - using dpctl::tensor::sycl_utils::sub_group_load; - using dpctl::tensor::sycl_utils::sub_group_store; + using dpnp::tensor::sycl_utils::sub_group_load; + using dpnp::tensor::sycl_utils::sub_group_store; #pragma unroll for (std::uint8_t it = 0; it < elems_per_wi; it += vec_sz) { const std::size_t offset = base + it * sgSize; @@ -197,23 +197,23 @@ template sycl::event nan_to_num_strided_impl(sycl::queue &q, const size_t nelems, const int nd, - const dpctl::tensor::ssize_t *shape_strides, + const dpnp::tensor::ssize_t *shape_strides, const scT nan, const scT posinf, const scT neginf, const char *in_cp, - const dpctl::tensor::ssize_t in_offset, + const dpnp::tensor::ssize_t in_offset, char *out_cp, - const dpctl::tensor::ssize_t out_offset, + const dpnp::tensor::ssize_t out_offset, const std::vector &depends) { - dpctl::tensor::type_utils::validate_type_for_device(q); + dpnp::tensor::type_utils::validate_type_for_device(q); const T *in_tp = reinterpret_cast(in_cp); T *out_tp = reinterpret_cast(out_cp); using InOutIndexerT = - typename dpctl::tensor::offset_utils::TwoOffsets_StridedIndexer; + typename dpnp::tensor::offset_utils::TwoOffsets_StridedIndexer; const InOutIndexerT indexer{nd, in_offset, out_offset, shape_strides}; sycl::event comp_ev = q.submit([&](sycl::handler &cgh) { @@ -258,8 +258,8 @@ sycl::event nan_to_num_contig_impl(sycl::queue &exec_q, sycl::event comp_ev = exec_q.submit([&](sycl::handler &cgh) { cgh.depends_on(depends); - using dpctl::tensor::kernels::alignment_utils::is_aligned; - using dpctl::tensor::kernels::alignment_utils::required_alignment; + using dpnp::tensor::kernels::alignment_utils::is_aligned; + using dpnp::tensor::kernels::alignment_utils::required_alignment; if (is_aligned(in_tp) && is_aligned(out_tp)) { constexpr bool enable_sg_loadstore = true; diff --git a/dpnp/backend/kernels/elementwise_functions/sinc.hpp b/dpnp/backend/kernels/elementwise_functions/sinc.hpp index 99f2d69e9986..a3f914b7f666 100644 --- a/dpnp/backend/kernels/elementwise_functions/sinc.hpp +++ b/dpnp/backend/kernels/elementwise_functions/sinc.hpp @@ -35,13 +35,13 @@ #include -// dpctl tensor headers +// dpnp tensor headers #include "kernels/elementwise_functions/sycl_complex.hpp" #include "utils/type_utils.hpp" namespace dpnp::kernels::sinc { -namespace tu_ns = dpctl::tensor::type_utils; +namespace tu_ns = dpnp::tensor::type_utils; namespace impl { diff --git a/dpnp/backend/kernels/indexing/choose.hpp b/dpnp/backend/kernels/indexing/choose.hpp index 49b71d05c96b..853394780475 100644 --- a/dpnp/backend/kernels/indexing/choose.hpp +++ b/dpnp/backend/kernels/indexing/choose.hpp @@ -32,12 +32,12 @@ #include -#include "kernels/dpctl_tensor_types.hpp" +#include "kernels/dpnp_tensor_types.hpp" #include "utils/strided_iters.hpp" namespace dpnp::kernels::choose { -using dpctl::tensor::ssize_t; +using dpnp::tensor::ssize_t; template -#include "dpctl_tensor_types.hpp" +#include "dpnp_tensor_types.hpp" #include "utils/offset_utils.hpp" #include "utils/sycl_alloc_utils.hpp" #include "utils/sycl_utils.hpp" #include "utils/type_dispatch_building.hpp" #include "utils/type_utils.hpp" -namespace dpctl::tensor::kernels::accumulators +namespace dpnp::tensor::kernels::accumulators { -namespace su_ns = dpctl::tensor::sycl_utils; +namespace su_ns = dpnp::tensor::sycl_utils; -using dpctl::tensor::ssize_t; -using namespace dpctl::tensor::offset_utils; +using dpnp::tensor::ssize_t; +using namespace dpnp::tensor::offset_utils; template T ceiling_quotient(T n, T m) @@ -95,7 +95,7 @@ struct CastTransformer dstTy operator()(const srcTy &val) const { - using dpctl::tensor::type_utils::convert_impl; + using dpnp::tensor::type_utils::convert_impl; return convert_impl(val); } }; @@ -662,10 +662,10 @@ sycl::event inclusive_scan_iter_1d(sycl::queue &exec_q, static constexpr std::size_t _iter_nelems = 1; - using IterIndexerT = dpctl::tensor::offset_utils::TwoZeroOffsets_Indexer; + using IterIndexerT = dpnp::tensor::offset_utils::TwoZeroOffsets_Indexer; static constexpr IterIndexerT _no_op_iter_indexer{}; - using NoOpIndexerT = dpctl::tensor::offset_utils::NoOpIndexer; + using NoOpIndexerT = dpnp::tensor::offset_utils::NoOpIndexer; static constexpr NoOpIndexerT _no_op_indexer{}; std::size_t n_groups; @@ -692,8 +692,8 @@ sycl::event inclusive_scan_iter_1d(sycl::queue &exec_q, // allocate auto temp_owner = - dpctl::tensor::alloc_utils::smart_malloc_device(temp_size, - exec_q); + dpnp::tensor::alloc_utils::smart_malloc_device(temp_size, + exec_q); outputT *temp = temp_owner.get(); std::vector> stack{}; @@ -743,7 +743,7 @@ sycl::event inclusive_scan_iter_1d(sycl::queue &exec_q, dependent_event); } - sycl::event free_ev = dpctl::tensor::alloc_utils::async_smart_free( + sycl::event free_ev = dpnp::tensor::alloc_utils::async_smart_free( exec_q, {dependent_event}, temp_owner); host_tasks.push_back(free_ev); @@ -776,7 +776,7 @@ sycl::event const srcT *src_data_ptr = reinterpret_cast(src); dstT *dst_data_ptr = reinterpret_cast(dst); - using NoOpIndexerT = dpctl::tensor::offset_utils::NoOpIndexer; + using NoOpIndexerT = dpnp::tensor::offset_utils::NoOpIndexer; static constexpr NoOpIndexerT flat_indexer{}; static constexpr transformerT transformer{}; @@ -954,8 +954,8 @@ sycl::event inclusive_scan_iter(sycl::queue &exec_q, su_ns::Identity::value; using IterIndexerT = - dpctl::tensor::offset_utils::TwoOffsets_CombinedIndexer< - InpIterIndexerT, OutIterIndexerT>; + dpnp::tensor::offset_utils::TwoOffsets_CombinedIndexer; const IterIndexerT iter_indexer{inp_iter_indexer, out_iter_indexer}; std::size_t acc_groups; @@ -982,7 +982,7 @@ sycl::event inclusive_scan_iter(sycl::queue &exec_q, // allocate auto temp_owner = - dpctl::tensor::alloc_utils::smart_malloc_device( + dpnp::tensor::alloc_utils::smart_malloc_device( iter_nelems * temp_size, exec_q); outputT *temp = temp_owner.get(); @@ -993,7 +993,7 @@ sycl::event inclusive_scan_iter(sycl::queue &exec_q, outputT *src = output; outputT *local_scans = temp; - using NoOpIndexerT = dpctl::tensor::offset_utils::NoOpIndexer; + using NoOpIndexerT = dpnp::tensor::offset_utils::NoOpIndexer; static constexpr NoOpIndexerT _no_op_indexer{}; using NoOpTransformerT = NoOpTransformer; static constexpr NoOpTransformerT _no_op_transformer{}; @@ -1002,12 +1002,12 @@ sycl::event inclusive_scan_iter(sycl::queue &exec_q, { std::size_t src_size = acc_groups - 1; using LocalScanIndexerT = - dpctl::tensor::offset_utils::Strided1DIndexer; + dpnp::tensor::offset_utils::Strided1DIndexer; const LocalScanIndexerT scan_iter_indexer{/* size */ iter_nelems, /* step */ src_size}; using IterIndexerT = - dpctl::tensor::offset_utils::TwoOffsets_CombinedIndexer< + dpnp::tensor::offset_utils::TwoOffsets_CombinedIndexer< OutIterIndexerT, LocalScanIndexerT>; const IterIndexerT iter_indexer_{out_iter_indexer, scan_iter_indexer}; @@ -1031,7 +1031,7 @@ sycl::event inclusive_scan_iter(sycl::queue &exec_q, std::size_t src_size = acc_groups_ - 1; using LocalScanIndexerT = - dpctl::tensor::offset_utils::Strided1DIndexer; + dpnp::tensor::offset_utils::Strided1DIndexer; const LocalScanIndexerT scan1_iter_indexer{ /* size */ iter_nelems, /* step */ size_to_update}; @@ -1039,7 +1039,7 @@ sycl::event inclusive_scan_iter(sycl::queue &exec_q, /* step */ src_size}; using IterIndexerT = - dpctl::tensor::offset_utils::TwoOffsets_CombinedIndexer< + dpnp::tensor::offset_utils::TwoOffsets_CombinedIndexer< LocalScanIndexerT, LocalScanIndexerT>; const IterIndexerT iter_indexer_{scan1_iter_indexer, scan2_iter_indexer}; @@ -1100,7 +1100,7 @@ sycl::event inclusive_scan_iter(sycl::queue &exec_q, dependent_event); } - sycl::event free_ev = dpctl::tensor::alloc_utils::async_smart_free( + sycl::event free_ev = dpnp::tensor::alloc_utils::async_smart_free( exec_q, {dependent_event}, temp_owner); host_tasks.push_back(free_ev); } @@ -1146,12 +1146,12 @@ sycl::event const srcT *src_data_ptr = reinterpret_cast(src); dstT *dst_data_ptr = reinterpret_cast(dst); - using InpIndexerT = dpctl::tensor::offset_utils::StridedIndexer; + using InpIndexerT = dpnp::tensor::offset_utils::StridedIndexer; const InpIndexerT inp_axis_indexer{acc_nd, 0, acc_shape_strides}; const InpIndexerT inp_iter_indexer{iter_nd, inp_iter_offset, iter_shape_strides}; - using OutIndexerT = dpctl::tensor::offset_utils::UnpackedStridedIndexer; + using OutIndexerT = dpnp::tensor::offset_utils::UnpackedStridedIndexer; const OutIndexerT out_axis_indexer{acc_nd, 0, acc_shape_strides, acc_shape_strides + 2 * acc_nd}; const OutIndexerT out_iter_indexer{iter_nd, out_iter_offset, @@ -1213,7 +1213,7 @@ std::size_t cumsum_val_contig_impl(sycl::queue &q, const maskT *mask_data_ptr = reinterpret_cast(mask); cumsumT *cumsum_data_ptr = reinterpret_cast(cumsum); - using NoOpIndexerT = dpctl::tensor::offset_utils::NoOpIndexer; + using NoOpIndexerT = dpnp::tensor::offset_utils::NoOpIndexer; static constexpr NoOpIndexerT flat_indexer{}; static constexpr transformerT transformer{}; @@ -1248,7 +1248,7 @@ std::size_t cumsum_val_contig_impl(sycl::queue &q, cumsumT *last_elem = cumsum_data_ptr + (n_elems - 1); auto host_usm_owner = - dpctl::tensor::alloc_utils::smart_malloc_host(1, q); + dpnp::tensor::alloc_utils::smart_malloc_host(1, q); cumsumT *last_elem_host_usm = host_usm_owner.get(); sycl::event copy_e = q.submit([&](sycl::handler &cgh) { @@ -1330,7 +1330,7 @@ std::size_t const maskT *mask_data_ptr = reinterpret_cast(mask); cumsumT *cumsum_data_ptr = reinterpret_cast(cumsum); - using StridedIndexerT = dpctl::tensor::offset_utils::StridedIndexer; + using StridedIndexerT = dpnp::tensor::offset_utils::StridedIndexer; const StridedIndexerT strided_indexer{nd, 0, shape_strides}; static constexpr transformerT transformer{}; @@ -1366,7 +1366,7 @@ std::size_t cumsumT *last_elem = cumsum_data_ptr + (n_elems - 1); auto host_usm_owner = - dpctl::tensor::alloc_utils::smart_malloc_host(1, q); + dpnp::tensor::alloc_utils::smart_malloc_host(1, q); cumsumT *last_elem_host_usm = host_usm_owner.get(); sycl::event copy_e = q.submit([&](sycl::handler &cgh) { @@ -1424,4 +1424,4 @@ struct Cumsum1DStridedFactory } }; -} // namespace dpctl::tensor::kernels::accumulators +} // namespace dpnp::tensor::kernels::accumulators diff --git a/dpnp/tensor/libtensor/include/kernels/alignment.hpp b/dpnp/tensor/libtensor/include/kernels/alignment.hpp index a67e9b15306e..17e067c09ae5 100644 --- a/dpnp/tensor/libtensor/include/kernels/alignment.hpp +++ b/dpnp/tensor/libtensor/include/kernels/alignment.hpp @@ -31,7 +31,7 @@ #include #include -namespace dpctl::tensor::kernels::alignment_utils +namespace dpnp::tensor::kernels::alignment_utils { inline constexpr std::size_t required_alignment = 64UL; @@ -43,4 +43,4 @@ bool is_aligned(Ptr p) template class disabled_sg_loadstore_wrapper_krn; -} // namespace dpctl::tensor::kernels::alignment_utils +} // namespace dpnp::tensor::kernels::alignment_utils diff --git a/dpnp/tensor/libtensor/include/kernels/boolean_advanced_indexing.hpp b/dpnp/tensor/libtensor/include/kernels/boolean_advanced_indexing.hpp index 046ad87d7d78..1bcf4ed3871b 100644 --- a/dpnp/tensor/libtensor/include/kernels/boolean_advanced_indexing.hpp +++ b/dpnp/tensor/libtensor/include/kernels/boolean_advanced_indexing.hpp @@ -41,15 +41,15 @@ #include -#include "dpctl_tensor_types.hpp" +#include "dpnp_tensor_types.hpp" #include "utils/offset_utils.hpp" #include "utils/type_dispatch_building.hpp" -namespace dpctl::tensor::kernels::indexing +namespace dpnp::tensor::kernels::indexing { -using dpctl::tensor::ssize_t; -using namespace dpctl::tensor::offset_utils; +using dpnp::tensor::ssize_t; +using namespace dpnp::tensor::offset_utils; template -#include "dpctl_tensor_types.hpp" +#include "dpnp_tensor_types.hpp" #include "kernels/alignment.hpp" #include "utils/math_utils.hpp" #include "utils/offset_utils.hpp" #include "utils/sycl_utils.hpp" #include "utils/type_utils.hpp" -namespace dpctl::tensor::kernels::clip +namespace dpnp::tensor::kernels::clip { -using dpctl::tensor::ssize_t; -using namespace dpctl::tensor::offset_utils; +using dpnp::tensor::ssize_t; +using namespace dpnp::tensor::offset_utils; -using dpctl::tensor::kernels::alignment_utils:: - disabled_sg_loadstore_wrapper_krn; -using dpctl::tensor::kernels::alignment_utils::is_aligned; -using dpctl::tensor::kernels::alignment_utils::required_alignment; +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 dpctl::tensor::sycl_utils::sub_group_load; -using dpctl::tensor::sycl_utils::sub_group_store; +using dpnp::tensor::sycl_utils::sub_group_load; +using dpnp::tensor::sycl_utils::sub_group_store; template T clip(const T &x, const T &min, const T &max) { - using dpctl::tensor::type_utils::is_complex; + using dpnp::tensor::type_utils::is_complex; if constexpr (is_complex::value) { - using dpctl::tensor::math_utils::max_complex; - using dpctl::tensor::math_utils::min_complex; + using dpnp::tensor::math_utils::max_complex; + using dpnp::tensor::math_utils::min_complex; return min_complex(max_complex(x, min), max); } else if constexpr (std::is_floating_point_v || @@ -114,7 +113,7 @@ class ClipContigFunctor { static constexpr std::uint8_t nelems_per_wi = n_vecs * vec_sz; - using dpctl::tensor::type_utils::is_complex; + using dpnp::tensor::type_utils::is_complex; if constexpr (is_complex::value || !enable_sg_loadstore) { const std::uint16_t sgSize = ndit.get_sub_group().get_local_range()[0]; @@ -353,4 +352,4 @@ struct ClipContigFactory } }; -} // namespace dpctl::tensor::kernels::clip +} // namespace dpnp::tensor::kernels::clip diff --git a/dpnp/tensor/libtensor/include/kernels/constructors.hpp b/dpnp/tensor/libtensor/include/kernels/constructors.hpp index 67f2502067ca..a4b2ade646cc 100644 --- a/dpnp/tensor/libtensor/include/kernels/constructors.hpp +++ b/dpnp/tensor/libtensor/include/kernels/constructors.hpp @@ -41,15 +41,15 @@ #include -#include "dpctl_tensor_types.hpp" +#include "dpnp_tensor_types.hpp" #include "utils/offset_utils.hpp" #include "utils/strided_iters.hpp" #include "utils/type_utils.hpp" -namespace dpctl::tensor::kernels::constructors +namespace dpnp::tensor::kernels::constructors { -using dpctl::tensor::ssize_t; +using dpnp::tensor::ssize_t; /*! @defgroup CtorKernels @@ -64,7 +64,7 @@ class full_strided_kernel; template class eye_kernel; -using namespace dpctl::tensor::offset_utils; +using namespace dpnp::tensor::offset_utils; template class LinearSequenceStepFunctor @@ -83,7 +83,7 @@ class LinearSequenceStepFunctor void operator()(sycl::id<1> wiid) const { auto i = wiid.get(0); - using dpctl::tensor::type_utils::is_complex; + using dpnp::tensor::type_utils::is_complex; if constexpr (is_complex::value) { p[i] = Ty{start_v.real() + i * step_v.real(), start_v.imag() + i * step_v.imag()}; @@ -119,7 +119,7 @@ sycl::event lin_space_step_impl(sycl::queue &exec_q, char *array_data, const std::vector &depends) { - dpctl::tensor::type_utils::validate_type_for_device(exec_q); + dpnp::tensor::type_utils::validate_type_for_device(exec_q); sycl::event lin_space_step_event = exec_q.submit([&](sycl::handler &cgh) { cgh.depends_on(depends); cgh.parallel_for>( @@ -154,7 +154,7 @@ class LinearSequenceAffineFunctor auto i = wiid.get(0); wTy wc = wTy(i) / n; wTy w = wTy(n - i) / n; - using dpctl::tensor::type_utils::is_complex; + using dpnp::tensor::type_utils::is_complex; if constexpr (is_complex::value) { using reT = typename Ty::value_type; auto _w = static_cast(w); @@ -179,7 +179,7 @@ class LinearSequenceAffineFunctor p[i] = affine_comb; } else { - using dpctl::tensor::type_utils::convert_impl; + using dpnp::tensor::type_utils::convert_impl; auto affine_comb = start_v * w + end_v * wc; p[i] = convert_impl(affine_comb); } @@ -212,7 +212,7 @@ sycl::event lin_space_affine_impl(sycl::queue &exec_q, char *array_data, const std::vector &depends) { - dpctl::tensor::type_utils::validate_type_for_device(exec_q); + dpnp::tensor::type_utils::validate_type_for_device(exec_q); const bool device_supports_doubles = exec_q.get_device().has(sycl::aspect::fp64); @@ -263,7 +263,7 @@ sycl::event full_contig_impl(sycl::queue &q, char *dst_p, const std::vector &depends) { - dpctl::tensor::type_utils::validate_type_for_device(q); + dpnp::tensor::type_utils::validate_type_for_device(q); sycl::event fill_ev = q.submit([&](sycl::handler &cgh) { cgh.depends_on(depends); dstTy *p = reinterpret_cast(dst_p); @@ -321,11 +321,11 @@ sycl::event full_strided_impl(sycl::queue &q, char *dst_p, const std::vector &depends) { - dpctl::tensor::type_utils::validate_type_for_device(q); + dpnp::tensor::type_utils::validate_type_for_device(q); dstTy *dst_tp = reinterpret_cast(dst_p); - using dpctl::tensor::offset_utils::StridedIndexer; + using dpnp::tensor::offset_utils::StridedIndexer; const StridedIndexer strided_indexer(nd, 0, shape_strides); sycl::event fill_ev = q.submit([&](sycl::handler &cgh) { @@ -406,7 +406,7 @@ sycl::event eye_impl(sycl::queue &exec_q, char *array_data, const std::vector &depends) { - dpctl::tensor::type_utils::validate_type_for_device(exec_q); + dpnp::tensor::type_utils::validate_type_for_device(exec_q); sycl::event eye_event = exec_q.submit([&](sycl::handler &cgh) { cgh.depends_on(depends); @@ -492,7 +492,7 @@ sycl::event tri_impl(sycl::queue &exec_q, Ty *src = reinterpret_cast(src_p); Ty *dst = reinterpret_cast(dst_p); - dpctl::tensor::type_utils::validate_type_for_device(exec_q); + dpnp::tensor::type_utils::validate_type_for_device(exec_q); sycl::event tri_ev = exec_q.submit([&](sycl::handler &cgh) { cgh.depends_on(depends); @@ -507,7 +507,7 @@ sycl::event tri_impl(sycl::queue &exec_q, bool to_copy{false}; { - using dpctl::tensor::strides::CIndexer_array; + using dpnp::tensor::strides::CIndexer_array; CIndexer_array indexer_i( {shape_and_strides[nd_2], shape_and_strides[nd_1]}); indexer_i.set(inner_gid); @@ -528,7 +528,7 @@ sycl::event tri_impl(sycl::queue &exec_q, ssize_t src_offset = 0; ssize_t dst_offset = 0; { - using dpctl::tensor::strides::CIndexer_vector; + using dpnp::tensor::strides::CIndexer_vector; CIndexer_vector outer(nd - d2); outer.get_displacement( outer_gid, shape_and_strides, shape_and_strides + src_s, @@ -572,4 +572,4 @@ struct TriuGenericFactory } }; -} // namespace dpctl::tensor::kernels::constructors +} // namespace dpnp::tensor::kernels::constructors diff --git a/dpnp/tensor/libtensor/include/kernels/copy_and_cast.hpp b/dpnp/tensor/libtensor/include/kernels/copy_and_cast.hpp index 2c4146d467e6..8cc227a6908d 100644 --- a/dpnp/tensor/libtensor/include/kernels/copy_and_cast.hpp +++ b/dpnp/tensor/libtensor/include/kernels/copy_and_cast.hpp @@ -40,25 +40,24 @@ #include #include -#include "dpctl_tensor_types.hpp" +#include "dpnp_tensor_types.hpp" #include "kernels/alignment.hpp" #include "utils/offset_utils.hpp" #include "utils/sycl_utils.hpp" #include "utils/type_utils.hpp" -namespace dpctl::tensor::kernels::copy_and_cast +namespace dpnp::tensor::kernels::copy_and_cast { -using dpctl::tensor::ssize_t; -using namespace dpctl::tensor::offset_utils; +using dpnp::tensor::ssize_t; +using namespace dpnp::tensor::offset_utils; -using dpctl::tensor::kernels::alignment_utils:: - disabled_sg_loadstore_wrapper_krn; -using dpctl::tensor::kernels::alignment_utils::is_aligned; -using dpctl::tensor::kernels::alignment_utils::required_alignment; +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 dpctl::tensor::sycl_utils::sub_group_load; -using dpctl::tensor::sycl_utils::sub_group_store; +using dpnp::tensor::sycl_utils::sub_group_load; +using dpnp::tensor::sycl_utils::sub_group_store; template class copy_cast_generic_kernel; @@ -82,7 +81,7 @@ class Caster Caster() = default; dstTy operator()(const srcTy &src) const { - using dpctl::tensor::type_utils::convert_impl; + using dpnp::tensor::type_utils::convert_impl; return convert_impl(src); } }; @@ -177,8 +176,8 @@ sycl::event copy_and_cast_generic_impl( const std::vector &depends, const std::vector &additional_depends) { - dpctl::tensor::type_utils::validate_type_for_device(q); - dpctl::tensor::type_utils::validate_type_for_device(q); + dpnp::tensor::type_utils::validate_type_for_device(q); + dpnp::tensor::type_utils::validate_type_for_device(q); sycl::event copy_and_cast_ev = q.submit([&](sycl::handler &cgh) { cgh.depends_on(depends); @@ -244,7 +243,7 @@ class ContigCopyFunctor static constexpr std::uint8_t elems_per_wi = n_vecs * vec_sz; - using dpctl::tensor::type_utils::is_complex_v; + using dpnp::tensor::type_utils::is_complex_v; if constexpr (!enable_sg_loadstore || is_complex_v || is_complex_v) { std::uint16_t sgSize = ndit.get_sub_group().get_local_range()[0]; @@ -334,8 +333,8 @@ sycl::event copy_and_cast_contig_impl(sycl::queue &q, char *dst_cp, const std::vector &depends) { - dpctl::tensor::type_utils::validate_type_for_device(q); - dpctl::tensor::type_utils::validate_type_for_device(q); + dpnp::tensor::type_utils::validate_type_for_device(q); + dpnp::tensor::type_utils::validate_type_for_device(q); sycl::event copy_and_cast_ev = q.submit([&](sycl::handler &cgh) { cgh.depends_on(depends); @@ -472,8 +471,8 @@ sycl::event copy_and_cast_nd_specialized_impl( ssize_t dst_offset, const std::vector &depends) { - dpctl::tensor::type_utils::validate_type_for_device(q); - dpctl::tensor::type_utils::validate_type_for_device(q); + dpnp::tensor::type_utils::validate_type_for_device(q); + dpnp::tensor::type_utils::validate_type_for_device(q); sycl::event copy_and_cast_ev = q.submit([&](sycl::handler &cgh) { using IndexerT = TwoOffsets_FixedDimStridedIndexer; @@ -624,8 +623,8 @@ void copy_and_cast_from_host_impl( { ssize_t nelems_range = src_max_nelem_offset - src_min_nelem_offset + 1; - dpctl::tensor::type_utils::validate_type_for_device(q); - dpctl::tensor::type_utils::validate_type_for_device(q); + dpnp::tensor::type_utils::validate_type_for_device(q); + dpnp::tensor::type_utils::validate_type_for_device(q); sycl::buffer npy_buf( reinterpret_cast(host_src_p) + src_min_nelem_offset, @@ -719,8 +718,8 @@ void copy_and_cast_from_host_contig_impl( ssize_t dst_offset, const std::vector &depends) { - dpctl::tensor::type_utils::validate_type_for_device(q); - dpctl::tensor::type_utils::validate_type_for_device(q); + dpnp::tensor::type_utils::validate_type_for_device(q); + dpnp::tensor::type_utils::validate_type_for_device(q); sycl::buffer npy_buf( reinterpret_cast(host_src_p) + src_offset, @@ -846,7 +845,7 @@ sycl::event char *dst_p, const std::vector &depends) { - dpctl::tensor::type_utils::validate_type_for_device(q); + dpnp::tensor::type_utils::validate_type_for_device(q); sycl::event copy_for_reshape_ev = q.submit([&](sycl::handler &cgh) { cgh.depends_on(depends); @@ -951,7 +950,7 @@ struct RolledNDIndexer ssize_t compute_offset(ssize_t gid) const { - using dpctl::tensor::strides::CIndexer_vector; + using dpnp::tensor::strides::CIndexer_vector; CIndexer_vector _ind(nd_); ssize_t relative_offset_(0); @@ -1047,7 +1046,7 @@ sycl::event copy_for_roll_strided_impl(sycl::queue &q, ssize_t dst_offset, const std::vector &depends) { - dpctl::tensor::type_utils::validate_type_for_device(q); + dpnp::tensor::type_utils::validate_type_for_device(q); sycl::event copy_for_roll_ev = q.submit([&](sycl::handler &cgh) { cgh.depends_on(depends); @@ -1131,7 +1130,7 @@ sycl::event copy_for_roll_contig_impl(sycl::queue &q, ssize_t dst_offset, const std::vector &depends) { - dpctl::tensor::type_utils::validate_type_for_device(q); + dpnp::tensor::type_utils::validate_type_for_device(q); sycl::event copy_for_roll_ev = q.submit([&](sycl::handler &cgh) { cgh.depends_on(depends); @@ -1216,7 +1215,7 @@ sycl::event copy_for_roll_ndshift_strided_impl( ssize_t dst_offset, const std::vector &depends) { - dpctl::tensor::type_utils::validate_type_for_device(q); + dpnp::tensor::type_utils::validate_type_for_device(q); sycl::event copy_for_roll_ev = q.submit([&](sycl::handler &cgh) { cgh.depends_on(depends); @@ -1270,4 +1269,4 @@ struct CopyForRollNDShiftFactory } }; -} // namespace dpctl::tensor::kernels::copy_and_cast +} // namespace dpnp::tensor::kernels::copy_and_cast diff --git a/dpnp/tensor/libtensor/include/kernels/copy_as_contiguous.hpp b/dpnp/tensor/libtensor/include/kernels/copy_as_contiguous.hpp index a723f6334e7e..af35fc79731d 100644 --- a/dpnp/tensor/libtensor/include/kernels/copy_as_contiguous.hpp +++ b/dpnp/tensor/libtensor/include/kernels/copy_as_contiguous.hpp @@ -40,17 +40,17 @@ #include #include -#include "dpctl_tensor_types.hpp" +#include "dpnp_tensor_types.hpp" #include "kernels/alignment.hpp" #include "utils/offset_utils.hpp" #include "utils/sycl_utils.hpp" #include "utils/type_utils.hpp" -namespace dpctl::tensor::kernels::copy_as_contig +namespace dpnp::tensor::kernels::copy_as_contig { -using dpctl::tensor::ssize_t; -using dpctl::tensor::sycl_utils::sub_group_store; +using dpnp::tensor::ssize_t; +using dpnp::tensor::sycl_utils::sub_group_store; template ::value) { const std::uint16_t sgSize = ndit.get_sub_group().get_max_local_range()[0]; @@ -211,21 +211,21 @@ sycl::event char *dst_p, const std::vector &depends) { - dpctl::tensor::type_utils::validate_type_for_device(exec_q); + dpnp::tensor::type_utils::validate_type_for_device(exec_q); const T *src_tp = reinterpret_cast(src_p); T *dst_tp = reinterpret_cast(dst_p); - using IndexerT = dpctl::tensor::offset_utils::StridedIndexer; + using IndexerT = dpnp::tensor::offset_utils::StridedIndexer; const IndexerT src_indexer(nd, ssize_t(0), shape_and_strides); static constexpr std::uint8_t vec_sz = 4u; static constexpr std::uint8_t n_vecs = 2u; - using dpctl::tensor::kernels::alignment_utils:: + using dpnp::tensor::kernels::alignment_utils:: disabled_sg_loadstore_wrapper_krn; - using dpctl::tensor::kernels::alignment_utils::is_aligned; - using dpctl::tensor::kernels::alignment_utils::required_alignment; + using dpnp::tensor::kernels::alignment_utils::is_aligned; + using dpnp::tensor::kernels::alignment_utils::required_alignment; sycl::event copy_ev; if (is_aligned(dst_p)) { @@ -288,7 +288,7 @@ sycl::event as_c_contiguous_batch_of_square_matrices_impl( ssize_t dst_ld, const std::vector &depends) { - dpctl::tensor::type_utils::validate_type_for_device(exec_q); + dpnp::tensor::type_utils::validate_type_for_device(exec_q); const T *src_tp = reinterpret_cast(src_p); T *dst_tp = reinterpret_cast(dst_p); @@ -537,8 +537,8 @@ sycl::event as_c_contiguous_1d_batch_of_square_matrices_impl( ssize_t dst_ld, const std::vector &depends) { - using dpctl::tensor::offset_utils::Strided1DIndexer; - using dpctl::tensor::offset_utils::TwoOffsets_CombinedIndexer; + using dpnp::tensor::offset_utils::Strided1DIndexer; + using dpnp::tensor::offset_utils::TwoOffsets_CombinedIndexer; using BatchIndexerT = TwoOffsets_CombinedIndexer; @@ -590,9 +590,9 @@ sycl::event as_c_contiguous_nd_batch_of_square_matrices_impl( ssize_t dst_ld, const std::vector &depends) { - using SrcIndexerT = dpctl::tensor::offset_utils::StridedIndexer; - using DstIndexerT = dpctl::tensor::offset_utils::Strided1DIndexer; - using dpctl::tensor::offset_utils::TwoOffsets_CombinedIndexer; + using SrcIndexerT = dpnp::tensor::offset_utils::StridedIndexer; + using DstIndexerT = dpnp::tensor::offset_utils::Strided1DIndexer; + using dpnp::tensor::offset_utils::TwoOffsets_CombinedIndexer; using BatchIndexerT = TwoOffsets_CombinedIndexer; static constexpr ssize_t zero_offset{0}; @@ -633,4 +633,4 @@ struct AsCContigNDBatchOfSquareMatricesFactory { fnT get() { return as_c_contiguous_nd_batch_of_square_matrices_impl; } }; -} // namespace dpctl::tensor::kernels::copy_as_contig +} // namespace dpnp::tensor::kernels::copy_as_contig diff --git a/dpnp/tensor/libtensor/include/kernels/dpctl_tensor_types.hpp b/dpnp/tensor/libtensor/include/kernels/dpnp_tensor_types.hpp similarity index 93% rename from dpnp/tensor/libtensor/include/kernels/dpctl_tensor_types.hpp rename to dpnp/tensor/libtensor/include/kernels/dpnp_tensor_types.hpp index 4db78e1805e3..6f9777b6e416 100644 --- a/dpnp/tensor/libtensor/include/kernels/dpctl_tensor_types.hpp +++ b/dpnp/tensor/libtensor/include/kernels/dpnp_tensor_types.hpp @@ -27,14 +27,14 @@ //***************************************************************************** /// /// \file -/// This file defines functions of dpctl.tensor._tensor_impl extensions +/// This file defines functions of dpnp.tensor._tensor_impl extensions //===--------------------------------------------------------------------===// #pragma once #include -namespace dpctl::tensor +namespace dpnp::tensor { typedef std::ptrdiff_t ssize_t; -} // namespace dpctl::tensor +} // namespace dpnp::tensor diff --git a/dpnp/tensor/libtensor/include/kernels/elementwise_functions/abs.hpp b/dpnp/tensor/libtensor/include/kernels/elementwise_functions/abs.hpp index 250ba1d70455..dd74e0ba91bd 100644 --- a/dpnp/tensor/libtensor/include/kernels/elementwise_functions/abs.hpp +++ b/dpnp/tensor/libtensor/include/kernels/elementwise_functions/abs.hpp @@ -44,19 +44,19 @@ #include "cabs_impl.hpp" #include "vec_size_util.hpp" -#include "kernels/dpctl_tensor_types.hpp" +#include "kernels/dpnp_tensor_types.hpp" #include "kernels/elementwise_functions/common.hpp" #include "utils/type_dispatch_building.hpp" #include "utils/type_utils.hpp" -namespace dpctl::tensor::kernels::abs +namespace dpnp::tensor::kernels::abs { -namespace td_ns = dpctl::tensor::type_dispatch; +namespace td_ns = dpnp::tensor::type_dispatch; -using dpctl::tensor::ssize_t; -using dpctl::tensor::type_utils::is_complex; +using dpnp::tensor::ssize_t; +using dpnp::tensor::type_utils::is_complex; template struct AbsFunctor @@ -131,7 +131,7 @@ struct AbsOutputType namespace hyperparam_detail { -namespace vsu_ns = dpctl::tensor::kernels::vec_size_utils; +namespace vsu_ns = dpnp::tensor::kernels::vec_size_utils; using vsu_ns::ContigHyperparameterSetDefault; @@ -234,4 +234,4 @@ struct AbsStridedFactory } }; -} // namespace dpctl::tensor::kernels::abs +} // namespace dpnp::tensor::kernels::abs diff --git a/dpnp/tensor/libtensor/include/kernels/elementwise_functions/acos.hpp b/dpnp/tensor/libtensor/include/kernels/elementwise_functions/acos.hpp index 9ceeb0947439..8176d6de62d2 100644 --- a/dpnp/tensor/libtensor/include/kernels/elementwise_functions/acos.hpp +++ b/dpnp/tensor/libtensor/include/kernels/elementwise_functions/acos.hpp @@ -44,19 +44,19 @@ #include "sycl_complex.hpp" #include "vec_size_util.hpp" -#include "kernels/dpctl_tensor_types.hpp" +#include "kernels/dpnp_tensor_types.hpp" #include "kernels/elementwise_functions/common.hpp" #include "utils/type_dispatch_building.hpp" #include "utils/type_utils.hpp" -namespace dpctl::tensor::kernels::acos +namespace dpnp::tensor::kernels::acos { -using dpctl::tensor::ssize_t; -namespace td_ns = dpctl::tensor::type_dispatch; +using dpnp::tensor::ssize_t; +namespace td_ns = dpnp::tensor::type_dispatch; -using dpctl::tensor::type_utils::is_complex; +using dpnp::tensor::type_utils::is_complex; template struct AcosFunctor @@ -170,7 +170,7 @@ struct AcosOutputType namespace hyperparam_detail { -namespace vsu_ns = dpctl::tensor::kernels::vec_size_utils; +namespace vsu_ns = dpnp::tensor::kernels::vec_size_utils; using vsu_ns::ContigHyperparameterSetDefault; @@ -270,4 +270,4 @@ struct AcosStridedFactory } }; -} // namespace dpctl::tensor::kernels::acos +} // namespace dpnp::tensor::kernels::acos diff --git a/dpnp/tensor/libtensor/include/kernels/elementwise_functions/acosh.hpp b/dpnp/tensor/libtensor/include/kernels/elementwise_functions/acosh.hpp index e356b37361d8..44e33ce1411f 100644 --- a/dpnp/tensor/libtensor/include/kernels/elementwise_functions/acosh.hpp +++ b/dpnp/tensor/libtensor/include/kernels/elementwise_functions/acosh.hpp @@ -46,19 +46,19 @@ #include "sycl_complex.hpp" #include "vec_size_util.hpp" -#include "kernels/dpctl_tensor_types.hpp" +#include "kernels/dpnp_tensor_types.hpp" #include "kernels/elementwise_functions/common.hpp" #include "utils/type_dispatch_building.hpp" #include "utils/type_utils.hpp" -namespace dpctl::tensor::kernels::acosh +namespace dpnp::tensor::kernels::acosh { -using dpctl::tensor::ssize_t; -namespace td_ns = dpctl::tensor::type_dispatch; +using dpnp::tensor::ssize_t; +namespace td_ns = dpnp::tensor::type_dispatch; -using dpctl::tensor::type_utils::is_complex; +using dpnp::tensor::type_utils::is_complex; template struct AcoshFunctor @@ -200,7 +200,7 @@ struct AcoshOutputType namespace hyperparam_detail { -namespace vsu_ns = dpctl::tensor::kernels::vec_size_utils; +namespace vsu_ns = dpnp::tensor::kernels::vec_size_utils; using vsu_ns::ContigHyperparameterSetDefault; using vsu_ns::UnaryContigHyperparameterSetEntry; @@ -301,4 +301,4 @@ struct AcoshStridedFactory } }; -} // namespace dpctl::tensor::kernels::acosh +} // namespace dpnp::tensor::kernels::acosh diff --git a/dpnp/tensor/libtensor/include/kernels/elementwise_functions/add.hpp b/dpnp/tensor/libtensor/include/kernels/elementwise_functions/add.hpp index c7386f99236a..a4d5b4252e99 100644 --- a/dpnp/tensor/libtensor/include/kernels/elementwise_functions/add.hpp +++ b/dpnp/tensor/libtensor/include/kernels/elementwise_functions/add.hpp @@ -45,19 +45,19 @@ #include "sycl_complex.hpp" #include "vec_size_util.hpp" -#include "kernels/dpctl_tensor_types.hpp" +#include "kernels/dpnp_tensor_types.hpp" #include "kernels/elementwise_functions/common.hpp" #include "kernels/elementwise_functions/common_inplace.hpp" #include "utils/type_dispatch_building.hpp" #include "utils/type_utils.hpp" -namespace dpctl::tensor::kernels::add +namespace dpnp::tensor::kernels::add { -using dpctl::tensor::ssize_t; -namespace td_ns = dpctl::tensor::type_dispatch; -namespace tu_ns = dpctl::tensor::type_utils; +using dpnp::tensor::ssize_t; +namespace td_ns = dpnp::tensor::type_dispatch; +namespace tu_ns = dpnp::tensor::type_utils; template struct AddFunctor @@ -105,7 +105,7 @@ struct AddFunctor return tmp; } else { - using dpctl::tensor::type_utils::vec_cast; + using dpnp::tensor::type_utils::vec_cast; return vec_cast( tmp); @@ -206,7 +206,7 @@ struct AddOutputType namespace hyperparam_detail { -namespace vsu_ns = dpctl::tensor::kernels::vec_size_utils; +namespace vsu_ns = dpnp::tensor::kernels::vec_size_utils; using vsu_ns::BinaryContigHyperparameterSetEntry; using vsu_ns::ContigHyperparameterSetDefault; @@ -397,9 +397,9 @@ struct AddContigMatrixContigRowBroadcastFactory } else { using resT = typename AddOutputType::value_type; - if constexpr (dpctl::tensor::type_utils::is_complex::value || - dpctl::tensor::type_utils::is_complex::value || - dpctl::tensor::type_utils::is_complex::value) { + if constexpr (dpnp::tensor::type_utils::is_complex::value || + dpnp::tensor::type_utils::is_complex::value || + dpnp::tensor::type_utils::is_complex::value) { fnT fn = nullptr; return fn; } @@ -443,9 +443,9 @@ struct AddContigRowContigMatrixBroadcastFactory } else { using resT = typename AddOutputType::value_type; - if constexpr (dpctl::tensor::type_utils::is_complex::value || - dpctl::tensor::type_utils::is_complex::value || - dpctl::tensor::type_utils::is_complex::value) { + if constexpr (dpnp::tensor::type_utils::is_complex::value || + dpnp::tensor::type_utils::is_complex::value || + dpnp::tensor::type_utils::is_complex::value) { fnT fn = nullptr; return fn; } @@ -663,8 +663,8 @@ struct AddInplaceRowMatrixBroadcastFactory return fn; } else { - if constexpr (dpctl::tensor::type_utils::is_complex::value || - dpctl::tensor::type_utils::is_complex::value) { + if constexpr (dpnp::tensor::type_utils::is_complex::value || + dpnp::tensor::type_utils::is_complex::value) { fnT fn = nullptr; return fn; } @@ -676,4 +676,4 @@ struct AddInplaceRowMatrixBroadcastFactory } }; -} // namespace dpctl::tensor::kernels::add +} // namespace dpnp::tensor::kernels::add diff --git a/dpnp/tensor/libtensor/include/kernels/elementwise_functions/angle.hpp b/dpnp/tensor/libtensor/include/kernels/elementwise_functions/angle.hpp index 93dbd648e575..0c0b9fd541fc 100644 --- a/dpnp/tensor/libtensor/include/kernels/elementwise_functions/angle.hpp +++ b/dpnp/tensor/libtensor/include/kernels/elementwise_functions/angle.hpp @@ -44,19 +44,19 @@ #include "sycl_complex.hpp" #include "vec_size_util.hpp" -#include "kernels/dpctl_tensor_types.hpp" +#include "kernels/dpnp_tensor_types.hpp" #include "kernels/elementwise_functions/common.hpp" #include "utils/type_dispatch_building.hpp" #include "utils/type_utils.hpp" -namespace dpctl::tensor::kernels::angle +namespace dpnp::tensor::kernels::angle { -using dpctl::tensor::ssize_t; -namespace td_ns = dpctl::tensor::type_dispatch; +using dpnp::tensor::ssize_t; +namespace td_ns = dpnp::tensor::type_dispatch; -using dpctl::tensor::type_utils::is_complex; +using dpnp::tensor::type_utils::is_complex; template struct AngleFunctor @@ -111,7 +111,7 @@ struct AngleOutputType namespace hyperparam_detail { -namespace vsu_ns = dpctl::tensor::kernels::vec_size_utils; +namespace vsu_ns = dpnp::tensor::kernels::vec_size_utils; using vsu_ns::ContigHyperparameterSetDefault; using vsu_ns::UnaryContigHyperparameterSetEntry; @@ -212,4 +212,4 @@ struct AngleStridedFactory } }; -} // namespace dpctl::tensor::kernels::angle +} // namespace dpnp::tensor::kernels::angle diff --git a/dpnp/tensor/libtensor/include/kernels/elementwise_functions/asin.hpp b/dpnp/tensor/libtensor/include/kernels/elementwise_functions/asin.hpp index d367c1243628..7ab7083498b8 100644 --- a/dpnp/tensor/libtensor/include/kernels/elementwise_functions/asin.hpp +++ b/dpnp/tensor/libtensor/include/kernels/elementwise_functions/asin.hpp @@ -46,19 +46,19 @@ #include "sycl_complex.hpp" #include "vec_size_util.hpp" -#include "kernels/dpctl_tensor_types.hpp" +#include "kernels/dpnp_tensor_types.hpp" #include "kernels/elementwise_functions/common.hpp" #include "utils/type_dispatch_building.hpp" #include "utils/type_utils.hpp" -namespace dpctl::tensor::kernels::asin +namespace dpnp::tensor::kernels::asin { -using dpctl::tensor::ssize_t; -namespace td_ns = dpctl::tensor::type_dispatch; +using dpnp::tensor::ssize_t; +namespace td_ns = dpnp::tensor::type_dispatch; -using dpctl::tensor::type_utils::is_complex; +using dpnp::tensor::type_utils::is_complex; template struct AsinFunctor @@ -192,7 +192,7 @@ struct AsinOutputType namespace hyperparam_detail { -namespace vsu_ns = dpctl::tensor::kernels::vec_size_utils; +namespace vsu_ns = dpnp::tensor::kernels::vec_size_utils; using vsu_ns::ContigHyperparameterSetDefault; using vsu_ns::UnaryContigHyperparameterSetEntry; @@ -293,4 +293,4 @@ struct AsinStridedFactory } }; -} // namespace dpctl::tensor::kernels::asin +} // namespace dpnp::tensor::kernels::asin diff --git a/dpnp/tensor/libtensor/include/kernels/elementwise_functions/asinh.hpp b/dpnp/tensor/libtensor/include/kernels/elementwise_functions/asinh.hpp index 472e04f7cbe8..1c78ed4f8af5 100644 --- a/dpnp/tensor/libtensor/include/kernels/elementwise_functions/asinh.hpp +++ b/dpnp/tensor/libtensor/include/kernels/elementwise_functions/asinh.hpp @@ -46,19 +46,19 @@ #include "sycl_complex.hpp" #include "vec_size_util.hpp" -#include "kernels/dpctl_tensor_types.hpp" +#include "kernels/dpnp_tensor_types.hpp" #include "kernels/elementwise_functions/common.hpp" #include "utils/type_dispatch_building.hpp" #include "utils/type_utils.hpp" -namespace dpctl::tensor::kernels::asinh +namespace dpnp::tensor::kernels::asinh { -using dpctl::tensor::ssize_t; -namespace td_ns = dpctl::tensor::type_dispatch; +using dpnp::tensor::ssize_t; +namespace td_ns = dpnp::tensor::type_dispatch; -using dpctl::tensor::type_utils::is_complex; +using dpnp::tensor::type_utils::is_complex; template struct AsinhFunctor @@ -175,7 +175,7 @@ struct AsinhOutputType namespace hyperparam_detail { -namespace vsu_ns = dpctl::tensor::kernels::vec_size_utils; +namespace vsu_ns = dpnp::tensor::kernels::vec_size_utils; using vsu_ns::ContigHyperparameterSetDefault; using vsu_ns::UnaryContigHyperparameterSetEntry; @@ -276,4 +276,4 @@ struct AsinhStridedFactory } }; -} // namespace dpctl::tensor::kernels::asinh +} // namespace dpnp::tensor::kernels::asinh diff --git a/dpnp/tensor/libtensor/include/kernels/elementwise_functions/atan.hpp b/dpnp/tensor/libtensor/include/kernels/elementwise_functions/atan.hpp index ab07a3fce3e0..2cef9ba11e1b 100644 --- a/dpnp/tensor/libtensor/include/kernels/elementwise_functions/atan.hpp +++ b/dpnp/tensor/libtensor/include/kernels/elementwise_functions/atan.hpp @@ -46,22 +46,22 @@ #include "sycl_complex.hpp" #include "vec_size_util.hpp" -#include "kernels/dpctl_tensor_types.hpp" +#include "kernels/dpnp_tensor_types.hpp" #include "kernels/elementwise_functions/common.hpp" #include "utils/type_dispatch_building.hpp" #include "utils/type_utils.hpp" -namespace dpctl::tensor::kernels::atan +namespace dpnp::tensor::kernels::atan { -using dpctl::tensor::ssize_t; -namespace td_ns = dpctl::tensor::type_dispatch; +using dpnp::tensor::ssize_t; +namespace td_ns = dpnp::tensor::type_dispatch; -using dpctl::tensor::kernels::vec_size_utils::ContigHyperparameterSetDefault; -using dpctl::tensor::kernels::vec_size_utils::UnaryContigHyperparameterSetEntry; +using dpnp::tensor::kernels::vec_size_utils::ContigHyperparameterSetDefault; +using dpnp::tensor::kernels::vec_size_utils::UnaryContigHyperparameterSetEntry; -using dpctl::tensor::type_utils::is_complex; +using dpnp::tensor::type_utils::is_complex; template struct AtanFunctor @@ -184,7 +184,7 @@ struct AtanOutputType namespace hyperparam_detail { -namespace vsu_ns = dpctl::tensor::kernels::vec_size_utils; +namespace vsu_ns = dpnp::tensor::kernels::vec_size_utils; using vsu_ns::ContigHyperparameterSetDefault; using vsu_ns::UnaryContigHyperparameterSetEntry; @@ -285,4 +285,4 @@ struct AtanStridedFactory } }; -} // namespace dpctl::tensor::kernels::atan +} // namespace dpnp::tensor::kernels::atan diff --git a/dpnp/tensor/libtensor/include/kernels/elementwise_functions/atan2.hpp b/dpnp/tensor/libtensor/include/kernels/elementwise_functions/atan2.hpp index 220722d5b596..6c052698c126 100644 --- a/dpnp/tensor/libtensor/include/kernels/elementwise_functions/atan2.hpp +++ b/dpnp/tensor/libtensor/include/kernels/elementwise_functions/atan2.hpp @@ -44,16 +44,16 @@ #include "vec_size_util.hpp" -#include "kernels/dpctl_tensor_types.hpp" +#include "kernels/dpnp_tensor_types.hpp" #include "kernels/elementwise_functions/common.hpp" #include "utils/type_dispatch_building.hpp" -namespace dpctl::tensor::kernels::atan2 +namespace dpnp::tensor::kernels::atan2 { -using dpctl::tensor::ssize_t; -namespace td_ns = dpctl::tensor::type_dispatch; +using dpnp::tensor::ssize_t; +namespace td_ns = dpnp::tensor::type_dispatch; template struct Atan2Functor @@ -115,7 +115,7 @@ struct Atan2OutputType namespace hyperparam_detail { -namespace vsu_ns = dpctl::tensor::kernels::vec_size_utils; +namespace vsu_ns = dpnp::tensor::kernels::vec_size_utils; using vsu_ns::BinaryContigHyperparameterSetEntry; using vsu_ns::ContigHyperparameterSetDefault; @@ -230,4 +230,4 @@ struct Atan2StridedFactory } }; -} // namespace dpctl::tensor::kernels::atan2 +} // namespace dpnp::tensor::kernels::atan2 diff --git a/dpnp/tensor/libtensor/include/kernels/elementwise_functions/atanh.hpp b/dpnp/tensor/libtensor/include/kernels/elementwise_functions/atanh.hpp index 32f5384f4ad8..7c74dc95cae0 100644 --- a/dpnp/tensor/libtensor/include/kernels/elementwise_functions/atanh.hpp +++ b/dpnp/tensor/libtensor/include/kernels/elementwise_functions/atanh.hpp @@ -47,19 +47,19 @@ #include "sycl_complex.hpp" #include "vec_size_util.hpp" -#include "kernels/dpctl_tensor_types.hpp" +#include "kernels/dpnp_tensor_types.hpp" #include "kernels/elementwise_functions/common.hpp" #include "utils/type_dispatch_building.hpp" #include "utils/type_utils.hpp" -namespace dpctl::tensor::kernels::atanh +namespace dpnp::tensor::kernels::atanh { -using dpctl::tensor::ssize_t; -namespace td_ns = dpctl::tensor::type_dispatch; +using dpnp::tensor::ssize_t; +namespace td_ns = dpnp::tensor::type_dispatch; -using dpctl::tensor::type_utils::is_complex; +using dpnp::tensor::type_utils::is_complex; template struct AtanhFunctor @@ -176,7 +176,7 @@ struct AtanhOutputType namespace hyperparam_detail { -namespace vsu_ns = dpctl::tensor::kernels::vec_size_utils; +namespace vsu_ns = dpnp::tensor::kernels::vec_size_utils; using vsu_ns::ContigHyperparameterSetDefault; using vsu_ns::UnaryContigHyperparameterSetEntry; @@ -277,4 +277,4 @@ struct AtanhStridedFactory } }; -} // namespace dpctl::tensor::kernels::atanh +} // namespace dpnp::tensor::kernels::atanh diff --git a/dpnp/tensor/libtensor/include/kernels/elementwise_functions/bitwise_and.hpp b/dpnp/tensor/libtensor/include/kernels/elementwise_functions/bitwise_and.hpp index dae2e62a76b2..a5e947949e39 100644 --- a/dpnp/tensor/libtensor/include/kernels/elementwise_functions/bitwise_and.hpp +++ b/dpnp/tensor/libtensor/include/kernels/elementwise_functions/bitwise_and.hpp @@ -42,18 +42,18 @@ #include "vec_size_util.hpp" -#include "kernels/dpctl_tensor_types.hpp" +#include "kernels/dpnp_tensor_types.hpp" #include "kernels/elementwise_functions/common.hpp" #include "kernels/elementwise_functions/common_inplace.hpp" #include "utils/type_dispatch_building.hpp" #include "utils/type_utils.hpp" -namespace dpctl::tensor::kernels::bitwise_and +namespace dpnp::tensor::kernels::bitwise_and { -using dpctl::tensor::ssize_t; -namespace td_ns = dpctl::tensor::type_dispatch; +using dpnp::tensor::ssize_t; +namespace td_ns = dpnp::tensor::type_dispatch; template struct BitwiseAndFunctor @@ -81,7 +81,7 @@ struct BitwiseAndFunctor { if constexpr (std::is_same_v) { - using dpctl::tensor::type_utils::vec_cast; + using dpnp::tensor::type_utils::vec_cast; auto tmp = (in1 && in2); return vec_cast( @@ -169,7 +169,7 @@ struct BitwiseAndOutputType namespace hyperparam_detail { -namespace vsu_ns = dpctl::tensor::kernels::vec_size_utils; +namespace vsu_ns = dpnp::tensor::kernels::vec_size_utils; using vsu_ns::BinaryContigHyperparameterSetEntry; using vsu_ns::ContigHyperparameterSetDefault; @@ -307,7 +307,7 @@ struct BitwiseAndInplaceFunctor { if constexpr (std::is_same_v) { - using dpctl::tensor::type_utils::vec_cast; + using dpnp::tensor::type_utils::vec_cast; auto tmp = (res && in); res = vec_cast( @@ -458,4 +458,4 @@ struct BitwiseAndInplaceStridedFactory } }; -} // namespace dpctl::tensor::kernels::bitwise_and +} // namespace dpnp::tensor::kernels::bitwise_and diff --git a/dpnp/tensor/libtensor/include/kernels/elementwise_functions/bitwise_invert.hpp b/dpnp/tensor/libtensor/include/kernels/elementwise_functions/bitwise_invert.hpp index 96da6b9627ab..a8e0ff0ef5c6 100644 --- a/dpnp/tensor/libtensor/include/kernels/elementwise_functions/bitwise_invert.hpp +++ b/dpnp/tensor/libtensor/include/kernels/elementwise_functions/bitwise_invert.hpp @@ -43,16 +43,16 @@ #include "vec_size_util.hpp" -#include "kernels/dpctl_tensor_types.hpp" +#include "kernels/dpnp_tensor_types.hpp" #include "kernels/elementwise_functions/common.hpp" #include "utils/type_dispatch_building.hpp" -namespace dpctl::tensor::kernels::bitwise_invert +namespace dpnp::tensor::kernels::bitwise_invert { -using dpctl::tensor::ssize_t; -namespace td_ns = dpctl::tensor::type_dispatch; +using dpnp::tensor::ssize_t; +namespace td_ns = dpnp::tensor::type_dispatch; template struct BitwiseInvertFunctor @@ -123,7 +123,7 @@ struct BitwiseInvertOutputType namespace hyperparam_detail { -namespace vsu_ns = dpctl::tensor::kernels::vec_size_utils; +namespace vsu_ns = dpnp::tensor::kernels::vec_size_utils; using vsu_ns::ContigHyperparameterSetDefault; using vsu_ns::UnaryContigHyperparameterSetEntry; @@ -228,4 +228,4 @@ struct BitwiseInvertStridedFactory } }; -} // namespace dpctl::tensor::kernels::bitwise_invert +} // namespace dpnp::tensor::kernels::bitwise_invert diff --git a/dpnp/tensor/libtensor/include/kernels/elementwise_functions/bitwise_left_shift.hpp b/dpnp/tensor/libtensor/include/kernels/elementwise_functions/bitwise_left_shift.hpp index 59279a803ed8..cc070247f98d 100644 --- a/dpnp/tensor/libtensor/include/kernels/elementwise_functions/bitwise_left_shift.hpp +++ b/dpnp/tensor/libtensor/include/kernels/elementwise_functions/bitwise_left_shift.hpp @@ -43,17 +43,17 @@ #include "vec_size_util.hpp" -#include "kernels/dpctl_tensor_types.hpp" +#include "kernels/dpnp_tensor_types.hpp" #include "kernels/elementwise_functions/common.hpp" #include "kernels/elementwise_functions/common_inplace.hpp" #include "utils/type_dispatch_building.hpp" -namespace dpctl::tensor::kernels::bitwise_left_shift +namespace dpnp::tensor::kernels::bitwise_left_shift { -using dpctl::tensor::ssize_t; -namespace td_ns = dpctl::tensor::type_dispatch; +using dpnp::tensor::ssize_t; +namespace td_ns = dpnp::tensor::type_dispatch; template struct BitwiseLeftShiftFunctor @@ -180,7 +180,7 @@ struct BitwiseLeftShiftOutputType namespace hyperparam_detail { -namespace vsu_ns = dpctl::tensor::kernels::vec_size_utils; +namespace vsu_ns = dpnp::tensor::kernels::vec_size_utils; using vsu_ns::BinaryContigHyperparameterSetEntry; using vsu_ns::ContigHyperparameterSetDefault; @@ -478,4 +478,4 @@ struct BitwiseLeftShiftInplaceStridedFactory } }; -} // namespace dpctl::tensor::kernels::bitwise_left_shift +} // namespace dpnp::tensor::kernels::bitwise_left_shift diff --git a/dpnp/tensor/libtensor/include/kernels/elementwise_functions/bitwise_or.hpp b/dpnp/tensor/libtensor/include/kernels/elementwise_functions/bitwise_or.hpp index 6714f238ffce..c025151ce72c 100644 --- a/dpnp/tensor/libtensor/include/kernels/elementwise_functions/bitwise_or.hpp +++ b/dpnp/tensor/libtensor/include/kernels/elementwise_functions/bitwise_or.hpp @@ -42,18 +42,18 @@ #include "vec_size_util.hpp" -#include "kernels/dpctl_tensor_types.hpp" +#include "kernels/dpnp_tensor_types.hpp" #include "kernels/elementwise_functions/common.hpp" #include "kernels/elementwise_functions/common_inplace.hpp" #include "utils/type_dispatch_building.hpp" #include "utils/type_utils.hpp" -namespace dpctl::tensor::kernels::bitwise_or +namespace dpnp::tensor::kernels::bitwise_or { -using dpctl::tensor::ssize_t; -namespace td_ns = dpctl::tensor::type_dispatch; +using dpnp::tensor::ssize_t; +namespace td_ns = dpnp::tensor::type_dispatch; template struct BitwiseOrFunctor @@ -81,7 +81,7 @@ struct BitwiseOrFunctor { if constexpr (std::is_same_v) { - using dpctl::tensor::type_utils::vec_cast; + using dpnp::tensor::type_utils::vec_cast; auto tmp = (in1 || in2); return vec_cast( @@ -169,7 +169,7 @@ struct BitwiseOrOutputType namespace hyperparam_detail { -namespace vsu_ns = dpctl::tensor::kernels::vec_size_utils; +namespace vsu_ns = dpnp::tensor::kernels::vec_size_utils; using vsu_ns::BinaryContigHyperparameterSetEntry; using vsu_ns::ContigHyperparameterSetDefault; @@ -307,7 +307,7 @@ struct BitwiseOrInplaceFunctor { if constexpr (std::is_same_v) { - using dpctl::tensor::type_utils::vec_cast; + using dpnp::tensor::type_utils::vec_cast; auto tmp = (res || in); res = vec_cast( @@ -458,4 +458,4 @@ struct BitwiseOrInplaceStridedFactory } }; -} // namespace dpctl::tensor::kernels::bitwise_or +} // namespace dpnp::tensor::kernels::bitwise_or diff --git a/dpnp/tensor/libtensor/include/kernels/elementwise_functions/bitwise_right_shift.hpp b/dpnp/tensor/libtensor/include/kernels/elementwise_functions/bitwise_right_shift.hpp index 241852b6a06e..140db67277e1 100644 --- a/dpnp/tensor/libtensor/include/kernels/elementwise_functions/bitwise_right_shift.hpp +++ b/dpnp/tensor/libtensor/include/kernels/elementwise_functions/bitwise_right_shift.hpp @@ -43,17 +43,17 @@ #include "vec_size_util.hpp" -#include "kernels/dpctl_tensor_types.hpp" +#include "kernels/dpnp_tensor_types.hpp" #include "kernels/elementwise_functions/common.hpp" #include "kernels/elementwise_functions/common_inplace.hpp" #include "utils/type_dispatch_building.hpp" -namespace dpctl::tensor::kernels::bitwise_right_shift +namespace dpnp::tensor::kernels::bitwise_right_shift { -using dpctl::tensor::ssize_t; -namespace td_ns = dpctl::tensor::type_dispatch; +using dpnp::tensor::ssize_t; +namespace td_ns = dpnp::tensor::type_dispatch; template struct BitwiseRightShiftFunctor @@ -182,7 +182,7 @@ struct BitwiseRightShiftOutputType namespace hyperparam_detail { -namespace vsu_ns = dpctl::tensor::kernels::vec_size_utils; +namespace vsu_ns = dpnp::tensor::kernels::vec_size_utils; using vsu_ns::BinaryContigHyperparameterSetEntry; using vsu_ns::ContigHyperparameterSetDefault; @@ -484,4 +484,4 @@ struct BitwiseRightShiftInplaceStridedFactory } }; -} // namespace dpctl::tensor::kernels::bitwise_right_shift +} // namespace dpnp::tensor::kernels::bitwise_right_shift diff --git a/dpnp/tensor/libtensor/include/kernels/elementwise_functions/bitwise_xor.hpp b/dpnp/tensor/libtensor/include/kernels/elementwise_functions/bitwise_xor.hpp index 292cf3f76df6..0744a32e7a6e 100644 --- a/dpnp/tensor/libtensor/include/kernels/elementwise_functions/bitwise_xor.hpp +++ b/dpnp/tensor/libtensor/include/kernels/elementwise_functions/bitwise_xor.hpp @@ -42,18 +42,18 @@ #include "vec_size_util.hpp" -#include "kernels/dpctl_tensor_types.hpp" +#include "kernels/dpnp_tensor_types.hpp" #include "kernels/elementwise_functions/common.hpp" #include "kernels/elementwise_functions/common_inplace.hpp" #include "utils/type_dispatch_building.hpp" #include "utils/type_utils.hpp" -namespace dpctl::tensor::kernels::bitwise_xor +namespace dpnp::tensor::kernels::bitwise_xor { -using dpctl::tensor::ssize_t; -namespace td_ns = dpctl::tensor::type_dispatch; +using dpnp::tensor::ssize_t; +namespace td_ns = dpnp::tensor::type_dispatch; template struct BitwiseXorFunctor @@ -83,7 +83,7 @@ struct BitwiseXorFunctor { if constexpr (std::is_same_v) { - using dpctl::tensor::type_utils::vec_cast; + using dpnp::tensor::type_utils::vec_cast; auto tmp = (in1 != in2); return vec_cast( @@ -171,7 +171,7 @@ struct BitwiseXorOutputType namespace hyperparam_detail { -namespace vsu_ns = dpctl::tensor::kernels::vec_size_utils; +namespace vsu_ns = dpnp::tensor::kernels::vec_size_utils; using vsu_ns::BinaryContigHyperparameterSetEntry; using vsu_ns::ContigHyperparameterSetDefault; @@ -310,7 +310,7 @@ struct BitwiseXorInplaceFunctor { if constexpr (std::is_same_v) { - using dpctl::tensor::type_utils::vec_cast; + using dpnp::tensor::type_utils::vec_cast; auto tmp = (res != in); res = vec_cast( @@ -462,4 +462,4 @@ struct BitwiseXorInplaceStridedFactory } }; -} // namespace dpctl::tensor::kernels::bitwise_xor +} // namespace dpnp::tensor::kernels::bitwise_xor diff --git a/dpnp/tensor/libtensor/include/kernels/elementwise_functions/cabs_impl.hpp b/dpnp/tensor/libtensor/include/kernels/elementwise_functions/cabs_impl.hpp index ae632061571f..5175b137cb10 100644 --- a/dpnp/tensor/libtensor/include/kernels/elementwise_functions/cabs_impl.hpp +++ b/dpnp/tensor/libtensor/include/kernels/elementwise_functions/cabs_impl.hpp @@ -39,7 +39,7 @@ #include "sycl_complex.hpp" -namespace dpctl::tensor::kernels::detail +namespace dpnp::tensor::kernels::detail { template @@ -74,4 +74,4 @@ realT cabs(std::complex const &z) return res; } -} // namespace dpctl::tensor::kernels::detail +} // namespace dpnp::tensor::kernels::detail diff --git a/dpnp/tensor/libtensor/include/kernels/elementwise_functions/cbrt.hpp b/dpnp/tensor/libtensor/include/kernels/elementwise_functions/cbrt.hpp index 20fb0ea7bcda..8c3027055d90 100644 --- a/dpnp/tensor/libtensor/include/kernels/elementwise_functions/cbrt.hpp +++ b/dpnp/tensor/libtensor/include/kernels/elementwise_functions/cbrt.hpp @@ -43,16 +43,16 @@ #include "vec_size_util.hpp" -#include "kernels/dpctl_tensor_types.hpp" +#include "kernels/dpnp_tensor_types.hpp" #include "kernels/elementwise_functions/common.hpp" #include "utils/type_dispatch_building.hpp" -namespace dpctl::tensor::kernels::cbrt +namespace dpnp::tensor::kernels::cbrt { -using dpctl::tensor::ssize_t; -namespace td_ns = dpctl::tensor::type_dispatch; +using dpnp::tensor::ssize_t; +namespace td_ns = dpnp::tensor::type_dispatch; template struct CbrtFunctor @@ -102,7 +102,7 @@ struct CbrtOutputType namespace hyperparam_detail { -namespace vsu_ns = dpctl::tensor::kernels::vec_size_utils; +namespace vsu_ns = dpnp::tensor::kernels::vec_size_utils; using vsu_ns::ContigHyperparameterSetDefault; using vsu_ns::UnaryContigHyperparameterSetEntry; @@ -203,4 +203,4 @@ struct CbrtStridedFactory } }; -} // namespace dpctl::tensor::kernels::cbrt +} // namespace dpnp::tensor::kernels::cbrt diff --git a/dpnp/tensor/libtensor/include/kernels/elementwise_functions/ceil.hpp b/dpnp/tensor/libtensor/include/kernels/elementwise_functions/ceil.hpp index 08fd4da2fb50..e78c415d88d1 100644 --- a/dpnp/tensor/libtensor/include/kernels/elementwise_functions/ceil.hpp +++ b/dpnp/tensor/libtensor/include/kernels/elementwise_functions/ceil.hpp @@ -43,19 +43,19 @@ #include "vec_size_util.hpp" -#include "kernels/dpctl_tensor_types.hpp" +#include "kernels/dpnp_tensor_types.hpp" #include "kernels/elementwise_functions/common.hpp" #include "utils/type_dispatch_building.hpp" #include "utils/type_utils.hpp" -namespace dpctl::tensor::kernels::ceil +namespace dpnp::tensor::kernels::ceil { -using dpctl::tensor::ssize_t; -namespace td_ns = dpctl::tensor::type_dispatch; +using dpnp::tensor::ssize_t; +namespace td_ns = dpnp::tensor::type_dispatch; -using dpctl::tensor::type_utils::is_complex; +using dpnp::tensor::type_utils::is_complex; template struct CeilFunctor @@ -126,7 +126,7 @@ struct CeilOutputType namespace hyperparam_detail { -namespace vsu_ns = dpctl::tensor::kernels::vec_size_utils; +namespace vsu_ns = dpnp::tensor::kernels::vec_size_utils; using vsu_ns::ContigHyperparameterSetDefault; using vsu_ns::UnaryContigHyperparameterSetEntry; @@ -227,4 +227,4 @@ struct CeilStridedFactory } }; -} // namespace dpctl::tensor::kernels::ceil +} // namespace dpnp::tensor::kernels::ceil diff --git a/dpnp/tensor/libtensor/include/kernels/elementwise_functions/common.hpp b/dpnp/tensor/libtensor/include/kernels/elementwise_functions/common.hpp index cfe3f4898491..bb310272e7a6 100644 --- a/dpnp/tensor/libtensor/include/kernels/elementwise_functions/common.hpp +++ b/dpnp/tensor/libtensor/include/kernels/elementwise_functions/common.hpp @@ -48,18 +48,17 @@ #include "utils/sycl_utils.hpp" #include "kernels/alignment.hpp" -#include "kernels/dpctl_tensor_types.hpp" +#include "kernels/dpnp_tensor_types.hpp" -namespace dpctl::tensor::kernels::elementwise_common +namespace dpnp::tensor::kernels::elementwise_common { -using dpctl::tensor::ssize_t; -using dpctl::tensor::kernels::alignment_utils:: - disabled_sg_loadstore_wrapper_krn; -using dpctl::tensor::kernels::alignment_utils::is_aligned; -using dpctl::tensor::kernels::alignment_utils::required_alignment; +using dpnp::tensor::ssize_t; +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 dpctl::tensor::sycl_utils::sub_group_load; -using dpctl::tensor::sycl_utils::sub_group_store; +using dpnp::tensor::sycl_utils::sub_group_load; +using dpnp::tensor::sycl_utils::sub_group_store; /*! @brief Functor for unary function evaluation on contiguous array */ template ::value_type; using IndexerT = - typename dpctl::tensor::offset_utils::TwoOffsets_StridedIndexer; + typename dpnp::tensor::offset_utils::TwoOffsets_StridedIndexer; const IndexerT indexer{nd, arg_offset, res_offset, shape_and_strides}; @@ -867,7 +866,7 @@ sycl::event using resTy = typename BinaryOutputType::value_type; using IndexerT = - typename dpctl::tensor::offset_utils::ThreeOffsets_StridedIndexer; + typename dpnp::tensor::offset_utils::ThreeOffsets_StridedIndexer; const IndexerT indexer{nd, arg1_offset, arg2_offset, res_offset, shape_and_strides}; @@ -918,12 +917,12 @@ sycl::event binary_contig_matrix_contig_row_broadcast_impl( std::size_t n1_padded = n1 + max_sgSize; auto padded_vec_owner = - dpctl::tensor::alloc_utils::smart_malloc_device(n1_padded, - exec_q); + dpnp::tensor::alloc_utils::smart_malloc_device(n1_padded, + exec_q); argT2 *padded_vec = padded_vec_owner.get(); sycl::event make_padded_vec_ev = - dpctl::tensor::kernels::elementwise_detail::populate_padded_vector< + dpnp::tensor::kernels::elementwise_detail::populate_padded_vector< argT2>(exec_q, vec, n1, padded_vec, n1_padded, depends); // sub-group spans work-items [I, I + sgSize) @@ -951,7 +950,7 @@ sycl::event binary_contig_matrix_contig_row_broadcast_impl( Impl(mat, padded_vec, res, n_elems, n1)); }); - sycl::event tmp_cleanup_ev = dpctl::tensor::alloc_utils::async_smart_free( + sycl::event tmp_cleanup_ev = dpnp::tensor::alloc_utils::async_smart_free( exec_q, {comp_ev}, padded_vec_owner); host_tasks.push_back(tmp_cleanup_ev); @@ -993,12 +992,12 @@ sycl::event binary_contig_row_contig_matrix_broadcast_impl( std::size_t n1_padded = n1 + max_sgSize; auto padded_vec_owner = - dpctl::tensor::alloc_utils::smart_malloc_device(n1_padded, - exec_q); + dpnp::tensor::alloc_utils::smart_malloc_device(n1_padded, + exec_q); argT2 *padded_vec = padded_vec_owner.get(); sycl::event make_padded_vec_ev = - dpctl::tensor::kernels::elementwise_detail::populate_padded_vector< + dpnp::tensor::kernels::elementwise_detail::populate_padded_vector< argT2>(exec_q, vec, n1, padded_vec, n1_padded, depends); // sub-group spans work-items [I, I + sgSize) @@ -1026,11 +1025,11 @@ sycl::event binary_contig_row_contig_matrix_broadcast_impl( Impl(padded_vec, mat, res, n_elems, n1)); }); - sycl::event tmp_cleanup_ev = dpctl::tensor::alloc_utils::async_smart_free( + sycl::event tmp_cleanup_ev = dpnp::tensor::alloc_utils::async_smart_free( exec_q, {comp_ev}, padded_vec_owner); host_tasks.push_back(tmp_cleanup_ev); return comp_ev; }; -} // namespace dpctl::tensor::kernels::elementwise_common +} // namespace dpnp::tensor::kernels::elementwise_common diff --git a/dpnp/tensor/libtensor/include/kernels/elementwise_functions/common_detail.hpp b/dpnp/tensor/libtensor/include/kernels/elementwise_functions/common_detail.hpp index 68d025ec6307..d78d52b9ed47 100644 --- a/dpnp/tensor/libtensor/include/kernels/elementwise_functions/common_detail.hpp +++ b/dpnp/tensor/libtensor/include/kernels/elementwise_functions/common_detail.hpp @@ -37,7 +37,7 @@ #include -namespace dpctl::tensor::kernels::elementwise_detail +namespace dpnp::tensor::kernels::elementwise_detail { template class populate_padded_vec_krn; @@ -66,4 +66,4 @@ sycl::event return populate_padded_vec_ev; } -} // namespace dpctl::tensor::kernels::elementwise_detail +} // namespace dpnp::tensor::kernels::elementwise_detail diff --git a/dpnp/tensor/libtensor/include/kernels/elementwise_functions/common_inplace.hpp b/dpnp/tensor/libtensor/include/kernels/elementwise_functions/common_inplace.hpp index 61902fce888a..9384ec603754 100644 --- a/dpnp/tensor/libtensor/include/kernels/elementwise_functions/common_inplace.hpp +++ b/dpnp/tensor/libtensor/include/kernels/elementwise_functions/common_inplace.hpp @@ -46,20 +46,19 @@ #include "utils/sycl_utils.hpp" #include "kernels/alignment.hpp" -#include "kernels/dpctl_tensor_types.hpp" +#include "kernels/dpnp_tensor_types.hpp" #include "kernels/elementwise_functions/common_detail.hpp" -namespace dpctl::tensor::kernels::elementwise_common +namespace dpnp::tensor::kernels::elementwise_common { -using dpctl::tensor::ssize_t; -using dpctl::tensor::kernels::alignment_utils:: - disabled_sg_loadstore_wrapper_krn; -using dpctl::tensor::kernels::alignment_utils::is_aligned; -using dpctl::tensor::kernels::alignment_utils::required_alignment; +using dpnp::tensor::ssize_t; +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 dpctl::tensor::sycl_utils::sub_group_load; -using dpctl::tensor::sycl_utils::sub_group_store; +using dpnp::tensor::sycl_utils::sub_group_load; +using dpnp::tensor::sycl_utils::sub_group_store; template (n1_padded, - exec_q); + dpnp::tensor::alloc_utils::smart_malloc_device(n1_padded, exec_q); argT *padded_vec = padded_vec_owner.get(); sycl::event make_padded_vec_ev = - dpctl::tensor::kernels::elementwise_detail::populate_padded_vector< - argT>(exec_q, vec, n1, padded_vec, n1_padded, depends); + dpnp::tensor::kernels::elementwise_detail::populate_padded_vector( + exec_q, vec, n1, padded_vec, n1_padded, depends); // sub-group spans work-items [I, I + sgSize) // base = ndit.get_global_linear_id() - sg.get_local_id()[0] @@ -466,11 +464,11 @@ sycl::event binary_inplace_row_matrix_broadcast_impl( Impl(padded_vec, mat, n_elems, n1)); }); - sycl::event tmp_cleanup_ev = dpctl::tensor::alloc_utils::async_smart_free( + sycl::event tmp_cleanup_ev = dpnp::tensor::alloc_utils::async_smart_free( exec_q, {comp_ev}, padded_vec_owner); host_tasks.push_back(tmp_cleanup_ev); return comp_ev; } -} // namespace dpctl::tensor::kernels::elementwise_common +} // namespace dpnp::tensor::kernels::elementwise_common diff --git a/dpnp/tensor/libtensor/include/kernels/elementwise_functions/conj.hpp b/dpnp/tensor/libtensor/include/kernels/elementwise_functions/conj.hpp index 2c965b236c87..b7919093d4e6 100644 --- a/dpnp/tensor/libtensor/include/kernels/elementwise_functions/conj.hpp +++ b/dpnp/tensor/libtensor/include/kernels/elementwise_functions/conj.hpp @@ -44,19 +44,19 @@ #include "sycl_complex.hpp" #include "vec_size_util.hpp" -#include "kernels/dpctl_tensor_types.hpp" +#include "kernels/dpnp_tensor_types.hpp" #include "kernels/elementwise_functions/common.hpp" #include "utils/type_dispatch_building.hpp" #include "utils/type_utils.hpp" -namespace dpctl::tensor::kernels::conj +namespace dpnp::tensor::kernels::conj { -using dpctl::tensor::ssize_t; -namespace td_ns = dpctl::tensor::type_dispatch; +using dpnp::tensor::ssize_t; +namespace td_ns = dpnp::tensor::type_dispatch; -using dpctl::tensor::type_utils::is_complex; +using dpnp::tensor::type_utils::is_complex; template struct ConjFunctor @@ -130,7 +130,7 @@ struct ConjOutputType namespace hyperparam_detail { -namespace vsu_ns = dpctl::tensor::kernels::vec_size_utils; +namespace vsu_ns = dpnp::tensor::kernels::vec_size_utils; using vsu_ns::ContigHyperparameterSetDefault; using vsu_ns::UnaryContigHyperparameterSetEntry; @@ -231,4 +231,4 @@ struct ConjStridedFactory } }; -} // namespace dpctl::tensor::kernels::conj +} // namespace dpnp::tensor::kernels::conj diff --git a/dpnp/tensor/libtensor/include/kernels/elementwise_functions/copysign.hpp b/dpnp/tensor/libtensor/include/kernels/elementwise_functions/copysign.hpp index c2eb0f7e850e..89318f73fb6c 100644 --- a/dpnp/tensor/libtensor/include/kernels/elementwise_functions/copysign.hpp +++ b/dpnp/tensor/libtensor/include/kernels/elementwise_functions/copysign.hpp @@ -47,15 +47,15 @@ #include "utils/type_dispatch_building.hpp" #include "utils/type_utils.hpp" -#include "kernels/dpctl_tensor_types.hpp" +#include "kernels/dpnp_tensor_types.hpp" #include "kernels/elementwise_functions/common.hpp" -namespace dpctl::tensor::kernels::copysign +namespace dpnp::tensor::kernels::copysign { -using dpctl::tensor::ssize_t; -namespace td_ns = dpctl::tensor::type_dispatch; -namespace tu_ns = dpctl::tensor::type_utils; +using dpnp::tensor::ssize_t; +namespace td_ns = dpnp::tensor::type_dispatch; +namespace tu_ns = dpnp::tensor::type_utils; template struct CopysignFunctor @@ -80,7 +80,7 @@ struct CopysignFunctor return tmp; } else { - using dpctl::tensor::type_utils::vec_cast; + using dpnp::tensor::type_utils::vec_cast; return vec_cast( tmp); @@ -130,7 +130,7 @@ struct CopysignOutputType namespace hyperparam_detail { -namespace vsu_ns = dpctl::tensor::kernels::vec_size_utils; +namespace vsu_ns = dpnp::tensor::kernels::vec_size_utils; using vsu_ns::BinaryContigHyperparameterSetEntry; using vsu_ns::ContigHyperparameterSetDefault; @@ -245,4 +245,4 @@ struct CopysignStridedFactory } }; -} // namespace dpctl::tensor::kernels::copysign +} // namespace dpnp::tensor::kernels::copysign diff --git a/dpnp/tensor/libtensor/include/kernels/elementwise_functions/cos.hpp b/dpnp/tensor/libtensor/include/kernels/elementwise_functions/cos.hpp index 7bd47d54778b..9d8dd7e3cf85 100644 --- a/dpnp/tensor/libtensor/include/kernels/elementwise_functions/cos.hpp +++ b/dpnp/tensor/libtensor/include/kernels/elementwise_functions/cos.hpp @@ -46,19 +46,19 @@ #include "sycl_complex.hpp" #include "vec_size_util.hpp" -#include "kernels/dpctl_tensor_types.hpp" +#include "kernels/dpnp_tensor_types.hpp" #include "kernels/elementwise_functions/common.hpp" #include "utils/type_dispatch_building.hpp" #include "utils/type_utils.hpp" -namespace dpctl::tensor::kernels::cos +namespace dpnp::tensor::kernels::cos { -using dpctl::tensor::ssize_t; -namespace td_ns = dpctl::tensor::type_dispatch; +using dpnp::tensor::ssize_t; +namespace td_ns = dpnp::tensor::type_dispatch; -using dpctl::tensor::type_utils::is_complex; +using dpnp::tensor::type_utils::is_complex; template struct CosFunctor @@ -208,7 +208,7 @@ struct CosOutputType namespace hyperparam_detail { -namespace vsu_ns = dpctl::tensor::kernels::vec_size_utils; +namespace vsu_ns = dpnp::tensor::kernels::vec_size_utils; using vsu_ns::ContigHyperparameterSetDefault; using vsu_ns::UnaryContigHyperparameterSetEntry; @@ -308,4 +308,4 @@ struct CosStridedFactory } }; -} // namespace dpctl::tensor::kernels::cos +} // namespace dpnp::tensor::kernels::cos diff --git a/dpnp/tensor/libtensor/include/kernels/elementwise_functions/cosh.hpp b/dpnp/tensor/libtensor/include/kernels/elementwise_functions/cosh.hpp index 505eb5fffc29..d52651fc7d69 100644 --- a/dpnp/tensor/libtensor/include/kernels/elementwise_functions/cosh.hpp +++ b/dpnp/tensor/libtensor/include/kernels/elementwise_functions/cosh.hpp @@ -46,19 +46,19 @@ #include "sycl_complex.hpp" #include "vec_size_util.hpp" -#include "kernels/dpctl_tensor_types.hpp" +#include "kernels/dpnp_tensor_types.hpp" #include "kernels/elementwise_functions/common.hpp" #include "utils/type_dispatch_building.hpp" #include "utils/type_utils.hpp" -namespace dpctl::tensor::kernels::cosh +namespace dpnp::tensor::kernels::cosh { -using dpctl::tensor::ssize_t; -namespace td_ns = dpctl::tensor::type_dispatch; +using dpnp::tensor::ssize_t; +namespace td_ns = dpnp::tensor::type_dispatch; -using dpctl::tensor::type_utils::is_complex; +using dpnp::tensor::type_utils::is_complex; template struct CoshFunctor @@ -197,7 +197,7 @@ struct CoshOutputType namespace hyperparam_detail { -namespace vsu_ns = dpctl::tensor::kernels::vec_size_utils; +namespace vsu_ns = dpnp::tensor::kernels::vec_size_utils; using vsu_ns::ContigHyperparameterSetDefault; using vsu_ns::UnaryContigHyperparameterSetEntry; @@ -298,4 +298,4 @@ struct CoshStridedFactory } }; -} // namespace dpctl::tensor::kernels::cosh +} // namespace dpnp::tensor::kernels::cosh diff --git a/dpnp/tensor/libtensor/include/kernels/elementwise_functions/equal.hpp b/dpnp/tensor/libtensor/include/kernels/elementwise_functions/equal.hpp index 07b3566c5cef..a02fab05cb02 100644 --- a/dpnp/tensor/libtensor/include/kernels/elementwise_functions/equal.hpp +++ b/dpnp/tensor/libtensor/include/kernels/elementwise_functions/equal.hpp @@ -45,18 +45,18 @@ #include "sycl_complex.hpp" #include "vec_size_util.hpp" -#include "kernels/dpctl_tensor_types.hpp" +#include "kernels/dpnp_tensor_types.hpp" #include "kernels/elementwise_functions/common.hpp" #include "utils/type_dispatch_building.hpp" #include "utils/type_utils.hpp" -namespace dpctl::tensor::kernels::equal +namespace dpnp::tensor::kernels::equal { -using dpctl::tensor::ssize_t; -namespace td_ns = dpctl::tensor::type_dispatch; -namespace tu_ns = dpctl::tensor::type_utils; +using dpnp::tensor::ssize_t; +namespace td_ns = dpnp::tensor::type_dispatch; +namespace tu_ns = dpnp::tensor::type_utils; template struct EqualFunctor @@ -113,7 +113,7 @@ struct EqualFunctor return tmp; } else { - using dpctl::tensor::type_utils::vec_cast; + using dpnp::tensor::type_utils::vec_cast; return vec_cast( tmp); @@ -198,7 +198,7 @@ struct EqualOutputType namespace hyperparam_detail { -namespace vsu_ns = dpctl::tensor::kernels::vec_size_utils; +namespace vsu_ns = dpnp::tensor::kernels::vec_size_utils; using vsu_ns::BinaryContigHyperparameterSetEntry; using vsu_ns::ContigHyperparameterSetDefault; @@ -313,4 +313,4 @@ struct EqualStridedFactory } }; -} // namespace dpctl::tensor::kernels::equal +} // namespace dpnp::tensor::kernels::equal diff --git a/dpnp/tensor/libtensor/include/kernels/elementwise_functions/exp.hpp b/dpnp/tensor/libtensor/include/kernels/elementwise_functions/exp.hpp index 97789e53bb5a..3b4f92d6e3ba 100644 --- a/dpnp/tensor/libtensor/include/kernels/elementwise_functions/exp.hpp +++ b/dpnp/tensor/libtensor/include/kernels/elementwise_functions/exp.hpp @@ -46,19 +46,19 @@ #include "sycl_complex.hpp" #include "vec_size_util.hpp" -#include "kernels/dpctl_tensor_types.hpp" +#include "kernels/dpnp_tensor_types.hpp" #include "kernels/elementwise_functions/common.hpp" #include "utils/type_dispatch_building.hpp" #include "utils/type_utils.hpp" -namespace dpctl::tensor::kernels::exp +namespace dpnp::tensor::kernels::exp { -using dpctl::tensor::ssize_t; -namespace td_ns = dpctl::tensor::type_dispatch; +using dpnp::tensor::ssize_t; +namespace td_ns = dpnp::tensor::type_dispatch; -using dpctl::tensor::type_utils::is_complex; +using dpnp::tensor::type_utils::is_complex; template struct ExpFunctor @@ -166,7 +166,7 @@ struct ExpOutputType namespace hyperparam_detail { -namespace vsu_ns = dpctl::tensor::kernels::vec_size_utils; +namespace vsu_ns = dpnp::tensor::kernels::vec_size_utils; using vsu_ns::ContigHyperparameterSetDefault; using vsu_ns::UnaryContigHyperparameterSetEntry; @@ -266,4 +266,4 @@ struct ExpStridedFactory } }; -} // namespace dpctl::tensor::kernels::exp +} // namespace dpnp::tensor::kernels::exp diff --git a/dpnp/tensor/libtensor/include/kernels/elementwise_functions/exp2.hpp b/dpnp/tensor/libtensor/include/kernels/elementwise_functions/exp2.hpp index dd09f4eee342..a717d48f839a 100644 --- a/dpnp/tensor/libtensor/include/kernels/elementwise_functions/exp2.hpp +++ b/dpnp/tensor/libtensor/include/kernels/elementwise_functions/exp2.hpp @@ -46,19 +46,19 @@ #include "sycl_complex.hpp" #include "vec_size_util.hpp" -#include "kernels/dpctl_tensor_types.hpp" +#include "kernels/dpnp_tensor_types.hpp" #include "kernels/elementwise_functions/common.hpp" #include "utils/type_dispatch_building.hpp" #include "utils/type_utils.hpp" -namespace dpctl::tensor::kernels::exp2 +namespace dpnp::tensor::kernels::exp2 { -using dpctl::tensor::ssize_t; -namespace td_ns = dpctl::tensor::type_dispatch; +using dpnp::tensor::ssize_t; +namespace td_ns = dpnp::tensor::type_dispatch; -using dpctl::tensor::type_utils::is_complex; +using dpnp::tensor::type_utils::is_complex; template struct Exp2Functor @@ -167,7 +167,7 @@ struct Exp2OutputType namespace hyperparam_detail { -namespace vsu_ns = dpctl::tensor::kernels::vec_size_utils; +namespace vsu_ns = dpnp::tensor::kernels::vec_size_utils; using vsu_ns::ContigHyperparameterSetDefault; using vsu_ns::UnaryContigHyperparameterSetEntry; @@ -269,4 +269,4 @@ struct Exp2StridedFactory } }; -} // namespace dpctl::tensor::kernels::exp2 +} // namespace dpnp::tensor::kernels::exp2 diff --git a/dpnp/tensor/libtensor/include/kernels/elementwise_functions/expm1.hpp b/dpnp/tensor/libtensor/include/kernels/elementwise_functions/expm1.hpp index c29030a6dc95..e9e2a704cf0b 100644 --- a/dpnp/tensor/libtensor/include/kernels/elementwise_functions/expm1.hpp +++ b/dpnp/tensor/libtensor/include/kernels/elementwise_functions/expm1.hpp @@ -45,19 +45,19 @@ #include "vec_size_util.hpp" -#include "kernels/dpctl_tensor_types.hpp" +#include "kernels/dpnp_tensor_types.hpp" #include "kernels/elementwise_functions/common.hpp" #include "utils/type_dispatch_building.hpp" #include "utils/type_utils.hpp" -namespace dpctl::tensor::kernels::expm1 +namespace dpnp::tensor::kernels::expm1 { -using dpctl::tensor::ssize_t; -namespace td_ns = dpctl::tensor::type_dispatch; +using dpnp::tensor::ssize_t; +namespace td_ns = dpnp::tensor::type_dispatch; -using dpctl::tensor::type_utils::is_complex; +using dpnp::tensor::type_utils::is_complex; template struct Expm1Functor @@ -178,7 +178,7 @@ struct Expm1OutputType namespace hyperparam_detail { -namespace vsu_ns = dpctl::tensor::kernels::vec_size_utils; +namespace vsu_ns = dpnp::tensor::kernels::vec_size_utils; using vsu_ns::ContigHyperparameterSetDefault; using vsu_ns::UnaryContigHyperparameterSetEntry; @@ -279,4 +279,4 @@ struct Expm1StridedFactory } }; -} // namespace dpctl::tensor::kernels::expm1 +} // namespace dpnp::tensor::kernels::expm1 diff --git a/dpnp/tensor/libtensor/include/kernels/elementwise_functions/floor.hpp b/dpnp/tensor/libtensor/include/kernels/elementwise_functions/floor.hpp index 375659b94a12..25b1abedb09e 100644 --- a/dpnp/tensor/libtensor/include/kernels/elementwise_functions/floor.hpp +++ b/dpnp/tensor/libtensor/include/kernels/elementwise_functions/floor.hpp @@ -42,19 +42,19 @@ #include "vec_size_util.hpp" -#include "kernels/dpctl_tensor_types.hpp" +#include "kernels/dpnp_tensor_types.hpp" #include "kernels/elementwise_functions/common.hpp" #include "utils/type_dispatch_building.hpp" #include "utils/type_utils.hpp" -namespace dpctl::tensor::kernels::floor +namespace dpnp::tensor::kernels::floor { -using dpctl::tensor::ssize_t; -namespace td_ns = dpctl::tensor::type_dispatch; +using dpnp::tensor::ssize_t; +namespace td_ns = dpnp::tensor::type_dispatch; -using dpctl::tensor::type_utils::is_complex; +using dpnp::tensor::type_utils::is_complex; template struct FloorFunctor @@ -125,7 +125,7 @@ struct FloorOutputType namespace hyperparam_detail { -namespace vsu_ns = dpctl::tensor::kernels::vec_size_utils; +namespace vsu_ns = dpnp::tensor::kernels::vec_size_utils; using vsu_ns::ContigHyperparameterSetDefault; using vsu_ns::UnaryContigHyperparameterSetEntry; @@ -226,4 +226,4 @@ struct FloorStridedFactory } }; -} // namespace dpctl::tensor::kernels::floor +} // namespace dpnp::tensor::kernels::floor diff --git a/dpnp/tensor/libtensor/include/kernels/elementwise_functions/floor_divide.hpp b/dpnp/tensor/libtensor/include/kernels/elementwise_functions/floor_divide.hpp index e669a97c04ea..ea413e7f2655 100644 --- a/dpnp/tensor/libtensor/include/kernels/elementwise_functions/floor_divide.hpp +++ b/dpnp/tensor/libtensor/include/kernels/elementwise_functions/floor_divide.hpp @@ -43,19 +43,19 @@ #include "vec_size_util.hpp" -#include "kernels/dpctl_tensor_types.hpp" +#include "kernels/dpnp_tensor_types.hpp" #include "kernels/elementwise_functions/common.hpp" #include "kernels/elementwise_functions/common_inplace.hpp" #include "utils/type_dispatch_building.hpp" #include "utils/type_utils.hpp" -namespace dpctl::tensor::kernels::floor_divide +namespace dpnp::tensor::kernels::floor_divide { -using dpctl::tensor::ssize_t; -namespace td_ns = dpctl::tensor::type_dispatch; -namespace tu_ns = dpctl::tensor::type_utils; +using dpnp::tensor::ssize_t; +namespace td_ns = dpnp::tensor::type_dispatch; +namespace tu_ns = dpnp::tensor::type_utils; template struct FloorDivideFunctor @@ -121,7 +121,7 @@ struct FloorDivideFunctor return tmp; } else { - using dpctl::tensor::type_utils::vec_cast; + using dpnp::tensor::type_utils::vec_cast; return vec_cast(tmp); } } @@ -213,7 +213,7 @@ struct FloorDivideOutputType namespace hyperparam_detail { -namespace vsu_ns = dpctl::tensor::kernels::vec_size_utils; +namespace vsu_ns = dpnp::tensor::kernels::vec_size_utils; using vsu_ns::BinaryContigHyperparameterSetEntry; using vsu_ns::ContigHyperparameterSetDefault; @@ -543,4 +543,4 @@ struct FloorDivideInplaceStridedFactory } }; -} // namespace dpctl::tensor::kernels::floor_divide +} // namespace dpnp::tensor::kernels::floor_divide diff --git a/dpnp/tensor/libtensor/include/kernels/elementwise_functions/greater.hpp b/dpnp/tensor/libtensor/include/kernels/elementwise_functions/greater.hpp index 9b3659faa161..79ba29963400 100644 --- a/dpnp/tensor/libtensor/include/kernels/elementwise_functions/greater.hpp +++ b/dpnp/tensor/libtensor/include/kernels/elementwise_functions/greater.hpp @@ -48,15 +48,15 @@ #include "utils/type_dispatch_building.hpp" #include "utils/type_utils.hpp" -#include "kernels/dpctl_tensor_types.hpp" +#include "kernels/dpnp_tensor_types.hpp" #include "kernels/elementwise_functions/common.hpp" -namespace dpctl::tensor::kernels::greater +namespace dpnp::tensor::kernels::greater { -using dpctl::tensor::ssize_t; -namespace td_ns = dpctl::tensor::type_dispatch; -namespace tu_ns = dpctl::tensor::type_utils; +using dpnp::tensor::ssize_t; +namespace td_ns = dpnp::tensor::type_dispatch; +namespace tu_ns = dpnp::tensor::type_utils; template struct GreaterFunctor @@ -75,7 +75,7 @@ struct GreaterFunctor if constexpr (tu_ns::is_complex::value || tu_ns::is_complex::value) { static_assert(std::is_same_v); - using dpctl::tensor::math_utils::greater_complex; + using dpnp::tensor::math_utils::greater_complex; return greater_complex(in1, in2); } else { @@ -113,7 +113,7 @@ struct GreaterFunctor return tmp; } else { - using dpctl::tensor::type_utils::vec_cast; + using dpnp::tensor::type_utils::vec_cast; return vec_cast( tmp); @@ -198,7 +198,7 @@ struct GreaterOutputType namespace hyperparam_detail { -namespace vsu_ns = dpctl::tensor::kernels::vec_size_utils; +namespace vsu_ns = dpnp::tensor::kernels::vec_size_utils; using vsu_ns::BinaryContigHyperparameterSetEntry; using vsu_ns::ContigHyperparameterSetDefault; @@ -314,4 +314,4 @@ struct GreaterStridedFactory } }; -} // namespace dpctl::tensor::kernels::greater +} // namespace dpnp::tensor::kernels::greater diff --git a/dpnp/tensor/libtensor/include/kernels/elementwise_functions/greater_equal.hpp b/dpnp/tensor/libtensor/include/kernels/elementwise_functions/greater_equal.hpp index 25c56d4d40a4..8749b1acac68 100644 --- a/dpnp/tensor/libtensor/include/kernels/elementwise_functions/greater_equal.hpp +++ b/dpnp/tensor/libtensor/include/kernels/elementwise_functions/greater_equal.hpp @@ -48,15 +48,15 @@ #include "utils/type_dispatch_building.hpp" #include "utils/type_utils.hpp" -#include "kernels/dpctl_tensor_types.hpp" +#include "kernels/dpnp_tensor_types.hpp" #include "kernels/elementwise_functions/common.hpp" -namespace dpctl::tensor::kernels::greater_equal +namespace dpnp::tensor::kernels::greater_equal { -using dpctl::tensor::ssize_t; -namespace td_ns = dpctl::tensor::type_dispatch; -namespace tu_ns = dpctl::tensor::type_utils; +using dpnp::tensor::ssize_t; +namespace td_ns = dpnp::tensor::type_dispatch; +namespace tu_ns = dpnp::tensor::type_utils; template struct GreaterEqualFunctor @@ -75,7 +75,7 @@ struct GreaterEqualFunctor if constexpr (tu_ns::is_complex::value || tu_ns::is_complex::value) { static_assert(std::is_same_v); - using dpctl::tensor::math_utils::greater_equal_complex; + using dpnp::tensor::math_utils::greater_equal_complex; return greater_equal_complex(in1, in2); } else { @@ -113,7 +113,7 @@ struct GreaterEqualFunctor return tmp; } else { - using dpctl::tensor::type_utils::vec_cast; + using dpnp::tensor::type_utils::vec_cast; return vec_cast( tmp); @@ -198,7 +198,7 @@ struct GreaterEqualOutputType namespace hyperparam_detail { -namespace vsu_ns = dpctl::tensor::kernels::vec_size_utils; +namespace vsu_ns = dpnp::tensor::kernels::vec_size_utils; using vsu_ns::BinaryContigHyperparameterSetEntry; using vsu_ns::ContigHyperparameterSetDefault; @@ -314,4 +314,4 @@ struct GreaterEqualStridedFactory } }; -} // namespace dpctl::tensor::kernels::greater_equal +} // namespace dpnp::tensor::kernels::greater_equal diff --git a/dpnp/tensor/libtensor/include/kernels/elementwise_functions/hypot.hpp b/dpnp/tensor/libtensor/include/kernels/elementwise_functions/hypot.hpp index 438a5eea3ae8..36468889c014 100644 --- a/dpnp/tensor/libtensor/include/kernels/elementwise_functions/hypot.hpp +++ b/dpnp/tensor/libtensor/include/kernels/elementwise_functions/hypot.hpp @@ -46,15 +46,15 @@ #include "utils/type_dispatch_building.hpp" #include "utils/type_utils.hpp" -#include "kernels/dpctl_tensor_types.hpp" +#include "kernels/dpnp_tensor_types.hpp" #include "kernels/elementwise_functions/common.hpp" -namespace dpctl::tensor::kernels::hypot +namespace dpnp::tensor::kernels::hypot { -using dpctl::tensor::ssize_t; -namespace td_ns = dpctl::tensor::type_dispatch; -namespace tu_ns = dpctl::tensor::type_utils; +using dpnp::tensor::ssize_t; +namespace td_ns = dpnp::tensor::type_dispatch; +namespace tu_ns = dpnp::tensor::type_utils; template struct HypotFunctor @@ -81,7 +81,7 @@ struct HypotFunctor return res; } else { - using dpctl::tensor::type_utils::vec_cast; + using dpnp::tensor::type_utils::vec_cast; return vec_cast( res); @@ -131,7 +131,7 @@ struct HypotOutputType namespace hyperparam_detail { -namespace vsu_ns = dpctl::tensor::kernels::vec_size_utils; +namespace vsu_ns = dpnp::tensor::kernels::vec_size_utils; using vsu_ns::BinaryContigHyperparameterSetEntry; using vsu_ns::ContigHyperparameterSetDefault; @@ -246,4 +246,4 @@ struct HypotStridedFactory } }; -} // namespace dpctl::tensor::kernels::hypot +} // namespace dpnp::tensor::kernels::hypot diff --git a/dpnp/tensor/libtensor/include/kernels/elementwise_functions/imag.hpp b/dpnp/tensor/libtensor/include/kernels/elementwise_functions/imag.hpp index 667fb47efdc8..0809a19ba720 100644 --- a/dpnp/tensor/libtensor/include/kernels/elementwise_functions/imag.hpp +++ b/dpnp/tensor/libtensor/include/kernels/elementwise_functions/imag.hpp @@ -43,20 +43,20 @@ #include "vec_size_util.hpp" -#include "kernels/dpctl_tensor_types.hpp" +#include "kernels/dpnp_tensor_types.hpp" #include "kernels/elementwise_functions/common.hpp" #include "utils/type_dispatch_building.hpp" #include "utils/type_utils.hpp" -namespace dpctl::tensor::kernels::imag +namespace dpnp::tensor::kernels::imag { -using dpctl::tensor::ssize_t; -namespace td_ns = dpctl::tensor::type_dispatch; +using dpnp::tensor::ssize_t; +namespace td_ns = dpnp::tensor::type_dispatch; -using dpctl::tensor::type_utils::is_complex; -using dpctl::tensor::type_utils::is_complex_v; +using dpnp::tensor::type_utils::is_complex; +using dpnp::tensor::type_utils::is_complex_v; template struct ImagFunctor @@ -128,7 +128,7 @@ struct ImagOutputType namespace hyperparam_detail { -namespace vsu_ns = dpctl::tensor::kernels::vec_size_utils; +namespace vsu_ns = dpnp::tensor::kernels::vec_size_utils; using vsu_ns::ContigHyperparameterSetDefault; using vsu_ns::UnaryContigHyperparameterSetEntry; @@ -229,4 +229,4 @@ struct ImagStridedFactory } }; -} // namespace dpctl::tensor::kernels::imag +} // namespace dpnp::tensor::kernels::imag diff --git a/dpnp/tensor/libtensor/include/kernels/elementwise_functions/isfinite.hpp b/dpnp/tensor/libtensor/include/kernels/elementwise_functions/isfinite.hpp index 8eb435c089d8..109c1804b176 100644 --- a/dpnp/tensor/libtensor/include/kernels/elementwise_functions/isfinite.hpp +++ b/dpnp/tensor/libtensor/include/kernels/elementwise_functions/isfinite.hpp @@ -45,20 +45,20 @@ #include "vec_size_util.hpp" -#include "kernels/dpctl_tensor_types.hpp" +#include "kernels/dpnp_tensor_types.hpp" #include "kernels/elementwise_functions/common.hpp" #include "utils/type_dispatch_building.hpp" #include "utils/type_utils.hpp" -namespace dpctl::tensor::kernels::isfinite +namespace dpnp::tensor::kernels::isfinite { -using dpctl::tensor::ssize_t; -namespace td_ns = dpctl::tensor::type_dispatch; +using dpnp::tensor::ssize_t; +namespace td_ns = dpnp::tensor::type_dispatch; -using dpctl::tensor::type_utils::is_complex; -using dpctl::tensor::type_utils::vec_cast; +using dpnp::tensor::type_utils::is_complex; +using dpnp::tensor::type_utils::vec_cast; template struct IsFiniteFunctor @@ -133,7 +133,7 @@ struct IsFiniteOutputType namespace hyperparam_detail { -namespace vsu_ns = dpctl::tensor::kernels::vec_size_utils; +namespace vsu_ns = dpnp::tensor::kernels::vec_size_utils; using vsu_ns::ContigHyperparameterSetDefault; using vsu_ns::UnaryContigHyperparameterSetEntry; @@ -225,4 +225,4 @@ struct IsFiniteStridedFactory } }; -} // namespace dpctl::tensor::kernels::isfinite +} // namespace dpnp::tensor::kernels::isfinite diff --git a/dpnp/tensor/libtensor/include/kernels/elementwise_functions/isinf.hpp b/dpnp/tensor/libtensor/include/kernels/elementwise_functions/isinf.hpp index b7d85e21a1f2..ca8aabc4527a 100644 --- a/dpnp/tensor/libtensor/include/kernels/elementwise_functions/isinf.hpp +++ b/dpnp/tensor/libtensor/include/kernels/elementwise_functions/isinf.hpp @@ -45,20 +45,20 @@ #include "vec_size_util.hpp" -#include "kernels/dpctl_tensor_types.hpp" +#include "kernels/dpnp_tensor_types.hpp" #include "kernels/elementwise_functions/common.hpp" #include "utils/type_dispatch_building.hpp" #include "utils/type_utils.hpp" -namespace dpctl::tensor::kernels::isinf +namespace dpnp::tensor::kernels::isinf { -using dpctl::tensor::ssize_t; -namespace td_ns = dpctl::tensor::type_dispatch; +using dpnp::tensor::ssize_t; +namespace td_ns = dpnp::tensor::type_dispatch; -using dpctl::tensor::type_utils::is_complex; -using dpctl::tensor::type_utils::vec_cast; +using dpnp::tensor::type_utils::is_complex; +using dpnp::tensor::type_utils::vec_cast; template struct IsInfFunctor @@ -131,7 +131,7 @@ struct IsInfOutputType namespace hyperparam_detail { -namespace vsu_ns = dpctl::tensor::kernels::vec_size_utils; +namespace vsu_ns = dpnp::tensor::kernels::vec_size_utils; using vsu_ns::ContigHyperparameterSetDefault; using vsu_ns::UnaryContigHyperparameterSetEntry; @@ -220,4 +220,4 @@ struct IsInfStridedFactory } }; -} // namespace dpctl::tensor::kernels::isinf +} // namespace dpnp::tensor::kernels::isinf diff --git a/dpnp/tensor/libtensor/include/kernels/elementwise_functions/isnan.hpp b/dpnp/tensor/libtensor/include/kernels/elementwise_functions/isnan.hpp index cad2d2239de0..ae343adcd80a 100644 --- a/dpnp/tensor/libtensor/include/kernels/elementwise_functions/isnan.hpp +++ b/dpnp/tensor/libtensor/include/kernels/elementwise_functions/isnan.hpp @@ -44,20 +44,20 @@ #include "vec_size_util.hpp" -#include "kernels/dpctl_tensor_types.hpp" +#include "kernels/dpnp_tensor_types.hpp" #include "kernels/elementwise_functions/common.hpp" #include "utils/type_dispatch_building.hpp" #include "utils/type_utils.hpp" -namespace dpctl::tensor::kernels::isnan +namespace dpnp::tensor::kernels::isnan { -using dpctl::tensor::ssize_t; -namespace td_ns = dpctl::tensor::type_dispatch; +using dpnp::tensor::ssize_t; +namespace td_ns = dpnp::tensor::type_dispatch; -using dpctl::tensor::type_utils::is_complex; -using dpctl::tensor::type_utils::vec_cast; +using dpnp::tensor::type_utils::is_complex; +using dpnp::tensor::type_utils::vec_cast; template struct IsNanFunctor @@ -129,7 +129,7 @@ struct IsNanOutputType namespace hyperparam_detail { -namespace vsu_ns = dpctl::tensor::kernels::vec_size_utils; +namespace vsu_ns = dpnp::tensor::kernels::vec_size_utils; using vsu_ns::ContigHyperparameterSetDefault; using vsu_ns::UnaryContigHyperparameterSetEntry; @@ -218,4 +218,4 @@ struct IsNanStridedFactory } }; -} // namespace dpctl::tensor::kernels::isnan +} // namespace dpnp::tensor::kernels::isnan diff --git a/dpnp/tensor/libtensor/include/kernels/elementwise_functions/less.hpp b/dpnp/tensor/libtensor/include/kernels/elementwise_functions/less.hpp index 19077936372e..cedb54ef2107 100644 --- a/dpnp/tensor/libtensor/include/kernels/elementwise_functions/less.hpp +++ b/dpnp/tensor/libtensor/include/kernels/elementwise_functions/less.hpp @@ -48,15 +48,15 @@ #include "utils/type_dispatch_building.hpp" #include "utils/type_utils.hpp" -#include "kernels/dpctl_tensor_types.hpp" +#include "kernels/dpnp_tensor_types.hpp" #include "kernels/elementwise_functions/common.hpp" -namespace dpctl::tensor::kernels::less +namespace dpnp::tensor::kernels::less { -using dpctl::tensor::ssize_t; -namespace td_ns = dpctl::tensor::type_dispatch; -namespace tu_ns = dpctl::tensor::type_utils; +using dpnp::tensor::ssize_t; +namespace td_ns = dpnp::tensor::type_dispatch; +namespace tu_ns = dpnp::tensor::type_utils; template struct LessFunctor @@ -75,7 +75,7 @@ struct LessFunctor if constexpr (tu_ns::is_complex::value || tu_ns::is_complex::value) { static_assert(std::is_same_v); - using dpctl::tensor::math_utils::less_complex; + using dpnp::tensor::math_utils::less_complex; return less_complex(in1, in2); } else { @@ -112,7 +112,7 @@ struct LessFunctor return tmp; } else { - using dpctl::tensor::type_utils::vec_cast; + using dpnp::tensor::type_utils::vec_cast; return vec_cast( tmp); @@ -197,7 +197,7 @@ struct LessOutputType namespace hyperparam_detail { -namespace vsu_ns = dpctl::tensor::kernels::vec_size_utils; +namespace vsu_ns = dpnp::tensor::kernels::vec_size_utils; using vsu_ns::BinaryContigHyperparameterSetEntry; using vsu_ns::ContigHyperparameterSetDefault; @@ -311,4 +311,4 @@ struct LessStridedFactory } }; -} // namespace dpctl::tensor::kernels::less +} // namespace dpnp::tensor::kernels::less diff --git a/dpnp/tensor/libtensor/include/kernels/elementwise_functions/less_equal.hpp b/dpnp/tensor/libtensor/include/kernels/elementwise_functions/less_equal.hpp index a0b23693e70d..e509ae59aa3e 100644 --- a/dpnp/tensor/libtensor/include/kernels/elementwise_functions/less_equal.hpp +++ b/dpnp/tensor/libtensor/include/kernels/elementwise_functions/less_equal.hpp @@ -48,15 +48,15 @@ #include "utils/type_dispatch_building.hpp" #include "utils/type_utils.hpp" -#include "kernels/dpctl_tensor_types.hpp" +#include "kernels/dpnp_tensor_types.hpp" #include "kernels/elementwise_functions/common.hpp" -namespace dpctl::tensor::kernels::less_equal +namespace dpnp::tensor::kernels::less_equal { -using dpctl::tensor::ssize_t; -namespace td_ns = dpctl::tensor::type_dispatch; -namespace tu_ns = dpctl::tensor::type_utils; +using dpnp::tensor::ssize_t; +namespace td_ns = dpnp::tensor::type_dispatch; +namespace tu_ns = dpnp::tensor::type_utils; template struct LessEqualFunctor @@ -75,7 +75,7 @@ struct LessEqualFunctor if constexpr (tu_ns::is_complex::value || tu_ns::is_complex::value) { static_assert(std::is_same_v); - using dpctl::tensor::math_utils::less_equal_complex; + using dpnp::tensor::math_utils::less_equal_complex; return less_equal_complex(in1, in2); } else { @@ -113,7 +113,7 @@ struct LessEqualFunctor return tmp; } else { - using dpctl::tensor::type_utils::vec_cast; + using dpnp::tensor::type_utils::vec_cast; return vec_cast( tmp); @@ -198,7 +198,7 @@ struct LessEqualOutputType namespace hyperparam_detail { -namespace vsu_ns = dpctl::tensor::kernels::vec_size_utils; +namespace vsu_ns = dpnp::tensor::kernels::vec_size_utils; using vsu_ns::BinaryContigHyperparameterSetEntry; using vsu_ns::ContigHyperparameterSetDefault; @@ -313,4 +313,4 @@ struct LessEqualStridedFactory } }; -} // namespace dpctl::tensor::kernels::less_equal +} // namespace dpnp::tensor::kernels::less_equal diff --git a/dpnp/tensor/libtensor/include/kernels/elementwise_functions/log.hpp b/dpnp/tensor/libtensor/include/kernels/elementwise_functions/log.hpp index 05e5048f65a7..7a6d7f265e75 100644 --- a/dpnp/tensor/libtensor/include/kernels/elementwise_functions/log.hpp +++ b/dpnp/tensor/libtensor/include/kernels/elementwise_functions/log.hpp @@ -44,19 +44,19 @@ #include "sycl_complex.hpp" #include "vec_size_util.hpp" -#include "kernels/dpctl_tensor_types.hpp" +#include "kernels/dpnp_tensor_types.hpp" #include "kernels/elementwise_functions/common.hpp" #include "utils/type_dispatch_building.hpp" #include "utils/type_utils.hpp" -namespace dpctl::tensor::kernels::log +namespace dpnp::tensor::kernels::log { -using dpctl::tensor::ssize_t; -namespace td_ns = dpctl::tensor::type_dispatch; +using dpnp::tensor::ssize_t; +namespace td_ns = dpnp::tensor::type_dispatch; -using dpctl::tensor::type_utils::is_complex; +using dpnp::tensor::type_utils::is_complex; template struct LogFunctor @@ -119,7 +119,7 @@ struct LogOutputType namespace hyperparam_detail { -namespace vsu_ns = dpctl::tensor::kernels::vec_size_utils; +namespace vsu_ns = dpnp::tensor::kernels::vec_size_utils; using vsu_ns::ContigHyperparameterSetDefault; using vsu_ns::UnaryContigHyperparameterSetEntry; @@ -219,4 +219,4 @@ struct LogStridedFactory } }; -} // namespace dpctl::tensor::kernels::log +} // namespace dpnp::tensor::kernels::log diff --git a/dpnp/tensor/libtensor/include/kernels/elementwise_functions/log10.hpp b/dpnp/tensor/libtensor/include/kernels/elementwise_functions/log10.hpp index 8ddb701ea622..faed782553f7 100644 --- a/dpnp/tensor/libtensor/include/kernels/elementwise_functions/log10.hpp +++ b/dpnp/tensor/libtensor/include/kernels/elementwise_functions/log10.hpp @@ -43,20 +43,20 @@ #include "sycl_complex.hpp" #include "vec_size_util.hpp" -#include "kernels/dpctl_tensor_types.hpp" +#include "kernels/dpnp_tensor_types.hpp" #include "kernels/elementwise_functions/common.hpp" #include "utils/type_dispatch_building.hpp" #include "utils/type_utils.hpp" -namespace dpctl::tensor::kernels::log10 +namespace dpnp::tensor::kernels::log10 { -using dpctl::tensor::ssize_t; -namespace td_ns = dpctl::tensor::type_dispatch; +using dpnp::tensor::ssize_t; +namespace td_ns = dpnp::tensor::type_dispatch; -using dpctl::tensor::type_utils::is_complex; -using dpctl::tensor::type_utils::vec_cast; +using dpnp::tensor::type_utils::is_complex; +using dpnp::tensor::type_utils::vec_cast; template struct Log10Functor @@ -136,7 +136,7 @@ struct Log10OutputType namespace hyperparam_detail { -namespace vsu_ns = dpctl::tensor::kernels::vec_size_utils; +namespace vsu_ns = dpnp::tensor::kernels::vec_size_utils; using vsu_ns::ContigHyperparameterSetDefault; using vsu_ns::UnaryContigHyperparameterSetEntry; @@ -237,4 +237,4 @@ struct Log10StridedFactory } }; -} // namespace dpctl::tensor::kernels::log10 +} // namespace dpnp::tensor::kernels::log10 diff --git a/dpnp/tensor/libtensor/include/kernels/elementwise_functions/log1p.hpp b/dpnp/tensor/libtensor/include/kernels/elementwise_functions/log1p.hpp index 8365932aead7..93f0f6498df2 100644 --- a/dpnp/tensor/libtensor/include/kernels/elementwise_functions/log1p.hpp +++ b/dpnp/tensor/libtensor/include/kernels/elementwise_functions/log1p.hpp @@ -44,19 +44,19 @@ #include "vec_size_util.hpp" -#include "kernels/dpctl_tensor_types.hpp" +#include "kernels/dpnp_tensor_types.hpp" #include "kernels/elementwise_functions/common.hpp" #include "utils/type_dispatch_building.hpp" #include "utils/type_utils.hpp" -namespace dpctl::tensor::kernels::log1p +namespace dpnp::tensor::kernels::log1p { -using dpctl::tensor::ssize_t; -namespace td_ns = dpctl::tensor::type_dispatch; +using dpnp::tensor::ssize_t; +namespace td_ns = dpnp::tensor::type_dispatch; -using dpctl::tensor::type_utils::is_complex; +using dpnp::tensor::type_utils::is_complex; // TODO: evaluate precision against alternatives template @@ -144,7 +144,7 @@ struct Log1pOutputType namespace hyperparam_detail { -namespace vsu_ns = dpctl::tensor::kernels::vec_size_utils; +namespace vsu_ns = dpnp::tensor::kernels::vec_size_utils; using vsu_ns::ContigHyperparameterSetDefault; using vsu_ns::UnaryContigHyperparameterSetEntry; @@ -245,4 +245,4 @@ struct Log1pStridedFactory } }; -} // namespace dpctl::tensor::kernels::log1p +} // namespace dpnp::tensor::kernels::log1p diff --git a/dpnp/tensor/libtensor/include/kernels/elementwise_functions/log2.hpp b/dpnp/tensor/libtensor/include/kernels/elementwise_functions/log2.hpp index 3cb537b82522..16704b0ac471 100644 --- a/dpnp/tensor/libtensor/include/kernels/elementwise_functions/log2.hpp +++ b/dpnp/tensor/libtensor/include/kernels/elementwise_functions/log2.hpp @@ -43,20 +43,20 @@ #include "sycl_complex.hpp" #include "vec_size_util.hpp" -#include "kernels/dpctl_tensor_types.hpp" +#include "kernels/dpnp_tensor_types.hpp" #include "kernels/elementwise_functions/common.hpp" #include "utils/type_dispatch_building.hpp" #include "utils/type_utils.hpp" -namespace dpctl::tensor::kernels::log2 +namespace dpnp::tensor::kernels::log2 { -using dpctl::tensor::ssize_t; -namespace td_ns = dpctl::tensor::type_dispatch; +using dpnp::tensor::ssize_t; +namespace td_ns = dpnp::tensor::type_dispatch; -using dpctl::tensor::type_utils::is_complex; -using dpctl::tensor::type_utils::vec_cast; +using dpnp::tensor::type_utils::is_complex; +using dpnp::tensor::type_utils::vec_cast; template struct Log2Functor @@ -137,7 +137,7 @@ struct Log2OutputType namespace hyperparam_detail { -namespace vsu_ns = dpctl::tensor::kernels::vec_size_utils; +namespace vsu_ns = dpnp::tensor::kernels::vec_size_utils; using vsu_ns::ContigHyperparameterSetDefault; using vsu_ns::UnaryContigHyperparameterSetEntry; @@ -238,4 +238,4 @@ struct Log2StridedFactory } }; -} // namespace dpctl::tensor::kernels::log2 +} // namespace dpnp::tensor::kernels::log2 diff --git a/dpnp/tensor/libtensor/include/kernels/elementwise_functions/logaddexp.hpp b/dpnp/tensor/libtensor/include/kernels/elementwise_functions/logaddexp.hpp index 3a79950672d2..eb5fcec56987 100644 --- a/dpnp/tensor/libtensor/include/kernels/elementwise_functions/logaddexp.hpp +++ b/dpnp/tensor/libtensor/include/kernels/elementwise_functions/logaddexp.hpp @@ -49,12 +49,12 @@ #include "utils/math_utils.hpp" #include "utils/type_dispatch_building.hpp" -#include "kernels/dpctl_tensor_types.hpp" +#include "kernels/dpnp_tensor_types.hpp" -namespace dpctl::tensor::kernels::logaddexp +namespace dpnp::tensor::kernels::logaddexp { -using dpctl::tensor::ssize_t; -namespace td_ns = dpctl::tensor::type_dispatch; +using dpnp::tensor::ssize_t; +namespace td_ns = dpnp::tensor::type_dispatch; template struct LogAddExpFunctor @@ -64,7 +64,7 @@ struct LogAddExpFunctor resT operator()(const argT1 &in1, const argT2 &in2) const { - using dpctl::tensor::math_utils::logaddexp; + using dpnp::tensor::math_utils::logaddexp; return logaddexp(in1, in2); } @@ -83,7 +83,7 @@ struct LogAddExpFunctor impl_finite(-sycl::fabs(diff[i])); } else { - using dpctl::tensor::math_utils::logaddexp; + using dpnp::tensor::math_utils::logaddexp; res[i] = logaddexp(in1[i], in2[i]); } } @@ -142,7 +142,7 @@ struct LogAddExpOutputType namespace hyperparam_detail { -namespace vsu_ns = dpctl::tensor::kernels::vec_size_utils; +namespace vsu_ns = dpnp::tensor::kernels::vec_size_utils; using vsu_ns::BinaryContigHyperparameterSetEntry; using vsu_ns::ContigHyperparameterSetDefault; @@ -260,4 +260,4 @@ struct LogAddExpStridedFactory template class logaddexp_matrix_row_broadcast_sg_krn; -} // namespace dpctl::tensor::kernels::logaddexp +} // namespace dpnp::tensor::kernels::logaddexp diff --git a/dpnp/tensor/libtensor/include/kernels/elementwise_functions/logical_and.hpp b/dpnp/tensor/libtensor/include/kernels/elementwise_functions/logical_and.hpp index 39049dab8d5e..b91324db166b 100644 --- a/dpnp/tensor/libtensor/include/kernels/elementwise_functions/logical_and.hpp +++ b/dpnp/tensor/libtensor/include/kernels/elementwise_functions/logical_and.hpp @@ -48,15 +48,15 @@ #include "utils/type_dispatch_building.hpp" #include "utils/type_utils.hpp" -#include "kernels/dpctl_tensor_types.hpp" +#include "kernels/dpnp_tensor_types.hpp" #include "kernels/elementwise_functions/common.hpp" -namespace dpctl::tensor::kernels::logical_and +namespace dpnp::tensor::kernels::logical_and { -using dpctl::tensor::ssize_t; -namespace td_ns = dpctl::tensor::type_dispatch; -namespace tu_ns = dpctl::tensor::type_utils; +using dpnp::tensor::ssize_t; +namespace td_ns = dpnp::tensor::type_dispatch; +namespace tu_ns = dpnp::tensor::type_utils; template struct LogicalAndFunctor @@ -90,7 +90,7 @@ struct LogicalAndFunctor return tmp; } else { - using dpctl::tensor::type_utils::vec_cast; + using dpnp::tensor::type_utils::vec_cast; return vec_cast( tmp); @@ -171,7 +171,7 @@ struct LogicalAndOutputType namespace hyperparam_detail { -namespace vsu_ns = dpctl::tensor::kernels::vec_size_utils; +namespace vsu_ns = dpnp::tensor::kernels::vec_size_utils; using vsu_ns::BinaryContigHyperparameterSetEntry; using vsu_ns::ContigHyperparameterSetDefault; @@ -288,4 +288,4 @@ struct LogicalAndStridedFactory } }; -} // namespace dpctl::tensor::kernels::logical_and +} // namespace dpnp::tensor::kernels::logical_and diff --git a/dpnp/tensor/libtensor/include/kernels/elementwise_functions/logical_not.hpp b/dpnp/tensor/libtensor/include/kernels/elementwise_functions/logical_not.hpp index b8f1c042ca73..65387f34dc99 100644 --- a/dpnp/tensor/libtensor/include/kernels/elementwise_functions/logical_not.hpp +++ b/dpnp/tensor/libtensor/include/kernels/elementwise_functions/logical_not.hpp @@ -43,18 +43,18 @@ #include "vec_size_util.hpp" -#include "kernels/dpctl_tensor_types.hpp" +#include "kernels/dpnp_tensor_types.hpp" #include "kernels/elementwise_functions/common.hpp" #include "utils/type_dispatch_building.hpp" #include "utils/type_utils.hpp" -namespace dpctl::tensor::kernels::logical_not +namespace dpnp::tensor::kernels::logical_not { -using dpctl::tensor::ssize_t; -namespace td_ns = dpctl::tensor::type_dispatch; -namespace tu_ns = dpctl::tensor::type_utils; +using dpnp::tensor::ssize_t; +namespace td_ns = dpnp::tensor::type_dispatch; +namespace tu_ns = dpnp::tensor::type_utils; template struct LogicalNotFunctor @@ -103,7 +103,7 @@ struct LogicalNotOutputType namespace hyperparam_detail { -namespace vsu_ns = dpctl::tensor::kernels::vec_size_utils; +namespace vsu_ns = dpnp::tensor::kernels::vec_size_utils; using vsu_ns::ContigHyperparameterSetDefault; using vsu_ns::UnaryContigHyperparameterSetEntry; @@ -196,4 +196,4 @@ struct LogicalNotStridedFactory } }; -} // namespace dpctl::tensor::kernels::logical_not +} // namespace dpnp::tensor::kernels::logical_not diff --git a/dpnp/tensor/libtensor/include/kernels/elementwise_functions/logical_or.hpp b/dpnp/tensor/libtensor/include/kernels/elementwise_functions/logical_or.hpp index 637e7681e7c0..8ec512da2b2e 100644 --- a/dpnp/tensor/libtensor/include/kernels/elementwise_functions/logical_or.hpp +++ b/dpnp/tensor/libtensor/include/kernels/elementwise_functions/logical_or.hpp @@ -48,15 +48,15 @@ #include "utils/type_dispatch_building.hpp" #include "utils/type_utils.hpp" -#include "kernels/dpctl_tensor_types.hpp" +#include "kernels/dpnp_tensor_types.hpp" #include "kernels/elementwise_functions/common.hpp" -namespace dpctl::tensor::kernels::logical_or +namespace dpnp::tensor::kernels::logical_or { -using dpctl::tensor::ssize_t; -namespace td_ns = dpctl::tensor::type_dispatch; -namespace tu_ns = dpctl::tensor::type_utils; +using dpnp::tensor::ssize_t; +namespace td_ns = dpnp::tensor::type_dispatch; +namespace tu_ns = dpnp::tensor::type_utils; template struct LogicalOrFunctor @@ -90,7 +90,7 @@ struct LogicalOrFunctor return tmp; } else { - using dpctl::tensor::type_utils::vec_cast; + using dpnp::tensor::type_utils::vec_cast; return vec_cast( tmp); @@ -171,7 +171,7 @@ struct LogicalOrOutputType namespace hyperparam_detail { -namespace vsu_ns = dpctl::tensor::kernels::vec_size_utils; +namespace vsu_ns = dpnp::tensor::kernels::vec_size_utils; using vsu_ns::BinaryContigHyperparameterSetEntry; using vsu_ns::ContigHyperparameterSetDefault; @@ -287,4 +287,4 @@ struct LogicalOrStridedFactory } }; -} // namespace dpctl::tensor::kernels::logical_or +} // namespace dpnp::tensor::kernels::logical_or diff --git a/dpnp/tensor/libtensor/include/kernels/elementwise_functions/logical_xor.hpp b/dpnp/tensor/libtensor/include/kernels/elementwise_functions/logical_xor.hpp index 698e4d9ab5c1..5f9306fd661e 100644 --- a/dpnp/tensor/libtensor/include/kernels/elementwise_functions/logical_xor.hpp +++ b/dpnp/tensor/libtensor/include/kernels/elementwise_functions/logical_xor.hpp @@ -48,15 +48,15 @@ #include "utils/type_dispatch_building.hpp" #include "utils/type_utils.hpp" -#include "kernels/dpctl_tensor_types.hpp" +#include "kernels/dpnp_tensor_types.hpp" #include "kernels/elementwise_functions/common.hpp" -namespace dpctl::tensor::kernels::logical_xor +namespace dpnp::tensor::kernels::logical_xor { -using dpctl::tensor::ssize_t; -namespace td_ns = dpctl::tensor::type_dispatch; -namespace tu_ns = dpctl::tensor::type_utils; +using dpnp::tensor::ssize_t; +namespace td_ns = dpnp::tensor::type_dispatch; +namespace tu_ns = dpnp::tensor::type_utils; template struct LogicalXorFunctor @@ -172,7 +172,7 @@ struct LogicalXorOutputType namespace hyperparam_detail { -namespace vsu_ns = dpctl::tensor::kernels::vec_size_utils; +namespace vsu_ns = dpnp::tensor::kernels::vec_size_utils; using vsu_ns::BinaryContigHyperparameterSetEntry; using vsu_ns::ContigHyperparameterSetDefault; @@ -289,4 +289,4 @@ struct LogicalXorStridedFactory } }; -} // namespace dpctl::tensor::kernels::logical_xor +} // namespace dpnp::tensor::kernels::logical_xor diff --git a/dpnp/tensor/libtensor/include/kernels/elementwise_functions/maximum.hpp b/dpnp/tensor/libtensor/include/kernels/elementwise_functions/maximum.hpp index 52494cceba93..2004bee663ac 100644 --- a/dpnp/tensor/libtensor/include/kernels/elementwise_functions/maximum.hpp +++ b/dpnp/tensor/libtensor/include/kernels/elementwise_functions/maximum.hpp @@ -50,14 +50,14 @@ #include "utils/type_dispatch_building.hpp" #include "utils/type_utils.hpp" -#include "kernels/dpctl_tensor_types.hpp" +#include "kernels/dpnp_tensor_types.hpp" -namespace dpctl::tensor::kernels::maximum +namespace dpnp::tensor::kernels::maximum { -using dpctl::tensor::ssize_t; -namespace td_ns = dpctl::tensor::type_dispatch; -namespace tu_ns = dpctl::tensor::type_utils; +using dpnp::tensor::ssize_t; +namespace td_ns = dpnp::tensor::type_dispatch; +namespace tu_ns = dpnp::tensor::type_utils; template struct MaximumFunctor @@ -75,7 +75,7 @@ struct MaximumFunctor if constexpr (tu_ns::is_complex::value || tu_ns::is_complex::value) { static_assert(std::is_same_v); - using dpctl::tensor::math_utils::max_complex; + using dpnp::tensor::math_utils::max_complex; return max_complex(in1, in2); } else if constexpr (std::is_floating_point_v || @@ -204,7 +204,7 @@ struct MaximumOutputType namespace hyperparam_detail { -namespace vsu_ns = dpctl::tensor::kernels::vec_size_utils; +namespace vsu_ns = dpnp::tensor::kernels::vec_size_utils; using vsu_ns::BinaryContigHyperparameterSetEntry; using vsu_ns::ContigHyperparameterSetDefault; @@ -318,4 +318,4 @@ struct MaximumStridedFactory } } }; -} // namespace dpctl::tensor::kernels::maximum +} // namespace dpnp::tensor::kernels::maximum diff --git a/dpnp/tensor/libtensor/include/kernels/elementwise_functions/minimum.hpp b/dpnp/tensor/libtensor/include/kernels/elementwise_functions/minimum.hpp index c11961f8c5c0..ea933f800a97 100644 --- a/dpnp/tensor/libtensor/include/kernels/elementwise_functions/minimum.hpp +++ b/dpnp/tensor/libtensor/include/kernels/elementwise_functions/minimum.hpp @@ -50,14 +50,14 @@ #include "utils/type_dispatch_building.hpp" #include "utils/type_utils.hpp" -#include "kernels/dpctl_tensor_types.hpp" +#include "kernels/dpnp_tensor_types.hpp" -namespace dpctl::tensor::kernels::minimum +namespace dpnp::tensor::kernels::minimum { -using dpctl::tensor::ssize_t; -namespace td_ns = dpctl::tensor::type_dispatch; -namespace tu_ns = dpctl::tensor::type_utils; +using dpnp::tensor::ssize_t; +namespace td_ns = dpnp::tensor::type_dispatch; +namespace tu_ns = dpnp::tensor::type_utils; template struct MinimumFunctor @@ -75,7 +75,7 @@ struct MinimumFunctor if constexpr (tu_ns::is_complex::value || tu_ns::is_complex::value) { static_assert(std::is_same_v); - using dpctl::tensor::math_utils::min_complex; + using dpnp::tensor::math_utils::min_complex; return min_complex(in1, in2); } else if constexpr (std::is_floating_point_v || @@ -204,7 +204,7 @@ struct MinimumOutputType namespace hyperparam_detail { -namespace vsu_ns = dpctl::tensor::kernels::vec_size_utils; +namespace vsu_ns = dpnp::tensor::kernels::vec_size_utils; using vsu_ns::BinaryContigHyperparameterSetEntry; using vsu_ns::ContigHyperparameterSetDefault; @@ -318,4 +318,4 @@ struct MinimumStridedFactory } } }; -} // namespace dpctl::tensor::kernels::minimum +} // namespace dpnp::tensor::kernels::minimum diff --git a/dpnp/tensor/libtensor/include/kernels/elementwise_functions/multiply.hpp b/dpnp/tensor/libtensor/include/kernels/elementwise_functions/multiply.hpp index 58ff88b3afeb..d34c17bbbe35 100644 --- a/dpnp/tensor/libtensor/include/kernels/elementwise_functions/multiply.hpp +++ b/dpnp/tensor/libtensor/include/kernels/elementwise_functions/multiply.hpp @@ -49,16 +49,16 @@ #include "utils/type_dispatch_building.hpp" #include "utils/type_utils.hpp" -#include "kernels/dpctl_tensor_types.hpp" +#include "kernels/dpnp_tensor_types.hpp" #include "kernels/elementwise_functions/common.hpp" #include "kernels/elementwise_functions/common_inplace.hpp" -namespace dpctl::tensor::kernels::multiply +namespace dpnp::tensor::kernels::multiply { -using dpctl::tensor::ssize_t; -namespace td_ns = dpctl::tensor::type_dispatch; -namespace tu_ns = dpctl::tensor::type_utils; +using dpnp::tensor::ssize_t; +namespace td_ns = dpnp::tensor::type_dispatch; +namespace tu_ns = dpnp::tensor::type_utils; template struct MultiplyFunctor @@ -95,7 +95,7 @@ struct MultiplyFunctor return tmp; } else { - using dpctl::tensor::type_utils::vec_cast; + using dpnp::tensor::type_utils::vec_cast; return vec_cast( tmp); @@ -196,7 +196,7 @@ struct MultiplyOutputType namespace hyperparam_detail { -namespace vsu_ns = dpctl::tensor::kernels::vec_size_utils; +namespace vsu_ns = dpnp::tensor::kernels::vec_size_utils; using vsu_ns::BinaryContigHyperparameterSetEntry; using vsu_ns::ContigHyperparameterSetDefault; @@ -355,9 +355,9 @@ struct MultiplyContigMatrixContigRowBroadcastFactory } else { using resT = typename MultiplyOutputType::value_type; - if constexpr (dpctl::tensor::type_utils::is_complex::value || - dpctl::tensor::type_utils::is_complex::value || - dpctl::tensor::type_utils::is_complex::value) { + if constexpr (dpnp::tensor::type_utils::is_complex::value || + dpnp::tensor::type_utils::is_complex::value || + dpnp::tensor::type_utils::is_complex::value) { fnT fn = nullptr; return fn; } @@ -402,9 +402,9 @@ struct MultiplyContigRowContigMatrixBroadcastFactory } else { using resT = typename MultiplyOutputType::value_type; - if constexpr (dpctl::tensor::type_utils::is_complex::value || - dpctl::tensor::type_utils::is_complex::value || - dpctl::tensor::type_utils::is_complex::value) { + if constexpr (dpnp::tensor::type_utils::is_complex::value || + dpnp::tensor::type_utils::is_complex::value || + dpnp::tensor::type_utils::is_complex::value) { fnT fn = nullptr; return fn; } @@ -625,8 +625,8 @@ struct MultiplyInplaceRowMatrixBroadcastFactory return fn; } else { - if constexpr (dpctl::tensor::type_utils::is_complex::value || - dpctl::tensor::type_utils::is_complex::value) { + if constexpr (dpnp::tensor::type_utils::is_complex::value || + dpnp::tensor::type_utils::is_complex::value) { fnT fn = nullptr; return fn; } @@ -638,4 +638,4 @@ struct MultiplyInplaceRowMatrixBroadcastFactory } }; -} // namespace dpctl::tensor::kernels::multiply +} // namespace dpnp::tensor::kernels::multiply diff --git a/dpnp/tensor/libtensor/include/kernels/elementwise_functions/negative.hpp b/dpnp/tensor/libtensor/include/kernels/elementwise_functions/negative.hpp index e0ac856a3818..c0618458c097 100644 --- a/dpnp/tensor/libtensor/include/kernels/elementwise_functions/negative.hpp +++ b/dpnp/tensor/libtensor/include/kernels/elementwise_functions/negative.hpp @@ -44,19 +44,19 @@ #include "vec_size_util.hpp" -#include "kernels/dpctl_tensor_types.hpp" +#include "kernels/dpnp_tensor_types.hpp" #include "kernels/elementwise_functions/common.hpp" #include "utils/type_dispatch_building.hpp" #include "utils/type_utils.hpp" -namespace dpctl::tensor::kernels::negative +namespace dpnp::tensor::kernels::negative { -using dpctl::tensor::ssize_t; -namespace td_ns = dpctl::tensor::type_dispatch; +using dpnp::tensor::ssize_t; +namespace td_ns = dpnp::tensor::type_dispatch; -using dpctl::tensor::type_utils::is_complex; +using dpnp::tensor::type_utils::is_complex; template struct NegativeFunctor @@ -109,7 +109,7 @@ struct NegativeOutputType namespace hyperparam_detail { -namespace vsu_ns = dpctl::tensor::kernels::vec_size_utils; +namespace vsu_ns = dpnp::tensor::kernels::vec_size_utils; using vsu_ns::ContigHyperparameterSetDefault; using vsu_ns::UnaryContigHyperparameterSetEntry; @@ -216,4 +216,4 @@ struct NegativeStridedFactory } }; -} // namespace dpctl::tensor::kernels::negative +} // namespace dpnp::tensor::kernels::negative diff --git a/dpnp/tensor/libtensor/include/kernels/elementwise_functions/nextafter.hpp b/dpnp/tensor/libtensor/include/kernels/elementwise_functions/nextafter.hpp index a703892a7606..80247805bcd0 100644 --- a/dpnp/tensor/libtensor/include/kernels/elementwise_functions/nextafter.hpp +++ b/dpnp/tensor/libtensor/include/kernels/elementwise_functions/nextafter.hpp @@ -47,15 +47,15 @@ #include "utils/type_dispatch_building.hpp" #include "utils/type_utils.hpp" -#include "kernels/dpctl_tensor_types.hpp" +#include "kernels/dpnp_tensor_types.hpp" #include "kernels/elementwise_functions/common.hpp" -namespace dpctl::tensor::kernels::nextafter +namespace dpnp::tensor::kernels::nextafter { -using dpctl::tensor::ssize_t; -namespace td_ns = dpctl::tensor::type_dispatch; -namespace tu_ns = dpctl::tensor::type_utils; +using dpnp::tensor::ssize_t; +namespace td_ns = dpnp::tensor::type_dispatch; +namespace tu_ns = dpnp::tensor::type_utils; template struct NextafterFunctor @@ -80,7 +80,7 @@ struct NextafterFunctor return res; } else { - using dpctl::tensor::type_utils::vec_cast; + using dpnp::tensor::type_utils::vec_cast; return vec_cast( res); @@ -130,7 +130,7 @@ struct NextafterOutputType namespace hyperparam_detail { -namespace vsu_ns = dpctl::tensor::kernels::vec_size_utils; +namespace vsu_ns = dpnp::tensor::kernels::vec_size_utils; using vsu_ns::BinaryContigHyperparameterSetEntry; using vsu_ns::ContigHyperparameterSetDefault; @@ -245,4 +245,4 @@ struct NextafterStridedFactory } }; -} // namespace dpctl::tensor::kernels::nextafter +} // namespace dpnp::tensor::kernels::nextafter diff --git a/dpnp/tensor/libtensor/include/kernels/elementwise_functions/not_equal.hpp b/dpnp/tensor/libtensor/include/kernels/elementwise_functions/not_equal.hpp index 007f374b6386..4672df041fc0 100644 --- a/dpnp/tensor/libtensor/include/kernels/elementwise_functions/not_equal.hpp +++ b/dpnp/tensor/libtensor/include/kernels/elementwise_functions/not_equal.hpp @@ -48,15 +48,15 @@ #include "utils/type_dispatch_building.hpp" #include "utils/type_utils.hpp" -#include "kernels/dpctl_tensor_types.hpp" +#include "kernels/dpnp_tensor_types.hpp" #include "kernels/elementwise_functions/common.hpp" -namespace dpctl::tensor::kernels::not_equal +namespace dpnp::tensor::kernels::not_equal { -using dpctl::tensor::ssize_t; -namespace td_ns = dpctl::tensor::type_dispatch; -namespace tu_ns = dpctl::tensor::type_utils; +using dpnp::tensor::ssize_t; +namespace td_ns = dpnp::tensor::type_dispatch; +namespace tu_ns = dpnp::tensor::type_utils; template struct NotEqualFunctor @@ -100,7 +100,7 @@ struct NotEqualFunctor return tmp; } else { - using dpctl::tensor::type_utils::vec_cast; + using dpnp::tensor::type_utils::vec_cast; return vec_cast( tmp); @@ -185,7 +185,7 @@ struct NotEqualOutputType namespace hyperparam_detail { -namespace vsu_ns = dpctl::tensor::kernels::vec_size_utils; +namespace vsu_ns = dpnp::tensor::kernels::vec_size_utils; using vsu_ns::BinaryContigHyperparameterSetEntry; using vsu_ns::ContigHyperparameterSetDefault; @@ -300,4 +300,4 @@ struct NotEqualStridedFactory } }; -} // namespace dpctl::tensor::kernels::not_equal +} // namespace dpnp::tensor::kernels::not_equal diff --git a/dpnp/tensor/libtensor/include/kernels/elementwise_functions/positive.hpp b/dpnp/tensor/libtensor/include/kernels/elementwise_functions/positive.hpp index fb351b6e50d2..8343777d7bce 100644 --- a/dpnp/tensor/libtensor/include/kernels/elementwise_functions/positive.hpp +++ b/dpnp/tensor/libtensor/include/kernels/elementwise_functions/positive.hpp @@ -44,20 +44,20 @@ #include "vec_size_util.hpp" -#include "kernels/dpctl_tensor_types.hpp" +#include "kernels/dpnp_tensor_types.hpp" #include "kernels/elementwise_functions/common.hpp" #include "utils/type_dispatch_building.hpp" #include "utils/type_utils.hpp" -namespace dpctl::tensor::kernels::positive +namespace dpnp::tensor::kernels::positive { -using dpctl::tensor::ssize_t; -namespace td_ns = dpctl::tensor::type_dispatch; +using dpnp::tensor::ssize_t; +namespace td_ns = dpnp::tensor::type_dispatch; -using dpctl::tensor::type_utils::is_complex; -using dpctl::tensor::type_utils::vec_cast; +using dpnp::tensor::type_utils::is_complex; +using dpnp::tensor::type_utils::vec_cast; template struct PositiveFunctor @@ -125,7 +125,7 @@ struct PositiveOutputType namespace hyperparam_detail { -namespace vsu_ns = dpctl::tensor::kernels::vec_size_utils; +namespace vsu_ns = dpnp::tensor::kernels::vec_size_utils; using vsu_ns::ContigHyperparameterSetDefault; using vsu_ns::UnaryContigHyperparameterSetEntry; @@ -232,4 +232,4 @@ struct PositiveStridedFactory } }; -} // namespace dpctl::tensor::kernels::positive +} // namespace dpnp::tensor::kernels::positive diff --git a/dpnp/tensor/libtensor/include/kernels/elementwise_functions/pow.hpp b/dpnp/tensor/libtensor/include/kernels/elementwise_functions/pow.hpp index 1c669ec894d2..82f35cc2ea35 100644 --- a/dpnp/tensor/libtensor/include/kernels/elementwise_functions/pow.hpp +++ b/dpnp/tensor/libtensor/include/kernels/elementwise_functions/pow.hpp @@ -49,16 +49,16 @@ #include "utils/type_dispatch_building.hpp" #include "utils/type_utils.hpp" -#include "kernels/dpctl_tensor_types.hpp" +#include "kernels/dpnp_tensor_types.hpp" #include "kernels/elementwise_functions/common.hpp" #include "kernels/elementwise_functions/common_inplace.hpp" -namespace dpctl::tensor::kernels::pow +namespace dpnp::tensor::kernels::pow { -using dpctl::tensor::ssize_t; -namespace td_ns = dpctl::tensor::type_dispatch; -namespace tu_ns = dpctl::tensor::type_utils; +using dpnp::tensor::ssize_t; +namespace td_ns = dpnp::tensor::type_dispatch; +namespace tu_ns = dpnp::tensor::type_utils; template struct PowFunctor @@ -147,7 +147,7 @@ struct PowFunctor return res; } else { - using dpctl::tensor::type_utils::vec_cast; + using dpnp::tensor::type_utils::vec_cast; return vec_cast(res); @@ -248,7 +248,7 @@ struct PowOutputType namespace hyperparam_detail { -namespace vsu_ns = dpctl::tensor::kernels::vec_size_utils; +namespace vsu_ns = dpnp::tensor::kernels::vec_size_utils; using vsu_ns::BinaryContigHyperparameterSetEntry; using vsu_ns::ContigHyperparameterSetDefault; @@ -596,4 +596,4 @@ struct PowInplaceStridedFactory } }; -} // namespace dpctl::tensor::kernels::pow +} // namespace dpnp::tensor::kernels::pow diff --git a/dpnp/tensor/libtensor/include/kernels/elementwise_functions/proj.hpp b/dpnp/tensor/libtensor/include/kernels/elementwise_functions/proj.hpp index 039da657cfd2..e9578e67bae4 100644 --- a/dpnp/tensor/libtensor/include/kernels/elementwise_functions/proj.hpp +++ b/dpnp/tensor/libtensor/include/kernels/elementwise_functions/proj.hpp @@ -45,19 +45,19 @@ #include "vec_size_util.hpp" -#include "kernels/dpctl_tensor_types.hpp" +#include "kernels/dpnp_tensor_types.hpp" #include "kernels/elementwise_functions/common.hpp" #include "utils/type_dispatch_building.hpp" #include "utils/type_utils.hpp" -namespace dpctl::tensor::kernels::proj +namespace dpnp::tensor::kernels::proj { -using dpctl::tensor::ssize_t; -namespace td_ns = dpctl::tensor::type_dispatch; +using dpnp::tensor::ssize_t; +namespace td_ns = dpnp::tensor::type_dispatch; -using dpctl::tensor::type_utils::is_complex; +using dpnp::tensor::type_utils::is_complex; template struct ProjFunctor @@ -129,7 +129,7 @@ struct ProjOutputType namespace hyperparam_detail { -namespace vsu_ns = dpctl::tensor::kernels::vec_size_utils; +namespace vsu_ns = dpnp::tensor::kernels::vec_size_utils; using vsu_ns::ContigHyperparameterSetDefault; using vsu_ns::UnaryContigHyperparameterSetEntry; @@ -236,4 +236,4 @@ struct ProjStridedFactory } }; -} // namespace dpctl::tensor::kernels::proj +} // namespace dpnp::tensor::kernels::proj diff --git a/dpnp/tensor/libtensor/include/kernels/elementwise_functions/real.hpp b/dpnp/tensor/libtensor/include/kernels/elementwise_functions/real.hpp index d21a9e6baa7d..59d249619643 100644 --- a/dpnp/tensor/libtensor/include/kernels/elementwise_functions/real.hpp +++ b/dpnp/tensor/libtensor/include/kernels/elementwise_functions/real.hpp @@ -43,20 +43,20 @@ #include "vec_size_util.hpp" -#include "kernels/dpctl_tensor_types.hpp" +#include "kernels/dpnp_tensor_types.hpp" #include "kernels/elementwise_functions/common.hpp" #include "utils/type_dispatch_building.hpp" #include "utils/type_utils.hpp" -namespace dpctl::tensor::kernels::real +namespace dpnp::tensor::kernels::real { -using dpctl::tensor::ssize_t; -namespace td_ns = dpctl::tensor::type_dispatch; +using dpnp::tensor::ssize_t; +namespace td_ns = dpnp::tensor::type_dispatch; -using dpctl::tensor::type_utils::is_complex; -using dpctl::tensor::type_utils::is_complex_v; +using dpnp::tensor::type_utils::is_complex; +using dpnp::tensor::type_utils::is_complex_v; template struct RealFunctor @@ -127,7 +127,7 @@ struct RealOutputType namespace hyperparam_detail { -namespace vsu_ns = dpctl::tensor::kernels::vec_size_utils; +namespace vsu_ns = dpnp::tensor::kernels::vec_size_utils; using vsu_ns::ContigHyperparameterSetDefault; using vsu_ns::UnaryContigHyperparameterSetEntry; @@ -228,4 +228,4 @@ struct RealStridedFactory } }; -} // namespace dpctl::tensor::kernels::real +} // namespace dpnp::tensor::kernels::real diff --git a/dpnp/tensor/libtensor/include/kernels/elementwise_functions/reciprocal.hpp b/dpnp/tensor/libtensor/include/kernels/elementwise_functions/reciprocal.hpp index f26f4043c9ab..9a0dad279509 100644 --- a/dpnp/tensor/libtensor/include/kernels/elementwise_functions/reciprocal.hpp +++ b/dpnp/tensor/libtensor/include/kernels/elementwise_functions/reciprocal.hpp @@ -45,19 +45,19 @@ #include "sycl_complex.hpp" #include "vec_size_util.hpp" -#include "kernels/dpctl_tensor_types.hpp" +#include "kernels/dpnp_tensor_types.hpp" #include "kernels/elementwise_functions/common.hpp" #include "utils/type_dispatch_building.hpp" #include "utils/type_utils.hpp" -namespace dpctl::tensor::kernels::reciprocal +namespace dpnp::tensor::kernels::reciprocal { -using dpctl::tensor::ssize_t; -namespace td_ns = dpctl::tensor::type_dispatch; +using dpnp::tensor::ssize_t; +namespace td_ns = dpnp::tensor::type_dispatch; -using dpctl::tensor::type_utils::is_complex; +using dpnp::tensor::type_utils::is_complex; template struct ReciprocalFunctor @@ -123,7 +123,7 @@ struct ReciprocalOutputType namespace hyperparam_detail { -namespace vsu_ns = dpctl::tensor::kernels::vec_size_utils; +namespace vsu_ns = dpnp::tensor::kernels::vec_size_utils; using vsu_ns::ContigHyperparameterSetDefault; using vsu_ns::UnaryContigHyperparameterSetEntry; @@ -226,4 +226,4 @@ struct ReciprocalStridedFactory } }; -} // namespace dpctl::tensor::kernels::reciprocal +} // namespace dpnp::tensor::kernels::reciprocal diff --git a/dpnp/tensor/libtensor/include/kernels/elementwise_functions/remainder.hpp b/dpnp/tensor/libtensor/include/kernels/elementwise_functions/remainder.hpp index 65cd97dbe56d..d88e272d5403 100644 --- a/dpnp/tensor/libtensor/include/kernels/elementwise_functions/remainder.hpp +++ b/dpnp/tensor/libtensor/include/kernels/elementwise_functions/remainder.hpp @@ -47,16 +47,16 @@ #include "utils/type_dispatch_building.hpp" #include "utils/type_utils.hpp" -#include "kernels/dpctl_tensor_types.hpp" +#include "kernels/dpnp_tensor_types.hpp" #include "kernels/elementwise_functions/common.hpp" #include "kernels/elementwise_functions/common_inplace.hpp" -namespace dpctl::tensor::kernels::remainder +namespace dpnp::tensor::kernels::remainder { -using dpctl::tensor::ssize_t; -namespace td_ns = dpctl::tensor::type_dispatch; -namespace tu_ns = dpctl::tensor::type_utils; +using dpnp::tensor::ssize_t; +namespace td_ns = dpnp::tensor::type_dispatch; +namespace tu_ns = dpnp::tensor::type_utils; template struct RemainderFunctor @@ -138,7 +138,7 @@ struct RemainderFunctor return rem; } else { - using dpctl::tensor::type_utils::vec_cast; + using dpnp::tensor::type_utils::vec_cast; return vec_cast(rem); } @@ -231,7 +231,7 @@ struct RemainderOutputType namespace hyperparam_detail { -namespace vsu_ns = dpctl::tensor::kernels::vec_size_utils; +namespace vsu_ns = dpnp::tensor::kernels::vec_size_utils; using vsu_ns::BinaryContigHyperparameterSetEntry; using vsu_ns::ContigHyperparameterSetDefault; @@ -569,4 +569,4 @@ struct RemainderInplaceStridedFactory } }; -} // namespace dpctl::tensor::kernels::remainder +} // namespace dpnp::tensor::kernels::remainder diff --git a/dpnp/tensor/libtensor/include/kernels/elementwise_functions/round.hpp b/dpnp/tensor/libtensor/include/kernels/elementwise_functions/round.hpp index b20166a4d505..ad831e7341ca 100644 --- a/dpnp/tensor/libtensor/include/kernels/elementwise_functions/round.hpp +++ b/dpnp/tensor/libtensor/include/kernels/elementwise_functions/round.hpp @@ -43,19 +43,19 @@ #include "vec_size_util.hpp" -#include "kernels/dpctl_tensor_types.hpp" +#include "kernels/dpnp_tensor_types.hpp" #include "kernels/elementwise_functions/common.hpp" #include "utils/type_dispatch_building.hpp" #include "utils/type_utils.hpp" -namespace dpctl::tensor::kernels::round +namespace dpnp::tensor::kernels::round { -using dpctl::tensor::ssize_t; -namespace td_ns = dpctl::tensor::type_dispatch; +using dpnp::tensor::ssize_t; +namespace td_ns = dpnp::tensor::type_dispatch; -using dpctl::tensor::type_utils::is_complex; +using dpnp::tensor::type_utils::is_complex; template struct RoundFunctor @@ -137,7 +137,7 @@ struct RoundOutputType namespace hyperparam_detail { -namespace vsu_ns = dpctl::tensor::kernels::vec_size_utils; +namespace vsu_ns = dpnp::tensor::kernels::vec_size_utils; using vsu_ns::ContigHyperparameterSetDefault; using vsu_ns::UnaryContigHyperparameterSetEntry; @@ -238,4 +238,4 @@ struct RoundStridedFactory } }; -} // namespace dpctl::tensor::kernels::round +} // namespace dpnp::tensor::kernels::round diff --git a/dpnp/tensor/libtensor/include/kernels/elementwise_functions/rsqrt.hpp b/dpnp/tensor/libtensor/include/kernels/elementwise_functions/rsqrt.hpp index aa4f1113d839..73ed2b5b3aa8 100644 --- a/dpnp/tensor/libtensor/include/kernels/elementwise_functions/rsqrt.hpp +++ b/dpnp/tensor/libtensor/include/kernels/elementwise_functions/rsqrt.hpp @@ -43,16 +43,16 @@ #include "vec_size_util.hpp" -#include "kernels/dpctl_tensor_types.hpp" +#include "kernels/dpnp_tensor_types.hpp" #include "kernels/elementwise_functions/common.hpp" #include "utils/type_dispatch_building.hpp" -namespace dpctl::tensor::kernels::rsqrt +namespace dpnp::tensor::kernels::rsqrt { -using dpctl::tensor::ssize_t; -namespace td_ns = dpctl::tensor::type_dispatch; +using dpnp::tensor::ssize_t; +namespace td_ns = dpnp::tensor::type_dispatch; template struct RsqrtFunctor @@ -102,7 +102,7 @@ struct RsqrtOutputType namespace hyperparam_detail { -namespace vsu_ns = dpctl::tensor::kernels::vec_size_utils; +namespace vsu_ns = dpnp::tensor::kernels::vec_size_utils; using vsu_ns::ContigHyperparameterSetDefault; using vsu_ns::UnaryContigHyperparameterSetEntry; @@ -203,4 +203,4 @@ struct RsqrtStridedFactory } }; -} // namespace dpctl::tensor::kernels::rsqrt +} // namespace dpnp::tensor::kernels::rsqrt diff --git a/dpnp/tensor/libtensor/include/kernels/elementwise_functions/sign.hpp b/dpnp/tensor/libtensor/include/kernels/elementwise_functions/sign.hpp index ceb3d1320f9c..fae83d7f1f4b 100644 --- a/dpnp/tensor/libtensor/include/kernels/elementwise_functions/sign.hpp +++ b/dpnp/tensor/libtensor/include/kernels/elementwise_functions/sign.hpp @@ -46,20 +46,20 @@ #include "cabs_impl.hpp" #include "vec_size_util.hpp" -#include "kernels/dpctl_tensor_types.hpp" +#include "kernels/dpnp_tensor_types.hpp" #include "kernels/elementwise_functions/common.hpp" #include "utils/type_dispatch_building.hpp" #include "utils/type_utils.hpp" -namespace dpctl::tensor::kernels::sign +namespace dpnp::tensor::kernels::sign { -using dpctl::tensor::ssize_t; -namespace td_ns = dpctl::tensor::type_dispatch; +using dpnp::tensor::ssize_t; +namespace td_ns = dpnp::tensor::type_dispatch; -using dpctl::tensor::type_utils::is_complex; -using dpctl::tensor::type_utils::vec_cast; +using dpnp::tensor::type_utils::is_complex; +using dpnp::tensor::type_utils::vec_cast; template struct SignFunctor @@ -150,7 +150,7 @@ struct SignOutputType namespace hyperparam_detail { -namespace vsu_ns = dpctl::tensor::kernels::vec_size_utils; +namespace vsu_ns = dpnp::tensor::kernels::vec_size_utils; using vsu_ns::ContigHyperparameterSetDefault; using vsu_ns::UnaryContigHyperparameterSetEntry; @@ -255,4 +255,4 @@ struct SignStridedFactory } }; -} // namespace dpctl::tensor::kernels::sign +} // namespace dpnp::tensor::kernels::sign diff --git a/dpnp/tensor/libtensor/include/kernels/elementwise_functions/signbit.hpp b/dpnp/tensor/libtensor/include/kernels/elementwise_functions/signbit.hpp index 65e9e5a202a9..1ada32f340dd 100644 --- a/dpnp/tensor/libtensor/include/kernels/elementwise_functions/signbit.hpp +++ b/dpnp/tensor/libtensor/include/kernels/elementwise_functions/signbit.hpp @@ -44,20 +44,20 @@ #include "vec_size_util.hpp" -#include "kernels/dpctl_tensor_types.hpp" +#include "kernels/dpnp_tensor_types.hpp" #include "kernels/elementwise_functions/common.hpp" #include "utils/type_dispatch_building.hpp" #include "utils/type_utils.hpp" -namespace dpctl::tensor::kernels::signbit +namespace dpnp::tensor::kernels::signbit { -using dpctl::tensor::ssize_t; -namespace td_ns = dpctl::tensor::type_dispatch; +using dpnp::tensor::ssize_t; +namespace td_ns = dpnp::tensor::type_dispatch; -using dpctl::tensor::type_utils::is_complex; -using dpctl::tensor::type_utils::vec_cast; +using dpnp::tensor::type_utils::is_complex; +using dpnp::tensor::type_utils::vec_cast; template struct SignbitFunctor @@ -115,7 +115,7 @@ struct SignbitOutputType namespace hyperparam_detail { -namespace vsu_ns = dpctl::tensor::kernels::vec_size_utils; +namespace vsu_ns = dpnp::tensor::kernels::vec_size_utils; using vsu_ns::ContigHyperparameterSetDefault; using vsu_ns::UnaryContigHyperparameterSetEntry; @@ -217,4 +217,4 @@ struct SignbitStridedFactory } }; -} // namespace dpctl::tensor::kernels::signbit +} // namespace dpnp::tensor::kernels::signbit diff --git a/dpnp/tensor/libtensor/include/kernels/elementwise_functions/sin.hpp b/dpnp/tensor/libtensor/include/kernels/elementwise_functions/sin.hpp index d1e3caa9effe..15be11caa6c4 100644 --- a/dpnp/tensor/libtensor/include/kernels/elementwise_functions/sin.hpp +++ b/dpnp/tensor/libtensor/include/kernels/elementwise_functions/sin.hpp @@ -46,19 +46,19 @@ #include "sycl_complex.hpp" #include "vec_size_util.hpp" -#include "kernels/dpctl_tensor_types.hpp" +#include "kernels/dpnp_tensor_types.hpp" #include "kernels/elementwise_functions/common.hpp" #include "utils/type_dispatch_building.hpp" #include "utils/type_utils.hpp" -namespace dpctl::tensor::kernels::sin +namespace dpnp::tensor::kernels::sin { -using dpctl::tensor::ssize_t; -namespace td_ns = dpctl::tensor::type_dispatch; +using dpnp::tensor::ssize_t; +namespace td_ns = dpnp::tensor::type_dispatch; -using dpctl::tensor::type_utils::is_complex; +using dpnp::tensor::type_utils::is_complex; template struct SinFunctor @@ -230,7 +230,7 @@ struct SinOutputType namespace hyperparam_detail { -namespace vsu_ns = dpctl::tensor::kernels::vec_size_utils; +namespace vsu_ns = dpnp::tensor::kernels::vec_size_utils; using vsu_ns::ContigHyperparameterSetDefault; using vsu_ns::UnaryContigHyperparameterSetEntry; @@ -330,4 +330,4 @@ struct SinStridedFactory } }; -} // namespace dpctl::tensor::kernels::sin +} // namespace dpnp::tensor::kernels::sin diff --git a/dpnp/tensor/libtensor/include/kernels/elementwise_functions/sinh.hpp b/dpnp/tensor/libtensor/include/kernels/elementwise_functions/sinh.hpp index f81a2730fd17..49819332e4ab 100644 --- a/dpnp/tensor/libtensor/include/kernels/elementwise_functions/sinh.hpp +++ b/dpnp/tensor/libtensor/include/kernels/elementwise_functions/sinh.hpp @@ -46,19 +46,19 @@ #include "sycl_complex.hpp" #include "vec_size_util.hpp" -#include "kernels/dpctl_tensor_types.hpp" +#include "kernels/dpnp_tensor_types.hpp" #include "kernels/elementwise_functions/common.hpp" #include "utils/type_dispatch_building.hpp" #include "utils/type_utils.hpp" -namespace dpctl::tensor::kernels::sinh +namespace dpnp::tensor::kernels::sinh { -using dpctl::tensor::ssize_t; -namespace td_ns = dpctl::tensor::type_dispatch; +using dpnp::tensor::ssize_t; +namespace td_ns = dpnp::tensor::type_dispatch; -using dpctl::tensor::type_utils::is_complex; +using dpnp::tensor::type_utils::is_complex; template struct SinhFunctor @@ -198,7 +198,7 @@ struct SinhOutputType namespace hyperparam_detail { -namespace vsu_ns = dpctl::tensor::kernels::vec_size_utils; +namespace vsu_ns = dpnp::tensor::kernels::vec_size_utils; using vsu_ns::ContigHyperparameterSetDefault; using vsu_ns::UnaryContigHyperparameterSetEntry; @@ -299,4 +299,4 @@ struct SinhStridedFactory } }; -} // namespace dpctl::tensor::kernels::sinh +} // namespace dpnp::tensor::kernels::sinh diff --git a/dpnp/tensor/libtensor/include/kernels/elementwise_functions/sqrt.hpp b/dpnp/tensor/libtensor/include/kernels/elementwise_functions/sqrt.hpp index 08b3b092d1ca..0252eef85859 100644 --- a/dpnp/tensor/libtensor/include/kernels/elementwise_functions/sqrt.hpp +++ b/dpnp/tensor/libtensor/include/kernels/elementwise_functions/sqrt.hpp @@ -45,19 +45,19 @@ #include "sycl_complex.hpp" #include "vec_size_util.hpp" -#include "kernels/dpctl_tensor_types.hpp" +#include "kernels/dpnp_tensor_types.hpp" #include "kernels/elementwise_functions/common.hpp" #include "utils/type_dispatch_building.hpp" #include "utils/type_utils.hpp" -namespace dpctl::tensor::kernels::sqrt +namespace dpnp::tensor::kernels::sqrt { -using dpctl::tensor::ssize_t; -namespace td_ns = dpctl::tensor::type_dispatch; +using dpnp::tensor::ssize_t; +namespace td_ns = dpnp::tensor::type_dispatch; -using dpctl::tensor::type_utils::is_complex; +using dpnp::tensor::type_utils::is_complex; template struct SqrtFunctor @@ -120,7 +120,7 @@ struct SqrtOutputType namespace hyperparam_detail { -namespace vsu_ns = dpctl::tensor::kernels::vec_size_utils; +namespace vsu_ns = dpnp::tensor::kernels::vec_size_utils; using vsu_ns::ContigHyperparameterSetDefault; using vsu_ns::UnaryContigHyperparameterSetEntry; @@ -221,4 +221,4 @@ struct SqrtStridedFactory } }; -} // namespace dpctl::tensor::kernels::sqrt +} // namespace dpnp::tensor::kernels::sqrt diff --git a/dpnp/tensor/libtensor/include/kernels/elementwise_functions/square.hpp b/dpnp/tensor/libtensor/include/kernels/elementwise_functions/square.hpp index de3007acfbea..acedb2fcccb2 100644 --- a/dpnp/tensor/libtensor/include/kernels/elementwise_functions/square.hpp +++ b/dpnp/tensor/libtensor/include/kernels/elementwise_functions/square.hpp @@ -45,20 +45,20 @@ #include "sycl_complex.hpp" #include "vec_size_util.hpp" -#include "kernels/dpctl_tensor_types.hpp" +#include "kernels/dpnp_tensor_types.hpp" #include "kernels/elementwise_functions/common.hpp" #include "utils/type_dispatch_building.hpp" #include "utils/type_utils.hpp" -namespace dpctl::tensor::kernels::square +namespace dpnp::tensor::kernels::square { -using dpctl::tensor::ssize_t; -namespace td_ns = dpctl::tensor::type_dispatch; +using dpnp::tensor::ssize_t; +namespace td_ns = dpnp::tensor::type_dispatch; -using dpctl::tensor::type_utils::is_complex; -using dpctl::tensor::type_utils::vec_cast; +using dpnp::tensor::type_utils::is_complex; +using dpnp::tensor::type_utils::vec_cast; template struct SquareFunctor @@ -147,7 +147,7 @@ struct SquareOutputType namespace hyperparam_detail { -namespace vsu_ns = dpctl::tensor::kernels::vec_size_utils; +namespace vsu_ns = dpnp::tensor::kernels::vec_size_utils; using vsu_ns::ContigHyperparameterSetDefault; using vsu_ns::UnaryContigHyperparameterSetEntry; @@ -248,4 +248,4 @@ struct SquareStridedFactory } }; -} // namespace dpctl::tensor::kernels::square +} // namespace dpnp::tensor::kernels::square diff --git a/dpnp/tensor/libtensor/include/kernels/elementwise_functions/subtract.hpp b/dpnp/tensor/libtensor/include/kernels/elementwise_functions/subtract.hpp index 431596594ad3..a1b6df1d3fa7 100644 --- a/dpnp/tensor/libtensor/include/kernels/elementwise_functions/subtract.hpp +++ b/dpnp/tensor/libtensor/include/kernels/elementwise_functions/subtract.hpp @@ -47,16 +47,16 @@ #include "utils/type_dispatch_building.hpp" #include "utils/type_utils.hpp" -#include "kernels/dpctl_tensor_types.hpp" +#include "kernels/dpnp_tensor_types.hpp" #include "kernels/elementwise_functions/common.hpp" #include "kernels/elementwise_functions/common_inplace.hpp" -namespace dpctl::tensor::kernels::subtract +namespace dpnp::tensor::kernels::subtract { -using dpctl::tensor::ssize_t; -namespace td_ns = dpctl::tensor::type_dispatch; -namespace tu_ns = dpctl::tensor::type_utils; +using dpnp::tensor::ssize_t; +namespace td_ns = dpnp::tensor::type_dispatch; +namespace tu_ns = dpnp::tensor::type_utils; template struct SubtractFunctor @@ -83,7 +83,7 @@ struct SubtractFunctor return tmp; } else { - using dpctl::tensor::type_utils::vec_cast; + using dpnp::tensor::type_utils::vec_cast; return vec_cast( tmp); @@ -183,7 +183,7 @@ struct SubtractOutputType namespace hyperparam_detail { -namespace vsu_ns = dpctl::tensor::kernels::vec_size_utils; +namespace vsu_ns = dpnp::tensor::kernels::vec_size_utils; using vsu_ns::BinaryContigHyperparameterSetEntry; using vsu_ns::ContigHyperparameterSetDefault; @@ -353,9 +353,9 @@ struct SubtractContigMatrixContigRowBroadcastFactory } else { using resT = typename SubtractOutputType::value_type; - if constexpr (dpctl::tensor::type_utils::is_complex::value || - dpctl::tensor::type_utils::is_complex::value || - dpctl::tensor::type_utils::is_complex::value) { + if constexpr (dpnp::tensor::type_utils::is_complex::value || + dpnp::tensor::type_utils::is_complex::value || + dpnp::tensor::type_utils::is_complex::value) { fnT fn = nullptr; return fn; } @@ -402,9 +402,9 @@ struct SubtractContigRowContigMatrixBroadcastFactory } else { using resT = typename SubtractOutputType::value_type; - if constexpr (dpctl::tensor::type_utils::is_complex::value || - dpctl::tensor::type_utils::is_complex::value || - dpctl::tensor::type_utils::is_complex::value) { + if constexpr (dpnp::tensor::type_utils::is_complex::value || + dpnp::tensor::type_utils::is_complex::value || + dpnp::tensor::type_utils::is_complex::value) { fnT fn = nullptr; return fn; } @@ -624,8 +624,8 @@ struct SubtractInplaceRowMatrixBroadcastFactory return fn; } else { - if constexpr (dpctl::tensor::type_utils::is_complex::value || - dpctl::tensor::type_utils::is_complex::value) { + if constexpr (dpnp::tensor::type_utils::is_complex::value || + dpnp::tensor::type_utils::is_complex::value) { fnT fn = nullptr; return fn; } @@ -637,4 +637,4 @@ struct SubtractInplaceRowMatrixBroadcastFactory } }; -} // namespace dpctl::tensor::kernels::subtract +} // namespace dpnp::tensor::kernels::subtract diff --git a/dpnp/tensor/libtensor/include/kernels/elementwise_functions/tan.hpp b/dpnp/tensor/libtensor/include/kernels/elementwise_functions/tan.hpp index 2db2a6b5fbf8..1879d5c6709d 100644 --- a/dpnp/tensor/libtensor/include/kernels/elementwise_functions/tan.hpp +++ b/dpnp/tensor/libtensor/include/kernels/elementwise_functions/tan.hpp @@ -46,19 +46,19 @@ #include "sycl_complex.hpp" #include "vec_size_util.hpp" -#include "kernels/dpctl_tensor_types.hpp" +#include "kernels/dpnp_tensor_types.hpp" #include "kernels/elementwise_functions/common.hpp" #include "utils/type_dispatch_building.hpp" #include "utils/type_utils.hpp" -namespace dpctl::tensor::kernels::tan +namespace dpnp::tensor::kernels::tan { -using dpctl::tensor::ssize_t; -namespace td_ns = dpctl::tensor::type_dispatch; +using dpnp::tensor::ssize_t; +namespace td_ns = dpnp::tensor::type_dispatch; -using dpctl::tensor::type_utils::is_complex; +using dpnp::tensor::type_utils::is_complex; template struct TanFunctor @@ -173,7 +173,7 @@ struct TanOutputType namespace hyperparam_detail { -namespace vsu_ns = dpctl::tensor::kernels::vec_size_utils; +namespace vsu_ns = dpnp::tensor::kernels::vec_size_utils; using vsu_ns::ContigHyperparameterSetDefault; using vsu_ns::UnaryContigHyperparameterSetEntry; @@ -273,4 +273,4 @@ struct TanStridedFactory } }; -} // namespace dpctl::tensor::kernels::tan +} // namespace dpnp::tensor::kernels::tan diff --git a/dpnp/tensor/libtensor/include/kernels/elementwise_functions/tanh.hpp b/dpnp/tensor/libtensor/include/kernels/elementwise_functions/tanh.hpp index dde16128fb1a..f9462e3cb343 100644 --- a/dpnp/tensor/libtensor/include/kernels/elementwise_functions/tanh.hpp +++ b/dpnp/tensor/libtensor/include/kernels/elementwise_functions/tanh.hpp @@ -46,19 +46,19 @@ #include "sycl_complex.hpp" #include "vec_size_util.hpp" -#include "kernels/dpctl_tensor_types.hpp" +#include "kernels/dpnp_tensor_types.hpp" #include "kernels/elementwise_functions/common.hpp" #include "utils/type_dispatch_building.hpp" #include "utils/type_utils.hpp" -namespace dpctl::tensor::kernels::tanh +namespace dpnp::tensor::kernels::tanh { -using dpctl::tensor::ssize_t; -namespace td_ns = dpctl::tensor::type_dispatch; +using dpnp::tensor::ssize_t; +namespace td_ns = dpnp::tensor::type_dispatch; -using dpctl::tensor::type_utils::is_complex; +using dpnp::tensor::type_utils::is_complex; template struct TanhFunctor @@ -166,7 +166,7 @@ struct TanhOutputType namespace hyperparam_detail { -namespace vsu_ns = dpctl::tensor::kernels::vec_size_utils; +namespace vsu_ns = dpnp::tensor::kernels::vec_size_utils; using vsu_ns::ContigHyperparameterSetDefault; using vsu_ns::UnaryContigHyperparameterSetEntry; @@ -267,4 +267,4 @@ struct TanhStridedFactory } }; -} // namespace dpctl::tensor::kernels::tanh +} // namespace dpnp::tensor::kernels::tanh diff --git a/dpnp/tensor/libtensor/include/kernels/elementwise_functions/true_divide.hpp b/dpnp/tensor/libtensor/include/kernels/elementwise_functions/true_divide.hpp index caa1cd2029c4..2c3ee16e3118 100644 --- a/dpnp/tensor/libtensor/include/kernels/elementwise_functions/true_divide.hpp +++ b/dpnp/tensor/libtensor/include/kernels/elementwise_functions/true_divide.hpp @@ -45,19 +45,19 @@ #include "sycl_complex.hpp" #include "vec_size_util.hpp" -#include "kernels/dpctl_tensor_types.hpp" +#include "kernels/dpnp_tensor_types.hpp" #include "kernels/elementwise_functions/common.hpp" #include "kernels/elementwise_functions/common_inplace.hpp" #include "utils/type_dispatch_building.hpp" #include "utils/type_utils.hpp" -namespace dpctl::tensor::kernels::true_divide +namespace dpnp::tensor::kernels::true_divide { -using dpctl::tensor::ssize_t; -namespace td_ns = dpctl::tensor::type_dispatch; -namespace tu_ns = dpctl::tensor::type_utils; +using dpnp::tensor::ssize_t; +namespace td_ns = dpnp::tensor::type_dispatch; +namespace tu_ns = dpnp::tensor::type_utils; template struct TrueDivideFunctor @@ -106,7 +106,7 @@ struct TrueDivideFunctor return tmp; } else { - using dpctl::tensor::type_utils::vec_cast; + using dpnp::tensor::type_utils::vec_cast; return vec_cast( tmp); @@ -186,7 +186,7 @@ struct TrueDivideOutputType namespace hyperparam_detail { -namespace vsu_ns = dpctl::tensor::kernels::vec_size_utils; +namespace vsu_ns = dpnp::tensor::kernels::vec_size_utils; using vsu_ns::BinaryContigHyperparameterSetEntry; using vsu_ns::ContigHyperparameterSetDefault; @@ -357,9 +357,9 @@ struct TrueDivideContigMatrixContigRowBroadcastFactory } else { using resT = typename TrueDivideOutputType::value_type; - if constexpr (dpctl::tensor::type_utils::is_complex::value || - dpctl::tensor::type_utils::is_complex::value || - dpctl::tensor::type_utils::is_complex::value) { + if constexpr (dpnp::tensor::type_utils::is_complex::value || + dpnp::tensor::type_utils::is_complex::value || + dpnp::tensor::type_utils::is_complex::value) { fnT fn = nullptr; return fn; } @@ -406,9 +406,9 @@ struct TrueDivideContigRowContigMatrixBroadcastFactory } else { using resT = typename TrueDivideOutputType::value_type; - if constexpr (dpctl::tensor::type_utils::is_complex::value || - dpctl::tensor::type_utils::is_complex::value || - dpctl::tensor::type_utils::is_complex::value) { + if constexpr (dpnp::tensor::type_utils::is_complex::value || + dpnp::tensor::type_utils::is_complex::value || + dpnp::tensor::type_utils::is_complex::value) { fnT fn = nullptr; return fn; } @@ -646,8 +646,8 @@ struct TrueDivideInplaceRowMatrixBroadcastFactory return fn; } else { - if constexpr (dpctl::tensor::type_utils::is_complex::value || - dpctl::tensor::type_utils::is_complex::value) { + if constexpr (dpnp::tensor::type_utils::is_complex::value || + dpnp::tensor::type_utils::is_complex::value) { fnT fn = nullptr; return fn; } @@ -659,4 +659,4 @@ struct TrueDivideInplaceRowMatrixBroadcastFactory } }; -} // namespace dpctl::tensor::kernels::true_divide +} // namespace dpnp::tensor::kernels::true_divide diff --git a/dpnp/tensor/libtensor/include/kernels/elementwise_functions/trunc.hpp b/dpnp/tensor/libtensor/include/kernels/elementwise_functions/trunc.hpp index 6fae9c4f27e5..19ffbcd1d656 100644 --- a/dpnp/tensor/libtensor/include/kernels/elementwise_functions/trunc.hpp +++ b/dpnp/tensor/libtensor/include/kernels/elementwise_functions/trunc.hpp @@ -42,19 +42,19 @@ #include "vec_size_util.hpp" -#include "kernels/dpctl_tensor_types.hpp" +#include "kernels/dpnp_tensor_types.hpp" #include "kernels/elementwise_functions/common.hpp" #include "utils/type_dispatch_building.hpp" #include "utils/type_utils.hpp" -namespace dpctl::tensor::kernels::trunc +namespace dpnp::tensor::kernels::trunc { -using dpctl::tensor::ssize_t; -namespace td_ns = dpctl::tensor::type_dispatch; +using dpnp::tensor::ssize_t; +namespace td_ns = dpnp::tensor::type_dispatch; -using dpctl::tensor::type_utils::is_complex; +using dpnp::tensor::type_utils::is_complex; template struct TruncFunctor @@ -122,7 +122,7 @@ struct TruncOutputType namespace hyperparam_detail { -namespace vsu_ns = dpctl::tensor::kernels::vec_size_utils; +namespace vsu_ns = dpnp::tensor::kernels::vec_size_utils; using vsu_ns::ContigHyperparameterSetDefault; using vsu_ns::UnaryContigHyperparameterSetEntry; @@ -223,4 +223,4 @@ struct TruncStridedFactory } }; -} // namespace dpctl::tensor::kernels::trunc +} // namespace dpnp::tensor::kernels::trunc diff --git a/dpnp/tensor/libtensor/include/kernels/elementwise_functions/vec_size_util.hpp b/dpnp/tensor/libtensor/include/kernels/elementwise_functions/vec_size_util.hpp index bdbc7e50cc86..fe8b8c7d1cc1 100644 --- a/dpnp/tensor/libtensor/include/kernels/elementwise_functions/vec_size_util.hpp +++ b/dpnp/tensor/libtensor/include/kernels/elementwise_functions/vec_size_util.hpp @@ -36,7 +36,7 @@ #include #include -namespace dpctl::tensor::kernels::vec_size_utils +namespace dpnp::tensor::kernels::vec_size_utils { template -#include "dpctl_tensor_types.hpp" +#include "dpnp_tensor_types.hpp" #include "utils/indexing_utils.hpp" #include "utils/offset_utils.hpp" #include "utils/type_utils.hpp" -namespace dpctl::tensor::kernels::indexing +namespace dpnp::tensor::kernels::indexing { -using dpctl::tensor::ssize_t; +using dpnp::tensor::ssize_t; template &depends) { - dpctl::tensor::type_utils::validate_type_for_device(q); + dpnp::tensor::type_utils::validate_type_for_device(q); sycl::event take_ev = q.submit([&](sycl::handler &cgh) { cgh.depends_on(depends); using OrthogIndexerT = - dpctl::tensor::offset_utils::TwoOffsets_StridedIndexer; + dpnp::tensor::offset_utils::TwoOffsets_StridedIndexer; const OrthogIndexerT orthog_indexer{nd, src_offset, dst_offset, orthog_shape_and_strides}; - using NthStrideIndexerT = dpctl::tensor::offset_utils::NthStrideOffset; + using NthStrideIndexerT = dpnp::tensor::offset_utils::NthStrideOffset; const NthStrideIndexerT indices_indexer{ind_nd, ind_offsets, ind_shape_and_strides}; - using AxesIndexerT = dpctl::tensor::offset_utils::StridedIndexer; + using AxesIndexerT = dpnp::tensor::offset_utils::StridedIndexer; const AxesIndexerT axes_indexer{ind_nd, 0, axes_shape_and_strides + (2 * k)}; @@ -308,21 +308,21 @@ sycl::event put_impl(sycl::queue &q, const ssize_t *ind_offsets, const std::vector &depends) { - dpctl::tensor::type_utils::validate_type_for_device(q); + dpnp::tensor::type_utils::validate_type_for_device(q); sycl::event put_ev = q.submit([&](sycl::handler &cgh) { cgh.depends_on(depends); using OrthogIndexerT = - dpctl::tensor::offset_utils::TwoOffsets_StridedIndexer; + dpnp::tensor::offset_utils::TwoOffsets_StridedIndexer; const OrthogIndexerT orthog_indexer{nd, dst_offset, val_offset, orthog_shape_and_strides}; - using NthStrideIndexerT = dpctl::tensor::offset_utils::NthStrideOffset; + using NthStrideIndexerT = dpnp::tensor::offset_utils::NthStrideOffset; const NthStrideIndexerT indices_indexer{ind_nd, ind_offsets, ind_shape_and_strides}; - using AxesIndexerT = dpctl::tensor::offset_utils::StridedIndexer; + using AxesIndexerT = dpnp::tensor::offset_utils::StridedIndexer; const AxesIndexerT axes_indexer{ind_nd, 0, axes_shape_and_strides + (2 * k)}; @@ -350,7 +350,7 @@ struct TakeWrapFactory { if constexpr (std::is_integral::value && !std::is_same::value) { - using dpctl::tensor::indexing_utils::WrapIndex; + using dpnp::tensor::indexing_utils::WrapIndex; fnT fn = take_impl, T, indT>; return fn; } @@ -368,7 +368,7 @@ struct TakeClipFactory { if constexpr (std::is_integral::value && !std::is_same::value) { - using dpctl::tensor::indexing_utils::ClipIndex; + using dpnp::tensor::indexing_utils::ClipIndex; fnT fn = take_impl, T, indT>; return fn; } @@ -386,7 +386,7 @@ struct PutWrapFactory { if constexpr (std::is_integral::value && !std::is_same::value) { - using dpctl::tensor::indexing_utils::WrapIndex; + using dpnp::tensor::indexing_utils::WrapIndex; fnT fn = put_impl, T, indT>; return fn; } @@ -404,7 +404,7 @@ struct PutClipFactory { if constexpr (std::is_integral::value && !std::is_same::value) { - using dpctl::tensor::indexing_utils::ClipIndex; + using dpnp::tensor::indexing_utils::ClipIndex; fnT fn = put_impl, T, indT>; return fn; } @@ -415,4 +415,4 @@ struct PutClipFactory } }; -} // namespace dpctl::tensor::kernels::indexing +} // namespace dpnp::tensor::kernels::indexing diff --git a/dpnp/tensor/libtensor/include/kernels/linalg_functions/dot_product.hpp b/dpnp/tensor/libtensor/include/kernels/linalg_functions/dot_product.hpp index b987ff2988be..b3216f382016 100644 --- a/dpnp/tensor/libtensor/include/kernels/linalg_functions/dot_product.hpp +++ b/dpnp/tensor/libtensor/include/kernels/linalg_functions/dot_product.hpp @@ -42,18 +42,18 @@ #include #include -#include "kernels/dpctl_tensor_types.hpp" +#include "kernels/dpnp_tensor_types.hpp" #include "kernels/reductions.hpp" #include "utils/offset_utils.hpp" #include "utils/sycl_alloc_utils.hpp" #include "utils/sycl_utils.hpp" #include "utils/type_utils.hpp" -namespace dpctl::tensor::kernels +namespace dpnp::tensor::kernels { -using dpctl::tensor::ssize_t; -namespace su_ns = dpctl::tensor::sycl_utils; +using dpnp::tensor::ssize_t; +namespace su_ns = dpnp::tensor::sycl_utils; template ( lhs_[lhs_batch_offset + lhs_reduction_offset]) * convert_impl( @@ -179,7 +179,7 @@ struct DotProductFunctor const auto &rhs_reduction_offset = reduction_offsets_.get_second_offset(); - using dpctl::tensor::type_utils::convert_impl; + using dpnp::tensor::type_utils::convert_impl; outT val = convert_impl( lhs_[lhs_batch_offset + lhs_reduction_offset]) * convert_impl( @@ -276,7 +276,7 @@ struct DotProductCustomFunctor const auto &rhs_reduction_offset = reduction_offsets_.get_second_offset(); - using dpctl::tensor::type_utils::convert_impl; + using dpnp::tensor::type_utils::convert_impl; outT val = convert_impl( lhs_[lhs_batch_offset + lhs_reduction_offset]) * convert_impl( @@ -457,9 +457,9 @@ sycl::event dot_product_impl(sycl::queue &exec_q, if (reduction_nelems < wg) { using InputOutputBatchIndexerT = - dpctl::tensor::offset_utils::ThreeOffsets_StridedIndexer; + dpnp::tensor::offset_utils::ThreeOffsets_StridedIndexer; using ReductionIndexerT = - dpctl::tensor::offset_utils::TwoOffsets_StridedIndexer; + dpnp::tensor::offset_utils::TwoOffsets_StridedIndexer; const InputOutputBatchIndexerT inp_out_batch_indexer{ batch_nd, batch_lhs_offset, batch_rhs_offset, batch_res_offset, @@ -479,8 +479,7 @@ sycl::event dot_product_impl(sycl::queue &exec_q, } else { sycl::event res_init_ev = exec_q.submit([&](sycl::handler &cgh) { - using IndexerT = - dpctl::tensor::offset_utils::UnpackedStridedIndexer; + using IndexerT = dpnp::tensor::offset_utils::UnpackedStridedIndexer; const ssize_t *const &res_shape = batch_shape_and_strides; const ssize_t *const &res_strides = @@ -501,9 +500,9 @@ sycl::event dot_product_impl(sycl::queue &exec_q, using ReductionOpT = sycl::plus; using BatchIndexerT = - dpctl::tensor::offset_utils::ThreeOffsets_StridedIndexer; + dpnp::tensor::offset_utils::ThreeOffsets_StridedIndexer; using ReductionIndexerT = - dpctl::tensor::offset_utils::TwoOffsets_StridedIndexer; + dpnp::tensor::offset_utils::TwoOffsets_StridedIndexer; const BatchIndexerT batch_indexer{batch_nd, batch_lhs_offset, batch_rhs_offset, batch_res_offset, @@ -575,14 +574,13 @@ sycl::event std::size_t wg = choose_workgroup_size<4>(reduction_nelems, sg_sizes); if (reduction_nelems < wg) { - using InputBatchIndexerT = - dpctl::tensor::offset_utils::Strided1DIndexer; - using NoOpIndexerT = dpctl::tensor::offset_utils::NoOpIndexer; + using InputBatchIndexerT = dpnp::tensor::offset_utils::Strided1DIndexer; + using NoOpIndexerT = dpnp::tensor::offset_utils::NoOpIndexer; using InputOutputBatchIndexerT = - dpctl::tensor::offset_utils::ThreeOffsets_CombinedIndexer< + dpnp::tensor::offset_utils::ThreeOffsets_CombinedIndexer< InputBatchIndexerT, InputBatchIndexerT, NoOpIndexerT>; using ReductionIndexerT = - dpctl::tensor::offset_utils::TwoOffsets_CombinedIndexer< + dpnp::tensor::offset_utils::TwoOffsets_CombinedIndexer< NoOpIndexerT, NoOpIndexerT>; const InputBatchIndexerT inp_batch_indexer{/* size */ batches, @@ -610,14 +608,13 @@ sycl::event using ReductionOpT = sycl::plus; - using InputBatchIndexerT = - dpctl::tensor::offset_utils::Strided1DIndexer; - using NoOpIndexerT = dpctl::tensor::offset_utils::NoOpIndexer; + using InputBatchIndexerT = dpnp::tensor::offset_utils::Strided1DIndexer; + using NoOpIndexerT = dpnp::tensor::offset_utils::NoOpIndexer; using InputOutputBatchIndexerT = - dpctl::tensor::offset_utils::ThreeOffsets_CombinedIndexer< + dpnp::tensor::offset_utils::ThreeOffsets_CombinedIndexer< InputBatchIndexerT, InputBatchIndexerT, NoOpIndexerT>; using ReductionIndexerT = - dpctl::tensor::offset_utils::TwoOffsets_CombinedIndexer< + dpnp::tensor::offset_utils::TwoOffsets_CombinedIndexer< NoOpIndexerT, NoOpIndexerT>; const InputBatchIndexerT inp_batch_indexer{/* size */ batches, @@ -722,7 +719,7 @@ struct DotProductNoAtomicFunctor const auto &rhs_reduction_offset = reduction_offsets_.get_second_offset(); - using dpctl::tensor::type_utils::convert_impl; + using dpnp::tensor::type_utils::convert_impl; outT val = convert_impl( lhs_[lhs_batch_offset + lhs_reduction_offset]) * convert_impl( @@ -822,7 +819,7 @@ struct DotProductNoAtomicCustomFunctor const auto &rhs_reduction_offset = reduction_offsets_.get_second_offset(); - using dpctl::tensor::type_utils::convert_impl; + using dpnp::tensor::type_utils::convert_impl; outT val = convert_impl( lhs_[lhs_batch_offset + lhs_reduction_offset]) * convert_impl( @@ -949,9 +946,9 @@ sycl::event dot_product_tree_impl(sycl::queue &exec_q, if (reduction_nelems < wg) { using InputOutputBatchIndexerT = - dpctl::tensor::offset_utils::ThreeOffsets_StridedIndexer; + dpnp::tensor::offset_utils::ThreeOffsets_StridedIndexer; using ReductionIndexerT = - dpctl::tensor::offset_utils::TwoOffsets_StridedIndexer; + dpnp::tensor::offset_utils::TwoOffsets_StridedIndexer; const InputOutputBatchIndexerT inp_out_batch_indexer{ batch_nd, batch_lhs_offset, batch_rhs_offset, batch_res_offset, @@ -981,9 +978,9 @@ sycl::event dot_product_tree_impl(sycl::queue &exec_q, std::size_t reductions_per_wi(preferred_reductions_per_wi); if (reduction_nelems <= preferred_reductions_per_wi * max_wg) { using BatchIndexerT = - dpctl::tensor::offset_utils::ThreeOffsets_StridedIndexer; + dpnp::tensor::offset_utils::ThreeOffsets_StridedIndexer; using ReductionIndexerT = - dpctl::tensor::offset_utils::TwoOffsets_StridedIndexer; + dpnp::tensor::offset_utils::TwoOffsets_StridedIndexer; const BatchIndexerT batch_indexer{batch_nd, batch_lhs_offset, batch_rhs_offset, batch_res_offset, @@ -1030,7 +1027,7 @@ sycl::event dot_product_tree_impl(sycl::queue &exec_q, // returns unique_ptr auto partially_reduced_tmp_owner = - dpctl::tensor::alloc_utils::smart_malloc_device( + dpnp::tensor::alloc_utils::smart_malloc_device( batches * (reduction_groups + second_iter_reduction_groups_), exec_q); @@ -1040,15 +1037,15 @@ sycl::event dot_product_tree_impl(sycl::queue &exec_q, sycl::event first_reduction_ev; { - using LhsIndexerT = dpctl::tensor::offset_utils::StridedIndexer; + using LhsIndexerT = dpnp::tensor::offset_utils::StridedIndexer; using RhsIndexerT = - dpctl::tensor::offset_utils::UnpackedStridedIndexer; - using ResIndexerT = dpctl::tensor::offset_utils::NoOpIndexer; + dpnp::tensor::offset_utils::UnpackedStridedIndexer; + using ResIndexerT = dpnp::tensor::offset_utils::NoOpIndexer; using InputOutputBatchIndexerT = - dpctl::tensor::offset_utils::ThreeOffsets_CombinedIndexer< + dpnp::tensor::offset_utils::ThreeOffsets_CombinedIndexer< LhsIndexerT, RhsIndexerT, ResIndexerT>; using ReductionIndexerT = - dpctl::tensor::offset_utils::TwoOffsets_StridedIndexer; + dpnp::tensor::offset_utils::TwoOffsets_StridedIndexer; const LhsIndexerT lhs_indexer(batch_nd, batch_lhs_offset, batch_shape_and_strides); @@ -1085,12 +1082,12 @@ sycl::event dot_product_tree_impl(sycl::queue &exec_q, (preferred_reductions_per_wi * wg); assert(reduction_groups_ > 1); - using InputIndexerT = dpctl::tensor::offset_utils::Strided1DIndexer; - using ResIndexerT = dpctl::tensor::offset_utils::NoOpIndexer; + using InputIndexerT = dpnp::tensor::offset_utils::Strided1DIndexer; + using ResIndexerT = dpnp::tensor::offset_utils::NoOpIndexer; using InputOutputIterIndexerT = - dpctl::tensor::offset_utils::TwoOffsets_CombinedIndexer< + dpnp::tensor::offset_utils::TwoOffsets_CombinedIndexer< InputIndexerT, ResIndexerT>; - using ReductionIndexerT = dpctl::tensor::offset_utils::NoOpIndexer; + using ReductionIndexerT = dpnp::tensor::offset_utils::NoOpIndexer; const InputIndexerT inp_indexer{/* size */ batches, /* step */ reduction_groups_}; @@ -1101,7 +1098,7 @@ sycl::event dot_product_tree_impl(sycl::queue &exec_q, static constexpr ReductionIndexerT reduction_indexer{}; sycl::event partial_reduction_ev = - dpctl::tensor::kernels::submit_no_atomic_reduction< + dpnp::tensor::kernels::submit_no_atomic_reduction< resTy, resTy, ReductionOpT, InputOutputIterIndexerT, ReductionIndexerT, dot_product_tree_reduction_krn>( exec_q, temp_arg, temp2_arg, identity_val, wg, batches, @@ -1115,12 +1112,12 @@ sycl::event dot_product_tree_impl(sycl::queue &exec_q, } // final reduction to res - using InputIndexerT = dpctl::tensor::offset_utils::Strided1DIndexer; - using ResIndexerT = dpctl::tensor::offset_utils::UnpackedStridedIndexer; + using InputIndexerT = dpnp::tensor::offset_utils::Strided1DIndexer; + using ResIndexerT = dpnp::tensor::offset_utils::UnpackedStridedIndexer; using InputOutputIterIndexerT = - dpctl::tensor::offset_utils::TwoOffsets_CombinedIndexer< + dpnp::tensor::offset_utils::TwoOffsets_CombinedIndexer< InputIndexerT, ResIndexerT>; - using ReductionIndexerT = dpctl::tensor::offset_utils::NoOpIndexer; + using ReductionIndexerT = dpnp::tensor::offset_utils::NoOpIndexer; const InputIndexerT inp_indexer{/* size */ batches, /* step */ remaining_reduction_nelems}; @@ -1143,7 +1140,7 @@ sycl::event dot_product_tree_impl(sycl::queue &exec_q, assert(reduction_groups == 1); sycl::event final_reduction_ev = - dpctl::tensor::kernels::submit_no_atomic_reduction< + dpnp::tensor::kernels::submit_no_atomic_reduction< resTy, resTy, ReductionOpT, InputOutputIterIndexerT, ReductionIndexerT, dot_product_tree_reduction_krn>( exec_q, temp_arg, res_tp, identity_val, wg, batches, @@ -1152,7 +1149,7 @@ sycl::event dot_product_tree_impl(sycl::queue &exec_q, // transfer ownership of USM allocation to host_task sycl::event cleanup_host_task_event = - dpctl::tensor::alloc_utils::async_smart_free( + dpnp::tensor::alloc_utils::async_smart_free( exec_q, {final_reduction_ev}, partially_reduced_tmp_owner); return cleanup_host_task_event; @@ -1185,14 +1182,13 @@ sycl::event std::size_t wg = choose_workgroup_size<4>(reduction_nelems, sg_sizes); if (reduction_nelems < wg) { - using InputBatchIndexerT = - dpctl::tensor::offset_utils::Strided1DIndexer; - using NoOpIndexerT = dpctl::tensor::offset_utils::NoOpIndexer; + using InputBatchIndexerT = dpnp::tensor::offset_utils::Strided1DIndexer; + using NoOpIndexerT = dpnp::tensor::offset_utils::NoOpIndexer; using InputOutputBatchIndexerT = - dpctl::tensor::offset_utils::ThreeOffsets_CombinedIndexer< + dpnp::tensor::offset_utils::ThreeOffsets_CombinedIndexer< InputBatchIndexerT, InputBatchIndexerT, NoOpIndexerT>; using ReductionIndexerT = - dpctl::tensor::offset_utils::TwoOffsets_CombinedIndexer< + dpnp::tensor::offset_utils::TwoOffsets_CombinedIndexer< NoOpIndexerT, NoOpIndexerT>; const InputBatchIndexerT inp_batch_indexer{/* size */ batches, @@ -1222,14 +1218,13 @@ sycl::event std::size_t reductions_per_wi(preferred_reductions_per_wi); if (reduction_nelems <= preferred_reductions_per_wi * max_wg) { - using InputBatchIndexerT = - dpctl::tensor::offset_utils::Strided1DIndexer; - using NoOpIndexerT = dpctl::tensor::offset_utils::NoOpIndexer; + using InputBatchIndexerT = dpnp::tensor::offset_utils::Strided1DIndexer; + using NoOpIndexerT = dpnp::tensor::offset_utils::NoOpIndexer; using InputOutputBatchIndexerT = - dpctl::tensor::offset_utils::ThreeOffsets_CombinedIndexer< + dpnp::tensor::offset_utils::ThreeOffsets_CombinedIndexer< InputBatchIndexerT, InputBatchIndexerT, NoOpIndexerT>; using ReductionIndexerT = - dpctl::tensor::offset_utils::TwoOffsets_CombinedIndexer< + dpnp::tensor::offset_utils::TwoOffsets_CombinedIndexer< NoOpIndexerT, NoOpIndexerT>; const InputBatchIndexerT inp_batch_indexer{/* size */ batches, @@ -1276,7 +1271,7 @@ sycl::event // unique_ptr that owns temporary allocation for partial reductions auto partially_reduced_tmp_owner = - dpctl::tensor::alloc_utils::smart_malloc_device( + dpnp::tensor::alloc_utils::smart_malloc_device( batches * (reduction_groups + second_iter_reduction_groups_), exec_q); // get raw pointers @@ -1287,13 +1282,13 @@ sycl::event sycl::event first_reduction_ev; { using InputBatchIndexerT = - dpctl::tensor::offset_utils::Strided1DIndexer; - using NoOpIndexerT = dpctl::tensor::offset_utils::NoOpIndexer; + dpnp::tensor::offset_utils::Strided1DIndexer; + using NoOpIndexerT = dpnp::tensor::offset_utils::NoOpIndexer; using InputOutputBatchIndexerT = - dpctl::tensor::offset_utils::ThreeOffsets_CombinedIndexer< + dpnp::tensor::offset_utils::ThreeOffsets_CombinedIndexer< InputBatchIndexerT, InputBatchIndexerT, NoOpIndexerT>; using ReductionIndexerT = - dpctl::tensor::offset_utils::TwoOffsets_CombinedIndexer< + dpnp::tensor::offset_utils::TwoOffsets_CombinedIndexer< NoOpIndexerT, NoOpIndexerT>; const InputBatchIndexerT inp_batch_indexer{ @@ -1326,12 +1321,12 @@ sycl::event (preferred_reductions_per_wi * wg); assert(reduction_groups_ > 1); - using InputIndexerT = dpctl::tensor::offset_utils::Strided1DIndexer; - using ResIndexerT = dpctl::tensor::offset_utils::NoOpIndexer; + using InputIndexerT = dpnp::tensor::offset_utils::Strided1DIndexer; + using ResIndexerT = dpnp::tensor::offset_utils::NoOpIndexer; using InputOutputIterIndexerT = - dpctl::tensor::offset_utils::TwoOffsets_CombinedIndexer< + dpnp::tensor::offset_utils::TwoOffsets_CombinedIndexer< InputIndexerT, ResIndexerT>; - using ReductionIndexerT = dpctl::tensor::offset_utils::NoOpIndexer; + using ReductionIndexerT = dpnp::tensor::offset_utils::NoOpIndexer; const InputIndexerT inp_indexer{/* size */ batches, /* step */ reduction_groups_}; @@ -1342,7 +1337,7 @@ sycl::event static constexpr ReductionIndexerT reduction_indexer{}; sycl::event partial_reduction_ev = - dpctl::tensor::kernels::submit_no_atomic_reduction< + dpnp::tensor::kernels::submit_no_atomic_reduction< resTy, resTy, ReductionOpT, InputOutputIterIndexerT, ReductionIndexerT, dot_product_tree_reduction_krn>( exec_q, temp_arg, temp2_arg, identity_val, wg, batches, @@ -1356,12 +1351,12 @@ sycl::event } // final reduction to res - using InputIndexerT = dpctl::tensor::offset_utils::Strided1DIndexer; - using ResIndexerT = dpctl::tensor::offset_utils::NoOpIndexer; + using InputIndexerT = dpnp::tensor::offset_utils::Strided1DIndexer; + using ResIndexerT = dpnp::tensor::offset_utils::NoOpIndexer; using InputOutputIterIndexerT = - dpctl::tensor::offset_utils::TwoOffsets_CombinedIndexer< + dpnp::tensor::offset_utils::TwoOffsets_CombinedIndexer< InputIndexerT, ResIndexerT>; - using ReductionIndexerT = dpctl::tensor::offset_utils::NoOpIndexer; + using ReductionIndexerT = dpnp::tensor::offset_utils::NoOpIndexer; const InputIndexerT inp_indexer{/* size */ batches, /* step */ remaining_reduction_nelems}; @@ -1381,7 +1376,7 @@ sycl::event assert(reduction_groups == 1); sycl::event final_reduction_ev = - dpctl::tensor::kernels::submit_no_atomic_reduction< + dpnp::tensor::kernels::submit_no_atomic_reduction< resTy, resTy, ReductionOpT, InputOutputIterIndexerT, ReductionIndexerT, dot_product_tree_reduction_krn>( exec_q, temp_arg, res_tp, identity_val, wg, batches, @@ -1389,11 +1384,11 @@ sycl::event in_out_iter_indexer, reduction_indexer, {dependent_ev}); sycl::event cleanup_host_task_event = - dpctl::tensor::alloc_utils::async_smart_free( + dpnp::tensor::alloc_utils::async_smart_free( exec_q, {final_reduction_ev}, partially_reduced_tmp_owner); return cleanup_host_task_event; } } -} // namespace dpctl::tensor::kernels +} // namespace dpnp::tensor::kernels diff --git a/dpnp/tensor/libtensor/include/kernels/linalg_functions/gemm.hpp b/dpnp/tensor/libtensor/include/kernels/linalg_functions/gemm.hpp index 5644ea172a1d..51e95b799bd0 100644 --- a/dpnp/tensor/libtensor/include/kernels/linalg_functions/gemm.hpp +++ b/dpnp/tensor/libtensor/include/kernels/linalg_functions/gemm.hpp @@ -47,17 +47,17 @@ #include #include -#include "kernels/dpctl_tensor_types.hpp" +#include "kernels/dpnp_tensor_types.hpp" #include "kernels/reductions.hpp" #include "utils/offset_utils.hpp" #include "utils/sycl_alloc_utils.hpp" #include "utils/sycl_utils.hpp" #include "utils/type_utils.hpp" -namespace dpctl::tensor::kernels +namespace dpnp::tensor::kernels { -using dpctl::tensor::ssize_t; +using dpnp::tensor::ssize_t; namespace gemm_detail { @@ -104,7 +104,7 @@ void scale_gemm_nm_parameters(const std::size_t &local_mem_size, } } // namespace gemm_detail -using dpctl::tensor::sycl_utils::choose_workgroup_size; +using dpnp::tensor::sycl_utils::choose_workgroup_size; template class gemm_seq_reduction_krn; @@ -131,12 +131,12 @@ sycl::event single_reduction_for_gemm(sycl::queue &exec_q, { sycl::event red_ev; if (reduction_nelems < wg) { - using NoOpIndexerT = dpctl::tensor::offset_utils::NoOpIndexer; - using ResIndexerT = dpctl::tensor::offset_utils::StridedIndexer; + using NoOpIndexerT = dpnp::tensor::offset_utils::NoOpIndexer; + using ResIndexerT = dpnp::tensor::offset_utils::StridedIndexer; using InputOutputIterIndexerT = - dpctl::tensor::offset_utils::TwoOffsets_CombinedIndexer< - NoOpIndexerT, ResIndexerT>; - using ReductionIndexerT = dpctl::tensor::offset_utils::Strided1DIndexer; + dpnp::tensor::offset_utils::TwoOffsets_CombinedIndexer; + using ReductionIndexerT = dpnp::tensor::offset_utils::Strided1DIndexer; const ResIndexerT res_iter_indexer{res_nd, 0, res_shapes_strides}; const InputOutputIterIndexerT in_out_iter_indexer{NoOpIndexerT{}, @@ -160,12 +160,12 @@ sycl::event single_reduction_for_gemm(sycl::queue &exec_q, }); } else { - using NoOpIndexerT = dpctl::tensor::offset_utils::NoOpIndexer; - using ResIndexerT = dpctl::tensor::offset_utils::StridedIndexer; + using NoOpIndexerT = dpnp::tensor::offset_utils::NoOpIndexer; + using ResIndexerT = dpnp::tensor::offset_utils::StridedIndexer; using InputOutputIterIndexerT = - dpctl::tensor::offset_utils::TwoOffsets_CombinedIndexer< - NoOpIndexerT, ResIndexerT>; - using ReductionIndexerT = dpctl::tensor::offset_utils::Strided1DIndexer; + dpnp::tensor::offset_utils::TwoOffsets_CombinedIndexer; + using ReductionIndexerT = dpnp::tensor::offset_utils::Strided1DIndexer; const ResIndexerT res_iter_indexer{res_nd, 0, res_shapes_strides}; const InputOutputIterIndexerT in_out_iter_indexer{NoOpIndexerT{}, @@ -185,7 +185,7 @@ sycl::event single_reduction_for_gemm(sycl::queue &exec_q, (reductions_per_wi * wg); assert(reduction_groups == 1); - red_ev = dpctl::tensor::kernels::submit_no_atomic_reduction< + red_ev = dpnp::tensor::kernels::submit_no_atomic_reduction< T, T, ReductionOpT, InputOutputIterIndexerT, ReductionIndexerT, gemm_tree_reduction_krn>( exec_q, tmp_tp, res_tp, identity_val, wg, iter_nelems, @@ -212,11 +212,11 @@ sycl::event { sycl::event red_ev; if (reduction_nelems < wg) { - using NoOpIndexerT = dpctl::tensor::offset_utils::NoOpIndexer; + using NoOpIndexerT = dpnp::tensor::offset_utils::NoOpIndexer; using InputOutputIterIndexerT = - dpctl::tensor::offset_utils::TwoOffsets_CombinedIndexer< + dpnp::tensor::offset_utils::TwoOffsets_CombinedIndexer< NoOpIndexerT, NoOpIndexerT>; - using ReductionIndexerT = dpctl::tensor::offset_utils::Strided1DIndexer; + using ReductionIndexerT = dpnp::tensor::offset_utils::Strided1DIndexer; static constexpr InputOutputIterIndexerT in_out_iter_indexer{ NoOpIndexerT{}, NoOpIndexerT{}}; @@ -241,11 +241,11 @@ sycl::event }); } else { - using NoOpIndexerT = dpctl::tensor::offset_utils::NoOpIndexer; + using NoOpIndexerT = dpnp::tensor::offset_utils::NoOpIndexer; using InputOutputIterIndexerT = - dpctl::tensor::offset_utils::TwoOffsets_CombinedIndexer< + dpnp::tensor::offset_utils::TwoOffsets_CombinedIndexer< NoOpIndexerT, NoOpIndexerT>; - using ReductionIndexerT = dpctl::tensor::offset_utils::Strided1DIndexer; + using ReductionIndexerT = dpnp::tensor::offset_utils::Strided1DIndexer; static constexpr InputOutputIterIndexerT in_out_iter_indexer{ NoOpIndexerT{}, NoOpIndexerT{}}; @@ -266,7 +266,7 @@ sycl::event (reductions_per_wi * wg); assert(reduction_groups == 1); - red_ev = dpctl::tensor::kernels::submit_no_atomic_reduction< + red_ev = dpnp::tensor::kernels::submit_no_atomic_reduction< T, T, ReductionOpT, InputOutputIterIndexerT, ReductionIndexerT, gemm_tree_reduction_krn>( exec_q, tmp_tp, res_tp, identity_val, wg, iter_nelems, @@ -296,11 +296,11 @@ sycl::event tree_reduction_for_gemm(sycl::queue &exec_q, { sycl::event first_reduction_ev; { - using NoOpIndexerT = dpctl::tensor::offset_utils::NoOpIndexer; + using NoOpIndexerT = dpnp::tensor::offset_utils::NoOpIndexer; using InputOutputIterIndexerT = - dpctl::tensor::offset_utils::TwoOffsets_CombinedIndexer< + dpnp::tensor::offset_utils::TwoOffsets_CombinedIndexer< NoOpIndexerT, NoOpIndexerT>; - using ReductionIndexerT = dpctl::tensor::offset_utils::Strided1DIndexer; + using ReductionIndexerT = dpnp::tensor::offset_utils::Strided1DIndexer; static constexpr InputOutputIterIndexerT in_out_iter_indexer{ NoOpIndexerT{}, NoOpIndexerT{}}; @@ -309,7 +309,7 @@ sycl::event tree_reduction_for_gemm(sycl::queue &exec_q, const ReductionIndexerT reduction_indexer{/* size */ reduction_nelems, /* step */ iter_nelems}; - first_reduction_ev = dpctl::tensor::kernels::submit_no_atomic_reduction< + first_reduction_ev = dpnp::tensor::kernels::submit_no_atomic_reduction< T, T, ReductionOpT, InputOutputIterIndexerT, ReductionIndexerT, gemm_tree_reduction_krn>( exec_q, partially_reduced_tmp, partially_reduced_tmp2, identity_val, @@ -330,12 +330,12 @@ sycl::event tree_reduction_for_gemm(sycl::queue &exec_q, assert(reduction_groups_ > 1); // keep reducing - using InputIndexerT = dpctl::tensor::offset_utils::Strided1DIndexer; - using ResIndexerT = dpctl::tensor::offset_utils::NoOpIndexer; + using InputIndexerT = dpnp::tensor::offset_utils::Strided1DIndexer; + using ResIndexerT = dpnp::tensor::offset_utils::NoOpIndexer; using InputOutputIterIndexerT = - dpctl::tensor::offset_utils::TwoOffsets_CombinedIndexer< + dpnp::tensor::offset_utils::TwoOffsets_CombinedIndexer< InputIndexerT, ResIndexerT>; - using ReductionIndexerT = dpctl::tensor::offset_utils::NoOpIndexer; + using ReductionIndexerT = dpnp::tensor::offset_utils::NoOpIndexer; const InputIndexerT inp_indexer{/* size */ iter_nelems, /* step */ reduction_groups_}; @@ -347,7 +347,7 @@ sycl::event tree_reduction_for_gemm(sycl::queue &exec_q, static constexpr ReductionIndexerT reduction_indexer{}; sycl::event partial_reduction_ev = - dpctl::tensor::kernels::submit_no_atomic_reduction< + dpnp::tensor::kernels::submit_no_atomic_reduction< T, T, ReductionOpT, InputOutputIterIndexerT, ReductionIndexerT, gemm_tree_reduction_krn>( exec_q, temp_arg, temp2_arg, identity_val, wg, iter_nelems, @@ -361,12 +361,12 @@ sycl::event tree_reduction_for_gemm(sycl::queue &exec_q, } // final reduction to res - using InputIndexerT = dpctl::tensor::offset_utils::Strided1DIndexer; - using ResIndexerT = dpctl::tensor::offset_utils::StridedIndexer; + using InputIndexerT = dpnp::tensor::offset_utils::Strided1DIndexer; + using ResIndexerT = dpnp::tensor::offset_utils::StridedIndexer; using InputOutputIterIndexerT = - dpctl::tensor::offset_utils::TwoOffsets_CombinedIndexer; - using ReductionIndexerT = dpctl::tensor::offset_utils::NoOpIndexer; + dpnp::tensor::offset_utils::TwoOffsets_CombinedIndexer; + using ReductionIndexerT = dpnp::tensor::offset_utils::NoOpIndexer; const InputIndexerT inp_indexer{/* size */ iter_nelems, /* step */ remaining_reduction_nelems}; @@ -389,7 +389,7 @@ sycl::event tree_reduction_for_gemm(sycl::queue &exec_q, assert(reduction_groups == 1); sycl::event final_reduction_ev = - dpctl::tensor::kernels::submit_no_atomic_reduction< + dpnp::tensor::kernels::submit_no_atomic_reduction< T, T, ReductionOpT, InputOutputIterIndexerT, ReductionIndexerT, gemm_tree_reduction_krn>( exec_q, temp_arg, res_tp, identity_val, wg, iter_nelems, @@ -418,11 +418,11 @@ sycl::event std::size_t reductions_per_wi, const std::vector &depends) { - using NoOpIndexerT = dpctl::tensor::offset_utils::NoOpIndexer; + using NoOpIndexerT = dpnp::tensor::offset_utils::NoOpIndexer; using InputOutputIterIndexerT = - dpctl::tensor::offset_utils::TwoOffsets_CombinedIndexer; - using ReductionIndexerT = dpctl::tensor::offset_utils::Strided1DIndexer; + dpnp::tensor::offset_utils::TwoOffsets_CombinedIndexer; + using ReductionIndexerT = dpnp::tensor::offset_utils::Strided1DIndexer; static constexpr InputOutputIterIndexerT in_out_iter_indexer{ NoOpIndexerT{}, NoOpIndexerT{}}; @@ -430,7 +430,7 @@ sycl::event /* step */ iter_nelems}; const sycl::event &first_reduction_ev = - dpctl::tensor::kernels::submit_no_atomic_reduction< + dpnp::tensor::kernels::submit_no_atomic_reduction< T, T, ReductionOpT, InputOutputIterIndexerT, ReductionIndexerT, gemm_reduction_over_group_temps_contig_krn>( exec_q, partially_reduced_tmp, partially_reduced_tmp2, identity_val, @@ -450,12 +450,12 @@ sycl::event assert(reduction_groups_ > 1); // keep reducing - using InputIndexerT = dpctl::tensor::offset_utils::Strided1DIndexer; - using ResIndexerT = dpctl::tensor::offset_utils::NoOpIndexer; + using InputIndexerT = dpnp::tensor::offset_utils::Strided1DIndexer; + using ResIndexerT = dpnp::tensor::offset_utils::NoOpIndexer; using InputOutputIterIndexerT = - dpctl::tensor::offset_utils::TwoOffsets_CombinedIndexer< + dpnp::tensor::offset_utils::TwoOffsets_CombinedIndexer< InputIndexerT, ResIndexerT>; - using ReductionIndexerT = dpctl::tensor::offset_utils::NoOpIndexer; + using ReductionIndexerT = dpnp::tensor::offset_utils::NoOpIndexer; // n * m = iter_nelems because essentially, this process // creates a stack of reduction_nelems 2D matrices and we reduce @@ -470,7 +470,7 @@ sycl::event static constexpr ReductionIndexerT reduction_indexer{}; sycl::event partial_reduction_ev = - dpctl::tensor::kernels::submit_no_atomic_reduction< + dpnp::tensor::kernels::submit_no_atomic_reduction< T, T, ReductionOpT, InputOutputIterIndexerT, ReductionIndexerT, gemm_reduction_over_group_temps_contig_krn>( exec_q, temp_arg, temp2_arg, identity_val, wg, iter_nelems, @@ -485,12 +485,12 @@ sycl::event // final reduction to res { - using InputIndexerT = dpctl::tensor::offset_utils::Strided1DIndexer; - using ResIndexerT = dpctl::tensor::offset_utils::NoOpIndexer; + using InputIndexerT = dpnp::tensor::offset_utils::Strided1DIndexer; + using ResIndexerT = dpnp::tensor::offset_utils::NoOpIndexer; using InputOutputIterIndexerT = - dpctl::tensor::offset_utils::TwoOffsets_CombinedIndexer< + dpnp::tensor::offset_utils::TwoOffsets_CombinedIndexer< InputIndexerT, ResIndexerT>; - using ReductionIndexerT = dpctl::tensor::offset_utils::NoOpIndexer; + using ReductionIndexerT = dpnp::tensor::offset_utils::NoOpIndexer; const InputIndexerT inp_indexer{ /* size */ iter_nelems, @@ -511,7 +511,7 @@ sycl::event assert(reduction_groups == 1); sycl::event final_reduction_ev = - dpctl::tensor::kernels::submit_no_atomic_reduction< + dpnp::tensor::kernels::submit_no_atomic_reduction< T, T, ReductionOpT, InputOutputIterIndexerT, ReductionIndexerT, gemm_reduction_over_group_temps_contig_krn>( exec_q, temp_arg, res_tp, identity_val, wg, iter_nelems, @@ -1422,14 +1422,14 @@ sycl::event gemm_impl(sycl::queue &exec_q, const rhsTy *rhs_tp = reinterpret_cast(rhs_cp); resTy *res_tp = reinterpret_cast(res_cp); - using OuterInnerIndexerT = dpctl::tensor::offset_utils::StridedIndexer; + using OuterInnerIndexerT = dpnp::tensor::offset_utils::StridedIndexer; const OuterInnerIndexerT lhs_indexer(inner_nd + lhs_outer_nd, 0, lhs_shape_strides); const OuterInnerIndexerT rhs_indexer(inner_nd + rhs_outer_nd, 0, rhs_shape_strides); const OuterInnerIndexerT res_indexer(res_outer_nd, 0, res_shape_strides); - using BatchIndexerT = dpctl::tensor::offset_utils::ThreeZeroOffsets_Indexer; + using BatchIndexerT = dpnp::tensor::offset_utils::ThreeZeroOffsets_Indexer; static constexpr BatchIndexerT batch_indexer{}; static constexpr std::size_t single_batch_nelems = 1; @@ -1448,7 +1448,7 @@ sycl::event gemm_impl(sycl::queue &exec_q, sycl::event res_init_ev = exec_q.submit([&](sycl::handler &cgh) { cgh.depends_on(depends); - using IndexerT = dpctl::tensor::offset_utils::StridedIndexer; + using IndexerT = dpnp::tensor::offset_utils::StridedIndexer; const IndexerT res_indexer(res_outer_nd, 0, res_shape_strides); using InitKernelName = class gemm_init_krn; cgh.parallel_for( @@ -1510,12 +1510,12 @@ sycl::event gemm_contig_impl(sycl::queue &exec_q, const rhsTy *rhs_tp = reinterpret_cast(rhs_cp); resTy *res_tp = reinterpret_cast(res_cp); - using OuterInnerIndexerT = dpctl::tensor::offset_utils::NoOpIndexer; + using OuterInnerIndexerT = dpnp::tensor::offset_utils::NoOpIndexer; static constexpr OuterInnerIndexerT lhs_indexer{}; static constexpr OuterInnerIndexerT rhs_indexer{}; static constexpr OuterInnerIndexerT res_indexer{}; - using BatchIndexerT = dpctl::tensor::offset_utils::ThreeZeroOffsets_Indexer; + using BatchIndexerT = dpnp::tensor::offset_utils::ThreeZeroOffsets_Indexer; static constexpr BatchIndexerT batch_indexer{}; static constexpr std::size_t single_batch_nelems = 1; @@ -1618,7 +1618,7 @@ sycl::event gemm_batch_impl(sycl::queue &exec_q, const rhsTy *rhs_tp = reinterpret_cast(rhs_cp); resTy *res_tp = reinterpret_cast(res_cp); - using OuterInnerDimsIndexerT = dpctl::tensor::offset_utils::StridedIndexer; + using OuterInnerDimsIndexerT = dpnp::tensor::offset_utils::StridedIndexer; const OuterInnerDimsIndexerT lhs_indexer(inner_nd + lhs_outer_nd, 0, lhs_outer_inner_shapes_strides); const OuterInnerDimsIndexerT rhs_indexer(inner_nd + rhs_outer_nd, 0, @@ -1626,7 +1626,7 @@ sycl::event gemm_batch_impl(sycl::queue &exec_q, const OuterInnerDimsIndexerT res_indexer(res_outer_nd, 0, res_outer_shapes_strides); using BatchDimsIndexerT = - dpctl::tensor::offset_utils::ThreeOffsets_StridedIndexer; + dpnp::tensor::offset_utils::ThreeOffsets_StridedIndexer; const BatchDimsIndexerT batch_indexer(batch_nd, lhs_batch_offset, rhs_batch_offset, res_batch_offset, batch_shape_strides); @@ -1645,7 +1645,7 @@ sycl::event gemm_batch_impl(sycl::queue &exec_q, sycl::event res_init_ev = exec_q.submit([&](sycl::handler &cgh) { cgh.depends_on(depends); - using IndexerT = dpctl::tensor::offset_utils::StridedIndexer; + using IndexerT = dpnp::tensor::offset_utils::StridedIndexer; const IndexerT res_indexer(batch_nd + res_outer_nd, res_batch_offset, res_shape_strides); using InitKernelName = class gemm_batch_init_krn; @@ -1720,13 +1720,13 @@ sycl::event gemm_batch_contig_impl(sycl::queue &exec_q, reinterpret_cast(rhs_cp) + rhs_batch_offset; resTy *res_tp = reinterpret_cast(res_cp) + res_batch_offset; - using OuterInnerDimsIndexerT = dpctl::tensor::offset_utils::NoOpIndexer; + using OuterInnerDimsIndexerT = dpnp::tensor::offset_utils::NoOpIndexer; static constexpr OuterInnerDimsIndexerT lhs_indexer{}; static constexpr OuterInnerDimsIndexerT rhs_indexer{}; static constexpr OuterInnerDimsIndexerT res_indexer{}; - using dpctl::tensor::offset_utils::Strided1DIndexer; - using dpctl::tensor::offset_utils::ThreeOffsets_CombinedIndexer; + using dpnp::tensor::offset_utils::Strided1DIndexer; + using dpnp::tensor::offset_utils::ThreeOffsets_CombinedIndexer; using BatchDimsIndexerT = ThreeOffsets_CombinedIndexer; @@ -2299,7 +2299,7 @@ sycl::event if (k <= (delta_k * n_wi)) { using OuterInnerDimsIndexerT = - dpctl::tensor::offset_utils::StridedIndexer; + dpnp::tensor::offset_utils::StridedIndexer; const OuterInnerDimsIndexerT lhs_indexer( inner_nd + lhs_outer_nd, 0, lhs_outer_inner_shapes_strides); const OuterInnerDimsIndexerT rhs_indexer( @@ -2307,7 +2307,7 @@ sycl::event const OuterInnerDimsIndexerT res_indexer(res_outer_nd, 0, res_outer_shapes_strides); using BatchDimsIndexerT = - dpctl::tensor::offset_utils::ThreeOffsets_StridedIndexer; + dpnp::tensor::offset_utils::ThreeOffsets_StridedIndexer; const BatchDimsIndexerT batch_indexer( batch_nd, lhs_batch_offset, rhs_batch_offset, res_batch_offset, batch_shape_strides); @@ -2353,23 +2353,23 @@ sycl::event if (reduction_nelems <= preferred_reductions_per_wi * max_wg) { auto tmp_owner = - dpctl::tensor::alloc_utils::smart_malloc_device( + dpnp::tensor::alloc_utils::smart_malloc_device( iter_nelems * reduction_nelems, exec_q); resTy *tmp = tmp_owner.get(); using OuterInnerDimsIndexerT = - dpctl::tensor::offset_utils::StridedIndexer; - using TmpIndexerT = dpctl::tensor::offset_utils::NoOpIndexer; + dpnp::tensor::offset_utils::StridedIndexer; + using TmpIndexerT = dpnp::tensor::offset_utils::NoOpIndexer; const OuterInnerDimsIndexerT lhs_indexer( inner_nd + lhs_outer_nd, 0, lhs_outer_inner_shapes_strides); const OuterInnerDimsIndexerT rhs_indexer( inner_nd + rhs_outer_nd, 0, rhs_outer_inner_shapes_strides); static constexpr TmpIndexerT res_indexer{}; - using dpctl::tensor::offset_utils::Strided1DIndexer; - using dpctl::tensor::offset_utils::StridedIndexer; - using dpctl::tensor::offset_utils::ThreeOffsets_CombinedIndexer; - using dpctl::tensor::offset_utils::UnpackedStridedIndexer; + using dpnp::tensor::offset_utils::Strided1DIndexer; + using dpnp::tensor::offset_utils::StridedIndexer; + using dpnp::tensor::offset_utils::ThreeOffsets_CombinedIndexer; + using dpnp::tensor::offset_utils::UnpackedStridedIndexer; using BatchDimsIndexerT = ThreeOffsets_CombinedIndexer< StridedIndexer, UnpackedStridedIndexer, Strided1DIndexer>; const StridedIndexer lhs_batch_indexer(batch_nd, lhs_batch_offset, @@ -2398,8 +2398,8 @@ sycl::event {gemm_ev}); sycl::event cleanup_host_task_event = - dpctl::tensor::alloc_utils::async_smart_free(exec_q, {red_ev}, - tmp_owner); + dpnp::tensor::alloc_utils::async_smart_free(exec_q, {red_ev}, + tmp_owner); return cleanup_host_task_event; } @@ -2413,7 +2413,7 @@ sycl::event // get unique_ptr owning the temporary allocation auto tmp_owner = - dpctl::tensor::alloc_utils::smart_malloc_device( + dpnp::tensor::alloc_utils::smart_malloc_device( tmp_alloc_size, exec_q); // get raw USM pointer resTy *partially_reduced_tmp = tmp_owner.get(); @@ -2422,16 +2422,16 @@ sycl::event ; using OuterInnerDimsIndexerT = - dpctl::tensor::offset_utils::StridedIndexer; - using TmpIndexerT = dpctl::tensor::offset_utils::NoOpIndexer; + dpnp::tensor::offset_utils::StridedIndexer; + using TmpIndexerT = dpnp::tensor::offset_utils::NoOpIndexer; const OuterInnerDimsIndexerT lhs_indexer( inner_nd + lhs_outer_nd, 0, lhs_outer_inner_shapes_strides); const OuterInnerDimsIndexerT rhs_indexer( inner_nd + rhs_outer_nd, 0, rhs_outer_inner_shapes_strides); static constexpr TmpIndexerT res_indexer{}; - using dpctl::tensor::offset_utils::Strided1DIndexer; - using dpctl::tensor::offset_utils::StridedIndexer; - using dpctl::tensor::offset_utils::ThreeOffsets_CombinedIndexer; + using dpnp::tensor::offset_utils::Strided1DIndexer; + using dpnp::tensor::offset_utils::StridedIndexer; + using dpnp::tensor::offset_utils::ThreeOffsets_CombinedIndexer; using BatchDimsIndexerT = ThreeOffsets_CombinedIndexer; @@ -2460,8 +2460,8 @@ sycl::event {gemm_ev}); sycl::event cleanup_host_task_event = - dpctl::tensor::alloc_utils::async_smart_free(exec_q, {red_ev}, - tmp_owner); + dpnp::tensor::alloc_utils::async_smart_free(exec_q, {red_ev}, + tmp_owner); return cleanup_host_task_event; } @@ -2595,7 +2595,7 @@ sycl::event // temp memory if only one group is needed if (k <= wi_delta_k) { using OuterInnerDimsIndexerT = - dpctl::tensor::offset_utils::StridedIndexer; + dpnp::tensor::offset_utils::StridedIndexer; const OuterInnerDimsIndexerT lhs_indexer( inner_nd + lhs_outer_nd, 0, lhs_outer_inner_shapes_strides); const OuterInnerDimsIndexerT rhs_indexer( @@ -2603,7 +2603,7 @@ sycl::event const OuterInnerDimsIndexerT res_indexer(res_outer_nd, 0, res_outer_shapes_strides); using BatchDimsIndexerT = - dpctl::tensor::offset_utils::ThreeOffsets_StridedIndexer; + dpnp::tensor::offset_utils::ThreeOffsets_StridedIndexer; const BatchDimsIndexerT batch_indexer( batch_nd, lhs_batch_offset, rhs_batch_offset, res_batch_offset, batch_shape_strides); @@ -2643,23 +2643,23 @@ sycl::event if (reduction_nelems <= preferred_reductions_per_wi * max_wg) { auto tmp_owner = - dpctl::tensor::alloc_utils::smart_malloc_device( + dpnp::tensor::alloc_utils::smart_malloc_device( iter_nelems * reduction_nelems, exec_q); resTy *tmp = tmp_owner.get(); using OuterInnerDimsIndexerT = - dpctl::tensor::offset_utils::StridedIndexer; - using TmpIndexerT = dpctl::tensor::offset_utils::NoOpIndexer; + dpnp::tensor::offset_utils::StridedIndexer; + using TmpIndexerT = dpnp::tensor::offset_utils::NoOpIndexer; const OuterInnerDimsIndexerT lhs_indexer( inner_nd + lhs_outer_nd, 0, lhs_outer_inner_shapes_strides); const OuterInnerDimsIndexerT rhs_indexer( inner_nd + rhs_outer_nd, 0, rhs_outer_inner_shapes_strides); static constexpr TmpIndexerT res_indexer{}; - using dpctl::tensor::offset_utils::Strided1DIndexer; - using dpctl::tensor::offset_utils::StridedIndexer; - using dpctl::tensor::offset_utils::ThreeOffsets_CombinedIndexer; - using dpctl::tensor::offset_utils::UnpackedStridedIndexer; + using dpnp::tensor::offset_utils::Strided1DIndexer; + using dpnp::tensor::offset_utils::StridedIndexer; + using dpnp::tensor::offset_utils::ThreeOffsets_CombinedIndexer; + using dpnp::tensor::offset_utils::UnpackedStridedIndexer; using BatchDimsIndexerT = ThreeOffsets_CombinedIndexer< StridedIndexer, UnpackedStridedIndexer, Strided1DIndexer>; const StridedIndexer lhs_batch_indexer(batch_nd, lhs_batch_offset, @@ -2688,8 +2688,8 @@ sycl::event {gemm_ev}); sycl::event cleanup_host_task_event = - dpctl::tensor::alloc_utils::async_smart_free(exec_q, {red_ev}, - tmp_owner); + dpnp::tensor::alloc_utils::async_smart_free(exec_q, {red_ev}, + tmp_owner); return cleanup_host_task_event; } @@ -2701,7 +2701,7 @@ sycl::event /* first reduction temp */ reduction_groups); auto tmp_owner = - dpctl::tensor::alloc_utils::smart_malloc_device( + dpnp::tensor::alloc_utils::smart_malloc_device( tmp_alloc_size, exec_q); resTy *partially_reduced_tmp = tmp_owner.get(); @@ -2710,8 +2710,8 @@ sycl::event ; using OuterInnerDimsIndexerT = - dpctl::tensor::offset_utils::StridedIndexer; - using TmpIndexerT = dpctl::tensor::offset_utils::NoOpIndexer; + dpnp::tensor::offset_utils::StridedIndexer; + using TmpIndexerT = dpnp::tensor::offset_utils::NoOpIndexer; const OuterInnerDimsIndexerT lhs_indexer( inner_nd + lhs_outer_nd, 0, lhs_outer_inner_shapes_strides); @@ -2719,10 +2719,10 @@ sycl::event inner_nd + rhs_outer_nd, 0, rhs_outer_inner_shapes_strides); static constexpr TmpIndexerT res_indexer{}; - using dpctl::tensor::offset_utils::Strided1DIndexer; - using dpctl::tensor::offset_utils::StridedIndexer; - using dpctl::tensor::offset_utils::ThreeOffsets_CombinedIndexer; - using dpctl::tensor::offset_utils::UnpackedStridedIndexer; + using dpnp::tensor::offset_utils::Strided1DIndexer; + using dpnp::tensor::offset_utils::StridedIndexer; + using dpnp::tensor::offset_utils::ThreeOffsets_CombinedIndexer; + using dpnp::tensor::offset_utils::UnpackedStridedIndexer; using BatchDimsIndexerT = ThreeOffsets_CombinedIndexer< StridedIndexer, UnpackedStridedIndexer, Strided1DIndexer>; @@ -2752,8 +2752,8 @@ sycl::event {gemm_ev}); sycl::event cleanup_host_task_event = - dpctl::tensor::alloc_utils::async_smart_free(exec_q, {red_ev}, - tmp_owner); + dpnp::tensor::alloc_utils::async_smart_free(exec_q, {red_ev}, + tmp_owner); return cleanup_host_task_event; } @@ -2785,7 +2785,7 @@ sycl::event gemm_batch_nm_impl(sycl::queue &exec_q, std::vector const &depends = {}) { - using OuterInnerDimsIndexerT = dpctl::tensor::offset_utils::StridedIndexer; + using OuterInnerDimsIndexerT = dpnp::tensor::offset_utils::StridedIndexer; const OuterInnerDimsIndexerT lhs_indexer(inner_nd + lhs_outer_nd, 0, lhs_outer_inner_shapes_strides); const OuterInnerDimsIndexerT rhs_indexer(inner_nd + rhs_outer_nd, 0, @@ -2794,7 +2794,7 @@ sycl::event gemm_batch_nm_impl(sycl::queue &exec_q, res_outer_shapes_strides); using BatchDimsIndexerT = - dpctl::tensor::offset_utils::ThreeOffsets_StridedIndexer; + dpnp::tensor::offset_utils::ThreeOffsets_StridedIndexer; const BatchDimsIndexerT batch_indexer(batch_nd, lhs_batch_offset, rhs_batch_offset, res_batch_offset, batch_shape_strides); @@ -2857,7 +2857,7 @@ sycl::event gemm_batch_tree_impl(sycl::queue &exec_q, exec_q.submit([&](sycl::handler &cgh) { cgh.depends_on(depends); - using IndexerT = dpctl::tensor::offset_utils::StridedIndexer; + using IndexerT = dpnp::tensor::offset_utils::StridedIndexer; const IndexerT res_indexer(batch_nd + res_outer_nd, res_batch_offset, res_shape_strides); using InitKernelName = @@ -2872,7 +2872,7 @@ sycl::event gemm_batch_tree_impl(sycl::queue &exec_q, } if (max_nm < 64) { - using dpctl::tensor::type_utils::is_complex; + using dpnp::tensor::type_utils::is_complex; if constexpr (!is_complex::value) { if (m < 4) { static constexpr std::uint32_t m_groups_one = 1; @@ -2909,7 +2909,7 @@ sycl::event gemm_batch_tree_impl(sycl::queue &exec_q, } } else { // m > 1, n > k or m > k - using dpctl::tensor::type_utils::is_complex; + using dpnp::tensor::type_utils::is_complex; if constexpr (!is_complex::value) { static constexpr std::uint32_t m_groups_four = 4; return gemm_batch_tree_nm_impl( @@ -2961,18 +2961,18 @@ sycl::event ); if (k <= (delta_k * n_wi)) { - using OuterInnerDimsIndexerT = dpctl::tensor::offset_utils::NoOpIndexer; + using OuterInnerDimsIndexerT = dpnp::tensor::offset_utils::NoOpIndexer; static constexpr OuterInnerDimsIndexerT lhs_indexer{}; static constexpr OuterInnerDimsIndexerT rhs_indexer{}; static constexpr OuterInnerDimsIndexerT res_indexer{}; - using dpctl::tensor::offset_utils::Strided1DIndexer; - using dpctl::tensor::offset_utils::ThreeOffsets_CombinedIndexer; + using dpnp::tensor::offset_utils::Strided1DIndexer; + using dpnp::tensor::offset_utils::ThreeOffsets_CombinedIndexer; using BatchDimsIndexerT = ThreeOffsets_CombinedIndexer; - using dpctl::tensor::offset_utils::Strided1DIndexer; + using dpnp::tensor::offset_utils::Strided1DIndexer; const BatchDimsIndexerT batch_indexer( Strided1DIndexer{/* size */ batch_nelems, /* step */ n * k}, @@ -3018,17 +3018,17 @@ sycl::event if (reduction_nelems <= preferred_reductions_per_wi * max_wg) { auto tmp_owner = - dpctl::tensor::alloc_utils::smart_malloc_device( + dpnp::tensor::alloc_utils::smart_malloc_device( iter_nelems * reduction_nelems, exec_q); resTy *tmp = tmp_owner.get(); using OuterInnerDimsIndexerT = - dpctl::tensor::offset_utils::NoOpIndexer; + dpnp::tensor::offset_utils::NoOpIndexer; static constexpr OuterInnerDimsIndexerT lhs_indexer{}; static constexpr OuterInnerDimsIndexerT rhs_indexer{}; static constexpr OuterInnerDimsIndexerT tmp_indexer{}; - using dpctl::tensor::offset_utils::Strided1DIndexer; - using dpctl::tensor::offset_utils::ThreeOffsets_CombinedIndexer; + using dpnp::tensor::offset_utils::Strided1DIndexer; + using dpnp::tensor::offset_utils::ThreeOffsets_CombinedIndexer; using BatchDimsIndexerT = ThreeOffsets_CombinedIndexer; @@ -3055,8 +3055,8 @@ sycl::event preferred_reductions_per_wi, reductions_per_wi, {gemm_ev}); sycl::event cleanup_host_task_event = - dpctl::tensor::alloc_utils::async_smart_free(exec_q, {red_ev}, - tmp_owner); + dpnp::tensor::alloc_utils::async_smart_free(exec_q, {red_ev}, + tmp_owner); return cleanup_host_task_event; } @@ -3068,7 +3068,7 @@ sycl::event /* first reduction temp */ reduction_groups); auto tmp_owner = - dpctl::tensor::alloc_utils::smart_malloc_device( + dpnp::tensor::alloc_utils::smart_malloc_device( tmp_alloc_size, exec_q); resTy *partially_reduced_tmp = tmp_owner.get(); @@ -3076,12 +3076,12 @@ sycl::event partially_reduced_tmp + reduction_nelems * iter_nelems; using OuterInnerDimsIndexerT = - dpctl::tensor::offset_utils::NoOpIndexer; + dpnp::tensor::offset_utils::NoOpIndexer; static constexpr OuterInnerDimsIndexerT lhs_indexer{}; static constexpr OuterInnerDimsIndexerT rhs_indexer{}; static constexpr OuterInnerDimsIndexerT tmp_indexer{}; - using dpctl::tensor::offset_utils::Strided1DIndexer; - using dpctl::tensor::offset_utils::ThreeOffsets_CombinedIndexer; + using dpnp::tensor::offset_utils::Strided1DIndexer; + using dpnp::tensor::offset_utils::ThreeOffsets_CombinedIndexer; using BatchDimsIndexerT = ThreeOffsets_CombinedIndexer; @@ -3109,8 +3109,8 @@ sycl::event reductions_per_wi, {gemm_ev}); sycl::event cleanup_host_task_event = - dpctl::tensor::alloc_utils::async_smart_free(exec_q, {red_ev}, - tmp_owner); + dpnp::tensor::alloc_utils::async_smart_free(exec_q, {red_ev}, + tmp_owner); return cleanup_host_task_event; } @@ -3150,13 +3150,13 @@ sycl::event // items in a column, so no need for allocating // temp memory if only one group is needed if (k <= wi_delta_k) { - using OuterInnerDimsIndexerT = dpctl::tensor::offset_utils::NoOpIndexer; + using OuterInnerDimsIndexerT = dpnp::tensor::offset_utils::NoOpIndexer; static constexpr OuterInnerDimsIndexerT lhs_indexer{}; static constexpr OuterInnerDimsIndexerT rhs_indexer{}; static constexpr OuterInnerDimsIndexerT res_indexer{}; - using dpctl::tensor::offset_utils::Strided1DIndexer; - using dpctl::tensor::offset_utils::ThreeOffsets_CombinedIndexer; + using dpnp::tensor::offset_utils::Strided1DIndexer; + using dpnp::tensor::offset_utils::ThreeOffsets_CombinedIndexer; using BatchDimsIndexerT = ThreeOffsets_CombinedIndexer; @@ -3204,19 +3204,19 @@ sycl::event if (reduction_nelems <= preferred_reductions_per_wi * max_wg) { auto tmp_owner = - dpctl::tensor::alloc_utils::smart_malloc_device( + dpnp::tensor::alloc_utils::smart_malloc_device( iter_nelems * reduction_nelems, exec_q); resTy *tmp = tmp_owner.get(); using OuterInnerDimsIndexerT = - dpctl::tensor::offset_utils::NoOpIndexer; + dpnp::tensor::offset_utils::NoOpIndexer; static constexpr OuterInnerDimsIndexerT lhs_indexer{}; static constexpr OuterInnerDimsIndexerT rhs_indexer{}; static constexpr OuterInnerDimsIndexerT tmp_indexer{}; - using dpctl::tensor::offset_utils::Strided1DIndexer; - using dpctl::tensor::offset_utils::ThreeOffsets_CombinedIndexer; + using dpnp::tensor::offset_utils::Strided1DIndexer; + using dpnp::tensor::offset_utils::ThreeOffsets_CombinedIndexer; using BatchDimsIndexerT = ThreeOffsets_CombinedIndexer; @@ -3243,8 +3243,8 @@ sycl::event preferred_reductions_per_wi, reductions_per_wi, {gemm_ev}); sycl::event cleanup_host_task_event = - dpctl::tensor::alloc_utils::async_smart_free(exec_q, {red_ev}, - tmp_owner); + dpnp::tensor::alloc_utils::async_smart_free(exec_q, {red_ev}, + tmp_owner); return cleanup_host_task_event; } @@ -3256,7 +3256,7 @@ sycl::event /* first reduction temp */ reduction_groups); auto tmp_owner = - dpctl::tensor::alloc_utils::smart_malloc_device( + dpnp::tensor::alloc_utils::smart_malloc_device( tmp_alloc_size, exec_q); resTy *partially_reduced_tmp = tmp_owner.get(); @@ -3264,13 +3264,13 @@ sycl::event partially_reduced_tmp + reduction_nelems * iter_nelems; using OuterInnerDimsIndexerT = - dpctl::tensor::offset_utils::NoOpIndexer; + dpnp::tensor::offset_utils::NoOpIndexer; static constexpr OuterInnerDimsIndexerT lhs_indexer{}; static constexpr OuterInnerDimsIndexerT rhs_indexer{}; static constexpr OuterInnerDimsIndexerT tmp_indexer{}; - using dpctl::tensor::offset_utils::Strided1DIndexer; - using dpctl::tensor::offset_utils::ThreeOffsets_CombinedIndexer; + using dpnp::tensor::offset_utils::Strided1DIndexer; + using dpnp::tensor::offset_utils::ThreeOffsets_CombinedIndexer; using BatchDimsIndexerT = ThreeOffsets_CombinedIndexer; @@ -3299,8 +3299,8 @@ sycl::event reductions_per_wi, {gemm_ev}); sycl::event cleanup_host_task_event = - dpctl::tensor::alloc_utils::async_smart_free(exec_q, {red_ev}, - tmp_owner); + dpnp::tensor::alloc_utils::async_smart_free(exec_q, {red_ev}, + tmp_owner); return cleanup_host_task_event; } @@ -3324,7 +3324,7 @@ sycl::event gemm_nm_impl(sycl::queue &exec_q, const ssize_t *res_shape_strides, std::vector const &depends = {}) { - using OuterInnerDimsIndexerT = dpctl::tensor::offset_utils::StridedIndexer; + using OuterInnerDimsIndexerT = dpnp::tensor::offset_utils::StridedIndexer; const OuterInnerDimsIndexerT lhs_indexer(inner_nd + lhs_outer_nd, 0, lhs_shape_strides); const OuterInnerDimsIndexerT rhs_indexer(inner_nd + rhs_outer_nd, 0, @@ -3333,7 +3333,7 @@ sycl::event gemm_nm_impl(sycl::queue &exec_q, res_shape_strides); using BatchDimsIndexerT = - dpctl::tensor::offset_utils::ThreeZeroOffsets_Indexer; + dpnp::tensor::offset_utils::ThreeZeroOffsets_Indexer; static constexpr BatchDimsIndexerT batch_indexer{}; static constexpr std::size_t single_batch_nelems = 1; @@ -3359,7 +3359,7 @@ sycl::event std::size_t m, std::vector const &depends = {}) { - using OuterInnerDimsIndexerT = dpctl::tensor::offset_utils::NoOpIndexer; + using OuterInnerDimsIndexerT = dpnp::tensor::offset_utils::NoOpIndexer; static constexpr OuterInnerDimsIndexerT lhs_indexer{}; static constexpr OuterInnerDimsIndexerT rhs_indexer{}; static constexpr OuterInnerDimsIndexerT res_indexer{}; @@ -3367,7 +3367,7 @@ sycl::event static constexpr std::size_t single_batch_nelems = 1; if (batch_nelems == single_batch_nelems) { using BatchDimsIndexerT = - dpctl::tensor::offset_utils::ThreeZeroOffsets_Indexer; + dpnp::tensor::offset_utils::ThreeZeroOffsets_Indexer; static constexpr BatchDimsIndexerT batch_indexer{}; sycl::event gemm_ev = gemm_detail::_gemm_batch_nm_impl< @@ -3379,13 +3379,13 @@ sycl::event return gemm_ev; } else { - using dpctl::tensor::offset_utils::Strided1DIndexer; - using dpctl::tensor::offset_utils::ThreeOffsets_CombinedIndexer; + using dpnp::tensor::offset_utils::Strided1DIndexer; + using dpnp::tensor::offset_utils::ThreeOffsets_CombinedIndexer; using BatchDimsIndexerT = ThreeOffsets_CombinedIndexer; - using dpctl::tensor::offset_utils::Strided1DIndexer; + using dpnp::tensor::offset_utils::Strided1DIndexer; const BatchDimsIndexerT batch_indexer( Strided1DIndexer{/* size */ batch_nelems, @@ -3444,7 +3444,7 @@ sycl::event } if (max_nm < 64) { - using dpctl::tensor::type_utils::is_complex; + using dpnp::tensor::type_utils::is_complex; if constexpr (!is_complex::value) { if (m < 4) { return gemm_batch_contig_tree_k_impl( @@ -3463,7 +3463,7 @@ sycl::event } } else { // m > 1, n > k or m > k - using dpctl::tensor::type_utils::is_complex; + using dpnp::tensor::type_utils::is_complex; if constexpr (!is_complex::value) { return gemm_batch_contig_tree_nm_impl( exec_q, lhs_tp, rhs_tp, res_tp, batch_nelems, n, k, m, depends); @@ -3525,12 +3525,12 @@ sycl::event gemm_tree_k_impl(sycl::queue &exec_q, delta_n // modified by reference ); - using BatchIndexerT = dpctl::tensor::offset_utils::ThreeZeroOffsets_Indexer; + using BatchIndexerT = dpnp::tensor::offset_utils::ThreeZeroOffsets_Indexer; static constexpr BatchIndexerT batch_indexer{}; static constexpr std::size_t single_batch_nelems = 1; - using OuterInnerDimsIndexerT = dpctl::tensor::offset_utils::StridedIndexer; + using OuterInnerDimsIndexerT = dpnp::tensor::offset_utils::StridedIndexer; const OuterInnerDimsIndexerT lhs_indexer(inner_nd + lhs_outer_nd, 0, lhs_outer_inner_shapes_strides); const OuterInnerDimsIndexerT rhs_indexer(inner_nd + rhs_outer_nd, 0, @@ -3578,11 +3578,11 @@ sycl::event gemm_tree_k_impl(sycl::queue &exec_q, if (reduction_nelems <= preferred_reductions_per_wi * max_wg) { auto tmp_owner = - dpctl::tensor::alloc_utils::smart_malloc_device( + dpnp::tensor::alloc_utils::smart_malloc_device( iter_nelems * reduction_nelems, exec_q); resTy *tmp = tmp_owner.get(); - using ResIndexerT = dpctl::tensor::offset_utils::NoOpIndexer; + using ResIndexerT = dpnp::tensor::offset_utils::NoOpIndexer; static constexpr ResIndexerT res_indexer{}; sycl::event gemm_ev = gemm_detail::_gemm_tree_k_step< @@ -3599,8 +3599,8 @@ sycl::event gemm_tree_k_impl(sycl::queue &exec_q, res_shapes_strides, {gemm_ev}); sycl::event cleanup_host_task_event = - dpctl::tensor::alloc_utils::async_smart_free(exec_q, {red_ev}, - tmp_owner); + dpnp::tensor::alloc_utils::async_smart_free(exec_q, {red_ev}, + tmp_owner); return cleanup_host_task_event; } else { @@ -3611,14 +3611,14 @@ sycl::event gemm_tree_k_impl(sycl::queue &exec_q, /* first reduction temp */ reduction_groups); auto tmp_owner = - dpctl::tensor::alloc_utils::smart_malloc_device( + dpnp::tensor::alloc_utils::smart_malloc_device( tmp_alloc_size, exec_q); resTy *partially_reduced_tmp = tmp_owner.get(); resTy *partially_reduced_tmp2 = partially_reduced_tmp + reduction_nelems * iter_nelems; - using ResIndexerT = dpctl::tensor::offset_utils::NoOpIndexer; + using ResIndexerT = dpnp::tensor::offset_utils::NoOpIndexer; static constexpr ResIndexerT res_indexer{}; sycl::event gemm_ev = gemm_detail::_gemm_tree_k_step< @@ -3636,8 +3636,8 @@ sycl::event gemm_tree_k_impl(sycl::queue &exec_q, res_nd, 0, res_shapes_strides, {gemm_ev}); sycl::event cleanup_host_task_event = - dpctl::tensor::alloc_utils::async_smart_free(exec_q, {red_ev}, - tmp_owner); + dpnp::tensor::alloc_utils::async_smart_free(exec_q, {red_ev}, + tmp_owner); return cleanup_host_task_event; } @@ -3678,12 +3678,12 @@ sycl::event gemm_tree_nm_impl(sycl::queue &exec_q, wg_delta_m // modified by reference ); - using BatchIndexerT = dpctl::tensor::offset_utils::ThreeZeroOffsets_Indexer; + using BatchIndexerT = dpnp::tensor::offset_utils::ThreeZeroOffsets_Indexer; static constexpr BatchIndexerT batch_indexer{}; static constexpr std::size_t single_batch_nelems = 1; - using OuterInnerDimsIndexerT = dpctl::tensor::offset_utils::StridedIndexer; + using OuterInnerDimsIndexerT = dpnp::tensor::offset_utils::StridedIndexer; const OuterInnerDimsIndexerT lhs_indexer(inner_nd + lhs_outer_nd, 0, lhs_outer_inner_shapes_strides); const OuterInnerDimsIndexerT rhs_indexer(inner_nd + rhs_outer_nd, 0, @@ -3730,11 +3730,11 @@ sycl::event gemm_tree_nm_impl(sycl::queue &exec_q, if (reduction_nelems <= preferred_reductions_per_wi * max_wg) { auto tmp_owner = - dpctl::tensor::alloc_utils::smart_malloc_device( + dpnp::tensor::alloc_utils::smart_malloc_device( iter_nelems * reduction_nelems, exec_q); resTy *tmp = tmp_owner.get(); - using ResIndexerT = dpctl::tensor::offset_utils::NoOpIndexer; + using ResIndexerT = dpnp::tensor::offset_utils::NoOpIndexer; static constexpr ResIndexerT res_indexer{}; sycl::event gemm_ev = gemm_detail::_gemm_tree_nm_step< @@ -3751,8 +3751,8 @@ sycl::event gemm_tree_nm_impl(sycl::queue &exec_q, res_shapes_strides, {gemm_ev}); sycl::event cleanup_host_task_event = - dpctl::tensor::alloc_utils::async_smart_free(exec_q, {red_ev}, - tmp_owner); + dpnp::tensor::alloc_utils::async_smart_free(exec_q, {red_ev}, + tmp_owner); return cleanup_host_task_event; } @@ -3763,14 +3763,14 @@ sycl::event gemm_tree_nm_impl(sycl::queue &exec_q, iter_nelems * (/* temp */ reduction_nelems + /* first reduction temp */ reduction_groups); auto tmp_owner = - dpctl::tensor::alloc_utils::smart_malloc_device( + dpnp::tensor::alloc_utils::smart_malloc_device( tmp_alloc_size, exec_q); resTy *partially_reduced_tmp = tmp_owner.get(); resTy *partially_reduced_tmp2 = partially_reduced_tmp + reduction_nelems * iter_nelems; - using ResIndexerT = dpctl::tensor::offset_utils::NoOpIndexer; + using ResIndexerT = dpnp::tensor::offset_utils::NoOpIndexer; static constexpr ResIndexerT res_indexer{}; sycl::event gemm_ev = gemm_detail::_gemm_tree_nm_step< @@ -3788,8 +3788,8 @@ sycl::event gemm_tree_nm_impl(sycl::queue &exec_q, res_nd, 0, res_shapes_strides, {gemm_ev}); sycl::event cleanup_host_task_event = - dpctl::tensor::alloc_utils::async_smart_free(exec_q, {red_ev}, - tmp_owner); + dpnp::tensor::alloc_utils::async_smart_free(exec_q, {red_ev}, + tmp_owner); return cleanup_host_task_event; } @@ -3836,7 +3836,7 @@ sycl::event gemm_tree_impl(sycl::queue &exec_q, exec_q.submit([&](sycl::handler &cgh) { cgh.depends_on(depends); - using IndexerT = dpctl::tensor::offset_utils::StridedIndexer; + using IndexerT = dpnp::tensor::offset_utils::StridedIndexer; const IndexerT res_indexer(res_nd, 0, res_shapes_strides); using InitKernelName = class gemm_tree_empty_krn; @@ -3850,7 +3850,7 @@ sycl::event gemm_tree_impl(sycl::queue &exec_q, } if (max_nm < 64) { - using dpctl::tensor::type_utils::is_complex; + using dpnp::tensor::type_utils::is_complex; if constexpr (!is_complex::value) { if (m < 4) { return gemm_tree_k_impl( @@ -3876,7 +3876,7 @@ sycl::event gemm_tree_impl(sycl::queue &exec_q, } } else { // m > 1, n > k or m > k - using dpctl::tensor::type_utils::is_complex; + using dpnp::tensor::type_utils::is_complex; if constexpr (!is_complex::value) { return gemm_tree_nm_impl( exec_q, lhs_tp, rhs_tp, res_tp, n, k, m, inner_nd, lhs_outer_nd, @@ -3919,12 +3919,12 @@ sycl::event gemm_contig_tree_k_impl(sycl::queue &exec_q, delta_n // modified by reference ); - using OuterInnerDimsIndexerT = dpctl::tensor::offset_utils::NoOpIndexer; + using OuterInnerDimsIndexerT = dpnp::tensor::offset_utils::NoOpIndexer; static constexpr OuterInnerDimsIndexerT lhs_indexer{}; static constexpr OuterInnerDimsIndexerT rhs_indexer{}; static constexpr OuterInnerDimsIndexerT res_indexer{}; - using BatchIndexerT = dpctl::tensor::offset_utils::ThreeZeroOffsets_Indexer; + using BatchIndexerT = dpnp::tensor::offset_utils::ThreeZeroOffsets_Indexer; static constexpr BatchIndexerT batch_indexer{}; static constexpr std::size_t single_batch_nelems = 1; @@ -3968,7 +3968,7 @@ sycl::event gemm_contig_tree_k_impl(sycl::queue &exec_q, if (reduction_nelems <= preferred_reductions_per_wi * max_wg) { auto tmp_owner = - dpctl::tensor::alloc_utils::smart_malloc_device( + dpnp::tensor::alloc_utils::smart_malloc_device( iter_nelems * reduction_nelems, exec_q); resTy *tmp = tmp_owner.get(); @@ -3986,8 +3986,8 @@ sycl::event gemm_contig_tree_k_impl(sycl::queue &exec_q, preferred_reductions_per_wi, reductions_per_wi, {gemm_ev}); sycl::event cleanup_host_task_event = - dpctl::tensor::alloc_utils::async_smart_free(exec_q, {red_ev}, - tmp_owner); + dpnp::tensor::alloc_utils::async_smart_free(exec_q, {red_ev}, + tmp_owner); return cleanup_host_task_event; } else { @@ -3997,7 +3997,7 @@ sycl::event gemm_contig_tree_k_impl(sycl::queue &exec_q, iter_nelems * (/* temp */ reduction_nelems + /* first reduction temp */ reduction_groups); auto tmp_owner = - dpctl::tensor::alloc_utils::smart_malloc_device( + dpnp::tensor::alloc_utils::smart_malloc_device( tmp_alloc_size, exec_q); resTy *partially_reduced_tmp = tmp_owner.get(); @@ -4021,8 +4021,8 @@ sycl::event gemm_contig_tree_k_impl(sycl::queue &exec_q, reductions_per_wi, {gemm_ev}); sycl::event cleanup_host_task_event = - dpctl::tensor::alloc_utils::async_smart_free(exec_q, {red_ev}, - tmp_owner); + dpnp::tensor::alloc_utils::async_smart_free(exec_q, {red_ev}, + tmp_owner); return cleanup_host_task_event; } @@ -4056,12 +4056,12 @@ sycl::event gemm_contig_tree_nm_impl(sycl::queue &exec_q, wg_delta_m // modified by reference ); - using OuterInnerDimsIndexerT = dpctl::tensor::offset_utils::NoOpIndexer; + using OuterInnerDimsIndexerT = dpnp::tensor::offset_utils::NoOpIndexer; static constexpr OuterInnerDimsIndexerT lhs_indexer{}; static constexpr OuterInnerDimsIndexerT rhs_indexer{}; static constexpr OuterInnerDimsIndexerT res_indexer{}; - using BatchIndexerT = dpctl::tensor::offset_utils::ThreeZeroOffsets_Indexer; + using BatchIndexerT = dpnp::tensor::offset_utils::ThreeZeroOffsets_Indexer; static constexpr BatchIndexerT batch_indexer{}; static constexpr std::size_t single_batch_nelems = 1; @@ -4106,7 +4106,7 @@ sycl::event gemm_contig_tree_nm_impl(sycl::queue &exec_q, if (reduction_nelems <= preferred_reductions_per_wi * max_wg) { auto tmp_owner = - dpctl::tensor::alloc_utils::smart_malloc_device( + dpnp::tensor::alloc_utils::smart_malloc_device( iter_nelems * reduction_nelems, exec_q); resTy *tmp = tmp_owner.get(); @@ -4125,8 +4125,8 @@ sycl::event gemm_contig_tree_nm_impl(sycl::queue &exec_q, preferred_reductions_per_wi, reductions_per_wi, {gemm_ev}); sycl::event cleanup_host_task_event = - dpctl::tensor::alloc_utils::async_smart_free(exec_q, {red_ev}, - tmp_owner); + dpnp::tensor::alloc_utils::async_smart_free(exec_q, {red_ev}, + tmp_owner); return cleanup_host_task_event; } else { @@ -4137,7 +4137,7 @@ sycl::event gemm_contig_tree_nm_impl(sycl::queue &exec_q, /* first reduction temp */ reduction_groups); auto tmp_owner = - dpctl::tensor::alloc_utils::smart_malloc_device( + dpnp::tensor::alloc_utils::smart_malloc_device( tmp_alloc_size, exec_q); resTy *partially_reduced_tmp = tmp_owner.get(); resTy *partially_reduced_tmp2 = @@ -4159,8 +4159,8 @@ sycl::event gemm_contig_tree_nm_impl(sycl::queue &exec_q, reductions_per_wi, {gemm_ev}); sycl::event cleanup_host_task_event = - dpctl::tensor::alloc_utils::async_smart_free(exec_q, {red_ev}, - tmp_owner); + dpnp::tensor::alloc_utils::async_smart_free(exec_q, {red_ev}, + tmp_owner); return cleanup_host_task_event; } @@ -4201,7 +4201,7 @@ sycl::event gemm_contig_tree_impl(sycl::queue &exec_q, } if (max_nm < 64) { - using dpctl::tensor::type_utils::is_complex; + using dpnp::tensor::type_utils::is_complex; if constexpr (!is_complex::value) { if (m < 4) { return gemm_contig_tree_k_impl( @@ -4218,7 +4218,7 @@ sycl::event gemm_contig_tree_impl(sycl::queue &exec_q, } } else { // m > 1, n > k or m > k - using dpctl::tensor::type_utils::is_complex; + using dpnp::tensor::type_utils::is_complex; if constexpr (!is_complex::value) { return gemm_contig_tree_nm_impl( exec_q, lhs_tp, rhs_tp, res_tp, n, k, m, depends); @@ -4230,4 +4230,4 @@ sycl::event gemm_contig_tree_impl(sycl::queue &exec_q, } } -} // namespace dpctl::tensor::kernels +} // namespace dpnp::tensor::kernels diff --git a/dpnp/tensor/libtensor/include/kernels/reductions.hpp b/dpnp/tensor/libtensor/include/kernels/reductions.hpp index 75df2c201968..42bea6f28126 100644 --- a/dpnp/tensor/libtensor/include/kernels/reductions.hpp +++ b/dpnp/tensor/libtensor/include/kernels/reductions.hpp @@ -46,18 +46,18 @@ #include -#include "dpctl_tensor_types.hpp" +#include "dpnp_tensor_types.hpp" #include "utils/math_utils.hpp" #include "utils/offset_utils.hpp" #include "utils/sycl_alloc_utils.hpp" #include "utils/sycl_utils.hpp" #include "utils/type_utils.hpp" -namespace dpctl::tensor::kernels +namespace dpnp::tensor::kernels { -using dpctl::tensor::ssize_t; -namespace su_ns = dpctl::tensor::sycl_utils; +using dpnp::tensor::ssize_t; +namespace su_ns = dpnp::tensor::sycl_utils; namespace reduction_detail { @@ -135,7 +135,7 @@ struct SequentialReduction const ssize_t inp_reduction_offset = inp_reduced_dims_indexer_(m); const ssize_t inp_offset = inp_iter_offset + inp_reduction_offset; - using dpctl::tensor::type_utils::convert_impl; + using dpnp::tensor::type_utils::convert_impl; outT val; if constexpr (su_ns::IsLogicalAnd::value || su_ns::IsLogicalOr::value) { @@ -225,7 +225,7 @@ struct ReductionOverGroupWithAtomicFunctor inp_reduced_dims_indexer_(arg_reduce_gid); auto inp_offset = inp_iter_offset + inp_reduction_offset; - using dpctl::tensor::type_utils::convert_impl; + using dpnp::tensor::type_utils::convert_impl; outT val; if constexpr (su_ns::IsLogicalAnd::value || su_ns::IsLogicalOr::value) { @@ -358,7 +358,7 @@ struct CustomReductionOverGroupWithAtomicFunctor inp_reduced_dims_indexer_(arg_reduce_gid); auto inp_offset = inp_iter_offset + inp_reduction_offset; - using dpctl::tensor::type_utils::convert_impl; + using dpnp::tensor::type_utils::convert_impl; outT val; if constexpr (su_ns::IsLogicalAnd::value || su_ns::IsLogicalOr::value) { @@ -479,7 +479,7 @@ struct ReductionOverGroupNoAtomicFunctor inp_reduced_dims_indexer_(arg_reduce_gid); auto inp_offset = inp_iter_offset + inp_reduction_offset; - using dpctl::tensor::type_utils::convert_impl; + using dpnp::tensor::type_utils::convert_impl; outT val; if constexpr (su_ns::IsLogicalAnd::value || su_ns::IsLogicalOr::value) { @@ -589,7 +589,7 @@ struct CustomReductionOverGroupNoAtomicFunctor inp_reduced_dims_indexer_(arg_reduce_gid); auto inp_offset = inp_iter_offset + inp_reduction_offset; - using dpctl::tensor::type_utils::convert_impl; + using dpnp::tensor::type_utils::convert_impl; outT val; if constexpr (std::is_same_v> || @@ -752,7 +752,7 @@ typedef sycl::event (*reduction_strided_impl_fn_ptr)( ssize_t, const std::vector &); -using dpctl::tensor::sycl_utils::choose_workgroup_size; +using dpnp::tensor::sycl_utils::choose_workgroup_size; template sycl::event reduction_over_group_with_atomics_strided_impl( @@ -784,8 +784,8 @@ sycl::event reduction_over_group_with_atomics_strided_impl( if (reduction_nelems < wg) { using InputOutputIterIndexerT = - dpctl::tensor::offset_utils::TwoOffsets_StridedIndexer; - using ReductionIndexerT = dpctl::tensor::offset_utils::StridedIndexer; + dpnp::tensor::offset_utils::TwoOffsets_StridedIndexer; + using ReductionIndexerT = dpnp::tensor::offset_utils::StridedIndexer; const InputOutputIterIndexerT in_out_iter_indexer{ iter_nd, iter_arg_offset, iter_res_offset, iter_shape_and_strides}; @@ -804,8 +804,7 @@ sycl::event reduction_over_group_with_atomics_strided_impl( } else { sycl::event res_init_ev = exec_q.submit([&](sycl::handler &cgh) { - using IndexerT = - dpctl::tensor::offset_utils::UnpackedStridedIndexer; + using IndexerT = dpnp::tensor::offset_utils::UnpackedStridedIndexer; const ssize_t *const &res_shape = iter_shape_and_strides; const ssize_t *const &res_strides = @@ -825,8 +824,8 @@ sycl::event reduction_over_group_with_atomics_strided_impl( }); using InputOutputIterIndexerT = - dpctl::tensor::offset_utils::TwoOffsets_StridedIndexer; - using ReductionIndexerT = dpctl::tensor::offset_utils::StridedIndexer; + dpnp::tensor::offset_utils::TwoOffsets_StridedIndexer; + using ReductionIndexerT = dpnp::tensor::offset_utils::StridedIndexer; const InputOutputIterIndexerT in_out_iter_indexer{ iter_nd, iter_arg_offset, iter_res_offset, iter_shape_and_strides}; @@ -895,10 +894,10 @@ sycl::event reduction_axis1_over_group_with_atomics_contig_impl( std::size_t wg = choose_workgroup_size<4>(reduction_nelems, sg_sizes); if (reduction_nelems < wg) { - using InputIterIndexerT = dpctl::tensor::offset_utils::Strided1DIndexer; - using NoOpIndexerT = dpctl::tensor::offset_utils::NoOpIndexer; + using InputIterIndexerT = dpnp::tensor::offset_utils::Strided1DIndexer; + using NoOpIndexerT = dpnp::tensor::offset_utils::NoOpIndexer; using InputOutputIterIndexerT = - dpctl::tensor::offset_utils::TwoOffsets_CombinedIndexer< + dpnp::tensor::offset_utils::TwoOffsets_CombinedIndexer< InputIterIndexerT, NoOpIndexerT>; using ReductionIndexerT = NoOpIndexerT; @@ -922,10 +921,10 @@ sycl::event reduction_axis1_over_group_with_atomics_contig_impl( sycl::event res_init_ev = exec_q.fill( res_tp, resTy(identity_val), iter_nelems, depends); - using NoOpIndexerT = dpctl::tensor::offset_utils::NoOpIndexer; - using RowsIndexerT = dpctl::tensor::offset_utils::Strided1DIndexer; + using NoOpIndexerT = dpnp::tensor::offset_utils::NoOpIndexer; + using RowsIndexerT = dpnp::tensor::offset_utils::Strided1DIndexer; using InputOutputIterIndexerT = - dpctl::tensor::offset_utils::TwoOffsets_CombinedIndexer< + dpnp::tensor::offset_utils::TwoOffsets_CombinedIndexer< RowsIndexerT, NoOpIndexerT>; using ReductionIndexerT = NoOpIndexerT; @@ -985,11 +984,11 @@ sycl::event reduction_axis0_over_group_with_atomics_contig_impl( std::size_t wg = choose_workgroup_size<4>(reduction_nelems, sg_sizes); if (reduction_nelems < wg) { - using NoOpIndexerT = dpctl::tensor::offset_utils::NoOpIndexer; + using NoOpIndexerT = dpnp::tensor::offset_utils::NoOpIndexer; using InputOutputIterIndexerT = - dpctl::tensor::offset_utils::TwoOffsets_CombinedIndexer< + dpnp::tensor::offset_utils::TwoOffsets_CombinedIndexer< NoOpIndexerT, NoOpIndexerT>; - using ReductionIndexerT = dpctl::tensor::offset_utils::Strided1DIndexer; + using ReductionIndexerT = dpnp::tensor::offset_utils::Strided1DIndexer; const InputOutputIterIndexerT in_out_iter_indexer{NoOpIndexerT{}, NoOpIndexerT{}}; @@ -1010,10 +1009,10 @@ sycl::event reduction_axis0_over_group_with_atomics_contig_impl( sycl::event res_init_ev = exec_q.fill( res_tp, resTy(identity_val), iter_nelems, depends); - using NoOpIndexerT = dpctl::tensor::offset_utils::NoOpIndexer; - using ColsIndexerT = dpctl::tensor::offset_utils::Strided1DIndexer; + using NoOpIndexerT = dpnp::tensor::offset_utils::NoOpIndexer; + using ColsIndexerT = dpnp::tensor::offset_utils::Strided1DIndexer; using InputOutputIterIndexerT = - dpctl::tensor::offset_utils::TwoOffsets_CombinedIndexer< + dpnp::tensor::offset_utils::TwoOffsets_CombinedIndexer< NoOpIndexerT, NoOpIndexerT>; using ReductionIndexerT = ColsIndexerT; @@ -1161,8 +1160,7 @@ sycl::event reduction_over_group_temps_strided_impl( if (reduction_nelems == 0) { sycl::event res_init_ev = exec_q.submit([&](sycl::handler &cgh) { - using IndexerT = - dpctl::tensor::offset_utils::UnpackedStridedIndexer; + using IndexerT = dpnp::tensor::offset_utils::UnpackedStridedIndexer; const ssize_t *const &res_shape = iter_shape_and_strides; const ssize_t *const &res_strides = @@ -1190,8 +1188,8 @@ sycl::event reduction_over_group_temps_strided_impl( if (reduction_nelems < wg) { using InputOutputIterIndexerT = - dpctl::tensor::offset_utils::TwoOffsets_StridedIndexer; - using ReductionIndexerT = dpctl::tensor::offset_utils::StridedIndexer; + dpnp::tensor::offset_utils::TwoOffsets_StridedIndexer; + using ReductionIndexerT = dpnp::tensor::offset_utils::StridedIndexer; const InputOutputIterIndexerT in_out_iter_indexer{ iter_nd, iter_arg_offset, iter_res_offset, iter_shape_and_strides}; @@ -1219,8 +1217,8 @@ sycl::event reduction_over_group_temps_strided_impl( // can output directly to res using InputOutputIterIndexerT = - dpctl::tensor::offset_utils::TwoOffsets_StridedIndexer; - using ReductionIndexerT = dpctl::tensor::offset_utils::StridedIndexer; + dpnp::tensor::offset_utils::TwoOffsets_StridedIndexer; + using ReductionIndexerT = dpnp::tensor::offset_utils::StridedIndexer; const InputOutputIterIndexerT in_out_iter_indexer{ iter_nd, iter_arg_offset, iter_res_offset, iter_shape_and_strides}; @@ -1261,7 +1259,7 @@ sycl::event reduction_over_group_temps_strided_impl( const std::size_t tmp_alloc_size = iter_nelems * (reduction_groups + second_iter_reduction_groups_); - auto tmp_owner = dpctl::tensor::alloc_utils::smart_malloc_device( + auto tmp_owner = dpnp::tensor::alloc_utils::smart_malloc_device( tmp_alloc_size, exec_q); resTy *partially_reduced_tmp = tmp_owner.get(); @@ -1271,13 +1269,13 @@ sycl::event reduction_over_group_temps_strided_impl( sycl::event first_reduction_ev; { - using InputIndexerT = dpctl::tensor::offset_utils::StridedIndexer; - using ResIndexerT = dpctl::tensor::offset_utils::NoOpIndexer; + using InputIndexerT = dpnp::tensor::offset_utils::StridedIndexer; + using ResIndexerT = dpnp::tensor::offset_utils::NoOpIndexer; using InputOutputIterIndexerT = - dpctl::tensor::offset_utils::TwoOffsets_CombinedIndexer< + dpnp::tensor::offset_utils::TwoOffsets_CombinedIndexer< InputIndexerT, ResIndexerT>; using ReductionIndexerT = - dpctl::tensor::offset_utils::StridedIndexer; + dpnp::tensor::offset_utils::StridedIndexer; // Only 2*iter_nd entries describing shape and strides of // iterated dimensions of input array from @@ -1319,13 +1317,13 @@ sycl::event reduction_over_group_temps_strided_impl( sycl::event partial_reduction_ev; { using InputIndexerT = - dpctl::tensor::offset_utils::Strided1DIndexer; - using ResIndexerT = dpctl::tensor::offset_utils::NoOpIndexer; + dpnp::tensor::offset_utils::Strided1DIndexer; + using ResIndexerT = dpnp::tensor::offset_utils::NoOpIndexer; using InputOutputIterIndexerT = - dpctl::tensor::offset_utils::TwoOffsets_CombinedIndexer< + dpnp::tensor::offset_utils::TwoOffsets_CombinedIndexer< InputIndexerT, ResIndexerT>; using ReductionIndexerT = - dpctl::tensor::offset_utils::NoOpIndexer; + dpnp::tensor::offset_utils::NoOpIndexer; const InputIndexerT inp_indexer{/* size */ iter_nelems, /* step */ reduction_groups_}; @@ -1350,12 +1348,12 @@ sycl::event reduction_over_group_temps_strided_impl( } // final reduction to res - using InputIndexerT = dpctl::tensor::offset_utils::Strided1DIndexer; - using ResIndexerT = dpctl::tensor::offset_utils::UnpackedStridedIndexer; + using InputIndexerT = dpnp::tensor::offset_utils::Strided1DIndexer; + using ResIndexerT = dpnp::tensor::offset_utils::UnpackedStridedIndexer; using InputOutputIterIndexerT = - dpctl::tensor::offset_utils::TwoOffsets_CombinedIndexer< + dpnp::tensor::offset_utils::TwoOffsets_CombinedIndexer< InputIndexerT, ResIndexerT>; - using ReductionIndexerT = dpctl::tensor::offset_utils::NoOpIndexer; + using ReductionIndexerT = dpnp::tensor::offset_utils::NoOpIndexer; const InputIndexerT inp_indexer{/* size */ iter_nelems, /* step */ remaining_reduction_nelems}; @@ -1385,7 +1383,7 @@ sycl::event reduction_over_group_temps_strided_impl( in_out_iter_indexer, reduction_indexer, {dependent_ev}); sycl::event cleanup_host_task_event = - dpctl::tensor::alloc_utils::async_smart_free( + dpnp::tensor::alloc_utils::async_smart_free( exec_q, {final_reduction_ev}, tmp_owner); // FIXME: do not return host-task event @@ -1428,10 +1426,10 @@ sycl::event reduction_axis1_over_group_temps_contig_impl( std::size_t wg = choose_workgroup_size<4>(reduction_nelems, sg_sizes); if (reduction_nelems < wg) { - using InputIterIndexerT = dpctl::tensor::offset_utils::Strided1DIndexer; - using NoOpIndexerT = dpctl::tensor::offset_utils::NoOpIndexer; + using InputIterIndexerT = dpnp::tensor::offset_utils::Strided1DIndexer; + using NoOpIndexerT = dpnp::tensor::offset_utils::NoOpIndexer; using InputOutputIterIndexerT = - dpctl::tensor::offset_utils::TwoOffsets_CombinedIndexer< + dpnp::tensor::offset_utils::TwoOffsets_CombinedIndexer< InputIterIndexerT, NoOpIndexerT>; using ReductionIndexerT = NoOpIndexerT; @@ -1461,10 +1459,10 @@ sycl::event reduction_axis1_over_group_temps_contig_impl( // Perform reduction using one 1 work-group per iteration, // can output directly to res - using InputIterIndexerT = dpctl::tensor::offset_utils::Strided1DIndexer; - using NoOpIndexerT = dpctl::tensor::offset_utils::NoOpIndexer; + using InputIterIndexerT = dpnp::tensor::offset_utils::Strided1DIndexer; + using NoOpIndexerT = dpnp::tensor::offset_utils::NoOpIndexer; using InputOutputIterIndexerT = - dpctl::tensor::offset_utils::TwoOffsets_CombinedIndexer< + dpnp::tensor::offset_utils::TwoOffsets_CombinedIndexer< InputIterIndexerT, NoOpIndexerT>; using ReductionIndexerT = NoOpIndexerT; @@ -1508,7 +1506,7 @@ sycl::event reduction_axis1_over_group_temps_contig_impl( const std::size_t tmp_alloc_size = iter_nelems * (reduction_groups + second_iter_reduction_groups_); - auto tmp_owner = dpctl::tensor::alloc_utils::smart_malloc_device( + auto tmp_owner = dpnp::tensor::alloc_utils::smart_malloc_device( tmp_alloc_size, exec_q); resTy *partially_reduced_tmp = tmp_owner.get(); resTy *partially_reduced_tmp2 = @@ -1516,10 +1514,10 @@ sycl::event reduction_axis1_over_group_temps_contig_impl( sycl::event first_reduction_ev; { - using NoOpIndexerT = dpctl::tensor::offset_utils::NoOpIndexer; - using RowsIndexerT = dpctl::tensor::offset_utils::Strided1DIndexer; + using NoOpIndexerT = dpnp::tensor::offset_utils::NoOpIndexer; + using RowsIndexerT = dpnp::tensor::offset_utils::Strided1DIndexer; using InputOutputIterIndexerT = - dpctl::tensor::offset_utils::TwoOffsets_CombinedIndexer< + dpnp::tensor::offset_utils::TwoOffsets_CombinedIndexer< RowsIndexerT, NoOpIndexerT>; using ReductionIndexerT = NoOpIndexerT; @@ -1554,12 +1552,12 @@ sycl::event reduction_axis1_over_group_temps_contig_impl( assert(reduction_groups_ > 1); // keep reducing - using InputIndexerT = dpctl::tensor::offset_utils::Strided1DIndexer; - using ResIndexerT = dpctl::tensor::offset_utils::NoOpIndexer; + using InputIndexerT = dpnp::tensor::offset_utils::Strided1DIndexer; + using ResIndexerT = dpnp::tensor::offset_utils::NoOpIndexer; using InputOutputIterIndexerT = - dpctl::tensor::offset_utils::TwoOffsets_CombinedIndexer< + dpnp::tensor::offset_utils::TwoOffsets_CombinedIndexer< InputIndexerT, ResIndexerT>; - using ReductionIndexerT = dpctl::tensor::offset_utils::NoOpIndexer; + using ReductionIndexerT = dpnp::tensor::offset_utils::NoOpIndexer; const InputIndexerT inp_indexer{/* size */ iter_nelems, /* step */ reduction_groups_}; @@ -1583,12 +1581,12 @@ sycl::event reduction_axis1_over_group_temps_contig_impl( } // final reduction to res - using InputIndexerT = dpctl::tensor::offset_utils::Strided1DIndexer; - using ResIndexerT = dpctl::tensor::offset_utils::NoOpIndexer; + using InputIndexerT = dpnp::tensor::offset_utils::Strided1DIndexer; + using ResIndexerT = dpnp::tensor::offset_utils::NoOpIndexer; using InputOutputIterIndexerT = - dpctl::tensor::offset_utils::TwoOffsets_CombinedIndexer< + dpnp::tensor::offset_utils::TwoOffsets_CombinedIndexer< InputIndexerT, ResIndexerT>; - using ReductionIndexerT = dpctl::tensor::offset_utils::NoOpIndexer; + using ReductionIndexerT = dpnp::tensor::offset_utils::NoOpIndexer; const InputIndexerT inp_indexer{/* size */ iter_nelems, /* step */ remaining_reduction_nelems}; @@ -1615,7 +1613,7 @@ sycl::event reduction_axis1_over_group_temps_contig_impl( in_out_iter_indexer, reduction_indexer, {dependent_ev}); sycl::event cleanup_host_task_event = - dpctl::tensor::alloc_utils::async_smart_free( + dpnp::tensor::alloc_utils::async_smart_free( exec_q, {final_reduction_ev}, tmp_owner); // FIXME: do not return host-task event @@ -1658,11 +1656,11 @@ sycl::event reduction_axis0_over_group_temps_contig_impl( std::size_t wg = choose_workgroup_size<4>(reduction_nelems, sg_sizes); if (reduction_nelems < wg) { - using NoOpIndexerT = dpctl::tensor::offset_utils::NoOpIndexer; + using NoOpIndexerT = dpnp::tensor::offset_utils::NoOpIndexer; using InputOutputIterIndexerT = - dpctl::tensor::offset_utils::TwoOffsets_CombinedIndexer< + dpnp::tensor::offset_utils::TwoOffsets_CombinedIndexer< NoOpIndexerT, NoOpIndexerT>; - using ReductionIndexerT = dpctl::tensor::offset_utils::Strided1DIndexer; + using ReductionIndexerT = dpnp::tensor::offset_utils::Strided1DIndexer; const InputOutputIterIndexerT in_out_iter_indexer{NoOpIndexerT{}, NoOpIndexerT{}}; @@ -1689,10 +1687,10 @@ sycl::event reduction_axis0_over_group_temps_contig_impl( // Perform reduction using one 1 work-group per iteration, // can output directly to res - using NoOpIndexerT = dpctl::tensor::offset_utils::NoOpIndexer; - using ColsIndexerT = dpctl::tensor::offset_utils::Strided1DIndexer; + using NoOpIndexerT = dpnp::tensor::offset_utils::NoOpIndexer; + using ColsIndexerT = dpnp::tensor::offset_utils::Strided1DIndexer; using InputOutputIterIndexerT = - dpctl::tensor::offset_utils::TwoOffsets_CombinedIndexer< + dpnp::tensor::offset_utils::TwoOffsets_CombinedIndexer< NoOpIndexerT, NoOpIndexerT>; using ReductionIndexerT = ColsIndexerT; @@ -1738,7 +1736,7 @@ sycl::event reduction_axis0_over_group_temps_contig_impl( const std::size_t tmp_alloc_size = iter_nelems * (reduction_groups + second_iter_reduction_groups_); - auto tmp_owner = dpctl::tensor::alloc_utils::smart_malloc_device( + auto tmp_owner = dpnp::tensor::alloc_utils::smart_malloc_device( tmp_alloc_size, exec_q); resTy *partially_reduced_tmp = tmp_owner.get(); @@ -1747,10 +1745,10 @@ sycl::event reduction_axis0_over_group_temps_contig_impl( sycl::event first_reduction_ev; { - using NoOpIndexerT = dpctl::tensor::offset_utils::NoOpIndexer; - using ColsIndexerT = dpctl::tensor::offset_utils::Strided1DIndexer; + using NoOpIndexerT = dpnp::tensor::offset_utils::NoOpIndexer; + using ColsIndexerT = dpnp::tensor::offset_utils::Strided1DIndexer; using InputOutputIterIndexerT = - dpctl::tensor::offset_utils::TwoOffsets_CombinedIndexer< + dpnp::tensor::offset_utils::TwoOffsets_CombinedIndexer< NoOpIndexerT, NoOpIndexerT>; using ReductionIndexerT = ColsIndexerT; @@ -1786,12 +1784,12 @@ sycl::event reduction_axis0_over_group_temps_contig_impl( assert(reduction_groups_ > 1); // keep reducing - using InputIndexerT = dpctl::tensor::offset_utils::Strided1DIndexer; - using ResIndexerT = dpctl::tensor::offset_utils::NoOpIndexer; + using InputIndexerT = dpnp::tensor::offset_utils::Strided1DIndexer; + using ResIndexerT = dpnp::tensor::offset_utils::NoOpIndexer; using InputOutputIterIndexerT = - dpctl::tensor::offset_utils::TwoOffsets_CombinedIndexer< + dpnp::tensor::offset_utils::TwoOffsets_CombinedIndexer< InputIndexerT, ResIndexerT>; - using ReductionIndexerT = dpctl::tensor::offset_utils::NoOpIndexer; + using ReductionIndexerT = dpnp::tensor::offset_utils::NoOpIndexer; const InputIndexerT inp_indexer{/* size */ iter_nelems, /* step */ reduction_groups_}; @@ -1815,12 +1813,12 @@ sycl::event reduction_axis0_over_group_temps_contig_impl( } // final reduction to res - using InputIndexerT = dpctl::tensor::offset_utils::Strided1DIndexer; - using ResIndexerT = dpctl::tensor::offset_utils::NoOpIndexer; + using InputIndexerT = dpnp::tensor::offset_utils::Strided1DIndexer; + using ResIndexerT = dpnp::tensor::offset_utils::NoOpIndexer; using InputOutputIterIndexerT = - dpctl::tensor::offset_utils::TwoOffsets_CombinedIndexer< + dpnp::tensor::offset_utils::TwoOffsets_CombinedIndexer< InputIndexerT, ResIndexerT>; - using ReductionIndexerT = dpctl::tensor::offset_utils::NoOpIndexer; + using ReductionIndexerT = dpnp::tensor::offset_utils::NoOpIndexer; const InputIndexerT inp_indexer{/* size */ iter_nelems, /* step */ remaining_reduction_nelems}; @@ -1847,7 +1845,7 @@ sycl::event reduction_axis0_over_group_temps_contig_impl( in_out_iter_indexer, reduction_indexer, {dependent_ev}); sycl::event cleanup_host_task_event = - dpctl::tensor::alloc_utils::async_smart_free( + dpnp::tensor::alloc_utils::async_smart_free( exec_q, {final_reduction_ev}, tmp_owner); // FIXME: do not return host-task event @@ -1921,9 +1919,9 @@ struct SequentialSearchReduction } else { if constexpr (su_ns::IsMinimum::value) { - using dpctl::tensor::type_utils::is_complex; + using dpnp::tensor::type_utils::is_complex; if constexpr (is_complex::value) { - using dpctl::tensor::math_utils::less_complex; + using dpnp::tensor::math_utils::less_complex; // less_complex always returns false for NaNs, so check if (less_complex(val, red_val) || std::isnan(std::real(val)) || @@ -1947,9 +1945,9 @@ struct SequentialSearchReduction } } else if constexpr (su_ns::IsMaximum::value) { - using dpctl::tensor::type_utils::is_complex; + using dpnp::tensor::type_utils::is_complex; if constexpr (is_complex::value) { - using dpctl::tensor::math_utils::greater_complex; + using dpnp::tensor::math_utils::greater_complex; if (greater_complex(val, red_val) || std::isnan(std::real(val)) || std::isnan(std::imag(val))) { @@ -2231,9 +2229,9 @@ struct CustomSearchReduction } else { if constexpr (su_ns::IsMinimum::value) { - using dpctl::tensor::type_utils::is_complex; + using dpnp::tensor::type_utils::is_complex; if constexpr (is_complex::value) { - using dpctl::tensor::math_utils::less_complex; + using dpnp::tensor::math_utils::less_complex; // less_complex always returns false for NaNs, so // check if (less_complex(val, local_red_val) || @@ -2277,9 +2275,9 @@ struct CustomSearchReduction } else if constexpr (su_ns::IsMaximum::value) { - using dpctl::tensor::type_utils::is_complex; + using dpnp::tensor::type_utils::is_complex; if constexpr (is_complex::value) { - using dpctl::tensor::math_utils::greater_complex; + using dpnp::tensor::math_utils::greater_complex; if (greater_complex(val, local_red_val) || std::isnan(std::real(val)) || std::isnan(std::imag(val))) { @@ -2328,7 +2326,7 @@ struct CustomSearchReduction argT red_val_over_wg = su_ns::custom_reduce_over_group( work_group, local_mem_, local_red_val, reduction_op_); - using dpctl::tensor::type_utils::is_complex; + using dpnp::tensor::type_utils::is_complex; if constexpr (is_complex::value) { // equality does not hold for NaNs, so check here local_idx = (red_val_over_wg == local_red_val || @@ -2517,8 +2515,7 @@ sycl::event search_over_group_temps_strided_impl( if (reduction_nelems == 0) { sycl::event res_init_ev = exec_q.submit([&](sycl::handler &cgh) { - using IndexerT = - dpctl::tensor::offset_utils::UnpackedStridedIndexer; + using IndexerT = dpnp::tensor::offset_utils::UnpackedStridedIndexer; const ssize_t *const &res_shape = iter_shape_and_strides; const ssize_t *const &res_strides = @@ -2545,8 +2542,8 @@ sycl::event search_over_group_temps_strided_impl( if (reduction_nelems < wg) { using InputOutputIterIndexerT = - dpctl::tensor::offset_utils::TwoOffsets_StridedIndexer; - using ReductionIndexerT = dpctl::tensor::offset_utils::StridedIndexer; + dpnp::tensor::offset_utils::TwoOffsets_StridedIndexer; + using ReductionIndexerT = dpnp::tensor::offset_utils::StridedIndexer; const InputOutputIterIndexerT in_out_iter_indexer{ iter_nd, iter_arg_offset, iter_res_offset, iter_shape_and_strides}; @@ -2581,8 +2578,8 @@ sycl::event search_over_group_temps_strided_impl( // can output directly to res using InputOutputIterIndexerT = - dpctl::tensor::offset_utils::TwoOffsets_StridedIndexer; - using ReductionIndexerT = dpctl::tensor::offset_utils::StridedIndexer; + dpnp::tensor::offset_utils::TwoOffsets_StridedIndexer; + using ReductionIndexerT = dpnp::tensor::offset_utils::StridedIndexer; const InputOutputIterIndexerT in_out_iter_indexer{ iter_nd, iter_arg_offset, iter_res_offset, iter_shape_and_strides}; @@ -2625,7 +2622,7 @@ sycl::event search_over_group_temps_strided_impl( const std::size_t tmp_alloc_size = iter_nelems * (reduction_groups + second_iter_reduction_groups_); - auto tmp_owner = dpctl::tensor::alloc_utils::smart_malloc_device( + auto tmp_owner = dpnp::tensor::alloc_utils::smart_malloc_device( tmp_alloc_size, exec_q); resTy *partially_reduced_tmp = tmp_owner.get(); @@ -2633,7 +2630,7 @@ sycl::event search_over_group_temps_strided_impl( partially_reduced_tmp + reduction_groups * iter_nelems; auto val_tmp_owner = - dpctl::tensor::alloc_utils::smart_malloc_device( + dpnp::tensor::alloc_utils::smart_malloc_device( tmp_alloc_size, exec_q); argTy *partially_reduced_vals_tmp = val_tmp_owner.get(); @@ -2642,13 +2639,13 @@ sycl::event search_over_group_temps_strided_impl( sycl::event first_reduction_ev; { - using InputIndexerT = dpctl::tensor::offset_utils::StridedIndexer; - using ResIndexerT = dpctl::tensor::offset_utils::NoOpIndexer; + using InputIndexerT = dpnp::tensor::offset_utils::StridedIndexer; + using ResIndexerT = dpnp::tensor::offset_utils::NoOpIndexer; using InputOutputIterIndexerT = - dpctl::tensor::offset_utils::TwoOffsets_CombinedIndexer< + dpnp::tensor::offset_utils::TwoOffsets_CombinedIndexer< InputIndexerT, ResIndexerT>; using ReductionIndexerT = - dpctl::tensor::offset_utils::StridedIndexer; + dpnp::tensor::offset_utils::StridedIndexer; // Only 2*iter_nd entries describing shape and strides of iterated // dimensions of input array from iter_shape_and_strides are going @@ -2692,12 +2689,12 @@ sycl::event search_over_group_temps_strided_impl( assert(reduction_groups_ > 1); // keep reducing - using InputIndexerT = dpctl::tensor::offset_utils::Strided1DIndexer; - using ResIndexerT = dpctl::tensor::offset_utils::NoOpIndexer; + using InputIndexerT = dpnp::tensor::offset_utils::Strided1DIndexer; + using ResIndexerT = dpnp::tensor::offset_utils::NoOpIndexer; using InputOutputIterIndexerT = - dpctl::tensor::offset_utils::TwoOffsets_CombinedIndexer< + dpnp::tensor::offset_utils::TwoOffsets_CombinedIndexer< InputIndexerT, ResIndexerT>; - using ReductionIndexerT = dpctl::tensor::offset_utils::NoOpIndexer; + using ReductionIndexerT = dpnp::tensor::offset_utils::NoOpIndexer; const InputIndexerT inp_indexer{/* size */ iter_nelems, /* step */ reduction_groups_}; @@ -2724,12 +2721,12 @@ sycl::event search_over_group_temps_strided_impl( } // final reduction to res - using InputIndexerT = dpctl::tensor::offset_utils::Strided1DIndexer; - using ResIndexerT = dpctl::tensor::offset_utils::UnpackedStridedIndexer; + using InputIndexerT = dpnp::tensor::offset_utils::Strided1DIndexer; + using ResIndexerT = dpnp::tensor::offset_utils::UnpackedStridedIndexer; using InputOutputIterIndexerT = - dpctl::tensor::offset_utils::TwoOffsets_CombinedIndexer< + dpnp::tensor::offset_utils::TwoOffsets_CombinedIndexer< InputIndexerT, ResIndexerT>; - using ReductionIndexerT = dpctl::tensor::offset_utils::NoOpIndexer; + using ReductionIndexerT = dpnp::tensor::offset_utils::NoOpIndexer; const InputIndexerT inp_indexer{/* size */ iter_nelems, /* step */ remaining_reduction_nelems}; @@ -2761,7 +2758,7 @@ sycl::event search_over_group_temps_strided_impl( reduction_indexer, {dependent_ev}); sycl::event cleanup_host_task_event = - dpctl::tensor::alloc_utils::async_smart_free( + dpnp::tensor::alloc_utils::async_smart_free( exec_q, {final_reduction_ev}, tmp_owner, val_tmp_owner); // FIXME: do not return host-task event @@ -2820,10 +2817,10 @@ sycl::event search_axis1_over_group_temps_contig_impl( std::size_t wg = choose_workgroup_size<4>(reduction_nelems, sg_sizes); if (reduction_nelems < wg) { - using InputIterIndexerT = dpctl::tensor::offset_utils::Strided1DIndexer; - using NoOpIndexerT = dpctl::tensor::offset_utils::NoOpIndexer; + using InputIterIndexerT = dpnp::tensor::offset_utils::Strided1DIndexer; + using NoOpIndexerT = dpnp::tensor::offset_utils::NoOpIndexer; using InputOutputIterIndexerT = - dpctl::tensor::offset_utils::TwoOffsets_CombinedIndexer< + dpnp::tensor::offset_utils::TwoOffsets_CombinedIndexer< InputIterIndexerT, NoOpIndexerT>; using ReductionIndexerT = NoOpIndexerT; @@ -2859,10 +2856,10 @@ sycl::event search_axis1_over_group_temps_contig_impl( if (reduction_nelems <= preferred_reductions_per_wi * max_wg) { // Perform reduction using one 1 work-group per iteration, // can output directly to res - using InputIterIndexerT = dpctl::tensor::offset_utils::Strided1DIndexer; - using NoOpIndexerT = dpctl::tensor::offset_utils::NoOpIndexer; + using InputIterIndexerT = dpnp::tensor::offset_utils::Strided1DIndexer; + using NoOpIndexerT = dpnp::tensor::offset_utils::NoOpIndexer; using InputOutputIterIndexerT = - dpctl::tensor::offset_utils::TwoOffsets_CombinedIndexer< + dpnp::tensor::offset_utils::TwoOffsets_CombinedIndexer< InputIterIndexerT, NoOpIndexerT>; using ReductionIndexerT = NoOpIndexerT; @@ -2908,14 +2905,14 @@ sycl::event search_axis1_over_group_temps_contig_impl( const std::size_t tmp_alloc_size = iter_nelems * (reduction_groups + second_iter_reduction_groups_); - auto tmp_owner = dpctl::tensor::alloc_utils::smart_malloc_device( + auto tmp_owner = dpnp::tensor::alloc_utils::smart_malloc_device( tmp_alloc_size, exec_q); resTy *partially_reduced_tmp = tmp_owner.get(); resTy *partially_reduced_tmp2 = partially_reduced_tmp + reduction_groups * iter_nelems; auto val_tmp_owner = - dpctl::tensor::alloc_utils::smart_malloc_device( + dpnp::tensor::alloc_utils::smart_malloc_device( tmp_alloc_size, exec_q); argTy *partially_reduced_vals_tmp = val_tmp_owner.get(); argTy *partially_reduced_vals_tmp2 = @@ -2924,10 +2921,10 @@ sycl::event search_axis1_over_group_temps_contig_impl( sycl::event first_reduction_ev; { using InputIterIndexerT = - dpctl::tensor::offset_utils::Strided1DIndexer; - using NoOpIndexerT = dpctl::tensor::offset_utils::NoOpIndexer; + dpnp::tensor::offset_utils::Strided1DIndexer; + using NoOpIndexerT = dpnp::tensor::offset_utils::NoOpIndexer; using InputOutputIterIndexerT = - dpctl::tensor::offset_utils::TwoOffsets_CombinedIndexer< + dpnp::tensor::offset_utils::TwoOffsets_CombinedIndexer< InputIterIndexerT, NoOpIndexerT>; using ReductionIndexerT = NoOpIndexerT; @@ -2967,12 +2964,12 @@ sycl::event search_axis1_over_group_temps_contig_impl( assert(reduction_groups_ > 1); // keep reducing - using InputIndexerT = dpctl::tensor::offset_utils::Strided1DIndexer; - using ResIndexerT = dpctl::tensor::offset_utils::NoOpIndexer; + using InputIndexerT = dpnp::tensor::offset_utils::Strided1DIndexer; + using ResIndexerT = dpnp::tensor::offset_utils::NoOpIndexer; using InputOutputIterIndexerT = - dpctl::tensor::offset_utils::TwoOffsets_CombinedIndexer< + dpnp::tensor::offset_utils::TwoOffsets_CombinedIndexer< InputIndexerT, ResIndexerT>; - using ReductionIndexerT = dpctl::tensor::offset_utils::NoOpIndexer; + using ReductionIndexerT = dpnp::tensor::offset_utils::NoOpIndexer; const InputIndexerT inp_indexer{/* size */ iter_nelems, /* step */ reduction_groups_}; @@ -2999,12 +2996,12 @@ sycl::event search_axis1_over_group_temps_contig_impl( } // final reduction to res - using InputIndexerT = dpctl::tensor::offset_utils::Strided1DIndexer; - using ResIndexerT = dpctl::tensor::offset_utils::NoOpIndexer; + using InputIndexerT = dpnp::tensor::offset_utils::Strided1DIndexer; + using ResIndexerT = dpnp::tensor::offset_utils::NoOpIndexer; using InputOutputIterIndexerT = - dpctl::tensor::offset_utils::TwoOffsets_CombinedIndexer< + dpnp::tensor::offset_utils::TwoOffsets_CombinedIndexer< InputIndexerT, ResIndexerT>; - using ReductionIndexerT = dpctl::tensor::offset_utils::NoOpIndexer; + using ReductionIndexerT = dpnp::tensor::offset_utils::NoOpIndexer; const InputIndexerT inp_indexer{/* size */ iter_nelems, /* step */ remaining_reduction_nelems}; @@ -3033,7 +3030,7 @@ sycl::event search_axis1_over_group_temps_contig_impl( reduction_indexer, {dependent_ev}); sycl::event cleanup_host_task_event = - dpctl::tensor::alloc_utils::async_smart_free( + dpnp::tensor::alloc_utils::async_smart_free( exec_q, {final_reduction_ev}, tmp_owner, val_tmp_owner); // FIXME: do not return host-task event @@ -3081,11 +3078,11 @@ sycl::event search_axis0_over_group_temps_contig_impl( std::size_t wg = choose_workgroup_size<4>(reduction_nelems, sg_sizes); if (reduction_nelems < wg) { - using NoOpIndexerT = dpctl::tensor::offset_utils::NoOpIndexer; + using NoOpIndexerT = dpnp::tensor::offset_utils::NoOpIndexer; using InputOutputIterIndexerT = - dpctl::tensor::offset_utils::TwoOffsets_CombinedIndexer< + dpnp::tensor::offset_utils::TwoOffsets_CombinedIndexer< NoOpIndexerT, NoOpIndexerT>; - using ReductionIndexerT = dpctl::tensor::offset_utils::Strided1DIndexer; + using ReductionIndexerT = dpnp::tensor::offset_utils::Strided1DIndexer; const InputOutputIterIndexerT in_out_iter_indexer{NoOpIndexerT{}, NoOpIndexerT{}}; @@ -3123,10 +3120,10 @@ sycl::event search_axis0_over_group_temps_contig_impl( if (reduction_nelems <= preferred_reductions_per_wi * max_wg) { // Perform reduction using one 1 work-group per iteration, // can output directly to res - using NoOpIndexerT = dpctl::tensor::offset_utils::NoOpIndexer; - using ColsIndexerT = dpctl::tensor::offset_utils::Strided1DIndexer; + using NoOpIndexerT = dpnp::tensor::offset_utils::NoOpIndexer; + using ColsIndexerT = dpnp::tensor::offset_utils::Strided1DIndexer; using InputOutputIterIndexerT = - dpctl::tensor::offset_utils::TwoOffsets_CombinedIndexer< + dpnp::tensor::offset_utils::TwoOffsets_CombinedIndexer< NoOpIndexerT, NoOpIndexerT>; using ReductionIndexerT = ColsIndexerT; @@ -3173,7 +3170,7 @@ sycl::event search_axis0_over_group_temps_contig_impl( const std::size_t tmp_alloc_size = iter_nelems * (reduction_groups + second_iter_reduction_groups_); - auto tmp_owner = dpctl::tensor::alloc_utils::smart_malloc_device( + auto tmp_owner = dpnp::tensor::alloc_utils::smart_malloc_device( tmp_alloc_size, exec_q); resTy *partially_reduced_tmp = tmp_owner.get(); @@ -3181,7 +3178,7 @@ sycl::event search_axis0_over_group_temps_contig_impl( partially_reduced_tmp + reduction_groups * iter_nelems; auto vals_tmp_owner = - dpctl::tensor::alloc_utils::smart_malloc_device( + dpnp::tensor::alloc_utils::smart_malloc_device( tmp_alloc_size, exec_q); argTy *partially_reduced_vals_tmp = vals_tmp_owner.get(); argTy *partially_reduced_vals_tmp2 = @@ -3189,10 +3186,10 @@ sycl::event search_axis0_over_group_temps_contig_impl( sycl::event first_reduction_ev; { - using NoOpIndexerT = dpctl::tensor::offset_utils::NoOpIndexer; - using ColsIndexerT = dpctl::tensor::offset_utils::Strided1DIndexer; + using NoOpIndexerT = dpnp::tensor::offset_utils::NoOpIndexer; + using ColsIndexerT = dpnp::tensor::offset_utils::Strided1DIndexer; using InputOutputIterIndexerT = - dpctl::tensor::offset_utils::TwoOffsets_CombinedIndexer< + dpnp::tensor::offset_utils::TwoOffsets_CombinedIndexer< NoOpIndexerT, NoOpIndexerT>; using ReductionIndexerT = ColsIndexerT; @@ -3234,12 +3231,12 @@ sycl::event search_axis0_over_group_temps_contig_impl( assert(reduction_groups_ > 1); // keep reducing - using InputIndexerT = dpctl::tensor::offset_utils::Strided1DIndexer; - using ResIndexerT = dpctl::tensor::offset_utils::NoOpIndexer; + using InputIndexerT = dpnp::tensor::offset_utils::Strided1DIndexer; + using ResIndexerT = dpnp::tensor::offset_utils::NoOpIndexer; using InputOutputIterIndexerT = - dpctl::tensor::offset_utils::TwoOffsets_CombinedIndexer< + dpnp::tensor::offset_utils::TwoOffsets_CombinedIndexer< InputIndexerT, ResIndexerT>; - using ReductionIndexerT = dpctl::tensor::offset_utils::NoOpIndexer; + using ReductionIndexerT = dpnp::tensor::offset_utils::NoOpIndexer; const InputIndexerT inp_indexer{/* size */ iter_nelems, /* step */ reduction_groups_}; @@ -3266,12 +3263,12 @@ sycl::event search_axis0_over_group_temps_contig_impl( } // final reduction to res - using InputIndexerT = dpctl::tensor::offset_utils::Strided1DIndexer; - using ResIndexerT = dpctl::tensor::offset_utils::NoOpIndexer; + using InputIndexerT = dpnp::tensor::offset_utils::Strided1DIndexer; + using ResIndexerT = dpnp::tensor::offset_utils::NoOpIndexer; using InputOutputIterIndexerT = - dpctl::tensor::offset_utils::TwoOffsets_CombinedIndexer< + dpnp::tensor::offset_utils::TwoOffsets_CombinedIndexer< InputIndexerT, ResIndexerT>; - using ReductionIndexerT = dpctl::tensor::offset_utils::NoOpIndexer; + using ReductionIndexerT = dpnp::tensor::offset_utils::NoOpIndexer; const InputIndexerT inp_indexer{/* size */ iter_nelems, /* step */ remaining_reduction_nelems}; @@ -3300,7 +3297,7 @@ sycl::event search_axis0_over_group_temps_contig_impl( reduction_indexer, {dependent_ev}); sycl::event cleanup_host_task_event = - dpctl::tensor::alloc_utils::async_smart_free( + dpnp::tensor::alloc_utils::async_smart_free( exec_q, {final_reduction_ev}, tmp_owner, vals_tmp_owner); // FIXME: do not return host-task event @@ -3310,4 +3307,4 @@ sycl::event search_axis0_over_group_temps_contig_impl( } } -} // namespace dpctl::tensor::kernels +} // namespace dpnp::tensor::kernels diff --git a/dpnp/tensor/libtensor/include/kernels/repeat.hpp b/dpnp/tensor/libtensor/include/kernels/repeat.hpp index 83a520adb538..1331d7b97dcb 100644 --- a/dpnp/tensor/libtensor/include/kernels/repeat.hpp +++ b/dpnp/tensor/libtensor/include/kernels/repeat.hpp @@ -39,14 +39,14 @@ #include -#include "dpctl_tensor_types.hpp" +#include "dpnp_tensor_types.hpp" #include "utils/offset_utils.hpp" -namespace dpctl::tensor::kernels::repeat +namespace dpnp::tensor::kernels::repeat { -using dpctl::tensor::ssize_t; -using namespace dpctl::tensor::offset_utils; +using dpnp::tensor::ssize_t; +using namespace dpnp::tensor::offset_utils; template -#include "kernels/dpctl_tensor_types.hpp" +#include "kernels/dpnp_tensor_types.hpp" #include "kernels/sorting/search_sorted_detail.hpp" #include "utils/offset_utils.hpp" #include "utils/rich_comparisons.hpp" -namespace dpctl::tensor::kernels +namespace dpnp::tensor::kernels { -using dpctl::tensor::ssize_t; +using dpnp::tensor::ssize_t; template id) const { using Compare = - typename dpctl::tensor::rich_comparisons::AscendingSorter::type; + typename dpnp::tensor::rich_comparisons::AscendingSorter::type; static constexpr Compare comp{}; const std::size_t i = id[0]; @@ -147,7 +147,7 @@ sycl::event isin_contig_impl(sycl::queue &exec_q, sycl::range<1> gRange(needles_nelems); - using TrivialIndexerT = dpctl::tensor::offset_utils::NoOpIndexer; + using TrivialIndexerT = dpnp::tensor::offset_utils::NoOpIndexer; static constexpr TrivialIndexerT hay_indexer{}; static constexpr TrivialIndexerT needles_indexer{}; @@ -213,17 +213,17 @@ sycl::event isin_strided_impl( sycl::range<1> gRange(needles_nelems); - using HayIndexerT = dpctl::tensor::offset_utils::Strided1DIndexer; + using HayIndexerT = dpnp::tensor::offset_utils::Strided1DIndexer; const HayIndexerT hay_indexer( /* offset */ hay_offset, /* size */ hay_nelems, /* step */ hay_stride); - using NeedlesIndexerT = dpctl::tensor::offset_utils::StridedIndexer; + using NeedlesIndexerT = dpnp::tensor::offset_utils::StridedIndexer; const ssize_t *needles_shape_strides = packed_shape_strides; const NeedlesIndexerT needles_indexer(needles_nd, needles_offset, needles_shape_strides); - using OutIndexerT = dpctl::tensor::offset_utils::UnpackedStridedIndexer; + using OutIndexerT = dpnp::tensor::offset_utils::UnpackedStridedIndexer; const ssize_t *out_shape = packed_shape_strides; const ssize_t *out_strides = packed_shape_strides + 2 * needles_nd; @@ -242,4 +242,4 @@ sycl::event isin_strided_impl( return comp_ev; } -} // namespace dpctl::tensor::kernels +} // namespace dpnp::tensor::kernels diff --git a/dpnp/tensor/libtensor/include/kernels/sorting/merge_sort.hpp b/dpnp/tensor/libtensor/include/kernels/sorting/merge_sort.hpp index 75d3dc5f01a0..8182e52d0855 100644 --- a/dpnp/tensor/libtensor/include/kernels/sorting/merge_sort.hpp +++ b/dpnp/tensor/libtensor/include/kernels/sorting/merge_sort.hpp @@ -45,18 +45,18 @@ #include -#include "kernels/dpctl_tensor_types.hpp" +#include "kernels/dpnp_tensor_types.hpp" #include "kernels/sorting/search_sorted_detail.hpp" #include "kernels/sorting/sort_utils.hpp" -namespace dpctl::tensor::kernels +namespace dpnp::tensor::kernels { namespace merge_sort_detail { -using dpctl::tensor::ssize_t; -using namespace dpctl::tensor::kernels::search_sorted_detail; +using dpnp::tensor::ssize_t; +using namespace dpnp::tensor::kernels::search_sorted_detail; /*! @brief Merge two contiguous sorted segments */ template @@ -807,7 +807,7 @@ sycl::event stable_argsort_axis1_contig_impl( const std::size_t total_nelems = iter_nelems * sort_nelems; - using dpctl::tensor::kernels::sort_utils_detail::iota_impl; + using dpnp::tensor::kernels::sort_utils_detail::iota_impl; using IotaKernelName = populate_index_data_krn; @@ -833,7 +833,7 @@ sycl::event stable_argsort_axis1_contig_impl( } using MapBackKernelName = index_map_to_rows_krn; - using dpctl::tensor::kernels::sort_utils_detail::map_back_impl; + using dpnp::tensor::kernels::sort_utils_detail::map_back_impl; sycl::event write_out_ev = map_back_impl( exec_q, total_nelems, res_tp, res_tp, sort_nelems, {merges_ev}); @@ -841,4 +841,4 @@ sycl::event stable_argsort_axis1_contig_impl( return write_out_ev; } -} // namespace dpctl::tensor::kernels +} // namespace dpnp::tensor::kernels diff --git a/dpnp/tensor/libtensor/include/kernels/sorting/radix_sort.hpp b/dpnp/tensor/libtensor/include/kernels/sorting/radix_sort.hpp index 5baa98e237df..27eade9f3586 100644 --- a/dpnp/tensor/libtensor/include/kernels/sorting/radix_sort.hpp +++ b/dpnp/tensor/libtensor/include/kernels/sorting/radix_sort.hpp @@ -29,7 +29,7 @@ //===----------------------------------------------------------------------===// /// /// \file -/// This file defines functions of dpctl.tensor._tensor_sorting_impl +/// This file defines functions of dpnp.tensor._tensor_sorting_impl /// extension. //===----------------------------------------------------------------------===// @@ -47,11 +47,11 @@ #include -#include "kernels/dpctl_tensor_types.hpp" +#include "kernels/dpnp_tensor_types.hpp" #include "kernels/sorting/sort_utils.hpp" #include "utils/sycl_alloc_utils.hpp" -namespace dpctl::tensor::kernels +namespace dpnp::tensor::kernels { namespace radix_sort_details @@ -1687,7 +1687,7 @@ sycl::event parallel_radix_sort_impl(sycl::queue &exec_q, // memory for storing count and offset values auto count_owner = - dpctl::tensor::alloc_utils::smart_malloc_device( + dpnp::tensor::alloc_utils::smart_malloc_device( n_iters * n_counts, exec_q); CountT *count_ptr = count_owner.get(); @@ -1703,14 +1703,14 @@ sycl::event parallel_radix_sort_impl(sycl::queue &exec_q, n_counts, count_ptr, proj_op, is_ascending, depends); - sort_ev = dpctl::tensor::alloc_utils::async_smart_free( + sort_ev = dpnp::tensor::alloc_utils::async_smart_free( exec_q, {sort_ev}, count_owner); return sort_ev; } auto tmp_arr_owner = - dpctl::tensor::alloc_utils::smart_malloc_device( + dpnp::tensor::alloc_utils::smart_malloc_device( n_iters * n_to_sort, exec_q); ValueT *tmp_arr = tmp_arr_owner.get(); @@ -1746,7 +1746,7 @@ sycl::event parallel_radix_sort_impl(sycl::queue &exec_q, } } - sort_ev = dpctl::tensor::alloc_utils::async_smart_free( + sort_ev = dpnp::tensor::alloc_utils::async_smart_free( exec_q, {sort_ev}, tmp_arr_owner, count_owner); } @@ -1794,7 +1794,7 @@ struct IndexedProj } // namespace radix_sort_details -using dpctl::tensor::ssize_t; +using dpnp::tensor::ssize_t; template sycl::event @@ -1861,8 +1861,8 @@ sycl::event const std::size_t total_nelems = iter_nelems * sort_nelems; auto workspace_owner = - dpctl::tensor::alloc_utils::smart_malloc_device(total_nelems, - exec_q); + dpnp::tensor::alloc_utils::smart_malloc_device(total_nelems, + exec_q); // get raw USM pointer IndexTy *workspace = workspace_owner.get(); @@ -1874,7 +1874,7 @@ sycl::event using IotaKernelName = radix_argsort_iota_krn; - using dpctl::tensor::kernels::sort_utils_detail::iota_impl; + using dpnp::tensor::kernels::sort_utils_detail::iota_impl; sycl::event iota_ev = iota_impl( exec_q, workspace, total_nelems, depends); @@ -1885,7 +1885,7 @@ sycl::event sort_ascending, {iota_ev}); using MapBackKernelName = radix_argsort_index_write_out_krn; - using dpctl::tensor::kernels::sort_utils_detail::map_back_impl; + using dpnp::tensor::kernels::sort_utils_detail::map_back_impl; sycl::event dep = radix_sort_ev; @@ -1896,10 +1896,10 @@ sycl::event exec_q, total_nelems, res_tp, res_tp, sort_nelems, {dep}); } - sycl::event cleanup_ev = dpctl::tensor::alloc_utils::async_smart_free( + sycl::event cleanup_ev = dpnp::tensor::alloc_utils::async_smart_free( exec_q, {dep}, workspace_owner); return cleanup_ev; } -} // namespace dpctl::tensor::kernels +} // namespace dpnp::tensor::kernels diff --git a/dpnp/tensor/libtensor/include/kernels/sorting/search_sorted_detail.hpp b/dpnp/tensor/libtensor/include/kernels/sorting/search_sorted_detail.hpp index 1f3576402511..b6436f0261fa 100644 --- a/dpnp/tensor/libtensor/include/kernels/sorting/search_sorted_detail.hpp +++ b/dpnp/tensor/libtensor/include/kernels/sorting/search_sorted_detail.hpp @@ -36,7 +36,7 @@ #include -namespace dpctl::tensor::kernels::search_sorted_detail +namespace dpnp::tensor::kernels::search_sorted_detail { template @@ -116,4 +116,4 @@ std::size_t upper_bound_indexed_impl(const Acc acc, acc_indexer); } -} // namespace dpctl::tensor::kernels::search_sorted_detail +} // namespace dpnp::tensor::kernels::search_sorted_detail diff --git a/dpnp/tensor/libtensor/include/kernels/sorting/searchsorted.hpp b/dpnp/tensor/libtensor/include/kernels/sorting/searchsorted.hpp index bc400c9e569a..b4ab73166a82 100644 --- a/dpnp/tensor/libtensor/include/kernels/sorting/searchsorted.hpp +++ b/dpnp/tensor/libtensor/include/kernels/sorting/searchsorted.hpp @@ -39,14 +39,14 @@ #include -#include "kernels/dpctl_tensor_types.hpp" +#include "kernels/dpnp_tensor_types.hpp" #include "kernels/sorting/search_sorted_detail.hpp" #include "utils/offset_utils.hpp" -namespace dpctl::tensor::kernels +namespace dpnp::tensor::kernels { -using dpctl::tensor::ssize_t; +using dpnp::tensor::ssize_t; template gRange(needles_nelems); - using TrivialIndexerT = dpctl::tensor::offset_utils::NoOpIndexer; + using TrivialIndexerT = dpnp::tensor::offset_utils::NoOpIndexer; static constexpr TrivialIndexerT hay_indexer{}; static constexpr TrivialIndexerT needles_indexer{}; @@ -222,18 +222,18 @@ sycl::event searchsorted_strided_impl( sycl::range<1> gRange(needles_nelems); - using HayIndexerT = dpctl::tensor::offset_utils::Strided1DIndexer; + using HayIndexerT = dpnp::tensor::offset_utils::Strided1DIndexer; const HayIndexerT hay_indexer( /* offset */ hay_offset, /* size */ hay_nelems, /* step */ hay_stride); - using NeedlesIndexerT = dpctl::tensor::offset_utils::StridedIndexer; + using NeedlesIndexerT = dpnp::tensor::offset_utils::StridedIndexer; const ssize_t *needles_shape_strides = packed_shape_strides; const NeedlesIndexerT needles_indexer(needles_nd, needles_offset, needles_shape_strides); using PositionsIndexerT = - dpctl::tensor::offset_utils::UnpackedStridedIndexer; + dpnp::tensor::offset_utils::UnpackedStridedIndexer; const ssize_t *positions_shape = packed_shape_strides; const ssize_t *positions_strides = @@ -255,4 +255,4 @@ sycl::event searchsorted_strided_impl( return comp_ev; } -} // namespace dpctl::tensor::kernels +} // namespace dpnp::tensor::kernels diff --git a/dpnp/tensor/libtensor/include/kernels/sorting/sort_impl_fn_ptr_t.hpp b/dpnp/tensor/libtensor/include/kernels/sorting/sort_impl_fn_ptr_t.hpp index 7b48f310a445..2cff5d9585f2 100644 --- a/dpnp/tensor/libtensor/include/kernels/sorting/sort_impl_fn_ptr_t.hpp +++ b/dpnp/tensor/libtensor/include/kernels/sorting/sort_impl_fn_ptr_t.hpp @@ -29,7 +29,7 @@ //===----------------------------------------------------------------------===// /// /// \file -/// This file defines functions of dpctl.tensor._tensor_sorting_impl +/// This file defines functions of dpnp.tensor._tensor_sorting_impl /// extension. //===----------------------------------------------------------------------===// @@ -40,12 +40,12 @@ #include -#include "kernels/dpctl_tensor_types.hpp" +#include "kernels/dpnp_tensor_types.hpp" -namespace dpctl::tensor::kernels +namespace dpnp::tensor::kernels { -using dpctl::tensor::ssize_t; +using dpnp::tensor::ssize_t; typedef sycl::event (*sort_contig_fn_ptr_t)(sycl::queue &, std::size_t, @@ -58,4 +58,4 @@ typedef sycl::event (*sort_contig_fn_ptr_t)(sycl::queue &, ssize_t, const std::vector &); -} // namespace dpctl::tensor::kernels +} // namespace dpnp::tensor::kernels diff --git a/dpnp/tensor/libtensor/include/kernels/sorting/sort_utils.hpp b/dpnp/tensor/libtensor/include/kernels/sorting/sort_utils.hpp index fd32905b808e..5c96f7f97f01 100644 --- a/dpnp/tensor/libtensor/include/kernels/sorting/sort_utils.hpp +++ b/dpnp/tensor/libtensor/include/kernels/sorting/sort_utils.hpp @@ -41,7 +41,7 @@ #include -namespace dpctl::tensor::kernels::sort_utils_detail +namespace dpnp::tensor::kernels::sort_utils_detail { namespace syclexp = sycl::ext::oneapi::experimental; @@ -141,4 +141,4 @@ sycl::event map_back_impl(sycl::queue &exec_q, return map_back_ev; } -} // namespace dpctl::tensor::kernels::sort_utils_detail +} // namespace dpnp::tensor::kernels::sort_utils_detail diff --git a/dpnp/tensor/libtensor/include/kernels/sorting/topk.hpp b/dpnp/tensor/libtensor/include/kernels/sorting/topk.hpp index 1bbaa9e8345a..b403b3f20fa5 100644 --- a/dpnp/tensor/libtensor/include/kernels/sorting/topk.hpp +++ b/dpnp/tensor/libtensor/include/kernels/sorting/topk.hpp @@ -50,7 +50,7 @@ #include "kernels/sorting/sort_utils.hpp" #include "utils/sycl_alloc_utils.hpp" -namespace dpctl::tensor::kernels +namespace dpnp::tensor::kernels { namespace topk_detail @@ -157,14 +157,14 @@ sycl::event const std::vector &depends) { auto index_data_owner = - dpctl::tensor::alloc_utils::smart_malloc_device( + dpnp::tensor::alloc_utils::smart_malloc_device( iter_nelems * axis_nelems, exec_q); // extract USM pointer IndexTy *index_data = index_data_owner.get(); using IotaKernelName = topk_populate_index_data_krn; - using dpctl::tensor::kernels::sort_utils_detail::iota_impl; + using dpnp::tensor::kernels::sort_utils_detail::iota_impl; sycl::event populate_indexed_data_ev = iota_impl( exec_q, index_data, iter_nelems * axis_nelems, depends); @@ -191,8 +191,8 @@ sycl::event axis_nelems, vals_tp, inds_tp, {merges_ev}); sycl::event cleanup_host_task_event = - dpctl::tensor::alloc_utils::async_smart_free(exec_q, {write_out_ev}, - index_data_owner); + dpnp::tensor::alloc_utils::async_smart_free(exec_q, {write_out_ev}, + index_data_owner); return cleanup_host_task_event; }; @@ -226,7 +226,7 @@ sycl::event topk_merge_impl( argTy *vals_tp = reinterpret_cast(vals_cp); IndexTy *inds_tp = reinterpret_cast(inds_cp); - using dpctl::tensor::kernels::IndexComp; + using dpnp::tensor::kernels::IndexComp; const IndexComp index_comp{arg_tp, ValueComp{}}; if (axis_nelems <= 512 || k >= 1024 || k > axis_nelems / 2) { @@ -306,7 +306,7 @@ sycl::event topk_merge_impl( } auto index_data_owner = - dpctl::tensor::alloc_utils::smart_malloc_device( + dpnp::tensor::alloc_utils::smart_malloc_device( iter_nelems * alloc_len, exec_q); // get raw USM pointer IndexTy *index_data = index_data_owner.get(); @@ -432,8 +432,8 @@ sycl::event topk_merge_impl( axis_nelems, vals_tp, inds_tp, {merges_ev}); sycl::event cleanup_host_task_event = - dpctl::tensor::alloc_utils::async_smart_free( - exec_q, {write_topk_ev}, index_data_owner); + dpnp::tensor::alloc_utils::async_smart_free(exec_q, {write_topk_ev}, + index_data_owner); return cleanup_host_task_event; } @@ -467,7 +467,7 @@ sycl::event topk_radix_impl(sycl::queue &exec_q, const std::size_t total_nelems = iter_nelems * axis_nelems; const std::size_t padded_total_nelems = ((total_nelems + 63) / 64) * 64; auto workspace_owner = - dpctl::tensor::alloc_utils::smart_malloc_device( + dpnp::tensor::alloc_utils::smart_malloc_device( padded_total_nelems + total_nelems, exec_q); // get raw USM pointer @@ -481,7 +481,7 @@ sycl::event topk_radix_impl(sycl::queue &exec_q, using IotaKernelName = topk_iota_krn; - using dpctl::tensor::kernels::sort_utils_detail::iota_impl; + using dpnp::tensor::kernels::sort_utils_detail::iota_impl; sycl::event iota_ev = iota_impl( exec_q, workspace, total_nelems, depends); @@ -499,10 +499,10 @@ sycl::event topk_radix_impl(sycl::queue &exec_q, exec_q, iter_nelems, k, arg_tp, tmp_tp, axis_nelems, axis_nelems, vals_tp, inds_tp, {radix_sort_ev}); - sycl::event cleanup_ev = dpctl::tensor::alloc_utils::async_smart_free( + sycl::event cleanup_ev = dpnp::tensor::alloc_utils::async_smart_free( exec_q, {write_topk_ev}, workspace_owner); return cleanup_ev; } -} // namespace dpctl::tensor::kernels +} // namespace dpnp::tensor::kernels diff --git a/dpnp/tensor/libtensor/include/kernels/where.hpp b/dpnp/tensor/libtensor/include/kernels/where.hpp index 5527cccec8d2..f8bf6bc6a38e 100644 --- a/dpnp/tensor/libtensor/include/kernels/where.hpp +++ b/dpnp/tensor/libtensor/include/kernels/where.hpp @@ -29,7 +29,7 @@ //===---------------------------------------------------------------------===// /// /// \file -/// This file defines kernels for dpctl.tensor.where. +/// This file defines kernels for dpnp.tensor.where. //===---------------------------------------------------------------------===// #pragma once @@ -40,25 +40,24 @@ #include -#include "dpctl_tensor_types.hpp" +#include "dpnp_tensor_types.hpp" #include "kernels/alignment.hpp" #include "utils/offset_utils.hpp" #include "utils/sycl_utils.hpp" #include "utils/type_utils.hpp" -namespace dpctl::tensor::kernels::search +namespace dpnp::tensor::kernels::search { -using dpctl::tensor::ssize_t; -using namespace dpctl::tensor::offset_utils; +using dpnp::tensor::ssize_t; +using namespace dpnp::tensor::offset_utils; -using dpctl::tensor::kernels::alignment_utils:: - disabled_sg_loadstore_wrapper_krn; -using dpctl::tensor::kernels::alignment_utils::is_aligned; -using dpctl::tensor::kernels::alignment_utils::required_alignment; +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 dpctl::tensor::sycl_utils::sub_group_load; -using dpctl::tensor::sycl_utils::sub_group_store; +using dpnp::tensor::sycl_utils::sub_group_load; +using dpnp::tensor::sycl_utils::sub_group_store; template class where_strided_kernel; @@ -94,7 +93,7 @@ class WhereContigFunctor { static constexpr std::uint8_t nelems_per_wi = n_vecs * vec_sz; - using dpctl::tensor::type_utils::is_complex; + using dpnp::tensor::type_utils::is_complex; if constexpr (!enable_sg_loadstore || is_complex::value || is_complex::value) { const std::uint16_t sgSize = @@ -106,7 +105,7 @@ class WhereContigFunctor (gid / sgSize) * (nelems_per_sg - sgSize) + gid; const std::size_t end = std::min(nelems, start + nelems_per_sg); for (std::size_t offset = start; offset < end; offset += sgSize) { - using dpctl::tensor::type_utils::convert_impl; + using dpnp::tensor::type_utils::convert_impl; const bool check = convert_impl(cond_p[offset]); dst_p[offset] = check ? x1_p[offset] : x2_p[offset]; } @@ -252,7 +251,7 @@ class WhereStridedFunctor std::size_t gid = id[0]; auto offsets = indexer(static_cast(gid)); - using dpctl::tensor::type_utils::convert_impl; + using dpnp::tensor::type_utils::convert_impl; bool check = convert_impl(cond_p[offsets.get_first_offset()]); @@ -333,4 +332,4 @@ struct WhereContigFactory } }; -} // namespace dpctl::tensor::kernels::search +} // namespace dpnp::tensor::kernels::search diff --git a/dpnp/tensor/libtensor/include/utils/indexing_utils.hpp b/dpnp/tensor/libtensor/include/utils/indexing_utils.hpp index d28c8174c39c..33e94d4661bc 100644 --- a/dpnp/tensor/libtensor/include/utils/indexing_utils.hpp +++ b/dpnp/tensor/libtensor/include/utils/indexing_utils.hpp @@ -41,14 +41,14 @@ #include -#include "kernels/dpctl_tensor_types.hpp" +#include "kernels/dpnp_tensor_types.hpp" -namespace dpctl::tensor::indexing_utils +namespace dpnp::tensor::indexing_utils { -using dpctl::tensor::ssize_t; +using dpnp::tensor::ssize_t; /* - * ssize_t for indices is a design choice, dpctl::tensor::usm_ndarray + * ssize_t for indices is a design choice, dpnp::tensor::usm_ndarray * uses py::ssize_t for shapes and strides internally and Python uses * py_ssize_t for sizes of e.g. lists. */ @@ -150,4 +150,4 @@ struct ClipIndex return projected; } }; -} // namespace dpctl::tensor::indexing_utils +} // namespace dpnp::tensor::indexing_utils diff --git a/dpnp/tensor/libtensor/include/utils/math_utils.hpp b/dpnp/tensor/libtensor/include/utils/math_utils.hpp index d35eff0074dc..ab2ae070e60c 100644 --- a/dpnp/tensor/libtensor/include/utils/math_utils.hpp +++ b/dpnp/tensor/libtensor/include/utils/math_utils.hpp @@ -38,7 +38,7 @@ #include -namespace dpctl::tensor::math_utils +namespace dpnp::tensor::math_utils { template bool less_complex(const T &x1, const T &x2) @@ -145,4 +145,4 @@ T logaddexp(T x, T y) : std::numeric_limits::quiet_NaN()); } } -} // namespace dpctl::tensor::math_utils +} // namespace dpnp::tensor::math_utils diff --git a/dpnp/tensor/libtensor/include/utils/memory_overlap.hpp b/dpnp/tensor/libtensor/include/utils/memory_overlap.hpp index b534e55b3192..f0a469886b41 100644 --- a/dpnp/tensor/libtensor/include/utils/memory_overlap.hpp +++ b/dpnp/tensor/libtensor/include/utils/memory_overlap.hpp @@ -49,14 +49,14 @@ TODO: Write proper Frobenius solver to account for holes, e.g. overlap( x_contig[::2], x_contig[1::2]) should give False, while this implementation gives True. */ -namespace dpctl::tensor::overlap +namespace dpnp::tensor::overlap { namespace py = pybind11; struct MemoryOverlap { - bool operator()(dpctl::tensor::usm_ndarray ar1, - dpctl::tensor::usm_ndarray ar2) const + bool operator()(dpnp::tensor::usm_ndarray ar1, + dpnp::tensor::usm_ndarray ar2) const { const char *ar1_data = ar1.get_data(); @@ -110,8 +110,8 @@ struct MemoryOverlap struct SameLogicalTensors { - bool operator()(dpctl::tensor::usm_ndarray ar1, - dpctl::tensor::usm_ndarray ar2) const + bool operator()(dpnp::tensor::usm_ndarray ar1, + dpnp::tensor::usm_ndarray ar2) const { // Same ndim int nd1 = ar1.get_ndim(); @@ -154,4 +154,4 @@ struct SameLogicalTensors return true; } }; -} // namespace dpctl::tensor::overlap +} // namespace dpnp::tensor::overlap diff --git a/dpnp/tensor/libtensor/include/utils/offset_utils.hpp b/dpnp/tensor/libtensor/include/utils/offset_utils.hpp index 3a6ac75dfc3a..e6e2179bdf8a 100644 --- a/dpnp/tensor/libtensor/include/utils/offset_utils.hpp +++ b/dpnp/tensor/libtensor/include/utils/offset_utils.hpp @@ -43,11 +43,11 @@ #include -#include "kernels/dpctl_tensor_types.hpp" +#include "kernels/dpnp_tensor_types.hpp" #include "utils/strided_iters.hpp" #include "utils/sycl_alloc_utils.hpp" -namespace dpctl::tensor::offset_utils +namespace dpnp::tensor::offset_utils { namespace detail { @@ -91,7 +91,7 @@ std::vector concat(std::vector lhs, Vs &&...vs) } // namespace detail template -std::tuple, +std::tuple, std::size_t, sycl::event> device_allocate_and_pack(sycl::queue &q, @@ -99,7 +99,7 @@ std::tuple, Vs &&...vs) { - using dpctl::tensor::alloc_utils::usm_host_allocator; + using dpnp::tensor::alloc_utils::usm_host_allocator; // memory transfer optimization, use USM-host for temporary speeds up // transfer to device, especially on dGPUs @@ -115,7 +115,7 @@ std::tuple, auto sz = packed_shape_strides_owner->size(); auto shape_strides_owner = - dpctl::tensor::alloc_utils::smart_malloc_device(sz, q); + dpnp::tensor::alloc_utils::smart_malloc_device(sz, q); indT *shape_strides = shape_strides_owner.get(); sycl::event copy_ev = @@ -140,7 +140,7 @@ struct NoOpIndexer constexpr std::size_t operator()(std::size_t gid) const { return gid; } }; -using dpctl::tensor::ssize_t; +using dpnp::tensor::ssize_t; /* @brief Indexer with shape and strides arrays of same size are packed */ struct StridedIndexer @@ -167,7 +167,7 @@ struct StridedIndexer ssize_t compute_offset(ssize_t gid) const { - using dpctl::tensor::strides::CIndexer_vector; + using dpnp::tensor::strides::CIndexer_vector; CIndexer_vector _ind(nd); ssize_t relative_offset(0); @@ -209,7 +209,7 @@ struct UnpackedStridedIndexer ssize_t compute_offset(ssize_t gid) const { - using dpctl::tensor::strides::CIndexer_vector; + using dpnp::tensor::strides::CIndexer_vector; CIndexer_vector _ind(nd); ssize_t relative_offset(0); @@ -339,7 +339,7 @@ struct TwoOffsets_StridedIndexer TwoOffsets compute_offsets(ssize_t gid) const { - using dpctl::tensor::strides::CIndexer_vector; + using dpnp::tensor::strides::CIndexer_vector; CIndexer_vector _ind(nd); ssize_t relative_first_offset(0); @@ -446,7 +446,7 @@ struct ThreeOffsets_StridedIndexer ThreeOffsets compute_offsets(ssize_t gid) const { - using dpctl::tensor::strides::CIndexer_vector; + using dpnp::tensor::strides::CIndexer_vector; CIndexer_vector _ind(nd); ssize_t relative_first_offset(0); @@ -576,7 +576,7 @@ struct FourOffsets_StridedIndexer FourOffsets compute_offsets(ssize_t gid) const { - using dpctl::tensor::strides::CIndexer_vector; + using dpnp::tensor::strides::CIndexer_vector; CIndexer_vector _ind(nd); ssize_t relative_first_offset(0); @@ -635,7 +635,7 @@ struct NthStrideOffset } private: - dpctl::tensor::strides::CIndexer_vector _ind; + dpnp::tensor::strides::CIndexer_vector _ind; int nd; ssize_t const *offsets; @@ -655,7 +655,7 @@ struct FixedDimStridedIndexer } std::size_t operator()(std::size_t gid) const { - dpctl::tensor::strides::CIndexer_array local_indexer( + dpnp::tensor::strides::CIndexer_array local_indexer( std::move(_ind)); local_indexer.set(gid); auto mi = local_indexer.get(); @@ -670,7 +670,7 @@ struct FixedDimStridedIndexer } private: - dpctl::tensor::strides::CIndexer_array _ind; + dpnp::tensor::strides::CIndexer_array _ind; std::array strides; ssize_t starting_offset; @@ -693,7 +693,7 @@ struct TwoOffsets_FixedDimStridedIndexer TwoOffsets operator()(std::size_t gid) const { - dpctl::tensor::strides::CIndexer_array local_indexer( + dpnp::tensor::strides::CIndexer_array local_indexer( std::move(_ind)); local_indexer.set(gid); auto mi = local_indexer.get(); @@ -715,7 +715,7 @@ struct TwoOffsets_FixedDimStridedIndexer } private: - dpctl::tensor::strides::CIndexer_array _ind; + dpnp::tensor::strides::CIndexer_array _ind; std::array strides1; std::array strides2; @@ -744,7 +744,7 @@ struct ThreeOffsets_FixedDimStridedIndexer ThreeOffsets operator()(std::size_t gid) const { - dpctl::tensor::strides::CIndexer_array local_indexer( + dpnp::tensor::strides::CIndexer_array local_indexer( std::move(_ind)); local_indexer.set(gid); auto mi = local_indexer.get(); @@ -773,7 +773,7 @@ struct ThreeOffsets_FixedDimStridedIndexer } private: - dpctl::tensor::strides::CIndexer_array _ind; + dpnp::tensor::strides::CIndexer_array _ind; std::array strides1; std::array strides2; @@ -785,4 +785,4 @@ struct ThreeOffsets_FixedDimStridedIndexer static_assert( sycl::is_device_copyable_v>); -} // namespace dpctl::tensor::offset_utils +} // namespace dpnp::tensor::offset_utils diff --git a/dpnp/tensor/libtensor/include/utils/output_validation.hpp b/dpnp/tensor/libtensor/include/utils/output_validation.hpp index 26f1b29bd3d8..3f523dda58e7 100644 --- a/dpnp/tensor/libtensor/include/utils/output_validation.hpp +++ b/dpnp/tensor/libtensor/include/utils/output_validation.hpp @@ -39,7 +39,7 @@ #include "dpnp4pybind11.hpp" -namespace dpctl::tensor::validation +namespace dpnp::tensor::validation { namespace py = pybind11; @@ -48,7 +48,7 @@ namespace py = pybind11; This should be called with an array before writing.*/ struct CheckWritable { - static void throw_if_not_writable(const dpctl::tensor::usm_ndarray &arr) + static void throw_if_not_writable(const dpnp::tensor::usm_ndarray &arr) { if (!arr.is_writable()) { throw py::value_error("output array is read-only."); @@ -64,7 +64,7 @@ struct CheckWritable struct AmpleMemory { template - static void throw_if_not_ample(const dpctl::tensor::usm_ndarray &arr, + static void throw_if_not_ample(const dpnp::tensor::usm_ndarray &arr, T nelems) { auto arr_offsets = arr.get_minmax_offsets(); @@ -76,4 +76,4 @@ struct AmpleMemory return; } }; -} // namespace dpctl::tensor::validation +} // namespace dpnp::tensor::validation diff --git a/dpnp/tensor/libtensor/include/utils/rich_comparisons.hpp b/dpnp/tensor/libtensor/include/utils/rich_comparisons.hpp index 5d03294392d8..0db7168ab9f7 100644 --- a/dpnp/tensor/libtensor/include/utils/rich_comparisons.hpp +++ b/dpnp/tensor/libtensor/include/utils/rich_comparisons.hpp @@ -27,7 +27,7 @@ //***************************************************************************** /// /// \file -/// This file defines functions of dpctl.tensor._tensor_sorting_impl +/// This file defines functions of dpnp.tensor._tensor_sorting_impl /// extension. //===---------------------------------------------------------------------===// @@ -40,7 +40,7 @@ #include "sycl/sycl.hpp" -namespace dpctl::tensor::rich_comparisons +namespace dpnp::tensor::rich_comparisons { namespace detail @@ -146,4 +146,4 @@ struct DescendingSorter> using type = detail::ExtendedComplexFPGreater>; }; -} // namespace dpctl::tensor::rich_comparisons +} // namespace dpnp::tensor::rich_comparisons diff --git a/dpnp/tensor/libtensor/include/utils/strided_iters.hpp b/dpnp/tensor/libtensor/include/utils/strided_iters.hpp index 65250b755b56..29c17467cd78 100644 --- a/dpnp/tensor/libtensor/include/utils/strided_iters.hpp +++ b/dpnp/tensor/libtensor/include/utils/strided_iters.hpp @@ -41,7 +41,7 @@ #include #include -namespace dpctl::tensor::strides +namespace dpnp::tensor::strides { /* An N-dimensional array can be stored in a single * contiguous chunk of memory by contiguously laying @@ -981,4 +981,4 @@ int compact_iteration(const int nd, ShapeTy *shape, StridesTy *strides) return nd_; } -} // namespace dpctl::tensor::strides +} // namespace dpnp::tensor::strides diff --git a/dpnp/tensor/libtensor/include/utils/sycl_alloc_utils.hpp b/dpnp/tensor/libtensor/include/utils/sycl_alloc_utils.hpp index 76f0174b9fdf..a3891a888430 100644 --- a/dpnp/tensor/libtensor/include/utils/sycl_alloc_utils.hpp +++ b/dpnp/tensor/libtensor/include/utils/sycl_alloc_utils.hpp @@ -44,7 +44,7 @@ #include -namespace dpctl::tensor::alloc_utils +namespace dpnp::tensor::alloc_utils { template class usm_host_allocator : public sycl::usm_allocator @@ -220,4 +220,4 @@ sycl::event async_smart_free(sycl::queue &exec_q, return ht_e; } -} // namespace dpctl::tensor::alloc_utils +} // namespace dpnp::tensor::alloc_utils diff --git a/dpnp/tensor/libtensor/include/utils/sycl_utils.hpp b/dpnp/tensor/libtensor/include/utils/sycl_utils.hpp index 9ae41e5ade6e..bd42a05f6bfd 100644 --- a/dpnp/tensor/libtensor/include/utils/sycl_utils.hpp +++ b/dpnp/tensor/libtensor/include/utils/sycl_utils.hpp @@ -46,7 +46,7 @@ #include "math_utils.hpp" -namespace dpctl::tensor::sycl_utils +namespace dpnp::tensor::sycl_utils { namespace detail { @@ -335,7 +335,7 @@ struct Maximum T operator()(const T &x, const T &y) const { if constexpr (detail::IsComplex::value) { - using dpctl::tensor::math_utils::max_complex; + using dpnp::tensor::math_utils::max_complex; return max_complex(x, y); } else if constexpr (std::is_floating_point_v || @@ -359,7 +359,7 @@ struct Minimum T operator()(const T &x, const T &y) const { if constexpr (detail::IsComplex::value) { - using dpctl::tensor::math_utils::min_complex; + using dpnp::tensor::math_utils::min_complex; return min_complex(x, y); } else if constexpr (std::is_floating_point_v || @@ -481,7 +481,7 @@ struct LogSumExp { T operator()(const T &x, const T &y) const { - using dpctl::tensor::math_utils::logaddexp; + using dpnp::tensor::math_utils::logaddexp; return logaddexp(x, y); } }; @@ -671,4 +671,4 @@ std::enable_if_t< return; #endif } -} // namespace dpctl::tensor::sycl_utils +} // namespace dpnp::tensor::sycl_utils diff --git a/dpnp/tensor/libtensor/include/utils/type_dispatch.hpp b/dpnp/tensor/libtensor/include/utils/type_dispatch.hpp index bead0da5093e..c2bb2a182a5b 100644 --- a/dpnp/tensor/libtensor/include/utils/type_dispatch.hpp +++ b/dpnp/tensor/libtensor/include/utils/type_dispatch.hpp @@ -41,14 +41,14 @@ #include "type_dispatch_building.hpp" -namespace dpctl::tensor::type_dispatch +namespace dpnp::tensor::type_dispatch { struct usm_ndarray_types { int typenum_to_lookup_id(int typenum) const { - using typenum_t = ::dpctl::tensor::type_dispatch::typenum_t; - auto const &api = ::dpctl::detail::dpctl_capi::get(); + using typenum_t = ::dpnp::tensor::type_dispatch::typenum_t; + auto const &api = ::dpnp::detail::dpnp_capi::get(); if (typenum == api.UAR_DOUBLE_) { return static_cast(typenum_t::DOUBLE); @@ -132,4 +132,4 @@ struct usm_ndarray_types std::to_string(typenum) + " encountered."); } }; -} // namespace dpctl::tensor::type_dispatch +} // namespace dpnp::tensor::type_dispatch diff --git a/dpnp/tensor/libtensor/include/utils/type_dispatch_building.hpp b/dpnp/tensor/libtensor/include/utils/type_dispatch_building.hpp index 7170624b5bbe..ec89c9ad4eab 100644 --- a/dpnp/tensor/libtensor/include/utils/type_dispatch_building.hpp +++ b/dpnp/tensor/libtensor/include/utils/type_dispatch_building.hpp @@ -40,7 +40,7 @@ #include -namespace dpctl::tensor::type_dispatch +namespace dpnp::tensor::type_dispatch { enum class typenum_t : int { @@ -290,4 +290,4 @@ struct NotDefinedEntry : std::true_type { static constexpr bool is_defined = false; }; -} // namespace dpctl::tensor::type_dispatch +} // namespace dpnp::tensor::type_dispatch diff --git a/dpnp/tensor/libtensor/include/utils/type_utils.hpp b/dpnp/tensor/libtensor/include/utils/type_utils.hpp index 47b1a5554815..49353310686f 100644 --- a/dpnp/tensor/libtensor/include/utils/type_utils.hpp +++ b/dpnp/tensor/libtensor/include/utils/type_utils.hpp @@ -41,7 +41,7 @@ #include -namespace dpctl::tensor::type_utils +namespace dpnp::tensor::type_utils { template struct is_complex : public std::false_type @@ -160,4 +160,4 @@ auto vec_cast(const sycl::vec &s) Indices{}); } } -} // namespace dpctl::tensor::type_utils +} // namespace dpnp::tensor::type_utils diff --git a/dpnp/tensor/libtensor/source/accumulators.cpp b/dpnp/tensor/libtensor/source/accumulators.cpp index c6ab96418d47..8605496087ff 100644 --- a/dpnp/tensor/libtensor/source/accumulators.cpp +++ b/dpnp/tensor/libtensor/source/accumulators.cpp @@ -29,7 +29,7 @@ //===----------------------------------------------------------------------===// /// /// \file -/// This file defines functions of dpctl.tensor._tensor_impl extensions +/// This file defines functions of dpnp.tensor._tensor_impl extensions //===----------------------------------------------------------------------===// #include @@ -53,21 +53,21 @@ #include "utils/sycl_alloc_utils.hpp" #include "utils/type_dispatch.hpp" -namespace dpctl::tensor::py_internal +namespace dpnp::tensor::py_internal { // Computation of positions of masked elements namespace py = pybind11; -namespace td_ns = dpctl::tensor::type_dispatch; +namespace td_ns = dpnp::tensor::type_dispatch; -using dpctl::tensor::kernels::accumulators::cumsum_val_contig_impl_fn_ptr_t; +using dpnp::tensor::kernels::accumulators::cumsum_val_contig_impl_fn_ptr_t; static cumsum_val_contig_impl_fn_ptr_t mask_positions_contig_i64_dispatch_vector[td_ns::num_types]; static cumsum_val_contig_impl_fn_ptr_t mask_positions_contig_i32_dispatch_vector[td_ns::num_types]; -using dpctl::tensor::kernels::accumulators::cumsum_val_strided_impl_fn_ptr_t; +using dpnp::tensor::kernels::accumulators::cumsum_val_strided_impl_fn_ptr_t; static cumsum_val_strided_impl_fn_ptr_t mask_positions_strided_i64_dispatch_vector[td_ns::num_types]; static cumsum_val_strided_impl_fn_ptr_t @@ -75,7 +75,7 @@ static cumsum_val_strided_impl_fn_ptr_t void populate_mask_positions_dispatch_vectors(void) { - using dpctl::tensor::kernels::accumulators:: + using dpnp::tensor::kernels::accumulators:: MaskPositionsContigFactoryForInt64; td_ns::DispatchVectorBuilder &depends) { - dpctl::tensor::validation::CheckWritable::throw_if_not_writable(cumsum); + dpnp::tensor::validation::CheckWritable::throw_if_not_writable(cumsum); // cumsum is 1D if (cumsum.get_ndim() != 1) { @@ -133,7 +133,7 @@ std::size_t py_mask_positions(const dpctl::tensor::usm_ndarray &mask, throw py::value_error("Inconsistent dimensions"); } - if (!dpctl::utils::queues_are_compatible(exec_q, {mask, cumsum})) { + if (!dpnp::utils::queues_are_compatible(exec_q, {mask, cumsum})) { // FIXME: use ExecutionPlacementError throw py::value_error( "Execution queue is not compatible with allocation queues"); @@ -205,7 +205,7 @@ std::size_t py_mask_positions(const dpctl::tensor::usm_ndarray &mask, (use_i32) ? mask_positions_strided_i32_dispatch_vector[mask_typeid] : mask_positions_strided_i64_dispatch_vector[mask_typeid]; - using dpctl::tensor::offset_utils::device_allocate_and_pack; + using dpnp::tensor::offset_utils::device_allocate_and_pack; auto ptr_size_event_tuple = device_allocate_and_pack( exec_q, host_task_events, compact_shape, compact_strides); auto shape_strides_owner = std::move(std::get<0>(ptr_size_event_tuple)); @@ -247,22 +247,22 @@ std::size_t py_mask_positions(const dpctl::tensor::usm_ndarray &mask, return total_set; } -using dpctl::tensor::kernels::accumulators::cumsum_val_strided_impl_fn_ptr_t; +using dpnp::tensor::kernels::accumulators::cumsum_val_strided_impl_fn_ptr_t; static cumsum_val_strided_impl_fn_ptr_t cumsum_1d_strided_dispatch_vector[td_ns::num_types]; -using dpctl::tensor::kernels::accumulators::cumsum_val_contig_impl_fn_ptr_t; +using dpnp::tensor::kernels::accumulators::cumsum_val_contig_impl_fn_ptr_t; static cumsum_val_contig_impl_fn_ptr_t cumsum_1d_contig_dispatch_vector[td_ns::num_types]; void populate_cumsum_1d_dispatch_vectors(void) { - using dpctl::tensor::kernels::accumulators::Cumsum1DContigFactory; + using dpnp::tensor::kernels::accumulators::Cumsum1DContigFactory; td_ns::DispatchVectorBuilder dvb1; dvb1.populate_dispatch_vector(cumsum_1d_contig_dispatch_vector); - using dpctl::tensor::kernels::accumulators::Cumsum1DStridedFactory; + using dpnp::tensor::kernels::accumulators::Cumsum1DStridedFactory; td_ns::DispatchVectorBuilder dvb2; @@ -271,8 +271,8 @@ void populate_cumsum_1d_dispatch_vectors(void) return; } -std::size_t py_cumsum_1d(const dpctl::tensor::usm_ndarray &src, - const dpctl::tensor::usm_ndarray &cumsum, +std::size_t py_cumsum_1d(const dpnp::tensor::usm_ndarray &src, + const dpnp::tensor::usm_ndarray &cumsum, sycl::queue &exec_q, std::vector const &depends) { @@ -292,13 +292,13 @@ std::size_t py_cumsum_1d(const dpctl::tensor::usm_ndarray &src, throw py::value_error("Inconsistent dimensions"); } - if (!dpctl::utils::queues_are_compatible(exec_q, {src, cumsum})) { + if (!dpnp::utils::queues_are_compatible(exec_q, {src, cumsum})) { // FIXME: use ExecutionPlacementError throw py::value_error( "Execution queue is not compatible with allocation queues"); } - dpctl::tensor::validation::CheckWritable::throw_if_not_writable(cumsum); + dpnp::tensor::validation::CheckWritable::throw_if_not_writable(cumsum); if (src_size == 0) { return 0; @@ -363,7 +363,7 @@ std::size_t py_cumsum_1d(const dpctl::tensor::usm_ndarray &src, std::to_string(src_typeid)); } - using dpctl::tensor::offset_utils::device_allocate_and_pack; + using dpnp::tensor::offset_utils::device_allocate_and_pack; auto ptr_size_event_tuple = device_allocate_and_pack( exec_q, host_task_events, compact_shape, compact_strides); auto shape_strides_owner = std::move(std::get<0>(ptr_size_event_tuple)); @@ -404,4 +404,4 @@ std::size_t py_cumsum_1d(const dpctl::tensor::usm_ndarray &src, return total; } -} // namespace dpctl::tensor::py_internal +} // namespace dpnp::tensor::py_internal diff --git a/dpnp/tensor/libtensor/source/accumulators.hpp b/dpnp/tensor/libtensor/source/accumulators.hpp index e400aad2dceb..0f9539437d21 100644 --- a/dpnp/tensor/libtensor/source/accumulators.hpp +++ b/dpnp/tensor/libtensor/source/accumulators.hpp @@ -29,7 +29,7 @@ //===----------------------------------------------------------------------===// /// /// \file -/// This file defines functions of dpctl.tensor._tensor_impl extensions +/// This file defines functions of dpnp.tensor._tensor_impl extensions //===----------------------------------------------------------------------===// #pragma once @@ -40,22 +40,22 @@ #include "dpnp4pybind11.hpp" -namespace dpctl::tensor::py_internal +namespace dpnp::tensor::py_internal { extern void populate_mask_positions_dispatch_vectors(void); extern std::size_t - py_mask_positions(const dpctl::tensor::usm_ndarray &mask, - const dpctl::tensor::usm_ndarray &cumsum, + py_mask_positions(const dpnp::tensor::usm_ndarray &mask, + const dpnp::tensor::usm_ndarray &cumsum, sycl::queue &exec_q, const std::vector &depends = {}); extern void populate_cumsum_1d_dispatch_vectors(void); -extern std::size_t py_cumsum_1d(const dpctl::tensor::usm_ndarray &src, - const dpctl::tensor::usm_ndarray &cumsum, +extern std::size_t py_cumsum_1d(const dpnp::tensor::usm_ndarray &src, + const dpnp::tensor::usm_ndarray &cumsum, sycl::queue &exec_q, std::vector const &depends = {}); -} // namespace dpctl::tensor::py_internal +} // namespace dpnp::tensor::py_internal diff --git a/dpnp/tensor/libtensor/source/accumulators/accumulate_over_axis.hpp b/dpnp/tensor/libtensor/source/accumulators/accumulate_over_axis.hpp index bce47c45f9b1..9810c82016f1 100644 --- a/dpnp/tensor/libtensor/source/accumulators/accumulate_over_axis.hpp +++ b/dpnp/tensor/libtensor/source/accumulators/accumulate_over_axis.hpp @@ -29,7 +29,7 @@ //===----------------------------------------------------------------------===// /// /// \file -/// This file defines functions of dpctl.tensor._tensor_accumulation_impl +/// This file defines functions of dpnp.tensor._tensor_accumulation_impl // extensions //===----------------------------------------------------------------------===// @@ -59,17 +59,17 @@ #include "utils/sycl_alloc_utils.hpp" #include "utils/type_dispatch.hpp" -namespace dpctl::tensor::py_internal +namespace dpnp::tensor::py_internal { namespace py = pybind11; -namespace td_ns = dpctl::tensor::type_dispatch; +namespace td_ns = dpnp::tensor::type_dispatch; template std::pair - py_accumulate_over_axis(const dpctl::tensor::usm_ndarray &src, + py_accumulate_over_axis(const dpnp::tensor::usm_ndarray &src, const int trailing_dims_to_accumulate, - const dpctl::tensor::usm_ndarray &dst, + const dpnp::tensor::usm_ndarray &dst, sycl::queue &exec_q, std::vector const &depends, const strided_fnT &strided_dispatch_table, @@ -111,23 +111,23 @@ std::pair "Destination shape does not match the input shape"); } - if (!dpctl::utils::queues_are_compatible(exec_q, {src, dst})) { + if (!dpnp::utils::queues_are_compatible(exec_q, {src, dst})) { throw py::value_error( "Execution queue is not compatible with allocation queues"); } - dpctl::tensor::validation::CheckWritable::throw_if_not_writable(dst); + dpnp::tensor::validation::CheckWritable::throw_if_not_writable(dst); if ((iter_nelems == 0) || (acc_nelems == 0)) { return std::make_pair(sycl::event(), sycl::event()); } - auto const &overlap = dpctl::tensor::overlap::MemoryOverlap(); + auto const &overlap = dpnp::tensor::overlap::MemoryOverlap(); if (overlap(src, dst)) { throw py::value_error("Arrays index overlapping segments of memory"); } - dpctl::tensor::validation::AmpleMemory::throw_if_not_ample( + dpnp::tensor::validation::AmpleMemory::throw_if_not_ample( dst, acc_nelems * iter_nelems); const char *src_data = src.get_data(); @@ -155,8 +155,7 @@ std::pair host_task_events, depends); return std::make_pair( - dpctl::utils::keep_args_alive(exec_q, {src, dst}, {acc_ev}), - acc_ev); + dpnp::utils::keep_args_alive(exec_q, {src, dst}, {acc_ev}), acc_ev); } auto src_shape_vec = src.get_shape_vector(); @@ -209,7 +208,7 @@ std::pair throw std::runtime_error("Datatypes are not supported"); } - using dpctl::tensor::offset_utils::device_allocate_and_pack; + using dpnp::tensor::offset_utils::device_allocate_and_pack; auto ptr_size_event_tuple = device_allocate_and_pack( exec_q, host_task_events, simplified_iter_shape, simplified_iter_src_strides, simplified_iter_dst_strides, acc_shape, @@ -234,19 +233,19 @@ std::pair iter_shape_and_strides, iter_src_offset, iter_dst_offset, acc_nd, acc_shapes_and_strides, dst_data, host_task_events, all_deps); - sycl::event temp_cleanup_ev = dpctl::tensor::alloc_utils::async_smart_free( + sycl::event temp_cleanup_ev = dpnp::tensor::alloc_utils::async_smart_free( exec_q, {acc_ev}, packed_shapes_and_strides_owner); host_task_events.push_back(temp_cleanup_ev); return std::make_pair( - dpctl::utils::keep_args_alive(exec_q, {src, dst}, host_task_events), + dpnp::utils::keep_args_alive(exec_q, {src, dst}, host_task_events), acc_ev); } template std::pair py_accumulate_final_axis_include_initial( - const dpctl::tensor::usm_ndarray &src, - const dpctl::tensor::usm_ndarray &dst, + const dpnp::tensor::usm_ndarray &src, + const dpnp::tensor::usm_ndarray &dst, sycl::queue &exec_q, std::vector const &depends, const strided_fnT &strided_dispatch_table, @@ -291,23 +290,23 @@ std::pair py_accumulate_final_axis_include_initial( "Destination shape does not match the input shape"); } - if (!dpctl::utils::queues_are_compatible(exec_q, {src, dst})) { + if (!dpnp::utils::queues_are_compatible(exec_q, {src, dst})) { throw py::value_error( "Execution queue is not compatible with allocation queues"); } - dpctl::tensor::validation::CheckWritable::throw_if_not_writable(dst); + dpnp::tensor::validation::CheckWritable::throw_if_not_writable(dst); if ((iter_nelems == 0) || (acc_nelems == 0)) { return std::make_pair(sycl::event(), sycl::event()); } - auto const &overlap = dpctl::tensor::overlap::MemoryOverlap(); + auto const &overlap = dpnp::tensor::overlap::MemoryOverlap(); if (overlap(src, dst)) { throw py::value_error("Arrays index overlapping segments of memory"); } - dpctl::tensor::validation::AmpleMemory::throw_if_not_ample( + dpnp::tensor::validation::AmpleMemory::throw_if_not_ample( dst, acc_nelems * iter_nelems); const char *src_data = src.get_data(); @@ -335,8 +334,7 @@ std::pair py_accumulate_final_axis_include_initial( host_task_events, depends); return std::make_pair( - dpctl::utils::keep_args_alive(exec_q, {src, dst}, {acc_ev}), - acc_ev); + dpnp::utils::keep_args_alive(exec_q, {src, dst}, {acc_ev}), acc_ev); } auto src_shape_vec = src.get_shape_vector(); @@ -387,7 +385,7 @@ std::pair py_accumulate_final_axis_include_initial( throw std::runtime_error("Datatypes are not supported"); } - using dpctl::tensor::offset_utils::device_allocate_and_pack; + using dpnp::tensor::offset_utils::device_allocate_and_pack; auto ptr_size_event_tuple = device_allocate_and_pack( exec_q, host_task_events, simplified_iter_shape, simplified_iter_src_strides, simplified_iter_dst_strides, acc_shape, @@ -412,12 +410,12 @@ std::pair py_accumulate_final_axis_include_initial( iter_shape_and_strides, iter_src_offset, iter_dst_offset, acc_nd, acc_shapes_and_strides, dst_data, host_task_events, all_deps); - sycl::event temp_cleanup_ev = dpctl::tensor::alloc_utils::async_smart_free( + sycl::event temp_cleanup_ev = dpnp::tensor::alloc_utils::async_smart_free( exec_q, {acc_ev}, packed_shapes_and_strides_owner); host_task_events.push_back(temp_cleanup_ev); return std::make_pair( - dpctl::utils::keep_args_alive(exec_q, {src, dst}, host_task_events), + dpnp::utils::keep_args_alive(exec_q, {src, dst}, host_task_events), acc_ev); } @@ -429,9 +427,9 @@ bool py_accumulate_dtype_supported(const py::dtype &input_dtype, const fnT &dispatch_table) { int arg_tn = - input_dtype.num(); // NumPy type numbers are the same as in dpctl + input_dtype.num(); // NumPy type numbers are the same as in dpnp int out_tn = - output_dtype.num(); // NumPy type numbers are the same as in dpctl + output_dtype.num(); // NumPy type numbers are the same as in dpnp int arg_typeid = -1; int out_typeid = -1; @@ -458,4 +456,4 @@ bool py_accumulate_dtype_supported(const py::dtype &input_dtype, return (fn != nullptr); } -} // namespace dpctl::tensor::py_internal +} // namespace dpnp::tensor::py_internal diff --git a/dpnp/tensor/libtensor/source/accumulators/accumulators_common.cpp b/dpnp/tensor/libtensor/source/accumulators/accumulators_common.cpp index 5e07e81b7ad5..6a95ef01beec 100644 --- a/dpnp/tensor/libtensor/source/accumulators/accumulators_common.cpp +++ b/dpnp/tensor/libtensor/source/accumulators/accumulators_common.cpp @@ -29,7 +29,7 @@ //===----------------------------------------------------------------------===// /// /// \file -/// This file defines functions of dpctl.tensor._tensor_accumulation_impl +/// This file defines functions of dpnp.tensor._tensor_accumulation_impl // extensions //===----------------------------------------------------------------------===// @@ -41,7 +41,7 @@ namespace py = pybind11; -namespace dpctl::tensor::py_internal +namespace dpnp::tensor::py_internal { /*! @brief Add accumulators to Python module */ @@ -52,4 +52,4 @@ void init_accumulator_functions(py::module_ m) init_cumulative_sum(m); } -} // namespace dpctl::tensor::py_internal +} // namespace dpnp::tensor::py_internal diff --git a/dpnp/tensor/libtensor/source/accumulators/accumulators_common.hpp b/dpnp/tensor/libtensor/source/accumulators/accumulators_common.hpp index c33a040a7fa7..d33cc7f1d84c 100644 --- a/dpnp/tensor/libtensor/source/accumulators/accumulators_common.hpp +++ b/dpnp/tensor/libtensor/source/accumulators/accumulators_common.hpp @@ -29,7 +29,7 @@ //===----------------------------------------------------------------------===// /// /// \file -/// This file defines functions of dpctl.tensor._tensor_accumulation_impl +/// This file defines functions of dpnp.tensor._tensor_accumulation_impl // extensions //===----------------------------------------------------------------------===// @@ -38,9 +38,9 @@ namespace py = pybind11; -namespace dpctl::tensor::py_internal +namespace dpnp::tensor::py_internal { extern void init_accumulator_functions(py::module_); -} // namespace dpctl::tensor::py_internal +} // namespace dpnp::tensor::py_internal diff --git a/dpnp/tensor/libtensor/source/accumulators/cumulative_logsumexp.cpp b/dpnp/tensor/libtensor/source/accumulators/cumulative_logsumexp.cpp index d4961c9edbf1..5f8611499ff0 100644 --- a/dpnp/tensor/libtensor/source/accumulators/cumulative_logsumexp.cpp +++ b/dpnp/tensor/libtensor/source/accumulators/cumulative_logsumexp.cpp @@ -29,7 +29,7 @@ //===----------------------------------------------------------------------===// /// /// \file -/// This file defines functions of dpctl.tensor._tensor_accumulation_impl +/// This file defines functions of dpnp.tensor._tensor_accumulation_impl // extensions //===----------------------------------------------------------------------===// @@ -51,20 +51,20 @@ namespace py = pybind11; -namespace dpctl::tensor::py_internal +namespace dpnp::tensor::py_internal { -namespace su_ns = dpctl::tensor::sycl_utils; -namespace td_ns = dpctl::tensor::type_dispatch; +namespace su_ns = dpnp::tensor::sycl_utils; +namespace td_ns = dpnp::tensor::type_dispatch; namespace impl { -using dpctl::tensor::kernels::accumulators::accumulate_1d_contig_impl_fn_ptr_t; +using dpnp::tensor::kernels::accumulators::accumulate_1d_contig_impl_fn_ptr_t; static accumulate_1d_contig_impl_fn_ptr_t cumlogsumexp_1d_contig_dispatch_table[td_ns::num_types][td_ns::num_types]; -using dpctl::tensor::kernels::accumulators::accumulate_strided_impl_fn_ptr_t; +using dpnp::tensor::kernels::accumulators::accumulate_strided_impl_fn_ptr_t; static accumulate_strided_impl_fn_ptr_t cumlogsumexp_strided_dispatch_table[td_ns::num_types][td_ns::num_types]; @@ -144,16 +144,16 @@ struct CumLogSumExp1DContigFactory using ScanOpT = su_ns::LogSumExp; static constexpr bool include_initial = false; if constexpr (std::is_same_v) { - using dpctl::tensor::kernels::accumulators::NoOpTransformer; - fnT fn = dpctl::tensor::kernels::accumulators:: + using dpnp::tensor::kernels::accumulators::NoOpTransformer; + fnT fn = dpnp::tensor::kernels::accumulators:: accumulate_1d_contig_impl, ScanOpT, include_initial>; return fn; } else { - using dpctl::tensor::kernels::accumulators::CastTransformer; - fnT fn = dpctl::tensor::kernels::accumulators:: + using dpnp::tensor::kernels::accumulators::CastTransformer; + fnT fn = dpnp::tensor::kernels::accumulators:: accumulate_1d_contig_impl, ScanOpT, include_initial>; @@ -176,16 +176,16 @@ struct CumLogSumExp1DIncludeInitialContigFactory using ScanOpT = su_ns::LogSumExp; static constexpr bool include_initial = true; if constexpr (std::is_same_v) { - using dpctl::tensor::kernels::accumulators::NoOpTransformer; - fnT fn = dpctl::tensor::kernels::accumulators:: + using dpnp::tensor::kernels::accumulators::NoOpTransformer; + fnT fn = dpnp::tensor::kernels::accumulators:: accumulate_1d_contig_impl, ScanOpT, include_initial>; return fn; } else { - using dpctl::tensor::kernels::accumulators::CastTransformer; - fnT fn = dpctl::tensor::kernels::accumulators:: + using dpnp::tensor::kernels::accumulators::CastTransformer; + fnT fn = dpnp::tensor::kernels::accumulators:: accumulate_1d_contig_impl, ScanOpT, include_initial>; @@ -208,16 +208,16 @@ struct CumLogSumExpStridedFactory using ScanOpT = su_ns::LogSumExp; static constexpr bool include_initial = false; if constexpr (std::is_same_v) { - using dpctl::tensor::kernels::accumulators::NoOpTransformer; - fnT fn = dpctl::tensor::kernels::accumulators:: + using dpnp::tensor::kernels::accumulators::NoOpTransformer; + fnT fn = dpnp::tensor::kernels::accumulators:: accumulate_strided_impl, ScanOpT, include_initial>; return fn; } else { - using dpctl::tensor::kernels::accumulators::CastTransformer; - fnT fn = dpctl::tensor::kernels::accumulators:: + using dpnp::tensor::kernels::accumulators::CastTransformer; + fnT fn = dpnp::tensor::kernels::accumulators:: accumulate_strided_impl, ScanOpT, include_initial>; @@ -240,16 +240,16 @@ struct CumLogSumExpIncludeInitialStridedFactory using ScanOpT = su_ns::LogSumExp; static constexpr bool include_initial = true; if constexpr (std::is_same_v) { - using dpctl::tensor::kernels::accumulators::NoOpTransformer; - fnT fn = dpctl::tensor::kernels::accumulators:: + using dpnp::tensor::kernels::accumulators::NoOpTransformer; + fnT fn = dpnp::tensor::kernels::accumulators:: accumulate_strided_impl, ScanOpT, include_initial>; return fn; } else { - using dpctl::tensor::kernels::accumulators::CastTransformer; - fnT fn = dpctl::tensor::kernels::accumulators:: + using dpnp::tensor::kernels::accumulators::CastTransformer; + fnT fn = dpnp::tensor::kernels::accumulators:: accumulate_strided_impl, ScanOpT, include_initial>; @@ -295,7 +295,7 @@ void populate_cumlogsumexp_dispatch_tables(void) void init_cumulative_logsumexp(py::module_ m) { - using arrayT = dpctl::tensor::usm_ndarray; + using arrayT = dpnp::tensor::usm_ndarray; using event_vecT = std::vector; using impl::populate_cumlogsumexp_dispatch_tables; @@ -340,4 +340,4 @@ void init_cumulative_logsumexp(py::module_ m) py::arg("arg_dtype"), py::arg("out_dtype")); } -} // namespace dpctl::tensor::py_internal +} // namespace dpnp::tensor::py_internal diff --git a/dpnp/tensor/libtensor/source/accumulators/cumulative_logsumexp.hpp b/dpnp/tensor/libtensor/source/accumulators/cumulative_logsumexp.hpp index f1292320bd0d..967712e1b57c 100644 --- a/dpnp/tensor/libtensor/source/accumulators/cumulative_logsumexp.hpp +++ b/dpnp/tensor/libtensor/source/accumulators/cumulative_logsumexp.hpp @@ -29,7 +29,7 @@ //===----------------------------------------------------------------------===// /// /// \file -/// This file defines functions of dpctl.tensor._tensor_accumulation_impl +/// This file defines functions of dpnp.tensor._tensor_accumulation_impl // extensions //===----------------------------------------------------------------------===// @@ -38,9 +38,9 @@ namespace py = pybind11; -namespace dpctl::tensor::py_internal +namespace dpnp::tensor::py_internal { extern void init_cumulative_logsumexp(py::module_ m); -} // namespace dpctl::tensor::py_internal +} // namespace dpnp::tensor::py_internal diff --git a/dpnp/tensor/libtensor/source/accumulators/cumulative_prod.cpp b/dpnp/tensor/libtensor/source/accumulators/cumulative_prod.cpp index 319709b30a76..20828a80e476 100644 --- a/dpnp/tensor/libtensor/source/accumulators/cumulative_prod.cpp +++ b/dpnp/tensor/libtensor/source/accumulators/cumulative_prod.cpp @@ -29,7 +29,7 @@ //===----------------------------------------------------------------------===// /// /// \file -/// This file defines functions of dpctl.tensor._tensor_accumulation_impl +/// This file defines functions of dpnp.tensor._tensor_accumulation_impl // extensions //===----------------------------------------------------------------------===// @@ -51,19 +51,19 @@ namespace py = pybind11; -namespace dpctl::tensor::py_internal +namespace dpnp::tensor::py_internal { -namespace td_ns = dpctl::tensor::type_dispatch; +namespace td_ns = dpnp::tensor::type_dispatch; namespace impl { -using dpctl::tensor::kernels::accumulators::accumulate_1d_contig_impl_fn_ptr_t; +using dpnp::tensor::kernels::accumulators::accumulate_1d_contig_impl_fn_ptr_t; static accumulate_1d_contig_impl_fn_ptr_t cumprod_1d_contig_dispatch_table[td_ns::num_types][td_ns::num_types]; -using dpctl::tensor::kernels::accumulators::accumulate_strided_impl_fn_ptr_t; +using dpnp::tensor::kernels::accumulators::accumulate_strided_impl_fn_ptr_t; static accumulate_strided_impl_fn_ptr_t cumprod_strided_dispatch_table[td_ns::num_types][td_ns::num_types]; @@ -156,16 +156,16 @@ struct CumProd1DContigFactory using ScanOpT = CumProdScanOpT; static constexpr bool include_initial = false; if constexpr (std::is_same_v) { - using dpctl::tensor::kernels::accumulators::NoOpTransformer; - fnT fn = dpctl::tensor::kernels::accumulators:: + using dpnp::tensor::kernels::accumulators::NoOpTransformer; + fnT fn = dpnp::tensor::kernels::accumulators:: accumulate_1d_contig_impl, ScanOpT, include_initial>; return fn; } else { - using dpctl::tensor::kernels::accumulators::CastTransformer; - fnT fn = dpctl::tensor::kernels::accumulators:: + using dpnp::tensor::kernels::accumulators::CastTransformer; + fnT fn = dpnp::tensor::kernels::accumulators:: accumulate_1d_contig_impl, ScanOpT, include_initial>; @@ -188,16 +188,16 @@ struct CumProd1DIncludeInitialContigFactory using ScanOpT = CumProdScanOpT; static constexpr bool include_initial = true; if constexpr (std::is_same_v) { - using dpctl::tensor::kernels::accumulators::NoOpTransformer; - fnT fn = dpctl::tensor::kernels::accumulators:: + using dpnp::tensor::kernels::accumulators::NoOpTransformer; + fnT fn = dpnp::tensor::kernels::accumulators:: accumulate_1d_contig_impl, ScanOpT, include_initial>; return fn; } else { - using dpctl::tensor::kernels::accumulators::CastTransformer; - fnT fn = dpctl::tensor::kernels::accumulators:: + using dpnp::tensor::kernels::accumulators::CastTransformer; + fnT fn = dpnp::tensor::kernels::accumulators:: accumulate_1d_contig_impl, ScanOpT, include_initial>; @@ -220,16 +220,16 @@ struct CumProdStridedFactory using ScanOpT = CumProdScanOpT; static constexpr bool include_initial = false; if constexpr (std::is_same_v) { - using dpctl::tensor::kernels::accumulators::NoOpTransformer; - fnT fn = dpctl::tensor::kernels::accumulators:: + using dpnp::tensor::kernels::accumulators::NoOpTransformer; + fnT fn = dpnp::tensor::kernels::accumulators:: accumulate_strided_impl, ScanOpT, include_initial>; return fn; } else { - using dpctl::tensor::kernels::accumulators::CastTransformer; - fnT fn = dpctl::tensor::kernels::accumulators:: + using dpnp::tensor::kernels::accumulators::CastTransformer; + fnT fn = dpnp::tensor::kernels::accumulators:: accumulate_strided_impl, ScanOpT, include_initial>; @@ -252,16 +252,16 @@ struct CumProdIncludeInitialStridedFactory using ScanOpT = CumProdScanOpT; static constexpr bool include_initial = true; if constexpr (std::is_same_v) { - using dpctl::tensor::kernels::accumulators::NoOpTransformer; - fnT fn = dpctl::tensor::kernels::accumulators:: + using dpnp::tensor::kernels::accumulators::NoOpTransformer; + fnT fn = dpnp::tensor::kernels::accumulators:: accumulate_strided_impl, ScanOpT, include_initial>; return fn; } else { - using dpctl::tensor::kernels::accumulators::CastTransformer; - fnT fn = dpctl::tensor::kernels::accumulators:: + using dpnp::tensor::kernels::accumulators::CastTransformer; + fnT fn = dpnp::tensor::kernels::accumulators:: accumulate_strided_impl, ScanOpT, include_initial>; @@ -307,7 +307,7 @@ void populate_cumprod_dispatch_tables(void) void init_cumulative_prod(py::module_ m) { - using arrayT = dpctl::tensor::usm_ndarray; + using arrayT = dpnp::tensor::usm_ndarray; using event_vecT = std::vector; using impl::populate_cumprod_dispatch_tables; @@ -349,4 +349,4 @@ void init_cumulative_prod(py::module_ m) py::arg("arg_dtype"), py::arg("out_dtype")); } -} // namespace dpctl::tensor::py_internal +} // namespace dpnp::tensor::py_internal diff --git a/dpnp/tensor/libtensor/source/accumulators/cumulative_prod.hpp b/dpnp/tensor/libtensor/source/accumulators/cumulative_prod.hpp index e14bb2c44361..177f933800f7 100644 --- a/dpnp/tensor/libtensor/source/accumulators/cumulative_prod.hpp +++ b/dpnp/tensor/libtensor/source/accumulators/cumulative_prod.hpp @@ -29,7 +29,7 @@ //===----------------------------------------------------------------------===// /// /// \file -/// This file defines functions of dpctl.tensor._tensor_accumulation_impl +/// This file defines functions of dpnp.tensor._tensor_accumulation_impl // extensions //===----------------------------------------------------------------------===// @@ -38,9 +38,9 @@ namespace py = pybind11; -namespace dpctl::tensor::py_internal +namespace dpnp::tensor::py_internal { extern void init_cumulative_prod(py::module_ m); -} // namespace dpctl::tensor::py_internal +} // namespace dpnp::tensor::py_internal diff --git a/dpnp/tensor/libtensor/source/accumulators/cumulative_sum.cpp b/dpnp/tensor/libtensor/source/accumulators/cumulative_sum.cpp index f700883af2a1..69b538eb2c1f 100644 --- a/dpnp/tensor/libtensor/source/accumulators/cumulative_sum.cpp +++ b/dpnp/tensor/libtensor/source/accumulators/cumulative_sum.cpp @@ -29,7 +29,7 @@ //===----------------------------------------------------------------------===// /// /// \file -/// This file defines functions of dpctl.tensor._tensor_accumulation_impl +/// This file defines functions of dpnp.tensor._tensor_accumulation_impl // extensions //===----------------------------------------------------------------------===// @@ -51,19 +51,19 @@ namespace py = pybind11; -namespace dpctl::tensor::py_internal +namespace dpnp::tensor::py_internal { -namespace td_ns = dpctl::tensor::type_dispatch; +namespace td_ns = dpnp::tensor::type_dispatch; namespace impl { -using dpctl::tensor::kernels::accumulators::accumulate_1d_contig_impl_fn_ptr_t; +using dpnp::tensor::kernels::accumulators::accumulate_1d_contig_impl_fn_ptr_t; static accumulate_1d_contig_impl_fn_ptr_t cumsum_1d_contig_dispatch_table[td_ns::num_types][td_ns::num_types]; -using dpctl::tensor::kernels::accumulators::accumulate_strided_impl_fn_ptr_t; +using dpnp::tensor::kernels::accumulators::accumulate_strided_impl_fn_ptr_t; static accumulate_strided_impl_fn_ptr_t cumsum_strided_dispatch_table[td_ns::num_types][td_ns::num_types]; @@ -155,16 +155,16 @@ struct CumSum1DContigFactory using ScanOpT = CumSumScanOpT; static constexpr bool include_initial = false; if constexpr (std::is_same_v) { - using dpctl::tensor::kernels::accumulators::NoOpTransformer; - fnT fn = dpctl::tensor::kernels::accumulators:: + using dpnp::tensor::kernels::accumulators::NoOpTransformer; + fnT fn = dpnp::tensor::kernels::accumulators:: accumulate_1d_contig_impl, ScanOpT, include_initial>; return fn; } else { - using dpctl::tensor::kernels::accumulators::CastTransformer; - fnT fn = dpctl::tensor::kernels::accumulators:: + using dpnp::tensor::kernels::accumulators::CastTransformer; + fnT fn = dpnp::tensor::kernels::accumulators:: accumulate_1d_contig_impl, ScanOpT, include_initial>; @@ -187,16 +187,16 @@ struct CumSum1DIncludeInitialContigFactory using ScanOpT = CumSumScanOpT; static constexpr bool include_initial = true; if constexpr (std::is_same_v) { - using dpctl::tensor::kernels::accumulators::NoOpTransformer; - fnT fn = dpctl::tensor::kernels::accumulators:: + using dpnp::tensor::kernels::accumulators::NoOpTransformer; + fnT fn = dpnp::tensor::kernels::accumulators:: accumulate_1d_contig_impl, ScanOpT, include_initial>; return fn; } else { - using dpctl::tensor::kernels::accumulators::CastTransformer; - fnT fn = dpctl::tensor::kernels::accumulators:: + using dpnp::tensor::kernels::accumulators::CastTransformer; + fnT fn = dpnp::tensor::kernels::accumulators:: accumulate_1d_contig_impl, ScanOpT, include_initial>; @@ -219,16 +219,16 @@ struct CumSumStridedFactory using ScanOpT = CumSumScanOpT; static constexpr bool include_initial = false; if constexpr (std::is_same_v) { - using dpctl::tensor::kernels::accumulators::NoOpTransformer; - fnT fn = dpctl::tensor::kernels::accumulators:: + using dpnp::tensor::kernels::accumulators::NoOpTransformer; + fnT fn = dpnp::tensor::kernels::accumulators:: accumulate_strided_impl, ScanOpT, include_initial>; return fn; } else { - using dpctl::tensor::kernels::accumulators::CastTransformer; - fnT fn = dpctl::tensor::kernels::accumulators:: + using dpnp::tensor::kernels::accumulators::CastTransformer; + fnT fn = dpnp::tensor::kernels::accumulators:: accumulate_strided_impl, ScanOpT, include_initial>; @@ -251,16 +251,16 @@ struct CumSumIncludeInitialStridedFactory using ScanOpT = CumSumScanOpT; static constexpr bool include_initial = true; if constexpr (std::is_same_v) { - using dpctl::tensor::kernels::accumulators::NoOpTransformer; - fnT fn = dpctl::tensor::kernels::accumulators:: + using dpnp::tensor::kernels::accumulators::NoOpTransformer; + fnT fn = dpnp::tensor::kernels::accumulators:: accumulate_strided_impl, ScanOpT, include_initial>; return fn; } else { - using dpctl::tensor::kernels::accumulators::CastTransformer; - fnT fn = dpctl::tensor::kernels::accumulators:: + using dpnp::tensor::kernels::accumulators::CastTransformer; + fnT fn = dpnp::tensor::kernels::accumulators:: accumulate_strided_impl, ScanOpT, include_initial>; @@ -305,7 +305,7 @@ void populate_cumsum_dispatch_tables(void) void init_cumulative_sum(py::module_ m) { - using arrayT = dpctl::tensor::usm_ndarray; + using arrayT = dpnp::tensor::usm_ndarray; using event_vecT = std::vector; using impl::populate_cumsum_dispatch_tables; @@ -347,4 +347,4 @@ void init_cumulative_sum(py::module_ m) py::arg("arg_dtype"), py::arg("out_dtype")); } -} // namespace dpctl::tensor::py_internal +} // namespace dpnp::tensor::py_internal diff --git a/dpnp/tensor/libtensor/source/accumulators/cumulative_sum.hpp b/dpnp/tensor/libtensor/source/accumulators/cumulative_sum.hpp index 5e06b222a3bc..056d02c74ab8 100644 --- a/dpnp/tensor/libtensor/source/accumulators/cumulative_sum.hpp +++ b/dpnp/tensor/libtensor/source/accumulators/cumulative_sum.hpp @@ -29,7 +29,7 @@ //===----------------------------------------------------------------------===// /// /// \file -/// This file defines functions of dpctl.tensor._tensor_accumulation_impl +/// This file defines functions of dpnp.tensor._tensor_accumulation_impl // extensions //===----------------------------------------------------------------------===// @@ -38,9 +38,9 @@ namespace py = pybind11; -namespace dpctl::tensor::py_internal +namespace dpnp::tensor::py_internal { extern void init_cumulative_sum(py::module_ m); -} // namespace dpctl::tensor::py_internal +} // namespace dpnp::tensor::py_internal diff --git a/dpnp/tensor/libtensor/source/boolean_advanced_indexing.cpp b/dpnp/tensor/libtensor/source/boolean_advanced_indexing.cpp index 146be45e4858..49471e03028e 100644 --- a/dpnp/tensor/libtensor/source/boolean_advanced_indexing.cpp +++ b/dpnp/tensor/libtensor/source/boolean_advanced_indexing.cpp @@ -29,8 +29,8 @@ //===----------------------------------------------------------------------===// /// /// \file -/// This file defines implementation functions of dpctl.tensor.place and -/// dpctl.tensor.extract, dpctl.tensor.nonzero +/// This file defines implementation functions of dpnp.tensor.place and +/// dpnp.tensor.extract, dpnp.tensor.nonzero //===----------------------------------------------------------------------===// #include @@ -61,14 +61,14 @@ #include "boolean_advanced_indexing.hpp" #include "kernels/boolean_advanced_indexing.hpp" -namespace dpctl::tensor::py_internal +namespace dpnp::tensor::py_internal { // Masked extraction -namespace td_ns = dpctl::tensor::type_dispatch; +namespace td_ns = dpnp::tensor::type_dispatch; -using dpctl::tensor::kernels::indexing:: +using dpnp::tensor::kernels::indexing:: masked_extract_all_slices_strided_impl_fn_ptr_t; static masked_extract_all_slices_strided_impl_fn_ptr_t @@ -78,7 +78,7 @@ static masked_extract_all_slices_strided_impl_fn_ptr_t masked_extract_all_slices_strided_i64_impl_dispatch_vector [td_ns::num_types]; -using dpctl::tensor::kernels::indexing:: +using dpnp::tensor::kernels::indexing:: masked_extract_all_slices_contig_impl_fn_ptr_t; static masked_extract_all_slices_contig_impl_fn_ptr_t @@ -86,7 +86,7 @@ static masked_extract_all_slices_contig_impl_fn_ptr_t static masked_extract_all_slices_contig_impl_fn_ptr_t masked_extract_all_slices_contig_i64_impl_dispatch_vector[td_ns::num_types]; -using dpctl::tensor::kernels::indexing:: +using dpnp::tensor::kernels::indexing:: masked_extract_some_slices_strided_impl_fn_ptr_t; static masked_extract_some_slices_strided_impl_fn_ptr_t @@ -98,7 +98,7 @@ static masked_extract_some_slices_strided_impl_fn_ptr_t void populate_masked_extract_dispatch_vectors(void) { - using dpctl::tensor::kernels::indexing:: + using dpnp::tensor::kernels::indexing:: MaskExtractAllSlicesStridedFactoryForInt32; td_ns::DispatchVectorBuilder< masked_extract_all_slices_strided_impl_fn_ptr_t, @@ -107,7 +107,7 @@ void populate_masked_extract_dispatch_vectors(void) dvb1.populate_dispatch_vector( masked_extract_all_slices_strided_i32_impl_dispatch_vector); - using dpctl::tensor::kernels::indexing:: + using dpnp::tensor::kernels::indexing:: MaskExtractAllSlicesStridedFactoryForInt64; td_ns::DispatchVectorBuilder< masked_extract_all_slices_strided_impl_fn_ptr_t, @@ -116,7 +116,7 @@ void populate_masked_extract_dispatch_vectors(void) dvb2.populate_dispatch_vector( masked_extract_all_slices_strided_i64_impl_dispatch_vector); - using dpctl::tensor::kernels::indexing:: + using dpnp::tensor::kernels::indexing:: MaskExtractSomeSlicesStridedFactoryForInt32; td_ns::DispatchVectorBuilder< masked_extract_some_slices_strided_impl_fn_ptr_t, @@ -125,7 +125,7 @@ void populate_masked_extract_dispatch_vectors(void) dvb3.populate_dispatch_vector( masked_extract_some_slices_strided_i32_impl_dispatch_vector); - using dpctl::tensor::kernels::indexing:: + using dpnp::tensor::kernels::indexing:: MaskExtractSomeSlicesStridedFactoryForInt64; td_ns::DispatchVectorBuilder< masked_extract_some_slices_strided_impl_fn_ptr_t, @@ -134,7 +134,7 @@ void populate_masked_extract_dispatch_vectors(void) dvb4.populate_dispatch_vector( masked_extract_some_slices_strided_i64_impl_dispatch_vector); - using dpctl::tensor::kernels::indexing:: + using dpnp::tensor::kernels::indexing:: MaskExtractAllSlicesContigFactoryForInt32; td_ns::DispatchVectorBuilder - py_extract(const dpctl::tensor::usm_ndarray &src, - const dpctl::tensor::usm_ndarray &cumsum, + py_extract(const dpnp::tensor::usm_ndarray &src, + const dpnp::tensor::usm_ndarray &cumsum, int axis_start, // axis_start <= mask_i < axis_end int axis_end, - const dpctl::tensor::usm_ndarray &dst, + const dpnp::tensor::usm_ndarray &dst, sycl::queue &exec_q, const std::vector &depends) { - dpctl::tensor::validation::CheckWritable::throw_if_not_writable(dst); + dpnp::tensor::validation::CheckWritable::throw_if_not_writable(dst); int src_nd = src.get_ndim(); if ((axis_start < 0 || axis_end > src_nd || axis_start >= axis_end)) { @@ -180,7 +180,7 @@ std::pair throw py::value_error("cumsum array must be a C-contiguous vector"); } - if (!dpctl::utils::queues_are_compatible(exec_q, {src, cumsum, dst})) { + if (!dpnp::utils::queues_are_compatible(exec_q, {src, cumsum, dst})) { throw py::value_error( "Execution queue is not compatible with allocation queues"); } @@ -217,10 +217,10 @@ std::pair throw py::value_error("Inconsistent array dimensions"); } - dpctl::tensor::validation::AmpleMemory::throw_if_not_ample( + dpnp::tensor::validation::AmpleMemory::throw_if_not_ample( dst, ortho_nelems * masked_dst_nelems); - auto const &overlap = dpctl::tensor::overlap::MemoryOverlap(); + auto const &overlap = dpnp::tensor::overlap::MemoryOverlap(); // check that dst does not intersect with src, not with cumsum. if (overlap(dst, cumsum) || overlap(dst, src)) { throw py::value_error("Destination array overlaps with inputs"); @@ -291,7 +291,7 @@ std::pair : masked_extract_all_slices_strided_i64_impl_dispatch_vector [src_typeid]; - using dpctl::tensor::offset_utils::device_allocate_and_pack; + using dpnp::tensor::offset_utils::device_allocate_and_pack; auto ptr_size_event_tuple1 = device_allocate_and_pack( exec_q, host_task_events, src_shape_vec, src_strides_vec); auto packed_src_shape_strides_owner = @@ -313,7 +313,7 @@ std::pair dst_shape_vec[0], dst_strides_vec[0], all_deps); sycl::event cleanup_tmp_allocations_ev = - dpctl::tensor::alloc_utils::async_smart_free( + dpnp::tensor::alloc_utils::async_smart_free( exec_q, {extract_ev}, packed_src_shape_strides_owner); host_task_events.push_back(cleanup_tmp_allocations_ev); } @@ -373,7 +373,7 @@ std::pair assert(masked_dst_shape.size() == 1); assert(masked_dst_strides.size() == 1); - using dpctl::tensor::offset_utils::device_allocate_and_pack; + using dpnp::tensor::offset_utils::device_allocate_and_pack; auto ptr_size_event_tuple1 = device_allocate_and_pack( exec_q, host_task_events, simplified_ortho_shape, simplified_ortho_src_strides, simplified_ortho_dst_strides, @@ -409,12 +409,12 @@ std::pair masked_dst_shape[0], masked_dst_strides[0], all_deps); sycl::event cleanup_tmp_allocations_ev = - dpctl::tensor::alloc_utils::async_smart_free( + dpnp::tensor::alloc_utils::async_smart_free( exec_q, {extract_ev}, packed_shapes_strides_owner); host_task_events.push_back(cleanup_tmp_allocations_ev); } - sycl::event py_obj_management_host_task_ev = dpctl::utils::keep_args_alive( + sycl::event py_obj_management_host_task_ev = dpnp::utils::keep_args_alive( exec_q, {src, cumsum, dst}, host_task_events); return std::make_pair(py_obj_management_host_task_ev, extract_ev); @@ -422,7 +422,7 @@ std::pair // Masked placement -using dpctl::tensor::kernels::indexing:: +using dpnp::tensor::kernels::indexing:: masked_place_all_slices_strided_impl_fn_ptr_t; static masked_place_all_slices_strided_impl_fn_ptr_t @@ -430,7 +430,7 @@ static masked_place_all_slices_strided_impl_fn_ptr_t static masked_place_all_slices_strided_impl_fn_ptr_t masked_place_all_slices_strided_i64_impl_dispatch_vector[td_ns::num_types]; -using dpctl::tensor::kernels::indexing:: +using dpnp::tensor::kernels::indexing:: masked_place_some_slices_strided_impl_fn_ptr_t; static masked_place_some_slices_strided_impl_fn_ptr_t @@ -440,7 +440,7 @@ static masked_place_some_slices_strided_impl_fn_ptr_t void populate_masked_place_dispatch_vectors(void) { - using dpctl::tensor::kernels::indexing:: + using dpnp::tensor::kernels::indexing:: MaskPlaceAllSlicesStridedFactoryForInt32; td_ns::DispatchVectorBuilder 0) ? cumsum[i-1] + 1 : 1) */ std::pair - py_place(const dpctl::tensor::usm_ndarray &dst, - const dpctl::tensor::usm_ndarray &cumsum, + py_place(const dpnp::tensor::usm_ndarray &dst, + const dpnp::tensor::usm_ndarray &cumsum, int axis_start, // axis_start <= mask_i < axis_end int axis_end, - const dpctl::tensor::usm_ndarray &rhs, + const dpnp::tensor::usm_ndarray &rhs, sycl::queue &exec_q, const std::vector &depends) { - dpctl::tensor::validation::CheckWritable::throw_if_not_writable(dst); + dpnp::tensor::validation::CheckWritable::throw_if_not_writable(dst); int dst_nd = dst.get_ndim(); if ((axis_start < 0 || axis_end > dst_nd || axis_start >= axis_end)) { @@ -508,7 +508,7 @@ std::pair throw py::value_error("cumsum array must be a C-contiguous vector"); } - if (!dpctl::utils::queues_are_compatible(exec_q, {dst, cumsum, rhs})) { + if (!dpnp::utils::queues_are_compatible(exec_q, {dst, cumsum, rhs})) { throw py::value_error( "Execution queue is not compatible with allocation queues"); } @@ -542,10 +542,10 @@ std::pair throw py::value_error("Inconsistent array dimensions"); } - dpctl::tensor::validation::AmpleMemory::throw_if_not_ample( + dpnp::tensor::validation::AmpleMemory::throw_if_not_ample( dst, ortho_nelems * masked_dst_nelems); - auto const &overlap = dpctl::tensor::overlap::MemoryOverlap(); + auto const &overlap = dpnp::tensor::overlap::MemoryOverlap(); // check that dst does not intersect with src, not with cumsum. if (overlap(dst, rhs) || overlap(dst, cumsum)) { throw py::value_error("Destination array overlaps with inputs"); @@ -599,7 +599,7 @@ std::pair assert(rhs_shape_vec.size() == 1); assert(rhs_strides_vec.size() == 1); - using dpctl::tensor::offset_utils::device_allocate_and_pack; + using dpnp::tensor::offset_utils::device_allocate_and_pack; auto ptr_size_event_tuple1 = device_allocate_and_pack( exec_q, host_task_events, dst_shape_vec, dst_strides_vec); auto packed_dst_shape_strides_owner = @@ -621,7 +621,7 @@ std::pair rhs_strides_vec[0], all_deps); sycl::event cleanup_tmp_allocations_ev = - dpctl::tensor::alloc_utils::async_smart_free( + dpnp::tensor::alloc_utils::async_smart_free( exec_q, {place_ev}, packed_dst_shape_strides_owner); host_task_events.push_back(cleanup_tmp_allocations_ev); } @@ -679,7 +679,7 @@ std::pair assert(masked_rhs_shape.size() == 1); assert(masked_rhs_strides.size() == 1); - using dpctl::tensor::offset_utils::device_allocate_and_pack; + using dpnp::tensor::offset_utils::device_allocate_and_pack; auto ptr_size_event_tuple1 = device_allocate_and_pack( exec_q, host_task_events, simplified_ortho_shape, simplified_ortho_dst_strides, simplified_ortho_rhs_strides, @@ -713,12 +713,12 @@ std::pair masked_rhs_shape[0], masked_rhs_strides[0], all_deps); sycl::event cleanup_tmp_allocations_ev = - dpctl::tensor::alloc_utils::async_smart_free( + dpnp::tensor::alloc_utils::async_smart_free( exec_q, {place_ev}, packed_shapes_strides_owner); host_task_events.push_back(cleanup_tmp_allocations_ev); } - sycl::event py_obj_management_host_task_ev = dpctl::utils::keep_args_alive( + sycl::event py_obj_management_host_task_ev = dpnp::utils::keep_args_alive( exec_q, {dst, cumsum, rhs}, host_task_events); return std::make_pair(py_obj_management_host_task_ev, place_ev); @@ -727,21 +727,21 @@ std::pair // Non-zero std::pair - py_nonzero(const dpctl::tensor::usm_ndarray + py_nonzero(const dpnp::tensor::usm_ndarray &cumsum, // int32/int64 input array, 1D, C-contiguous - const dpctl::tensor::usm_ndarray + const dpnp::tensor::usm_ndarray &indexes, // int32/int64 2D output array, C-contiguous const std::vector &mask_shape, // shape of array from which cumsum was computed sycl::queue &exec_q, const std::vector &depends) { - if (!dpctl::utils::queues_are_compatible(exec_q, {cumsum, indexes})) { + if (!dpnp::utils::queues_are_compatible(exec_q, {cumsum, indexes})) { throw py::value_error( "Execution queue is not compatible with allocation queues"); } - dpctl::tensor::validation::CheckWritable::throw_if_not_writable(indexes); + dpnp::tensor::validation::CheckWritable::throw_if_not_writable(indexes); int cumsum_nd = cumsum.get_ndim(); if (cumsum_nd != 1 || !cumsum.is_c_contiguous()) { @@ -798,18 +798,18 @@ std::pair return std::make_pair(sycl::event(), sycl::event()); } - auto const &overlap = dpctl::tensor::overlap::MemoryOverlap(); + auto const &overlap = dpnp::tensor::overlap::MemoryOverlap(); if (overlap(cumsum, indexes)) { throw py::value_error("Arrays are expected to ave no memory overlap"); } - dpctl::tensor::validation::AmpleMemory::throw_if_not_ample( - indexes, nz_elems * _ndim); + dpnp::tensor::validation::AmpleMemory::throw_if_not_ample(indexes, + nz_elems * _ndim); std::vector host_task_events; host_task_events.reserve(2); - using dpctl::tensor::offset_utils::device_allocate_and_pack; + using dpnp::tensor::offset_utils::device_allocate_and_pack; auto mask_shape_copying_tuple = device_allocate_and_pack( exec_q, host_task_events, mask_shape); auto src_shape_device_owner = @@ -823,8 +823,8 @@ std::pair all_deps.insert(all_deps.end(), depends.begin(), depends.end()); all_deps.push_back(copy_ev); - using dpctl::tensor::kernels::indexing::non_zero_indexes_fn_ptr_t; - using dpctl::tensor::kernels::indexing::non_zero_indexes_impl; + using dpnp::tensor::kernels::indexing::non_zero_indexes_fn_ptr_t; + using dpnp::tensor::kernels::indexing::non_zero_indexes_impl; int fn_index = ((cumsum_typeid == int64_typeid) ? 1 : 0) + ((indexes_typeid == int64_typeid) ? 2 : 0); @@ -840,14 +840,14 @@ std::pair indexes.get_data(), src_shape_device_ptr, all_deps); sycl::event temporaries_cleanup_ev = - dpctl::tensor::alloc_utils::async_smart_free( + dpnp::tensor::alloc_utils::async_smart_free( exec_q, {non_zero_indexes_ev}, src_shape_device_owner); host_task_events.push_back(temporaries_cleanup_ev); - sycl::event py_obj_management_host_task_ev = dpctl::utils::keep_args_alive( + sycl::event py_obj_management_host_task_ev = dpnp::utils::keep_args_alive( exec_q, {cumsum, indexes}, host_task_events); return std::make_pair(py_obj_management_host_task_ev, non_zero_indexes_ev); } -} // namespace dpctl::tensor::py_internal +} // namespace dpnp::tensor::py_internal diff --git a/dpnp/tensor/libtensor/source/boolean_advanced_indexing.hpp b/dpnp/tensor/libtensor/source/boolean_advanced_indexing.hpp index 71eafc77b00c..e8231178bdb3 100644 --- a/dpnp/tensor/libtensor/source/boolean_advanced_indexing.hpp +++ b/dpnp/tensor/libtensor/source/boolean_advanced_indexing.hpp @@ -29,7 +29,7 @@ //===----------------------------------------------------------------------===// /// /// \file -/// This file defines functions of dpctl.tensor._tensor_impl extensions +/// This file defines functions of dpnp.tensor._tensor_impl extensions //===----------------------------------------------------------------------===// #pragma once @@ -43,39 +43,39 @@ namespace py = pybind11; -namespace dpctl::tensor::py_internal +namespace dpnp::tensor::py_internal { extern std::pair - py_extract(const dpctl::tensor::usm_ndarray &src, - const dpctl::tensor::usm_ndarray &cumsum, + py_extract(const dpnp::tensor::usm_ndarray &src, + const dpnp::tensor::usm_ndarray &cumsum, int axis_start, // axis_start <= mask_i < axis_end int axis_end, - const dpctl::tensor::usm_ndarray &dst, + const dpnp::tensor::usm_ndarray &dst, sycl::queue &exec_q, const std::vector &depends = {}); extern void populate_masked_extract_dispatch_vectors(void); extern std::pair - py_place(const dpctl::tensor::usm_ndarray &dst, - const dpctl::tensor::usm_ndarray &cumsum, + py_place(const dpnp::tensor::usm_ndarray &dst, + const dpnp::tensor::usm_ndarray &cumsum, int axis_start, // axis_start <= mask_i < axis_end int axis_end, - const dpctl::tensor::usm_ndarray &rhs, + const dpnp::tensor::usm_ndarray &rhs, sycl::queue &exec_q, const std::vector &depends = {}); extern void populate_masked_place_dispatch_vectors(void); extern std::pair - py_nonzero(const dpctl::tensor::usm_ndarray + py_nonzero(const dpnp::tensor::usm_ndarray &cumsum, // int32 input array, 1D, C-contiguous - const dpctl::tensor::usm_ndarray + const dpnp::tensor::usm_ndarray &indexes, // int32 2D output array, C-contiguous const std::vector &mask_shape, // shape of array from which cumsum was computed sycl::queue &exec_q, const std::vector &depends = {}); -} // namespace dpctl::tensor::py_internal +} // namespace dpnp::tensor::py_internal diff --git a/dpnp/tensor/libtensor/source/clip.cpp b/dpnp/tensor/libtensor/source/clip.cpp index 4a0e5b9357de..2dfd98c9a2cd 100644 --- a/dpnp/tensor/libtensor/source/clip.cpp +++ b/dpnp/tensor/libtensor/source/clip.cpp @@ -30,7 +30,7 @@ /// /// \file /// This file defines Python API for implementation functions of -/// dpctl.tensor.clip +/// dpnp.tensor.clip //===---------------------------------------------------------------------===// #include @@ -53,14 +53,14 @@ #include "utils/sycl_alloc_utils.hpp" #include "utils/type_dispatch.hpp" -namespace dpctl::tensor::py_internal +namespace dpnp::tensor::py_internal { namespace py = pybind11; -namespace td_ns = dpctl::tensor::type_dispatch; +namespace td_ns = dpnp::tensor::type_dispatch; -using dpctl::tensor::kernels::clip::clip_contig_impl_fn_ptr_t; -using dpctl::tensor::kernels::clip::clip_strided_impl_fn_ptr_t; +using dpnp::tensor::kernels::clip::clip_contig_impl_fn_ptr_t; +using dpnp::tensor::kernels::clip::clip_strided_impl_fn_ptr_t; static clip_contig_impl_fn_ptr_t clip_contig_dispatch_vector[td_ns::num_types]; static clip_strided_impl_fn_ptr_t @@ -69,36 +69,36 @@ static clip_strided_impl_fn_ptr_t void init_clip_dispatch_vectors(void) { using namespace td_ns; - using dpctl::tensor::kernels::clip::ClipContigFactory; + using dpnp::tensor::kernels::clip::ClipContigFactory; DispatchVectorBuilder dvb1; dvb1.populate_dispatch_vector(clip_contig_dispatch_vector); - using dpctl::tensor::kernels::clip::ClipStridedFactory; + using dpnp::tensor::kernels::clip::ClipStridedFactory; DispatchVectorBuilder dvb2; dvb2.populate_dispatch_vector(clip_strided_dispatch_vector); } -using dpctl::utils::keep_args_alive; +using dpnp::utils::keep_args_alive; std::pair - py_clip(const dpctl::tensor::usm_ndarray &src, - const dpctl::tensor::usm_ndarray &min, - const dpctl::tensor::usm_ndarray &max, - const dpctl::tensor::usm_ndarray &dst, + py_clip(const dpnp::tensor::usm_ndarray &src, + const dpnp::tensor::usm_ndarray &min, + const dpnp::tensor::usm_ndarray &max, + const dpnp::tensor::usm_ndarray &dst, sycl::queue &exec_q, const std::vector &depends) { - if (!dpctl::utils::queues_are_compatible(exec_q, {src, min, max, dst})) { + if (!dpnp::utils::queues_are_compatible(exec_q, {src, min, max, dst})) { throw py::value_error( "Execution queue is not compatible with allocation queues"); } - dpctl::tensor::validation::CheckWritable::throw_if_not_writable(dst); + dpnp::tensor::validation::CheckWritable::throw_if_not_writable(dst); int nd = src.get_ndim(); int min_nd = min.get_ndim(); @@ -137,9 +137,9 @@ std::pair return std::make_pair(sycl::event{}, sycl::event{}); } - auto const &overlap = dpctl::tensor::overlap::MemoryOverlap(); + auto const &overlap = dpnp::tensor::overlap::MemoryOverlap(); auto const &same_logical_tensors = - dpctl::tensor::overlap::SameLogicalTensors(); + dpnp::tensor::overlap::SameLogicalTensors(); if ((overlap(dst, src) && !same_logical_tensors(dst, src)) || (overlap(dst, min) && !same_logical_tensors(dst, min)) || (overlap(dst, max) && !same_logical_tensors(dst, max))) { @@ -163,7 +163,7 @@ std::pair "have the same data type"); } - dpctl::tensor::validation::AmpleMemory::throw_if_not_ample(dst, nelems); + dpnp::tensor::validation::AmpleMemory::throw_if_not_ample(dst, nelems); char *src_data = src.get_data(); char *min_data = min.get_data(); @@ -226,7 +226,7 @@ std::pair std::vector host_task_events; host_task_events.reserve(2); - using dpctl::tensor::offset_utils::device_allocate_and_pack; + using dpnp::tensor::offset_utils::device_allocate_and_pack; auto ptr_size_event_tuple = device_allocate_and_pack( exec_q, host_task_events, // common shape and strides @@ -250,8 +250,8 @@ std::pair // free packed temporaries sycl::event temporaries_cleanup_ev = - dpctl::tensor::alloc_utils::async_smart_free( - exec_q, {clip_ev}, packed_shape_strides_owner); + dpnp::tensor::alloc_utils::async_smart_free(exec_q, {clip_ev}, + packed_shape_strides_owner); host_task_events.push_back(temporaries_cleanup_ev); sycl::event arg_cleanup_ev = @@ -260,4 +260,4 @@ std::pair return std::make_pair(arg_cleanup_ev, clip_ev); } -} // namespace dpctl::tensor::py_internal +} // namespace dpnp::tensor::py_internal diff --git a/dpnp/tensor/libtensor/source/clip.hpp b/dpnp/tensor/libtensor/source/clip.hpp index de8f0e559b6e..719fa2a7ae6f 100644 --- a/dpnp/tensor/libtensor/source/clip.hpp +++ b/dpnp/tensor/libtensor/source/clip.hpp @@ -30,7 +30,7 @@ /// /// \file /// This file defines Python API for implementation functions of -/// dpctl.tensor.clip +/// dpnp.tensor.clip //===---------------------------------------------------------------------===// #pragma once @@ -41,17 +41,17 @@ #include "dpnp4pybind11.hpp" -namespace dpctl::tensor::py_internal +namespace dpnp::tensor::py_internal { extern std::pair - py_clip(const dpctl::tensor::usm_ndarray &src, - const dpctl::tensor::usm_ndarray &min, - const dpctl::tensor::usm_ndarray &max, - const dpctl::tensor::usm_ndarray &dst, + py_clip(const dpnp::tensor::usm_ndarray &src, + const dpnp::tensor::usm_ndarray &min, + const dpnp::tensor::usm_ndarray &max, + const dpnp::tensor::usm_ndarray &dst, sycl::queue &exec_q, const std::vector &depends); extern void init_clip_dispatch_vectors(void); -} // namespace dpctl::tensor::py_internal +} // namespace dpnp::tensor::py_internal diff --git a/dpnp/tensor/libtensor/source/copy_and_cast_usm_to_usm.cpp b/dpnp/tensor/libtensor/source/copy_and_cast_usm_to_usm.cpp index 7c2db989b0c2..85bb9e6947e3 100644 --- a/dpnp/tensor/libtensor/source/copy_and_cast_usm_to_usm.cpp +++ b/dpnp/tensor/libtensor/source/copy_and_cast_usm_to_usm.cpp @@ -29,7 +29,7 @@ //===----------------------------------------------------------------------===// /// /// \file -/// This file defines functions of dpctl.tensor._tensor_impl extensions +/// This file defines functions of dpnp.tensor._tensor_impl extensions //===----------------------------------------------------------------------===// #include @@ -53,14 +53,14 @@ #include "copy_as_contig.hpp" #include "simplify_iteration_space.hpp" -namespace dpctl::tensor::py_internal +namespace dpnp::tensor::py_internal { -namespace td_ns = dpctl::tensor::type_dispatch; +namespace td_ns = dpnp::tensor::type_dispatch; -using dpctl::tensor::kernels::copy_and_cast::copy_and_cast_1d_fn_ptr_t; -using dpctl::tensor::kernels::copy_and_cast::copy_and_cast_contig_fn_ptr_t; -using dpctl::tensor::kernels::copy_and_cast::copy_and_cast_generic_fn_ptr_t; +using dpnp::tensor::kernels::copy_and_cast::copy_and_cast_1d_fn_ptr_t; +using dpnp::tensor::kernels::copy_and_cast::copy_and_cast_contig_fn_ptr_t; +using dpnp::tensor::kernels::copy_and_cast::copy_and_cast_generic_fn_ptr_t; static copy_and_cast_generic_fn_ptr_t copy_and_cast_generic_dispatch_table[td_ns::num_types][td_ns::num_types]; @@ -71,11 +71,11 @@ static copy_and_cast_contig_fn_ptr_t namespace py = pybind11; -using dpctl::utils::keep_args_alive; +using dpnp::utils::keep_args_alive; std::pair copy_usm_ndarray_into_usm_ndarray( - const dpctl::tensor::usm_ndarray &src, - const dpctl::tensor::usm_ndarray &dst, + const dpnp::tensor::usm_ndarray &src, + const dpnp::tensor::usm_ndarray &dst, sycl::queue &exec_q, const std::vector &depends = {}) { @@ -107,15 +107,15 @@ std::pair copy_usm_ndarray_into_usm_ndarray( return std::make_pair(sycl::event(), sycl::event()); } - dpctl::tensor::validation::AmpleMemory::throw_if_not_ample(dst, src_nelems); + dpnp::tensor::validation::AmpleMemory::throw_if_not_ample(dst, src_nelems); // check compatibility of execution queue and allocation queue - if (!dpctl::utils::queues_are_compatible(exec_q, {src, dst})) { + if (!dpnp::utils::queues_are_compatible(exec_q, {src, dst})) { throw py::value_error( "Execution queue is not compatible with allocation queues"); } - dpctl::tensor::validation::CheckWritable::throw_if_not_writable(dst); + dpnp::tensor::validation::CheckWritable::throw_if_not_writable(dst); int src_typenum = src.get_typenum(); int dst_typenum = dst.get_typenum(); @@ -128,7 +128,7 @@ std::pair copy_usm_ndarray_into_usm_ndarray( char *dst_data = dst.get_data(); // check that arrays do not overlap, and concurrent copying is safe. - auto const &overlap = dpctl::tensor::overlap::MemoryOverlap(); + auto const &overlap = dpnp::tensor::overlap::MemoryOverlap(); if (overlap(src, dst)) { // TODO: could use a temporary, but this is done by the caller throw py::value_error("Arrays index overlapping segments of memory"); @@ -248,7 +248,7 @@ std::pair copy_usm_ndarray_into_usm_ndarray( std::vector host_task_events; host_task_events.reserve(2); - using dpctl::tensor::offset_utils::device_allocate_and_pack; + using dpnp::tensor::offset_utils::device_allocate_and_pack; auto ptr_size_event_tuple = device_allocate_and_pack( exec_q, host_task_events, simplified_shape, simplified_src_strides, simplified_dst_strides); @@ -262,7 +262,7 @@ std::pair copy_usm_ndarray_into_usm_ndarray( // async free of shape_strides temporary const auto &temporaries_cleanup_ev = - dpctl::tensor::alloc_utils::async_smart_free( + dpnp::tensor::alloc_utils::async_smart_free( exec_q, {copy_and_cast_generic_ev}, shape_strides_owner); host_task_events.push_back(temporaries_cleanup_ev); @@ -274,23 +274,23 @@ void init_copy_and_cast_usm_to_usm_dispatch_tables(void) { using namespace td_ns; - using dpctl::tensor::kernels::copy_and_cast::CopyAndCastContigFactory; + using dpnp::tensor::kernels::copy_and_cast::CopyAndCastContigFactory; DispatchTableBuilder dtb_contig; dtb_contig.populate_dispatch_table(copy_and_cast_contig_dispatch_table); - using dpctl::tensor::kernels::copy_and_cast::CopyAndCastGenericFactory; + using dpnp::tensor::kernels::copy_and_cast::CopyAndCastGenericFactory; DispatchTableBuilder dtb_generic; dtb_generic.populate_dispatch_table(copy_and_cast_generic_dispatch_table); - using dpctl::tensor::kernels::copy_and_cast::CopyAndCast1DFactory; + using dpnp::tensor::kernels::copy_and_cast::CopyAndCast1DFactory; DispatchTableBuilder dtb_1d; dtb_1d.populate_dispatch_table(copy_and_cast_1d_dispatch_table); } -} // namespace dpctl::tensor::py_internal +} // namespace dpnp::tensor::py_internal diff --git a/dpnp/tensor/libtensor/source/copy_and_cast_usm_to_usm.hpp b/dpnp/tensor/libtensor/source/copy_and_cast_usm_to_usm.hpp index d2e07b08d38f..0183d2ebc18c 100644 --- a/dpnp/tensor/libtensor/source/copy_and_cast_usm_to_usm.hpp +++ b/dpnp/tensor/libtensor/source/copy_and_cast_usm_to_usm.hpp @@ -29,7 +29,7 @@ //===----------------------------------------------------------------------===// /// /// \file -/// This file defines functions of dpctl.tensor._tensor_impl extensions +/// This file defines functions of dpnp.tensor._tensor_impl extensions //===----------------------------------------------------------------------===// #pragma once @@ -39,15 +39,15 @@ #include "dpnp4pybind11.hpp" -namespace dpctl::tensor::py_internal +namespace dpnp::tensor::py_internal { extern std::pair copy_usm_ndarray_into_usm_ndarray( - const dpctl::tensor::usm_ndarray &src, - const dpctl::tensor::usm_ndarray &dst, + const dpnp::tensor::usm_ndarray &src, + const dpnp::tensor::usm_ndarray &dst, sycl::queue &exec_q, const std::vector &depends = {}); extern void init_copy_and_cast_usm_to_usm_dispatch_tables(); -} // namespace dpctl::tensor::py_internal +} // namespace dpnp::tensor::py_internal diff --git a/dpnp/tensor/libtensor/source/copy_as_contig.cpp b/dpnp/tensor/libtensor/source/copy_as_contig.cpp index c1c4b740dfba..66ace2138032 100644 --- a/dpnp/tensor/libtensor/source/copy_as_contig.cpp +++ b/dpnp/tensor/libtensor/source/copy_as_contig.cpp @@ -29,7 +29,7 @@ //===----------------------------------------------------------------------===// /// /// \file -/// This file defines functions of dpctl.tensor._tensor_impl extensions +/// This file defines functions of dpnp.tensor._tensor_impl extensions //===----------------------------------------------------------------------===// #include @@ -55,19 +55,19 @@ #include "copy_as_contig.hpp" #include "simplify_iteration_space.hpp" -namespace dpctl::tensor::py_internal +namespace dpnp::tensor::py_internal { namespace py = pybind11; -namespace td_ns = dpctl::tensor::type_dispatch; +namespace td_ns = dpnp::tensor::type_dispatch; -using dpctl::tensor::kernels::copy_as_contig:: +using dpnp::tensor::kernels::copy_as_contig:: as_c_contiguous_1d_batch_of_square_matrices_impl_fn_ptr_t; -using dpctl::tensor::kernels::copy_as_contig:: +using dpnp::tensor::kernels::copy_as_contig:: as_c_contiguous_array_impl_fn_ptr_t; -using dpctl::tensor::kernels::copy_as_contig:: +using dpnp::tensor::kernels::copy_as_contig:: as_c_contiguous_nd_batch_of_square_matrices_impl_fn_ptr_t; -using dpctl::utils::keep_args_alive; +using dpnp::utils::keep_args_alive; static as_c_contiguous_array_impl_fn_ptr_t as_c_contig_array_dispatch_vector[td_ns::num_types]; @@ -81,10 +81,10 @@ static as_c_contiguous_nd_batch_of_square_matrices_impl_fn_ptr_t void init_copy_as_contig_dispatch_vectors(void) { - using dpctl::tensor::kernels::copy_as_contig:: + using dpnp::tensor::kernels::copy_as_contig:: AsCContig1DBatchOfSquareMatricesFactory; - using dpctl::tensor::kernels::copy_as_contig::AsCContigFactory; - using dpctl::tensor::kernels::copy_as_contig:: + using dpnp::tensor::kernels::copy_as_contig::AsCContigFactory; + using dpnp::tensor::kernels::copy_as_contig:: AsCContigNDBatchOfSquareMatricesFactory; using td_ns::DispatchVectorBuilder; @@ -135,14 +135,14 @@ std::size_t get_nelems(const std::vector &shape) } // end of anonymous namespace std::pair - py_as_c_contig_f2c(const dpctl::tensor::usm_ndarray &src, - const dpctl::tensor::usm_ndarray &dst, + py_as_c_contig_f2c(const dpnp::tensor::usm_ndarray &src, + const dpnp::tensor::usm_ndarray &dst, sycl::queue &exec_q, const std::vector &depends); std::pair - py_as_c_contig(const dpctl::tensor::usm_ndarray &src, - const dpctl::tensor::usm_ndarray &dst, + py_as_c_contig(const dpnp::tensor::usm_ndarray &src, + const dpnp::tensor::usm_ndarray &dst, sycl::queue &exec_q, const std::vector &depends) { @@ -181,16 +181,16 @@ std::pair throw py::value_error("Destination array must be C-contiguous"); } - dpctl::tensor::validation::CheckWritable::throw_if_not_writable(dst); + dpnp::tensor::validation::CheckWritable::throw_if_not_writable(dst); // check compatibility of execution queue and allocation queue - if (!dpctl::utils::queues_are_compatible(exec_q, {src, dst})) { + if (!dpnp::utils::queues_are_compatible(exec_q, {src, dst})) { throw py::value_error( "Execution queue is not compatible with allocation queues"); } // check that arrays do not overlap, and concurrent copying is safe. - auto const &overlap = dpctl::tensor::overlap::MemoryOverlap(); + auto const &overlap = dpnp::tensor::overlap::MemoryOverlap(); if (overlap(src, dst)) { throw py::value_error("Arrays index overlapping segments of memory"); } @@ -238,7 +238,7 @@ std::pair std::vector host_task_events{}; auto ptr_size_event_tuple = - dpctl::tensor::offset_utils::device_allocate_and_pack( + dpnp::tensor::offset_utils::device_allocate_and_pack( exec_q, host_task_events, simplified_shape, simplified_src_strides); auto shape_stride_owner = std::move(std::get<0>(ptr_size_event_tuple)); const sycl::event ©_shape_ev = std::get<2>(ptr_size_event_tuple); @@ -257,8 +257,8 @@ std::pair dst.get_data(), all_depends); const auto &temporaries_cleanup_ev = - dpctl::tensor::alloc_utils::async_smart_free(exec_q, {ascontig_ev}, - shape_stride_owner); + dpnp::tensor::alloc_utils::async_smart_free(exec_q, {ascontig_ev}, + shape_stride_owner); host_task_events.push_back(temporaries_cleanup_ev); return std::make_pair(keep_args_alive(exec_q, {src, dst}, host_task_events), @@ -266,14 +266,14 @@ std::pair } std::pair - py_as_f_contig_c2f(const dpctl::tensor::usm_ndarray &src, - const dpctl::tensor::usm_ndarray &dst, + py_as_f_contig_c2f(const dpnp::tensor::usm_ndarray &src, + const dpnp::tensor::usm_ndarray &dst, sycl::queue &exec_q, const std::vector &depends); std::pair - py_as_f_contig(const dpctl::tensor::usm_ndarray &src, - const dpctl::tensor::usm_ndarray &dst, + py_as_f_contig(const dpnp::tensor::usm_ndarray &src, + const dpnp::tensor::usm_ndarray &dst, sycl::queue &exec_q, const std::vector &depends) { @@ -312,16 +312,16 @@ std::pair throw py::value_error("Destination array must be F-contiguous"); } - dpctl::tensor::validation::CheckWritable::throw_if_not_writable(dst); + dpnp::tensor::validation::CheckWritable::throw_if_not_writable(dst); // check compatibility of execution queue and allocation queue - if (!dpctl::utils::queues_are_compatible(exec_q, {src, dst})) { + if (!dpnp::utils::queues_are_compatible(exec_q, {src, dst})) { throw py::value_error( "Execution queue is not compatible with allocation queues"); } // check that arrays do not overlap, and concurrent copying is safe. - auto const &overlap = dpctl::tensor::overlap::MemoryOverlap(); + auto const &overlap = dpnp::tensor::overlap::MemoryOverlap(); if (overlap(src, dst)) { throw py::value_error("Arrays index overlapping segments of memory"); } @@ -372,7 +372,7 @@ std::pair std::vector host_task_events{}; auto ptr_size_event_tuple = - dpctl::tensor::offset_utils::device_allocate_and_pack( + dpnp::tensor::offset_utils::device_allocate_and_pack( exec_q, host_task_events, simplified_shape, simplified_src_strides); auto shape_stride_owner = std::move(std::get<0>(ptr_size_event_tuple)); const sycl::event ©_shape_ev = std::get<2>(ptr_size_event_tuple); @@ -391,8 +391,8 @@ std::pair dst.get_data(), all_depends); const auto &temporaries_cleanup_ev = - dpctl::tensor::alloc_utils::async_smart_free(exec_q, {ascontig_ev}, - shape_stride_owner); + dpnp::tensor::alloc_utils::async_smart_free(exec_q, {ascontig_ev}, + shape_stride_owner); host_task_events.push_back(temporaries_cleanup_ev); return std::make_pair(keep_args_alive(exec_q, {src, dst}, host_task_events), @@ -400,8 +400,8 @@ std::pair } std::pair - py_as_c_contig_f2c(const dpctl::tensor::usm_ndarray &src, - const dpctl::tensor::usm_ndarray &dst, + py_as_c_contig_f2c(const dpnp::tensor::usm_ndarray &src, + const dpnp::tensor::usm_ndarray &dst, sycl::queue &exec_q, const std::vector &depends) { @@ -463,16 +463,16 @@ std::pair throw py::value_error("Destination array must be C-contiguous"); } - dpctl::tensor::validation::CheckWritable::throw_if_not_writable(dst); + dpnp::tensor::validation::CheckWritable::throw_if_not_writable(dst); // check compatibility of execution queue and allocation queue - if (!dpctl::utils::queues_are_compatible(exec_q, {src, dst})) { + if (!dpnp::utils::queues_are_compatible(exec_q, {src, dst})) { throw py::value_error( "Execution queue is not compatible with allocation queues"); } // check that arrays do not overlap, and concurrent copying is safe. - auto const &overlap = dpctl::tensor::overlap::MemoryOverlap(); + auto const &overlap = dpnp::tensor::overlap::MemoryOverlap(); if (overlap(src, dst)) { throw py::value_error("Arrays index overlapping segments of memory"); } @@ -559,7 +559,7 @@ std::pair std::vector host_task_events; host_task_events.reserve(2); - using dpctl::tensor::offset_utils::device_allocate_and_pack; + using dpnp::tensor::offset_utils::device_allocate_and_pack; auto ptr_size_event_tuple = device_allocate_and_pack( exec_q, host_task_events, simplified_shape, simplified_src_strides); auto packed_shape_strides_owner = @@ -580,8 +580,8 @@ std::pair // async free of shape_strides temporary sycl::event temporaries_cleanup_ev = - dpctl::tensor::alloc_utils::async_smart_free( - exec_q, {ascontig_ev}, packed_shape_strides_owner); + dpnp::tensor::alloc_utils::async_smart_free(exec_q, {ascontig_ev}, + packed_shape_strides_owner); host_task_events.push_back(temporaries_cleanup_ev); return std::make_pair(keep_args_alive(exec_q, {src, dst}, host_task_events), @@ -589,8 +589,8 @@ std::pair } std::pair - py_as_f_contig_c2f(const dpctl::tensor::usm_ndarray &src, - const dpctl::tensor::usm_ndarray &dst, + py_as_f_contig_c2f(const dpnp::tensor::usm_ndarray &src, + const dpnp::tensor::usm_ndarray &dst, sycl::queue &exec_q, const std::vector &depends) { @@ -640,16 +640,16 @@ std::pair throw py::value_error("Unexpected destination array layout"); } - dpctl::tensor::validation::CheckWritable::throw_if_not_writable(dst); + dpnp::tensor::validation::CheckWritable::throw_if_not_writable(dst); // check compatibility of execution queue and allocation queue - if (!dpctl::utils::queues_are_compatible(exec_q, {src, dst})) { + if (!dpnp::utils::queues_are_compatible(exec_q, {src, dst})) { throw py::value_error( "Execution queue is not compatible with allocation queues"); } // check that arrays do not overlap, and concurrent copying is safe. - auto const &overlap = dpctl::tensor::overlap::MemoryOverlap(); + auto const &overlap = dpnp::tensor::overlap::MemoryOverlap(); if (overlap(src, dst)) { throw py::value_error("Arrays index overlapping segments of memory"); } @@ -750,7 +750,7 @@ std::pair std::vector host_task_events; host_task_events.reserve(2); - using dpctl::tensor::offset_utils::device_allocate_and_pack; + using dpnp::tensor::offset_utils::device_allocate_and_pack; auto ptr_size_event_tuple = device_allocate_and_pack( exec_q, host_task_events, simplified_shape, simplified_src_strides); auto packed_shape_strides_owner = @@ -771,12 +771,12 @@ std::pair // async free of shape_strides sycl::event temporaries_cleanup_ev = - dpctl::tensor::alloc_utils::async_smart_free( - exec_q, {ascontig_ev}, packed_shape_strides_owner); + dpnp::tensor::alloc_utils::async_smart_free(exec_q, {ascontig_ev}, + packed_shape_strides_owner); host_task_events.push_back(temporaries_cleanup_ev); return std::make_pair(keep_args_alive(exec_q, {src, dst}, host_task_events), ascontig_ev); } -} // namespace dpctl::tensor::py_internal +} // namespace dpnp::tensor::py_internal diff --git a/dpnp/tensor/libtensor/source/copy_as_contig.hpp b/dpnp/tensor/libtensor/source/copy_as_contig.hpp index bfe3159c8813..ada5341361e4 100644 --- a/dpnp/tensor/libtensor/source/copy_as_contig.hpp +++ b/dpnp/tensor/libtensor/source/copy_as_contig.hpp @@ -34,21 +34,21 @@ #include "dpnp4pybind11.hpp" #include -namespace dpctl::tensor::py_internal +namespace dpnp::tensor::py_internal { std::pair - py_as_c_contig(const dpctl::tensor::usm_ndarray &, - const dpctl::tensor::usm_ndarray &, + py_as_c_contig(const dpnp::tensor::usm_ndarray &, + const dpnp::tensor::usm_ndarray &, sycl::queue &, const std::vector &); std::pair - py_as_f_contig(const dpctl::tensor::usm_ndarray &, - const dpctl::tensor::usm_ndarray &, + py_as_f_contig(const dpnp::tensor::usm_ndarray &, + const dpnp::tensor::usm_ndarray &, sycl::queue &, const std::vector &); void init_copy_as_contig_dispatch_vectors(void); -} // namespace dpctl::tensor::py_internal +} // namespace dpnp::tensor::py_internal diff --git a/dpnp/tensor/libtensor/source/copy_for_reshape.cpp b/dpnp/tensor/libtensor/source/copy_for_reshape.cpp index 524bfcfdb98b..f7c60d8cfa08 100644 --- a/dpnp/tensor/libtensor/source/copy_for_reshape.cpp +++ b/dpnp/tensor/libtensor/source/copy_for_reshape.cpp @@ -29,7 +29,7 @@ //===----------------------------------------------------------------------===// /// /// \file -/// This file defines functions of dpctl.tensor._tensor_impl extensions +/// This file defines functions of dpnp.tensor._tensor_impl extensions //===----------------------------------------------------------------------===// #include @@ -49,14 +49,14 @@ #include "utils/sycl_alloc_utils.hpp" #include "utils/type_dispatch.hpp" -namespace dpctl::tensor::py_internal +namespace dpnp::tensor::py_internal { namespace py = pybind11; -namespace td_ns = dpctl::tensor::type_dispatch; +namespace td_ns = dpnp::tensor::type_dispatch; -using dpctl::tensor::kernels::copy_and_cast::copy_for_reshape_fn_ptr_t; -using dpctl::utils::keep_args_alive; +using dpnp::tensor::kernels::copy_and_cast::copy_for_reshape_fn_ptr_t; +using dpnp::utils::keep_args_alive; // define static vector static copy_for_reshape_fn_ptr_t @@ -72,8 +72,8 @@ static copy_for_reshape_fn_ptr_t * dst[np.multi_index(i, dst.shape)] = src[np.multi_index(i, src.shape)] */ std::pair - copy_usm_ndarray_for_reshape(const dpctl::tensor::usm_ndarray &src, - const dpctl::tensor::usm_ndarray &dst, + copy_usm_ndarray_for_reshape(const dpnp::tensor::usm_ndarray &src, + const dpnp::tensor::usm_ndarray &dst, sycl::queue &exec_q, const std::vector &depends) { @@ -101,15 +101,15 @@ std::pair return std::make_pair(sycl::event(), sycl::event()); } - dpctl::tensor::validation::AmpleMemory::throw_if_not_ample(dst, src_nelems); + dpnp::tensor::validation::AmpleMemory::throw_if_not_ample(dst, src_nelems); // check same contexts - if (!dpctl::utils::queues_are_compatible(exec_q, {src, dst})) { + if (!dpnp::utils::queues_are_compatible(exec_q, {src, dst})) { throw py::value_error( "Execution queue is not compatible with allocation queues"); } - dpctl::tensor::validation::CheckWritable::throw_if_not_writable(dst); + dpnp::tensor::validation::CheckWritable::throw_if_not_writable(dst); if (src_nelems == 1) { // handle special case of 1-element array @@ -141,7 +141,7 @@ std::pair host_task_events.reserve(2); // shape_strides = [src_shape, src_strides, dst_shape, dst_strides] - using dpctl::tensor::offset_utils::device_allocate_and_pack; + using dpnp::tensor::offset_utils::device_allocate_and_pack; auto ptr_size_event_tuple = device_allocate_and_pack( exec_q, host_task_events, src_shape, src_strides, dst_shape, dst_strides); @@ -161,7 +161,7 @@ std::pair dst_data, all_deps); sycl::event temporaries_cleanup_ev = - dpctl::tensor::alloc_utils::async_smart_free( + dpnp::tensor::alloc_utils::async_smart_free( exec_q, {copy_for_reshape_event}, shape_strides_owner); host_task_events.push_back(temporaries_cleanup_ev); @@ -173,7 +173,7 @@ std::pair void init_copy_for_reshape_dispatch_vectors(void) { using namespace td_ns; - using dpctl::tensor::kernels::copy_and_cast::CopyForReshapeGenericFactory; + using dpnp::tensor::kernels::copy_and_cast::CopyForReshapeGenericFactory; DispatchVectorBuilder @@ -181,4 +181,4 @@ void init_copy_for_reshape_dispatch_vectors(void) dvb.populate_dispatch_vector(copy_for_reshape_generic_dispatch_vector); } -} // namespace dpctl::tensor::py_internal +} // namespace dpnp::tensor::py_internal diff --git a/dpnp/tensor/libtensor/source/copy_for_reshape.hpp b/dpnp/tensor/libtensor/source/copy_for_reshape.hpp index c5af885ad6cd..843183ed5b95 100644 --- a/dpnp/tensor/libtensor/source/copy_for_reshape.hpp +++ b/dpnp/tensor/libtensor/source/copy_for_reshape.hpp @@ -29,7 +29,7 @@ //===----------------------------------------------------------------------===// /// /// \file -/// This file defines functions of dpctl.tensor._tensor_impl extensions +/// This file defines functions of dpnp.tensor._tensor_impl extensions //===----------------------------------------------------------------------===// #pragma once @@ -40,15 +40,15 @@ #include "dpnp4pybind11.hpp" -namespace dpctl::tensor::py_internal +namespace dpnp::tensor::py_internal { extern std::pair - copy_usm_ndarray_for_reshape(const dpctl::tensor::usm_ndarray &src, - const dpctl::tensor::usm_ndarray &dst, + copy_usm_ndarray_for_reshape(const dpnp::tensor::usm_ndarray &src, + const dpnp::tensor::usm_ndarray &dst, sycl::queue &exec_q, const std::vector &depends = {}); extern void init_copy_for_reshape_dispatch_vectors(); -} // namespace dpctl::tensor::py_internal +} // namespace dpnp::tensor::py_internal diff --git a/dpnp/tensor/libtensor/source/copy_for_roll.cpp b/dpnp/tensor/libtensor/source/copy_for_roll.cpp index 7742c1c96a4e..662a0390e0be 100644 --- a/dpnp/tensor/libtensor/source/copy_for_roll.cpp +++ b/dpnp/tensor/libtensor/source/copy_for_roll.cpp @@ -29,7 +29,7 @@ //===----------------------------------------------------------------------===// /// /// \file -/// This file defines functions of dpctl.tensor._tensor_impl extensions +/// This file defines functions of dpnp.tensor._tensor_impl extensions //===----------------------------------------------------------------------===// #include @@ -53,17 +53,17 @@ #include "simplify_iteration_space.hpp" -namespace dpctl::tensor::py_internal +namespace dpnp::tensor::py_internal { namespace py = pybind11; -namespace td_ns = dpctl::tensor::type_dispatch; +namespace td_ns = dpnp::tensor::type_dispatch; -using dpctl::tensor::kernels::copy_and_cast::copy_for_roll_contig_fn_ptr_t; -using dpctl::tensor::kernels::copy_and_cast:: +using dpnp::tensor::kernels::copy_and_cast::copy_for_roll_contig_fn_ptr_t; +using dpnp::tensor::kernels::copy_and_cast:: copy_for_roll_ndshift_strided_fn_ptr_t; -using dpctl::tensor::kernels::copy_and_cast::copy_for_roll_strided_fn_ptr_t; -using dpctl::utils::keep_args_alive; +using dpnp::tensor::kernels::copy_and_cast::copy_for_roll_strided_fn_ptr_t; +using dpnp::utils::keep_args_alive; // define static vector static copy_for_roll_strided_fn_ptr_t @@ -85,8 +85,8 @@ static copy_for_roll_ndshift_strided_fn_ptr_t * dst[np.multi_index(i, dst.shape)] = src[np.multi_index(i, src.shape)] */ std::pair - copy_usm_ndarray_for_roll_1d(const dpctl::tensor::usm_ndarray &src, - const dpctl::tensor::usm_ndarray &dst, + copy_usm_ndarray_for_roll_1d(const dpnp::tensor::usm_ndarray &src, + const dpnp::tensor::usm_ndarray &dst, py::ssize_t shift, sycl::queue &exec_q, const std::vector &depends) @@ -126,15 +126,15 @@ std::pair return std::make_pair(sycl::event(), sycl::event()); } - dpctl::tensor::validation::AmpleMemory::throw_if_not_ample(dst, src_nelems); + dpnp::tensor::validation::AmpleMemory::throw_if_not_ample(dst, src_nelems); // check same contexts - if (!dpctl::utils::queues_are_compatible(exec_q, {src, dst})) { + if (!dpnp::utils::queues_are_compatible(exec_q, {src, dst})) { throw py::value_error( "Execution queue is not compatible with allocation queues"); } - dpctl::tensor::validation::CheckWritable::throw_if_not_writable(dst); + dpnp::tensor::validation::CheckWritable::throw_if_not_writable(dst); if (src_nelems == 1) { // handle special case of 1-element array @@ -225,7 +225,7 @@ std::pair host_task_events.reserve(2); // shape_strides = [src_shape, src_strides, dst_strides] - using dpctl::tensor::offset_utils::device_allocate_and_pack; + using dpnp::tensor::offset_utils::device_allocate_and_pack; auto ptr_size_event_tuple = device_allocate_and_pack( exec_q, host_task_events, simplified_shape, simplified_src_strides, simplified_dst_strides); @@ -242,7 +242,7 @@ std::pair src_offset, dst_data, dst_offset, all_deps); sycl::event temporaries_cleanup_ev = - dpctl::tensor::alloc_utils::async_smart_free( + dpnp::tensor::alloc_utils::async_smart_free( exec_q, {copy_for_roll_event}, shape_strides_owner); host_task_events.push_back(temporaries_cleanup_ev); @@ -251,8 +251,8 @@ std::pair } std::pair - copy_usm_ndarray_for_roll_nd(const dpctl::tensor::usm_ndarray &src, - const dpctl::tensor::usm_ndarray &dst, + copy_usm_ndarray_for_roll_nd(const dpnp::tensor::usm_ndarray &src, + const dpnp::tensor::usm_ndarray &dst, const std::vector &shifts, sycl::queue &exec_q, const std::vector &depends) @@ -298,10 +298,10 @@ std::pair return std::make_pair(sycl::event(), sycl::event()); } - dpctl::tensor::validation::AmpleMemory::throw_if_not_ample(dst, src_nelems); + dpnp::tensor::validation::AmpleMemory::throw_if_not_ample(dst, src_nelems); // check for compatible queues - if (!dpctl::utils::queues_are_compatible(exec_q, {src, dst})) { + if (!dpnp::utils::queues_are_compatible(exec_q, {src, dst})) { throw py::value_error( "Execution queue is not compatible with allocation queues"); } @@ -348,7 +348,7 @@ std::pair host_task_events.reserve(2); // shape_strides = [src_shape, src_strides, dst_strides] - using dpctl::tensor::offset_utils::device_allocate_and_pack; + using dpnp::tensor::offset_utils::device_allocate_and_pack; auto ptr_size_event_tuple = device_allocate_and_pack( exec_q, host_task_events, common_shape, src_strides, dst_strides, normalized_shifts); @@ -365,7 +365,7 @@ std::pair fn(exec_q, src_nelems, src_nd, shape_strides_shifts, src_data, src_offset, dst_data, dst_offset, all_deps); - auto temporaries_cleanup_ev = dpctl::tensor::alloc_utils::async_smart_free( + auto temporaries_cleanup_ev = dpnp::tensor::alloc_utils::async_smart_free( exec_q, {copy_for_roll_event}, shape_strides_shifts_owner); host_task_events.push_back(temporaries_cleanup_ev); @@ -376,24 +376,24 @@ std::pair void init_copy_for_roll_dispatch_vectors(void) { using namespace td_ns; - using dpctl::tensor::kernels::copy_and_cast::CopyForRollStridedFactory; + using dpnp::tensor::kernels::copy_and_cast::CopyForRollStridedFactory; DispatchVectorBuilder dvb1; dvb1.populate_dispatch_vector(copy_for_roll_strided_dispatch_vector); - using dpctl::tensor::kernels::copy_and_cast::CopyForRollContigFactory; + using dpnp::tensor::kernels::copy_and_cast::CopyForRollContigFactory; DispatchVectorBuilder dvb2; dvb2.populate_dispatch_vector(copy_for_roll_contig_dispatch_vector); - using dpctl::tensor::kernels::copy_and_cast::CopyForRollNDShiftFactory; + using dpnp::tensor::kernels::copy_and_cast::CopyForRollNDShiftFactory; DispatchVectorBuilder dvb3; dvb3.populate_dispatch_vector(copy_for_roll_ndshift_dispatch_vector); } -} // namespace dpctl::tensor::py_internal +} // namespace dpnp::tensor::py_internal diff --git a/dpnp/tensor/libtensor/source/copy_for_roll.hpp b/dpnp/tensor/libtensor/source/copy_for_roll.hpp index cffbf9f6f0d6..9b14e98ba38d 100644 --- a/dpnp/tensor/libtensor/source/copy_for_roll.hpp +++ b/dpnp/tensor/libtensor/source/copy_for_roll.hpp @@ -29,7 +29,7 @@ //===----------------------------------------------------------------------===// /// /// \file -/// This file defines functions of dpctl.tensor._tensor_impl extensions +/// This file defines functions of dpnp.tensor._tensor_impl extensions //===----------------------------------------------------------------------===// #pragma once @@ -43,23 +43,23 @@ namespace py = pybind11; -namespace dpctl::tensor::py_internal +namespace dpnp::tensor::py_internal { extern std::pair - copy_usm_ndarray_for_roll_1d(const dpctl::tensor::usm_ndarray &src, - const dpctl::tensor::usm_ndarray &dst, + copy_usm_ndarray_for_roll_1d(const dpnp::tensor::usm_ndarray &src, + const dpnp::tensor::usm_ndarray &dst, py::ssize_t shift, sycl::queue &exec_q, const std::vector &depends = {}); extern std::pair - copy_usm_ndarray_for_roll_nd(const dpctl::tensor::usm_ndarray &src, - const dpctl::tensor::usm_ndarray &dst, + copy_usm_ndarray_for_roll_nd(const dpnp::tensor::usm_ndarray &src, + const dpnp::tensor::usm_ndarray &dst, const std::vector &shifts, sycl::queue &exec_q, const std::vector &depends = {}); extern void init_copy_for_roll_dispatch_vectors(); -} // namespace dpctl::tensor::py_internal +} // namespace dpnp::tensor::py_internal diff --git a/dpnp/tensor/libtensor/source/copy_numpy_ndarray_into_usm_ndarray.cpp b/dpnp/tensor/libtensor/source/copy_numpy_ndarray_into_usm_ndarray.cpp index e97e8aeb1ca1..8785e51258f5 100644 --- a/dpnp/tensor/libtensor/source/copy_numpy_ndarray_into_usm_ndarray.cpp +++ b/dpnp/tensor/libtensor/source/copy_numpy_ndarray_into_usm_ndarray.cpp @@ -29,7 +29,7 @@ //===----------------------------------------------------------------------===// /// /// \file -/// This file defines functions of dpctl.tensor._tensor_impl extensions +/// This file defines functions of dpnp.tensor._tensor_impl extensions //===----------------------------------------------------------------------===// #include @@ -57,19 +57,19 @@ #include "simplify_iteration_space.hpp" namespace py = pybind11; -namespace td_ns = dpctl::tensor::type_dispatch; +namespace td_ns = dpnp::tensor::type_dispatch; -namespace dpctl::tensor::py_internal +namespace dpnp::tensor::py_internal { -using dpctl::tensor::kernels::copy_and_cast:: +using dpnp::tensor::kernels::copy_and_cast:: copy_and_cast_from_host_blocking_fn_ptr_t; static copy_and_cast_from_host_blocking_fn_ptr_t copy_and_cast_from_host_blocking_dispatch_table[td_ns::num_types] [td_ns::num_types]; -using dpctl::tensor::kernels::copy_and_cast:: +using dpnp::tensor::kernels::copy_and_cast:: copy_and_cast_from_host_contig_blocking_fn_ptr_t; static copy_and_cast_from_host_contig_blocking_fn_ptr_t @@ -78,7 +78,7 @@ static copy_and_cast_from_host_contig_blocking_fn_ptr_t void copy_numpy_ndarray_into_usm_ndarray( const py::array &npy_src, - const dpctl::tensor::usm_ndarray &dst, + const dpnp::tensor::usm_ndarray &dst, sycl::queue &exec_q, const std::vector &depends) { @@ -111,14 +111,14 @@ void copy_numpy_ndarray_into_usm_ndarray( return; } - dpctl::tensor::validation::AmpleMemory::throw_if_not_ample(dst, src_nelems); + dpnp::tensor::validation::AmpleMemory::throw_if_not_ample(dst, src_nelems); - if (!dpctl::utils::queues_are_compatible(exec_q, {dst})) { + if (!dpnp::utils::queues_are_compatible(exec_q, {dst})) { throw py::value_error("Execution queue is not compatible with the " "allocation queue"); } - dpctl::tensor::validation::CheckWritable::throw_if_not_writable(dst); + dpnp::tensor::validation::CheckWritable::throw_if_not_writable(dst); // here we assume that NumPy's type numbers agree with ours for types // supported in both @@ -219,11 +219,11 @@ void copy_numpy_ndarray_into_usm_ndarray( else { if (is_src_c_contig) { src_strides_in_elems = - dpctl::tensor::c_contiguous_strides(nd, src_shape); + dpnp::tensor::c_contiguous_strides(nd, src_shape); } else if (is_src_f_contig) { src_strides_in_elems = - dpctl::tensor::f_contiguous_strides(nd, src_shape); + dpnp::tensor::f_contiguous_strides(nd, src_shape); } else { throw py::value_error("NumPy source array has null strides but is " @@ -313,7 +313,7 @@ void copy_numpy_ndarray_into_usm_ndarray( host_task_events.reserve(1); // Copy shape strides into device memory - using dpctl::tensor::offset_utils::device_allocate_and_pack; + using dpnp::tensor::offset_utils::device_allocate_and_pack; auto ptr_size_event_tuple = device_allocate_and_pack( exec_q, host_task_events, simplified_shape, simplified_src_strides, simplified_dst_strides); @@ -345,7 +345,7 @@ void copy_numpy_ndarray_into_usm_ndarray( void init_copy_numpy_ndarray_into_usm_ndarray_dispatch_tables(void) { using namespace td_ns; - using dpctl::tensor::kernels::copy_and_cast::CopyAndCastFromHostFactory; + using dpnp::tensor::kernels::copy_and_cast::CopyAndCastFromHostFactory; DispatchTableBuilder @@ -354,7 +354,7 @@ void init_copy_numpy_ndarray_into_usm_ndarray_dispatch_tables(void) dtb_copy_from_numpy.populate_dispatch_table( copy_and_cast_from_host_blocking_dispatch_table); - using dpctl::tensor::kernels::copy_and_cast:: + using dpnp::tensor::kernels::copy_and_cast:: CopyAndCastFromHostContigFactory; DispatchTableBuilder &depends = {}); extern void init_copy_numpy_ndarray_into_usm_ndarray_dispatch_tables(void); -} // namespace dpctl::tensor::py_internal +} // namespace dpnp::tensor::py_internal diff --git a/dpnp/tensor/libtensor/source/device_support_queries.cpp b/dpnp/tensor/libtensor/source/device_support_queries.cpp index 6026520f3daa..530dde211635 100644 --- a/dpnp/tensor/libtensor/source/device_support_queries.cpp +++ b/dpnp/tensor/libtensor/source/device_support_queries.cpp @@ -29,7 +29,7 @@ //===--------------------------------------------------------------------===// /// /// \file -/// This file defines functions of dpctl.tensor._tensor_impl extensions +/// This file defines functions of dpnp.tensor._tensor_impl extensions //===--------------------------------------------------------------------===// #include @@ -39,7 +39,7 @@ #include -namespace dpctl::tensor::py_internal +namespace dpnp::tensor::py_internal { namespace py = pybind11; @@ -116,7 +116,7 @@ std::string _default_device_index_type(const sycl::device &) { return "i8"; } sycl::device _extract_device(const py::object &arg) { - auto const &api = dpctl::detail::dpctl_capi::get(); + auto const &api = ::dpctl::detail::dpctl_capi::get(); PyObject *source = arg.ptr(); if (api.PySyclQueue_Check_(source)) { @@ -170,4 +170,4 @@ std::string default_device_index_type(const py::object &arg) return _default_device_index_type(d); } -} // namespace dpctl::tensor::py_internal +} // namespace dpnp::tensor::py_internal diff --git a/dpnp/tensor/libtensor/source/device_support_queries.hpp b/dpnp/tensor/libtensor/source/device_support_queries.hpp index adde7aefe3dd..ccb8d66aede3 100644 --- a/dpnp/tensor/libtensor/source/device_support_queries.hpp +++ b/dpnp/tensor/libtensor/source/device_support_queries.hpp @@ -28,7 +28,7 @@ //===--------------------------------------------------------------------===// /// /// \file -/// This file defines functions of dpctl.tensor._tensor_impl extensions +/// This file defines functions of dpnp.tensor._tensor_impl extensions //===--------------------------------------------------------------------===// #pragma once @@ -37,7 +37,7 @@ #include "dpnp4pybind11.hpp" #include -namespace dpctl::tensor::py_internal +namespace dpnp::tensor::py_internal { extern std::string default_device_fp_type(const py::object &); @@ -47,4 +47,4 @@ extern std::string default_device_bool_type(const py::object &); extern std::string default_device_complex_type(const py::object &); extern std::string default_device_index_type(const py::object &); -} // namespace dpctl::tensor::py_internal +} // namespace dpnp::tensor::py_internal diff --git a/dpnp/tensor/libtensor/source/elementwise_functions/abs.cpp b/dpnp/tensor/libtensor/source/elementwise_functions/abs.cpp index 067a201099de..e0487e89f52d 100644 --- a/dpnp/tensor/libtensor/source/elementwise_functions/abs.cpp +++ b/dpnp/tensor/libtensor/source/elementwise_functions/abs.cpp @@ -29,7 +29,7 @@ //===---------------------------------------------------------------------===// /// /// \file -/// This file defines functions of dpctl.tensor._tensor_elementwise_impl +/// This file defines functions of dpnp.tensor._tensor_elementwise_impl /// extension, specifically functions for elementwise operations. //===---------------------------------------------------------------------===// @@ -50,13 +50,13 @@ #include "kernels/elementwise_functions/abs.hpp" #include "kernels/elementwise_functions/common.hpp" -namespace dpctl::tensor::py_internal +namespace dpnp::tensor::py_internal { namespace py = pybind11; -namespace td_ns = dpctl::tensor::type_dispatch; +namespace td_ns = dpnp::tensor::type_dispatch; -namespace ew_cmn_ns = dpctl::tensor::kernels::elementwise_common; +namespace ew_cmn_ns = dpnp::tensor::kernels::elementwise_common; using ew_cmn_ns::unary_contig_impl_fn_ptr_t; using ew_cmn_ns::unary_strided_impl_fn_ptr_t; @@ -64,7 +64,7 @@ using ew_cmn_ns::unary_strided_impl_fn_ptr_t; namespace impl { -namespace abs_fn_ns = dpctl::tensor::kernels::abs; +namespace abs_fn_ns = dpnp::tensor::kernels::abs; static unary_contig_impl_fn_ptr_t abs_contig_dispatch_vector[td_ns::num_types]; static int abs_output_typeid_vector[td_ns::num_types]; @@ -97,7 +97,7 @@ void populate_abs_dispatch_vectors(void) void init_abs(py::module_ m) { - using arrayT = dpctl::tensor::usm_ndarray; + using arrayT = dpnp::tensor::usm_ndarray; using event_vecT = std::vector; { impl::populate_abs_dispatch_vectors(); @@ -122,4 +122,4 @@ void init_abs(py::module_ m) } } -} // namespace dpctl::tensor::py_internal +} // namespace dpnp::tensor::py_internal diff --git a/dpnp/tensor/libtensor/source/elementwise_functions/abs.hpp b/dpnp/tensor/libtensor/source/elementwise_functions/abs.hpp index b496f1e694ac..1504f28d0199 100644 --- a/dpnp/tensor/libtensor/source/elementwise_functions/abs.hpp +++ b/dpnp/tensor/libtensor/source/elementwise_functions/abs.hpp @@ -29,7 +29,7 @@ //===---------------------------------------------------------------------===// /// /// \file -/// This file defines functions of dpctl.tensor._tensor_elementwise_impl +/// This file defines functions of dpnp.tensor._tensor_elementwise_impl /// extension, specifically functions for elementwise operations. //===---------------------------------------------------------------------===// @@ -38,9 +38,9 @@ namespace py = pybind11; -namespace dpctl::tensor::py_internal +namespace dpnp::tensor::py_internal { extern void init_abs(py::module_ m); -} // namespace dpctl::tensor::py_internal +} // namespace dpnp::tensor::py_internal diff --git a/dpnp/tensor/libtensor/source/elementwise_functions/acos.cpp b/dpnp/tensor/libtensor/source/elementwise_functions/acos.cpp index 52d962cd828e..0cfd711d711e 100644 --- a/dpnp/tensor/libtensor/source/elementwise_functions/acos.cpp +++ b/dpnp/tensor/libtensor/source/elementwise_functions/acos.cpp @@ -29,7 +29,7 @@ //===---------------------------------------------------------------------===// /// /// \file -/// This file defines functions of dpctl.tensor._tensor_elementwise_impl +/// This file defines functions of dpnp.tensor._tensor_elementwise_impl /// extension, specifically functions for elementwise operations. //===---------------------------------------------------------------------===// @@ -50,13 +50,13 @@ #include "kernels/elementwise_functions/acos.hpp" #include "kernels/elementwise_functions/common.hpp" -namespace dpctl::tensor::py_internal +namespace dpnp::tensor::py_internal { namespace py = pybind11; -namespace td_ns = dpctl::tensor::type_dispatch; +namespace td_ns = dpnp::tensor::type_dispatch; -namespace ew_cmn_ns = dpctl::tensor::kernels::elementwise_common; +namespace ew_cmn_ns = dpnp::tensor::kernels::elementwise_common; using ew_cmn_ns::unary_contig_impl_fn_ptr_t; using ew_cmn_ns::unary_strided_impl_fn_ptr_t; @@ -64,7 +64,7 @@ using ew_cmn_ns::unary_strided_impl_fn_ptr_t; namespace impl { -namespace acos_fn_ns = dpctl::tensor::kernels::acos; +namespace acos_fn_ns = dpnp::tensor::kernels::acos; static unary_contig_impl_fn_ptr_t acos_contig_dispatch_vector[td_ns::num_types]; static int acos_output_typeid_vector[td_ns::num_types]; @@ -97,7 +97,7 @@ void populate_acos_dispatch_vectors(void) void init_acos(py::module_ m) { - using arrayT = dpctl::tensor::usm_ndarray; + using arrayT = dpnp::tensor::usm_ndarray; using event_vecT = std::vector; { impl::populate_acos_dispatch_vectors(); @@ -122,4 +122,4 @@ void init_acos(py::module_ m) } } -} // namespace dpctl::tensor::py_internal +} // namespace dpnp::tensor::py_internal diff --git a/dpnp/tensor/libtensor/source/elementwise_functions/acos.hpp b/dpnp/tensor/libtensor/source/elementwise_functions/acos.hpp index 608b684c4e18..517bee921fb4 100644 --- a/dpnp/tensor/libtensor/source/elementwise_functions/acos.hpp +++ b/dpnp/tensor/libtensor/source/elementwise_functions/acos.hpp @@ -29,7 +29,7 @@ //===---------------------------------------------------------------------===// /// /// \file -/// This file defines functions of dpctl.tensor._tensor_elementwise_impl +/// This file defines functions of dpnp.tensor._tensor_elementwise_impl /// extension, specifically functions for elementwise operations. //===---------------------------------------------------------------------===// @@ -38,9 +38,9 @@ namespace py = pybind11; -namespace dpctl::tensor::py_internal +namespace dpnp::tensor::py_internal { extern void init_acos(py::module_ m); -} // namespace dpctl::tensor::py_internal +} // namespace dpnp::tensor::py_internal diff --git a/dpnp/tensor/libtensor/source/elementwise_functions/acosh.cpp b/dpnp/tensor/libtensor/source/elementwise_functions/acosh.cpp index c2334804e422..c7334736f510 100644 --- a/dpnp/tensor/libtensor/source/elementwise_functions/acosh.cpp +++ b/dpnp/tensor/libtensor/source/elementwise_functions/acosh.cpp @@ -29,7 +29,7 @@ //===---------------------------------------------------------------------===// /// /// \file -/// This file defines functions of dpctl.tensor._tensor_elementwise_impl +/// This file defines functions of dpnp.tensor._tensor_elementwise_impl /// extension, specifically functions for elementwise operations. //===---------------------------------------------------------------------===// @@ -50,13 +50,13 @@ #include "kernels/elementwise_functions/acosh.hpp" #include "kernels/elementwise_functions/common.hpp" -namespace dpctl::tensor::py_internal +namespace dpnp::tensor::py_internal { namespace py = pybind11; -namespace td_ns = dpctl::tensor::type_dispatch; +namespace td_ns = dpnp::tensor::type_dispatch; -namespace ew_cmn_ns = dpctl::tensor::kernels::elementwise_common; +namespace ew_cmn_ns = dpnp::tensor::kernels::elementwise_common; using ew_cmn_ns::unary_contig_impl_fn_ptr_t; using ew_cmn_ns::unary_strided_impl_fn_ptr_t; @@ -64,7 +64,7 @@ using ew_cmn_ns::unary_strided_impl_fn_ptr_t; namespace impl { -namespace acosh_fn_ns = dpctl::tensor::kernels::acosh; +namespace acosh_fn_ns = dpnp::tensor::kernels::acosh; static unary_contig_impl_fn_ptr_t acosh_contig_dispatch_vector[td_ns::num_types]; @@ -98,7 +98,7 @@ void populate_acosh_dispatch_vectors(void) void init_acosh(py::module_ m) { - using arrayT = dpctl::tensor::usm_ndarray; + using arrayT = dpnp::tensor::usm_ndarray; using event_vecT = std::vector; { impl::populate_acosh_dispatch_vectors(); @@ -124,4 +124,4 @@ void init_acosh(py::module_ m) } } -} // namespace dpctl::tensor::py_internal +} // namespace dpnp::tensor::py_internal diff --git a/dpnp/tensor/libtensor/source/elementwise_functions/acosh.hpp b/dpnp/tensor/libtensor/source/elementwise_functions/acosh.hpp index fc74fa99874f..5a9d4dd8e5b9 100644 --- a/dpnp/tensor/libtensor/source/elementwise_functions/acosh.hpp +++ b/dpnp/tensor/libtensor/source/elementwise_functions/acosh.hpp @@ -29,7 +29,7 @@ //===---------------------------------------------------------------------===// /// /// \file -/// This file defines functions of dpctl.tensor._tensor_elementwise_impl +/// This file defines functions of dpnp.tensor._tensor_elementwise_impl /// extension, specifically functions for elementwise operations. //===---------------------------------------------------------------------===// @@ -38,9 +38,9 @@ namespace py = pybind11; -namespace dpctl::tensor::py_internal +namespace dpnp::tensor::py_internal { extern void init_acosh(py::module_ m); -} // namespace dpctl::tensor::py_internal +} // namespace dpnp::tensor::py_internal diff --git a/dpnp/tensor/libtensor/source/elementwise_functions/add.cpp b/dpnp/tensor/libtensor/source/elementwise_functions/add.cpp index e37fad67e294..7ba2fd8a37f3 100644 --- a/dpnp/tensor/libtensor/source/elementwise_functions/add.cpp +++ b/dpnp/tensor/libtensor/source/elementwise_functions/add.cpp @@ -29,7 +29,7 @@ //===---------------------------------------------------------------------===// /// /// \file -/// This file defines functions of dpctl.tensor._tensor_elementwise_impl +/// This file defines functions of dpnp.tensor._tensor_elementwise_impl /// extension, specifically functions for elementwise operations. //===---------------------------------------------------------------------===// @@ -51,13 +51,13 @@ #include "kernels/elementwise_functions/common.hpp" #include "kernels/elementwise_functions/common_inplace.hpp" -namespace dpctl::tensor::py_internal +namespace dpnp::tensor::py_internal { namespace py = pybind11; -namespace td_ns = dpctl::tensor::type_dispatch; +namespace td_ns = dpnp::tensor::type_dispatch; -namespace ew_cmn_ns = dpctl::tensor::kernels::elementwise_common; +namespace ew_cmn_ns = dpnp::tensor::kernels::elementwise_common; using ew_cmn_ns::binary_contig_impl_fn_ptr_t; using ew_cmn_ns::binary_contig_matrix_contig_row_broadcast_impl_fn_ptr_t; using ew_cmn_ns::binary_contig_row_contig_matrix_broadcast_impl_fn_ptr_t; @@ -71,7 +71,7 @@ using ew_cmn_ns::binary_inplace_strided_impl_fn_ptr_t; namespace impl { -namespace add_fn_ns = dpctl::tensor::kernels::add; +namespace add_fn_ns = dpnp::tensor::kernels::add; static binary_contig_impl_fn_ptr_t add_contig_dispatch_table[td_ns::num_types] [td_ns::num_types]; @@ -175,7 +175,7 @@ void populate_add_dispatch_tables(void) void init_add(py::module_ m) { - using arrayT = dpctl::tensor::usm_ndarray; + using arrayT = dpnp::tensor::usm_ndarray; using event_vecT = std::vector; { impl::populate_add_dispatch_tables(); @@ -240,4 +240,4 @@ void init_add(py::module_ m) } } -} // namespace dpctl::tensor::py_internal +} // namespace dpnp::tensor::py_internal diff --git a/dpnp/tensor/libtensor/source/elementwise_functions/add.hpp b/dpnp/tensor/libtensor/source/elementwise_functions/add.hpp index 0797adb79ddb..2d668184a523 100644 --- a/dpnp/tensor/libtensor/source/elementwise_functions/add.hpp +++ b/dpnp/tensor/libtensor/source/elementwise_functions/add.hpp @@ -29,7 +29,7 @@ //===---------------------------------------------------------------------===// /// /// \file -/// This file defines functions of dpctl.tensor._tensor_elementwise_impl +/// This file defines functions of dpnp.tensor._tensor_elementwise_impl /// extension, specifically functions for elementwise operations. //===---------------------------------------------------------------------===// @@ -38,9 +38,9 @@ namespace py = pybind11; -namespace dpctl::tensor::py_internal +namespace dpnp::tensor::py_internal { extern void init_add(py::module_ m); -} // namespace dpctl::tensor::py_internal +} // namespace dpnp::tensor::py_internal diff --git a/dpnp/tensor/libtensor/source/elementwise_functions/angle.cpp b/dpnp/tensor/libtensor/source/elementwise_functions/angle.cpp index df2b97fe7644..8d3336796ad4 100644 --- a/dpnp/tensor/libtensor/source/elementwise_functions/angle.cpp +++ b/dpnp/tensor/libtensor/source/elementwise_functions/angle.cpp @@ -29,7 +29,7 @@ //===---------------------------------------------------------------------===// /// /// \file -/// This file defines functions of dpctl.tensor._tensor_elementwise_impl +/// This file defines functions of dpnp.tensor._tensor_elementwise_impl /// extension, specifically functions for elementwise operations. //===---------------------------------------------------------------------===// @@ -50,13 +50,13 @@ #include "kernels/elementwise_functions/angle.hpp" #include "kernels/elementwise_functions/common.hpp" -namespace dpctl::tensor::py_internal +namespace dpnp::tensor::py_internal { namespace py = pybind11; -namespace td_ns = dpctl::tensor::type_dispatch; +namespace td_ns = dpnp::tensor::type_dispatch; -namespace ew_cmn_ns = dpctl::tensor::kernels::elementwise_common; +namespace ew_cmn_ns = dpnp::tensor::kernels::elementwise_common; using ew_cmn_ns::unary_contig_impl_fn_ptr_t; using ew_cmn_ns::unary_strided_impl_fn_ptr_t; @@ -64,7 +64,7 @@ using ew_cmn_ns::unary_strided_impl_fn_ptr_t; namespace impl { -namespace angle_fn_ns = dpctl::tensor::kernels::angle; +namespace angle_fn_ns = dpnp::tensor::kernels::angle; static unary_contig_impl_fn_ptr_t angle_contig_dispatch_vector[td_ns::num_types]; @@ -98,7 +98,7 @@ void populate_angle_dispatch_vectors(void) void init_angle(py::module_ m) { - using arrayT = dpctl::tensor::usm_ndarray; + using arrayT = dpnp::tensor::usm_ndarray; using event_vecT = std::vector; { impl::populate_angle_dispatch_vectors(); @@ -124,4 +124,4 @@ void init_angle(py::module_ m) } } -} // namespace dpctl::tensor::py_internal +} // namespace dpnp::tensor::py_internal diff --git a/dpnp/tensor/libtensor/source/elementwise_functions/angle.hpp b/dpnp/tensor/libtensor/source/elementwise_functions/angle.hpp index 73071b945d7b..630e8dbbc077 100644 --- a/dpnp/tensor/libtensor/source/elementwise_functions/angle.hpp +++ b/dpnp/tensor/libtensor/source/elementwise_functions/angle.hpp @@ -29,7 +29,7 @@ //===---------------------------------------------------------------------===// /// /// \file -/// This file defines functions of dpctl.tensor._tensor_elementwise_impl +/// This file defines functions of dpnp.tensor._tensor_elementwise_impl /// extension, specifically functions for elementwise operations. //===---------------------------------------------------------------------===// @@ -38,9 +38,9 @@ namespace py = pybind11; -namespace dpctl::tensor::py_internal +namespace dpnp::tensor::py_internal { extern void init_angle(py::module_ m); -} // namespace dpctl::tensor::py_internal +} // namespace dpnp::tensor::py_internal diff --git a/dpnp/tensor/libtensor/source/elementwise_functions/asin.cpp b/dpnp/tensor/libtensor/source/elementwise_functions/asin.cpp index 32d71c67527e..7c62285af510 100644 --- a/dpnp/tensor/libtensor/source/elementwise_functions/asin.cpp +++ b/dpnp/tensor/libtensor/source/elementwise_functions/asin.cpp @@ -29,7 +29,7 @@ //===---------------------------------------------------------------------===// /// /// \file -/// This file defines functions of dpctl.tensor._tensor_elementwise_impl +/// This file defines functions of dpnp.tensor._tensor_elementwise_impl /// extension, specifically functions for elementwise operations. //===---------------------------------------------------------------------===// @@ -50,13 +50,13 @@ #include "kernels/elementwise_functions/asin.hpp" #include "kernels/elementwise_functions/common.hpp" -namespace dpctl::tensor::py_internal +namespace dpnp::tensor::py_internal { namespace py = pybind11; -namespace td_ns = dpctl::tensor::type_dispatch; +namespace td_ns = dpnp::tensor::type_dispatch; -namespace ew_cmn_ns = dpctl::tensor::kernels::elementwise_common; +namespace ew_cmn_ns = dpnp::tensor::kernels::elementwise_common; using ew_cmn_ns::unary_contig_impl_fn_ptr_t; using ew_cmn_ns::unary_strided_impl_fn_ptr_t; @@ -64,7 +64,7 @@ using ew_cmn_ns::unary_strided_impl_fn_ptr_t; namespace impl { -namespace asin_fn_ns = dpctl::tensor::kernels::asin; +namespace asin_fn_ns = dpnp::tensor::kernels::asin; static unary_contig_impl_fn_ptr_t asin_contig_dispatch_vector[td_ns::num_types]; static int asin_output_typeid_vector[td_ns::num_types]; @@ -97,7 +97,7 @@ void populate_asin_dispatch_vectors(void) void init_asin(py::module_ m) { - using arrayT = dpctl::tensor::usm_ndarray; + using arrayT = dpnp::tensor::usm_ndarray; using event_vecT = std::vector; { impl::populate_asin_dispatch_vectors(); @@ -122,4 +122,4 @@ void init_asin(py::module_ m) } } -} // namespace dpctl::tensor::py_internal +} // namespace dpnp::tensor::py_internal diff --git a/dpnp/tensor/libtensor/source/elementwise_functions/asin.hpp b/dpnp/tensor/libtensor/source/elementwise_functions/asin.hpp index 39230000bdfc..260ed3232e80 100644 --- a/dpnp/tensor/libtensor/source/elementwise_functions/asin.hpp +++ b/dpnp/tensor/libtensor/source/elementwise_functions/asin.hpp @@ -29,7 +29,7 @@ //===---------------------------------------------------------------------===// /// /// \file -/// This file defines functions of dpctl.tensor._tensor_elementwise_impl +/// This file defines functions of dpnp.tensor._tensor_elementwise_impl /// extension, specifically functions for elementwise operations. //===---------------------------------------------------------------------===// @@ -38,9 +38,9 @@ namespace py = pybind11; -namespace dpctl::tensor::py_internal +namespace dpnp::tensor::py_internal { extern void init_asin(py::module_ m); -} // namespace dpctl::tensor::py_internal +} // namespace dpnp::tensor::py_internal diff --git a/dpnp/tensor/libtensor/source/elementwise_functions/asinh.cpp b/dpnp/tensor/libtensor/source/elementwise_functions/asinh.cpp index 47f8a7dbf190..e560dc3330bf 100644 --- a/dpnp/tensor/libtensor/source/elementwise_functions/asinh.cpp +++ b/dpnp/tensor/libtensor/source/elementwise_functions/asinh.cpp @@ -29,7 +29,7 @@ //===---------------------------------------------------------------------===// /// /// \file -/// This file defines functions of dpctl.tensor._tensor_elementwise_impl +/// This file defines functions of dpnp.tensor._tensor_elementwise_impl /// extension, specifically functions for elementwise operations. //===---------------------------------------------------------------------===// @@ -50,13 +50,13 @@ #include "kernels/elementwise_functions/asinh.hpp" #include "kernels/elementwise_functions/common.hpp" -namespace dpctl::tensor::py_internal +namespace dpnp::tensor::py_internal { namespace py = pybind11; -namespace td_ns = dpctl::tensor::type_dispatch; +namespace td_ns = dpnp::tensor::type_dispatch; -namespace ew_cmn_ns = dpctl::tensor::kernels::elementwise_common; +namespace ew_cmn_ns = dpnp::tensor::kernels::elementwise_common; using ew_cmn_ns::unary_contig_impl_fn_ptr_t; using ew_cmn_ns::unary_strided_impl_fn_ptr_t; @@ -64,7 +64,7 @@ using ew_cmn_ns::unary_strided_impl_fn_ptr_t; namespace impl { -namespace asinh_fn_ns = dpctl::tensor::kernels::asinh; +namespace asinh_fn_ns = dpnp::tensor::kernels::asinh; static unary_contig_impl_fn_ptr_t asinh_contig_dispatch_vector[td_ns::num_types]; @@ -98,7 +98,7 @@ void populate_asinh_dispatch_vectors(void) void init_asinh(py::module_ m) { - using arrayT = dpctl::tensor::usm_ndarray; + using arrayT = dpnp::tensor::usm_ndarray; using event_vecT = std::vector; { impl::populate_asinh_dispatch_vectors(); @@ -124,4 +124,4 @@ void init_asinh(py::module_ m) } } -} // namespace dpctl::tensor::py_internal +} // namespace dpnp::tensor::py_internal diff --git a/dpnp/tensor/libtensor/source/elementwise_functions/asinh.hpp b/dpnp/tensor/libtensor/source/elementwise_functions/asinh.hpp index 0d761f082ae3..1c5ac0bbf125 100644 --- a/dpnp/tensor/libtensor/source/elementwise_functions/asinh.hpp +++ b/dpnp/tensor/libtensor/source/elementwise_functions/asinh.hpp @@ -29,7 +29,7 @@ //===---------------------------------------------------------------------===// /// /// \file -/// This file defines functions of dpctl.tensor._tensor_elementwise_impl +/// This file defines functions of dpnp.tensor._tensor_elementwise_impl /// extension, specifically functions for elementwise operations. //===---------------------------------------------------------------------===// @@ -38,9 +38,9 @@ namespace py = pybind11; -namespace dpctl::tensor::py_internal +namespace dpnp::tensor::py_internal { extern void init_asinh(py::module_ m); -} // namespace dpctl::tensor::py_internal +} // namespace dpnp::tensor::py_internal diff --git a/dpnp/tensor/libtensor/source/elementwise_functions/atan.cpp b/dpnp/tensor/libtensor/source/elementwise_functions/atan.cpp index 74ee82edbbc9..b72a3437524b 100644 --- a/dpnp/tensor/libtensor/source/elementwise_functions/atan.cpp +++ b/dpnp/tensor/libtensor/source/elementwise_functions/atan.cpp @@ -29,7 +29,7 @@ //===---------------------------------------------------------------------===// /// /// \file -/// This file defines functions of dpctl.tensor._tensor_elementwise_impl +/// This file defines functions of dpnp.tensor._tensor_elementwise_impl /// extension, specifically functions for elementwise operations. //===---------------------------------------------------------------------===// @@ -50,13 +50,13 @@ #include "kernels/elementwise_functions/atan.hpp" #include "kernels/elementwise_functions/common.hpp" -namespace dpctl::tensor::py_internal +namespace dpnp::tensor::py_internal { namespace py = pybind11; -namespace td_ns = dpctl::tensor::type_dispatch; +namespace td_ns = dpnp::tensor::type_dispatch; -namespace ew_cmn_ns = dpctl::tensor::kernels::elementwise_common; +namespace ew_cmn_ns = dpnp::tensor::kernels::elementwise_common; using ew_cmn_ns::unary_contig_impl_fn_ptr_t; using ew_cmn_ns::unary_strided_impl_fn_ptr_t; @@ -64,7 +64,7 @@ using ew_cmn_ns::unary_strided_impl_fn_ptr_t; namespace impl { -namespace atan_fn_ns = dpctl::tensor::kernels::atan; +namespace atan_fn_ns = dpnp::tensor::kernels::atan; static unary_contig_impl_fn_ptr_t atan_contig_dispatch_vector[td_ns::num_types]; static int atan_output_typeid_vector[td_ns::num_types]; @@ -97,7 +97,7 @@ void populate_atan_dispatch_vectors(void) void init_atan(py::module_ m) { - using arrayT = dpctl::tensor::usm_ndarray; + using arrayT = dpnp::tensor::usm_ndarray; using event_vecT = std::vector; { impl::populate_atan_dispatch_vectors(); @@ -122,4 +122,4 @@ void init_atan(py::module_ m) } } -} // namespace dpctl::tensor::py_internal +} // namespace dpnp::tensor::py_internal diff --git a/dpnp/tensor/libtensor/source/elementwise_functions/atan.hpp b/dpnp/tensor/libtensor/source/elementwise_functions/atan.hpp index c4eb3f3baf92..be69279f28c1 100644 --- a/dpnp/tensor/libtensor/source/elementwise_functions/atan.hpp +++ b/dpnp/tensor/libtensor/source/elementwise_functions/atan.hpp @@ -29,7 +29,7 @@ //===---------------------------------------------------------------------===// /// /// \file -/// This file defines functions of dpctl.tensor._tensor_elementwise_impl +/// This file defines functions of dpnp.tensor._tensor_elementwise_impl /// extension, specifically functions for elementwise operations. //===---------------------------------------------------------------------===// @@ -38,9 +38,9 @@ namespace py = pybind11; -namespace dpctl::tensor::py_internal +namespace dpnp::tensor::py_internal { extern void init_atan(py::module_ m); -} // namespace dpctl::tensor::py_internal +} // namespace dpnp::tensor::py_internal diff --git a/dpnp/tensor/libtensor/source/elementwise_functions/atan2.cpp b/dpnp/tensor/libtensor/source/elementwise_functions/atan2.cpp index 60bb2e081fef..aaef3bdd45d7 100644 --- a/dpnp/tensor/libtensor/source/elementwise_functions/atan2.cpp +++ b/dpnp/tensor/libtensor/source/elementwise_functions/atan2.cpp @@ -29,7 +29,7 @@ //===---------------------------------------------------------------------===// /// /// \file -/// This file defines functions of dpctl.tensor._tensor_elementwise_impl +/// This file defines functions of dpnp.tensor._tensor_elementwise_impl /// extension, specifically functions for elementwise operations. //===---------------------------------------------------------------------===// @@ -50,13 +50,13 @@ #include "kernels/elementwise_functions/atan2.hpp" #include "kernels/elementwise_functions/common.hpp" -namespace dpctl::tensor::py_internal +namespace dpnp::tensor::py_internal { namespace py = pybind11; -namespace td_ns = dpctl::tensor::type_dispatch; +namespace td_ns = dpnp::tensor::type_dispatch; -namespace ew_cmn_ns = dpctl::tensor::kernels::elementwise_common; +namespace ew_cmn_ns = dpnp::tensor::kernels::elementwise_common; using ew_cmn_ns::binary_contig_impl_fn_ptr_t; using ew_cmn_ns::binary_contig_matrix_contig_row_broadcast_impl_fn_ptr_t; using ew_cmn_ns::binary_contig_row_contig_matrix_broadcast_impl_fn_ptr_t; @@ -65,7 +65,7 @@ using ew_cmn_ns::binary_strided_impl_fn_ptr_t; // B02: ===== ATAN2 (x1, x2) namespace impl { -namespace atan2_fn_ns = dpctl::tensor::kernels::atan2; +namespace atan2_fn_ns = dpnp::tensor::kernels::atan2; static binary_contig_impl_fn_ptr_t atan2_contig_dispatch_table[td_ns::num_types][td_ns::num_types]; @@ -103,7 +103,7 @@ void populate_atan2_dispatch_tables(void) void init_atan2(py::module_ m) { - using arrayT = dpctl::tensor::usm_ndarray; + using arrayT = dpnp::tensor::usm_ndarray; using event_vecT = std::vector; { impl::populate_atan2_dispatch_tables(); @@ -143,4 +143,4 @@ void init_atan2(py::module_ m) } } -} // namespace dpctl::tensor::py_internal +} // namespace dpnp::tensor::py_internal diff --git a/dpnp/tensor/libtensor/source/elementwise_functions/atan2.hpp b/dpnp/tensor/libtensor/source/elementwise_functions/atan2.hpp index 5bdf9b74db2e..0bf08fedb770 100644 --- a/dpnp/tensor/libtensor/source/elementwise_functions/atan2.hpp +++ b/dpnp/tensor/libtensor/source/elementwise_functions/atan2.hpp @@ -29,7 +29,7 @@ //===---------------------------------------------------------------------===// /// /// \file -/// This file defines functions of dpctl.tensor._tensor_elementwise_impl +/// This file defines functions of dpnp.tensor._tensor_elementwise_impl /// extension, specifically functions for elementwise operations. //===---------------------------------------------------------------------===// @@ -38,9 +38,9 @@ namespace py = pybind11; -namespace dpctl::tensor::py_internal +namespace dpnp::tensor::py_internal { extern void init_atan2(py::module_ m); -} // namespace dpctl::tensor::py_internal +} // namespace dpnp::tensor::py_internal diff --git a/dpnp/tensor/libtensor/source/elementwise_functions/atanh.cpp b/dpnp/tensor/libtensor/source/elementwise_functions/atanh.cpp index 2857f9ab8c10..0d8dd64a1e3d 100644 --- a/dpnp/tensor/libtensor/source/elementwise_functions/atanh.cpp +++ b/dpnp/tensor/libtensor/source/elementwise_functions/atanh.cpp @@ -29,7 +29,7 @@ //===---------------------------------------------------------------------===// /// /// \file -/// This file defines functions of dpctl.tensor._tensor_elementwise_impl +/// This file defines functions of dpnp.tensor._tensor_elementwise_impl /// extension, specifically functions for elementwise operations. //===---------------------------------------------------------------------===// @@ -50,13 +50,13 @@ #include "kernels/elementwise_functions/atanh.hpp" #include "kernels/elementwise_functions/common.hpp" -namespace dpctl::tensor::py_internal +namespace dpnp::tensor::py_internal { namespace py = pybind11; -namespace td_ns = dpctl::tensor::type_dispatch; +namespace td_ns = dpnp::tensor::type_dispatch; -namespace ew_cmn_ns = dpctl::tensor::kernels::elementwise_common; +namespace ew_cmn_ns = dpnp::tensor::kernels::elementwise_common; using ew_cmn_ns::unary_contig_impl_fn_ptr_t; using ew_cmn_ns::unary_strided_impl_fn_ptr_t; @@ -64,7 +64,7 @@ using ew_cmn_ns::unary_strided_impl_fn_ptr_t; namespace impl { -namespace atanh_fn_ns = dpctl::tensor::kernels::atanh; +namespace atanh_fn_ns = dpnp::tensor::kernels::atanh; static unary_contig_impl_fn_ptr_t atanh_contig_dispatch_vector[td_ns::num_types]; @@ -98,7 +98,7 @@ void populate_atanh_dispatch_vectors(void) void init_atanh(py::module_ m) { - using arrayT = dpctl::tensor::usm_ndarray; + using arrayT = dpnp::tensor::usm_ndarray; using event_vecT = std::vector; { impl::populate_atanh_dispatch_vectors(); @@ -124,4 +124,4 @@ void init_atanh(py::module_ m) } } -} // namespace dpctl::tensor::py_internal +} // namespace dpnp::tensor::py_internal diff --git a/dpnp/tensor/libtensor/source/elementwise_functions/atanh.hpp b/dpnp/tensor/libtensor/source/elementwise_functions/atanh.hpp index 5604e48deef6..20a09d584f1f 100644 --- a/dpnp/tensor/libtensor/source/elementwise_functions/atanh.hpp +++ b/dpnp/tensor/libtensor/source/elementwise_functions/atanh.hpp @@ -29,7 +29,7 @@ //===---------------------------------------------------------------------===// /// /// \file -/// This file defines functions of dpctl.tensor._tensor_elementwise_impl +/// This file defines functions of dpnp.tensor._tensor_elementwise_impl /// extension, specifically functions for elementwise operations. //===---------------------------------------------------------------------===// @@ -38,9 +38,9 @@ namespace py = pybind11; -namespace dpctl::tensor::py_internal +namespace dpnp::tensor::py_internal { extern void init_atanh(py::module_ m); -} // namespace dpctl::tensor::py_internal +} // namespace dpnp::tensor::py_internal diff --git a/dpnp/tensor/libtensor/source/elementwise_functions/bitwise_and.cpp b/dpnp/tensor/libtensor/source/elementwise_functions/bitwise_and.cpp index 3976f480ff6d..43fd70e46be4 100644 --- a/dpnp/tensor/libtensor/source/elementwise_functions/bitwise_and.cpp +++ b/dpnp/tensor/libtensor/source/elementwise_functions/bitwise_and.cpp @@ -29,7 +29,7 @@ //===---------------------------------------------------------------------===// /// /// \file -/// This file defines functions of dpctl.tensor._tensor_elementwise_impl +/// This file defines functions of dpnp.tensor._tensor_elementwise_impl /// extension, specifically functions for elementwise operations. //===---------------------------------------------------------------------===// @@ -51,13 +51,13 @@ #include "kernels/elementwise_functions/common.hpp" #include "kernels/elementwise_functions/common_inplace.hpp" -namespace dpctl::tensor::py_internal +namespace dpnp::tensor::py_internal { namespace py = pybind11; -namespace td_ns = dpctl::tensor::type_dispatch; +namespace td_ns = dpnp::tensor::type_dispatch; -namespace ew_cmn_ns = dpctl::tensor::kernels::elementwise_common; +namespace ew_cmn_ns = dpnp::tensor::kernels::elementwise_common; using ew_cmn_ns::binary_contig_impl_fn_ptr_t; using ew_cmn_ns::binary_contig_matrix_contig_row_broadcast_impl_fn_ptr_t; using ew_cmn_ns::binary_contig_row_contig_matrix_broadcast_impl_fn_ptr_t; @@ -70,7 +70,7 @@ using ew_cmn_ns::binary_inplace_strided_impl_fn_ptr_t; // B03: ===== BITWISE_AND (x1, x2) namespace impl { -namespace bitwise_and_fn_ns = dpctl::tensor::kernels::bitwise_and; +namespace bitwise_and_fn_ns = dpnp::tensor::kernels::bitwise_and; static binary_contig_impl_fn_ptr_t bitwise_and_contig_dispatch_table[td_ns::num_types][td_ns::num_types]; @@ -137,7 +137,7 @@ void populate_bitwise_and_dispatch_tables(void) void init_bitwise_and(py::module_ m) { - using arrayT = dpctl::tensor::usm_ndarray; + using arrayT = dpnp::tensor::usm_ndarray; using event_vecT = std::vector; { impl::populate_bitwise_and_dispatch_tables(); @@ -203,4 +203,4 @@ void init_bitwise_and(py::module_ m) } } -} // namespace dpctl::tensor::py_internal +} // namespace dpnp::tensor::py_internal diff --git a/dpnp/tensor/libtensor/source/elementwise_functions/bitwise_and.hpp b/dpnp/tensor/libtensor/source/elementwise_functions/bitwise_and.hpp index 19f29ae8822e..14dae1aa5a49 100644 --- a/dpnp/tensor/libtensor/source/elementwise_functions/bitwise_and.hpp +++ b/dpnp/tensor/libtensor/source/elementwise_functions/bitwise_and.hpp @@ -29,7 +29,7 @@ //===---------------------------------------------------------------------===// /// /// \file -/// This file defines functions of dpctl.tensor._tensor_elementwise_impl +/// This file defines functions of dpnp.tensor._tensor_elementwise_impl /// extension, specifically functions for elementwise operations. //===---------------------------------------------------------------------===// @@ -38,9 +38,9 @@ namespace py = pybind11; -namespace dpctl::tensor::py_internal +namespace dpnp::tensor::py_internal { extern void init_bitwise_and(py::module_ m); -} // namespace dpctl::tensor::py_internal +} // namespace dpnp::tensor::py_internal diff --git a/dpnp/tensor/libtensor/source/elementwise_functions/bitwise_invert.cpp b/dpnp/tensor/libtensor/source/elementwise_functions/bitwise_invert.cpp index 05e7f4eeb61b..214de22d2766 100644 --- a/dpnp/tensor/libtensor/source/elementwise_functions/bitwise_invert.cpp +++ b/dpnp/tensor/libtensor/source/elementwise_functions/bitwise_invert.cpp @@ -29,7 +29,7 @@ //===---------------------------------------------------------------------===// /// /// \file -/// This file defines functions of dpctl.tensor._tensor_elementwise_impl +/// This file defines functions of dpnp.tensor._tensor_elementwise_impl /// extension, specifically functions for elementwise operations. //===---------------------------------------------------------------------===// @@ -50,13 +50,13 @@ #include "kernels/elementwise_functions/bitwise_invert.hpp" #include "kernels/elementwise_functions/common.hpp" -namespace dpctl::tensor::py_internal +namespace dpnp::tensor::py_internal { namespace py = pybind11; -namespace td_ns = dpctl::tensor::type_dispatch; +namespace td_ns = dpnp::tensor::type_dispatch; -namespace ew_cmn_ns = dpctl::tensor::kernels::elementwise_common; +namespace ew_cmn_ns = dpnp::tensor::kernels::elementwise_common; using ew_cmn_ns::unary_contig_impl_fn_ptr_t; using ew_cmn_ns::unary_strided_impl_fn_ptr_t; @@ -64,7 +64,7 @@ using ew_cmn_ns::unary_strided_impl_fn_ptr_t; namespace impl { -namespace bitwise_invert_fn_ns = dpctl::tensor::kernels::bitwise_invert; +namespace bitwise_invert_fn_ns = dpnp::tensor::kernels::bitwise_invert; static unary_contig_impl_fn_ptr_t bitwise_invert_contig_dispatch_vector[td_ns::num_types]; @@ -98,7 +98,7 @@ void populate_bitwise_invert_dispatch_vectors(void) void init_bitwise_invert(py::module_ m) { - using arrayT = dpctl::tensor::usm_ndarray; + using arrayT = dpnp::tensor::usm_ndarray; using event_vecT = std::vector; { impl::populate_bitwise_invert_dispatch_vectors(); @@ -126,4 +126,4 @@ void init_bitwise_invert(py::module_ m) } } -} // namespace dpctl::tensor::py_internal +} // namespace dpnp::tensor::py_internal diff --git a/dpnp/tensor/libtensor/source/elementwise_functions/bitwise_invert.hpp b/dpnp/tensor/libtensor/source/elementwise_functions/bitwise_invert.hpp index e20c0df3cf11..73cb2d78dab9 100644 --- a/dpnp/tensor/libtensor/source/elementwise_functions/bitwise_invert.hpp +++ b/dpnp/tensor/libtensor/source/elementwise_functions/bitwise_invert.hpp @@ -29,7 +29,7 @@ //===---------------------------------------------------------------------===// /// /// \file -/// This file defines functions of dpctl.tensor._tensor_elementwise_impl +/// This file defines functions of dpnp.tensor._tensor_elementwise_impl /// extension, specifically functions for elementwise operations. //===---------------------------------------------------------------------===// @@ -38,9 +38,9 @@ namespace py = pybind11; -namespace dpctl::tensor::py_internal +namespace dpnp::tensor::py_internal { extern void init_bitwise_invert(py::module_ m); -} // namespace dpctl::tensor::py_internal +} // namespace dpnp::tensor::py_internal diff --git a/dpnp/tensor/libtensor/source/elementwise_functions/bitwise_left_shift.cpp b/dpnp/tensor/libtensor/source/elementwise_functions/bitwise_left_shift.cpp index c26c9a42864f..c9496f055f4c 100644 --- a/dpnp/tensor/libtensor/source/elementwise_functions/bitwise_left_shift.cpp +++ b/dpnp/tensor/libtensor/source/elementwise_functions/bitwise_left_shift.cpp @@ -29,7 +29,7 @@ //===---------------------------------------------------------------------===// /// /// \file -/// This file defines functions of dpctl.tensor._tensor_elementwise_impl +/// This file defines functions of dpnp.tensor._tensor_elementwise_impl /// extension, specifically functions for elementwise operations. //===---------------------------------------------------------------------===// @@ -51,13 +51,13 @@ #include "kernels/elementwise_functions/common.hpp" #include "kernels/elementwise_functions/common_inplace.hpp" -namespace dpctl::tensor::py_internal +namespace dpnp::tensor::py_internal { namespace py = pybind11; -namespace td_ns = dpctl::tensor::type_dispatch; +namespace td_ns = dpnp::tensor::type_dispatch; -namespace ew_cmn_ns = dpctl::tensor::kernels::elementwise_common; +namespace ew_cmn_ns = dpnp::tensor::kernels::elementwise_common; using ew_cmn_ns::binary_contig_impl_fn_ptr_t; using ew_cmn_ns::binary_contig_matrix_contig_row_broadcast_impl_fn_ptr_t; using ew_cmn_ns::binary_contig_row_contig_matrix_broadcast_impl_fn_ptr_t; @@ -70,7 +70,7 @@ using ew_cmn_ns::binary_inplace_strided_impl_fn_ptr_t; // B04: ===== BITWISE_LEFT_SHIFT (x1, x2) namespace impl { -namespace bitwise_left_shift_fn_ns = dpctl::tensor::kernels::bitwise_left_shift; +namespace bitwise_left_shift_fn_ns = dpnp::tensor::kernels::bitwise_left_shift; static binary_contig_impl_fn_ptr_t bitwise_left_shift_contig_dispatch_table[td_ns::num_types] @@ -143,7 +143,7 @@ void populate_bitwise_left_shift_dispatch_tables(void) void init_bitwise_left_shift(py::module_ m) { - using arrayT = dpctl::tensor::usm_ndarray; + using arrayT = dpnp::tensor::usm_ndarray; using event_vecT = std::vector; { impl::populate_bitwise_left_shift_dispatch_tables(); @@ -213,4 +213,4 @@ void init_bitwise_left_shift(py::module_ m) } } -} // namespace dpctl::tensor::py_internal +} // namespace dpnp::tensor::py_internal diff --git a/dpnp/tensor/libtensor/source/elementwise_functions/bitwise_left_shift.hpp b/dpnp/tensor/libtensor/source/elementwise_functions/bitwise_left_shift.hpp index 49a7947d98c3..5d1962e8cf3d 100644 --- a/dpnp/tensor/libtensor/source/elementwise_functions/bitwise_left_shift.hpp +++ b/dpnp/tensor/libtensor/source/elementwise_functions/bitwise_left_shift.hpp @@ -29,7 +29,7 @@ //===---------------------------------------------------------------------===// /// /// \file -/// This file defines functions of dpctl.tensor._tensor_elementwise_impl +/// This file defines functions of dpnp.tensor._tensor_elementwise_impl /// extension, specifically functions for elementwise operations. //===---------------------------------------------------------------------===// @@ -38,9 +38,9 @@ namespace py = pybind11; -namespace dpctl::tensor::py_internal +namespace dpnp::tensor::py_internal { extern void init_bitwise_left_shift(py::module_ m); -} // namespace dpctl::tensor::py_internal +} // namespace dpnp::tensor::py_internal diff --git a/dpnp/tensor/libtensor/source/elementwise_functions/bitwise_or.cpp b/dpnp/tensor/libtensor/source/elementwise_functions/bitwise_or.cpp index bbb138c406fb..1fa2ff494589 100644 --- a/dpnp/tensor/libtensor/source/elementwise_functions/bitwise_or.cpp +++ b/dpnp/tensor/libtensor/source/elementwise_functions/bitwise_or.cpp @@ -29,7 +29,7 @@ //===---------------------------------------------------------------------===// /// /// \file -/// This file defines functions of dpctl.tensor._tensor_elementwise_impl +/// This file defines functions of dpnp.tensor._tensor_elementwise_impl /// extension, specifically functions for elementwise operations. //===---------------------------------------------------------------------===// @@ -51,13 +51,13 @@ #include "kernels/elementwise_functions/common.hpp" #include "kernels/elementwise_functions/common_inplace.hpp" -namespace dpctl::tensor::py_internal +namespace dpnp::tensor::py_internal { namespace py = pybind11; -namespace td_ns = dpctl::tensor::type_dispatch; +namespace td_ns = dpnp::tensor::type_dispatch; -namespace ew_cmn_ns = dpctl::tensor::kernels::elementwise_common; +namespace ew_cmn_ns = dpnp::tensor::kernels::elementwise_common; using ew_cmn_ns::binary_contig_impl_fn_ptr_t; using ew_cmn_ns::binary_contig_matrix_contig_row_broadcast_impl_fn_ptr_t; using ew_cmn_ns::binary_contig_row_contig_matrix_broadcast_impl_fn_ptr_t; @@ -70,7 +70,7 @@ using ew_cmn_ns::binary_inplace_strided_impl_fn_ptr_t; // B05: ===== BITWISE_OR (x1, x2) namespace impl { -namespace bitwise_or_fn_ns = dpctl::tensor::kernels::bitwise_or; +namespace bitwise_or_fn_ns = dpnp::tensor::kernels::bitwise_or; static binary_contig_impl_fn_ptr_t bitwise_or_contig_dispatch_table[td_ns::num_types][td_ns::num_types]; @@ -137,7 +137,7 @@ void populate_bitwise_or_dispatch_tables(void) void init_bitwise_or(py::module_ m) { - using arrayT = dpctl::tensor::usm_ndarray; + using arrayT = dpnp::tensor::usm_ndarray; using event_vecT = std::vector; { impl::populate_bitwise_or_dispatch_tables(); @@ -203,4 +203,4 @@ void init_bitwise_or(py::module_ m) } } -} // namespace dpctl::tensor::py_internal +} // namespace dpnp::tensor::py_internal diff --git a/dpnp/tensor/libtensor/source/elementwise_functions/bitwise_or.hpp b/dpnp/tensor/libtensor/source/elementwise_functions/bitwise_or.hpp index 1e24caa54429..cb13c0927a19 100644 --- a/dpnp/tensor/libtensor/source/elementwise_functions/bitwise_or.hpp +++ b/dpnp/tensor/libtensor/source/elementwise_functions/bitwise_or.hpp @@ -29,7 +29,7 @@ //===---------------------------------------------------------------------===// /// /// \file -/// This file defines functions of dpctl.tensor._tensor_elementwise_impl +/// This file defines functions of dpnp.tensor._tensor_elementwise_impl /// extension, specifically functions for elementwise operations. //===---------------------------------------------------------------------===// @@ -38,9 +38,9 @@ namespace py = pybind11; -namespace dpctl::tensor::py_internal +namespace dpnp::tensor::py_internal { extern void init_bitwise_or(py::module_ m); -} // namespace dpctl::tensor::py_internal +} // namespace dpnp::tensor::py_internal diff --git a/dpnp/tensor/libtensor/source/elementwise_functions/bitwise_right_shift.cpp b/dpnp/tensor/libtensor/source/elementwise_functions/bitwise_right_shift.cpp index 099dd56b4484..e578a699ea2f 100644 --- a/dpnp/tensor/libtensor/source/elementwise_functions/bitwise_right_shift.cpp +++ b/dpnp/tensor/libtensor/source/elementwise_functions/bitwise_right_shift.cpp @@ -29,7 +29,7 @@ //===---------------------------------------------------------------------===// /// /// \file -/// This file defines functions of dpctl.tensor._tensor_elementwise_impl +/// This file defines functions of dpnp.tensor._tensor_elementwise_impl /// extension, specifically functions for elementwise operations. //===---------------------------------------------------------------------===// @@ -51,13 +51,13 @@ #include "kernels/elementwise_functions/common.hpp" #include "kernels/elementwise_functions/common_inplace.hpp" -namespace dpctl::tensor::py_internal +namespace dpnp::tensor::py_internal { namespace py = pybind11; -namespace td_ns = dpctl::tensor::type_dispatch; +namespace td_ns = dpnp::tensor::type_dispatch; -namespace ew_cmn_ns = dpctl::tensor::kernels::elementwise_common; +namespace ew_cmn_ns = dpnp::tensor::kernels::elementwise_common; using ew_cmn_ns::binary_contig_impl_fn_ptr_t; using ew_cmn_ns::binary_contig_matrix_contig_row_broadcast_impl_fn_ptr_t; using ew_cmn_ns::binary_contig_row_contig_matrix_broadcast_impl_fn_ptr_t; @@ -71,7 +71,7 @@ using ew_cmn_ns::binary_inplace_strided_impl_fn_ptr_t; namespace impl { namespace bitwise_right_shift_fn_ns = - dpctl::tensor::kernels::bitwise_right_shift; + dpnp::tensor::kernels::bitwise_right_shift; static binary_contig_impl_fn_ptr_t bitwise_right_shift_contig_dispatch_table[td_ns::num_types] @@ -144,7 +144,7 @@ void populate_bitwise_right_shift_dispatch_tables(void) void init_bitwise_right_shift(py::module_ m) { - using arrayT = dpctl::tensor::usm_ndarray; + using arrayT = dpnp::tensor::usm_ndarray; using event_vecT = std::vector; { impl::populate_bitwise_right_shift_dispatch_tables(); @@ -214,4 +214,4 @@ void init_bitwise_right_shift(py::module_ m) } } -} // namespace dpctl::tensor::py_internal +} // namespace dpnp::tensor::py_internal diff --git a/dpnp/tensor/libtensor/source/elementwise_functions/bitwise_right_shift.hpp b/dpnp/tensor/libtensor/source/elementwise_functions/bitwise_right_shift.hpp index aeb24d73b2fc..f8a1204d7a19 100644 --- a/dpnp/tensor/libtensor/source/elementwise_functions/bitwise_right_shift.hpp +++ b/dpnp/tensor/libtensor/source/elementwise_functions/bitwise_right_shift.hpp @@ -29,7 +29,7 @@ //===---------------------------------------------------------------------===// /// /// \file -/// This file defines functions of dpctl.tensor._tensor_elementwise_impl +/// This file defines functions of dpnp.tensor._tensor_elementwise_impl /// extension, specifically functions for elementwise operations. //===---------------------------------------------------------------------===// @@ -38,9 +38,9 @@ namespace py = pybind11; -namespace dpctl::tensor::py_internal +namespace dpnp::tensor::py_internal { extern void init_bitwise_right_shift(py::module_ m); -} // namespace dpctl::tensor::py_internal +} // namespace dpnp::tensor::py_internal diff --git a/dpnp/tensor/libtensor/source/elementwise_functions/bitwise_xor.cpp b/dpnp/tensor/libtensor/source/elementwise_functions/bitwise_xor.cpp index 9a23fec82e72..24a316602f1a 100644 --- a/dpnp/tensor/libtensor/source/elementwise_functions/bitwise_xor.cpp +++ b/dpnp/tensor/libtensor/source/elementwise_functions/bitwise_xor.cpp @@ -29,7 +29,7 @@ //===---------------------------------------------------------------------===// /// /// \file -/// This file defines functions of dpctl.tensor._tensor_elementwise_impl +/// This file defines functions of dpnp.tensor._tensor_elementwise_impl /// extension, specifically functions for elementwise operations. //===---------------------------------------------------------------------===// @@ -51,13 +51,13 @@ #include "kernels/elementwise_functions/common.hpp" #include "kernels/elementwise_functions/common_inplace.hpp" -namespace dpctl::tensor::py_internal +namespace dpnp::tensor::py_internal { namespace py = pybind11; -namespace td_ns = dpctl::tensor::type_dispatch; +namespace td_ns = dpnp::tensor::type_dispatch; -namespace ew_cmn_ns = dpctl::tensor::kernels::elementwise_common; +namespace ew_cmn_ns = dpnp::tensor::kernels::elementwise_common; using ew_cmn_ns::binary_contig_impl_fn_ptr_t; using ew_cmn_ns::binary_contig_matrix_contig_row_broadcast_impl_fn_ptr_t; using ew_cmn_ns::binary_contig_row_contig_matrix_broadcast_impl_fn_ptr_t; @@ -70,7 +70,7 @@ using ew_cmn_ns::binary_inplace_strided_impl_fn_ptr_t; // B07: ===== BITWISE_XOR (x1, x2) namespace impl { -namespace bitwise_xor_fn_ns = dpctl::tensor::kernels::bitwise_xor; +namespace bitwise_xor_fn_ns = dpnp::tensor::kernels::bitwise_xor; static binary_contig_impl_fn_ptr_t bitwise_xor_contig_dispatch_table[td_ns::num_types][td_ns::num_types]; @@ -137,7 +137,7 @@ void populate_bitwise_xor_dispatch_tables(void) void init_bitwise_xor(py::module_ m) { - using arrayT = dpctl::tensor::usm_ndarray; + using arrayT = dpnp::tensor::usm_ndarray; using event_vecT = std::vector; { impl::populate_bitwise_xor_dispatch_tables(); @@ -203,4 +203,4 @@ void init_bitwise_xor(py::module_ m) } } -} // namespace dpctl::tensor::py_internal +} // namespace dpnp::tensor::py_internal diff --git a/dpnp/tensor/libtensor/source/elementwise_functions/bitwise_xor.hpp b/dpnp/tensor/libtensor/source/elementwise_functions/bitwise_xor.hpp index 4029574cdd7d..12c82c118d6c 100644 --- a/dpnp/tensor/libtensor/source/elementwise_functions/bitwise_xor.hpp +++ b/dpnp/tensor/libtensor/source/elementwise_functions/bitwise_xor.hpp @@ -29,7 +29,7 @@ //===---------------------------------------------------------------------===// /// /// \file -/// This file defines functions of dpctl.tensor._tensor_elementwise_impl +/// This file defines functions of dpnp.tensor._tensor_elementwise_impl /// extension, specifically functions for elementwise operations. //===---------------------------------------------------------------------===// @@ -38,9 +38,9 @@ namespace py = pybind11; -namespace dpctl::tensor::py_internal +namespace dpnp::tensor::py_internal { extern void init_bitwise_xor(py::module_ m); -} // namespace dpctl::tensor::py_internal +} // namespace dpnp::tensor::py_internal diff --git a/dpnp/tensor/libtensor/source/elementwise_functions/cbrt.cpp b/dpnp/tensor/libtensor/source/elementwise_functions/cbrt.cpp index a061235acfd7..3279754e5931 100644 --- a/dpnp/tensor/libtensor/source/elementwise_functions/cbrt.cpp +++ b/dpnp/tensor/libtensor/source/elementwise_functions/cbrt.cpp @@ -29,7 +29,7 @@ //===---------------------------------------------------------------------===// /// /// \file -/// This file defines functions of dpctl.tensor._tensor_elementwise_impl +/// This file defines functions of dpnp.tensor._tensor_elementwise_impl /// extension, specifically functions for elementwise operations. //===---------------------------------------------------------------------===// @@ -50,13 +50,13 @@ #include "kernels/elementwise_functions/cbrt.hpp" #include "kernels/elementwise_functions/common.hpp" -namespace dpctl::tensor::py_internal +namespace dpnp::tensor::py_internal { namespace py = pybind11; -namespace td_ns = dpctl::tensor::type_dispatch; +namespace td_ns = dpnp::tensor::type_dispatch; -namespace ew_cmn_ns = dpctl::tensor::kernels::elementwise_common; +namespace ew_cmn_ns = dpnp::tensor::kernels::elementwise_common; using ew_cmn_ns::unary_contig_impl_fn_ptr_t; using ew_cmn_ns::unary_strided_impl_fn_ptr_t; @@ -64,7 +64,7 @@ using ew_cmn_ns::unary_strided_impl_fn_ptr_t; namespace impl { -namespace cbrt_fn_ns = dpctl::tensor::kernels::cbrt; +namespace cbrt_fn_ns = dpnp::tensor::kernels::cbrt; static unary_contig_impl_fn_ptr_t cbrt_contig_dispatch_vector[td_ns::num_types]; static int cbrt_output_typeid_vector[td_ns::num_types]; @@ -97,7 +97,7 @@ void populate_cbrt_dispatch_vectors(void) void init_cbrt(py::module_ m) { - using arrayT = dpctl::tensor::usm_ndarray; + using arrayT = dpnp::tensor::usm_ndarray; using event_vecT = std::vector; { impl::populate_cbrt_dispatch_vectors(); @@ -122,4 +122,4 @@ void init_cbrt(py::module_ m) } } -} // namespace dpctl::tensor::py_internal +} // namespace dpnp::tensor::py_internal diff --git a/dpnp/tensor/libtensor/source/elementwise_functions/cbrt.hpp b/dpnp/tensor/libtensor/source/elementwise_functions/cbrt.hpp index 53757bff7134..ceec690c0af6 100644 --- a/dpnp/tensor/libtensor/source/elementwise_functions/cbrt.hpp +++ b/dpnp/tensor/libtensor/source/elementwise_functions/cbrt.hpp @@ -29,7 +29,7 @@ //===---------------------------------------------------------------------===// /// /// \file -/// This file defines functions of dpctl.tensor._tensor_elementwise_impl +/// This file defines functions of dpnp.tensor._tensor_elementwise_impl /// extension, specifically functions for elementwise operations. //===---------------------------------------------------------------------===// @@ -38,9 +38,9 @@ namespace py = pybind11; -namespace dpctl::tensor::py_internal +namespace dpnp::tensor::py_internal { extern void init_cbrt(py::module_ m); -} // namespace dpctl::tensor::py_internal +} // namespace dpnp::tensor::py_internal diff --git a/dpnp/tensor/libtensor/source/elementwise_functions/ceil.cpp b/dpnp/tensor/libtensor/source/elementwise_functions/ceil.cpp index 4c4604e31692..740d7c3925f0 100644 --- a/dpnp/tensor/libtensor/source/elementwise_functions/ceil.cpp +++ b/dpnp/tensor/libtensor/source/elementwise_functions/ceil.cpp @@ -29,7 +29,7 @@ //===---------------------------------------------------------------------===// /// /// \file -/// This file defines functions of dpctl.tensor._tensor_elementwise_impl +/// This file defines functions of dpnp.tensor._tensor_elementwise_impl /// extension, specifically functions for elementwise operations. //===---------------------------------------------------------------------===// @@ -50,13 +50,13 @@ #include "kernels/elementwise_functions/ceil.hpp" #include "kernels/elementwise_functions/common.hpp" -namespace dpctl::tensor::py_internal +namespace dpnp::tensor::py_internal { namespace py = pybind11; -namespace td_ns = dpctl::tensor::type_dispatch; +namespace td_ns = dpnp::tensor::type_dispatch; -namespace ew_cmn_ns = dpctl::tensor::kernels::elementwise_common; +namespace ew_cmn_ns = dpnp::tensor::kernels::elementwise_common; using ew_cmn_ns::unary_contig_impl_fn_ptr_t; using ew_cmn_ns::unary_strided_impl_fn_ptr_t; @@ -64,7 +64,7 @@ using ew_cmn_ns::unary_strided_impl_fn_ptr_t; namespace impl { -namespace ceil_fn_ns = dpctl::tensor::kernels::ceil; +namespace ceil_fn_ns = dpnp::tensor::kernels::ceil; static unary_contig_impl_fn_ptr_t ceil_contig_dispatch_vector[td_ns::num_types]; static int ceil_output_typeid_vector[td_ns::num_types]; @@ -97,7 +97,7 @@ void populate_ceil_dispatch_vectors(void) void init_ceil(py::module_ m) { - using arrayT = dpctl::tensor::usm_ndarray; + using arrayT = dpnp::tensor::usm_ndarray; using event_vecT = std::vector; { impl::populate_ceil_dispatch_vectors(); @@ -122,4 +122,4 @@ void init_ceil(py::module_ m) } } -} // namespace dpctl::tensor::py_internal +} // namespace dpnp::tensor::py_internal diff --git a/dpnp/tensor/libtensor/source/elementwise_functions/ceil.hpp b/dpnp/tensor/libtensor/source/elementwise_functions/ceil.hpp index 436cb5f89b2b..fe7942bad31d 100644 --- a/dpnp/tensor/libtensor/source/elementwise_functions/ceil.hpp +++ b/dpnp/tensor/libtensor/source/elementwise_functions/ceil.hpp @@ -29,7 +29,7 @@ //===---------------------------------------------------------------------===// /// /// \file -/// This file defines functions of dpctl.tensor._tensor_elementwise_impl +/// This file defines functions of dpnp.tensor._tensor_elementwise_impl /// extension, specifically functions for elementwise operations. //===---------------------------------------------------------------------===// @@ -38,9 +38,9 @@ namespace py = pybind11; -namespace dpctl::tensor::py_internal +namespace dpnp::tensor::py_internal { extern void init_ceil(py::module_ m); -} // namespace dpctl::tensor::py_internal +} // namespace dpnp::tensor::py_internal diff --git a/dpnp/tensor/libtensor/source/elementwise_functions/conj.cpp b/dpnp/tensor/libtensor/source/elementwise_functions/conj.cpp index cee977f719f4..6ae999b3faaa 100644 --- a/dpnp/tensor/libtensor/source/elementwise_functions/conj.cpp +++ b/dpnp/tensor/libtensor/source/elementwise_functions/conj.cpp @@ -29,7 +29,7 @@ //===---------------------------------------------------------------------===// /// /// \file -/// This file defines functions of dpctl.tensor._tensor_elementwise_impl +/// This file defines functions of dpnp.tensor._tensor_elementwise_impl /// extension, specifically functions for elementwise operations. //===---------------------------------------------------------------------===// @@ -50,13 +50,13 @@ #include "kernels/elementwise_functions/common.hpp" #include "kernels/elementwise_functions/conj.hpp" -namespace dpctl::tensor::py_internal +namespace dpnp::tensor::py_internal { namespace py = pybind11; -namespace td_ns = dpctl::tensor::type_dispatch; +namespace td_ns = dpnp::tensor::type_dispatch; -namespace ew_cmn_ns = dpctl::tensor::kernels::elementwise_common; +namespace ew_cmn_ns = dpnp::tensor::kernels::elementwise_common; using ew_cmn_ns::unary_contig_impl_fn_ptr_t; using ew_cmn_ns::unary_strided_impl_fn_ptr_t; @@ -64,7 +64,7 @@ using ew_cmn_ns::unary_strided_impl_fn_ptr_t; namespace impl { -namespace conj_fn_ns = dpctl::tensor::kernels::conj; +namespace conj_fn_ns = dpnp::tensor::kernels::conj; static unary_contig_impl_fn_ptr_t conj_contig_dispatch_vector[td_ns::num_types]; static int conj_output_typeid_vector[td_ns::num_types]; @@ -97,7 +97,7 @@ void populate_conj_dispatch_vectors(void) void init_conj(py::module_ m) { - using arrayT = dpctl::tensor::usm_ndarray; + using arrayT = dpnp::tensor::usm_ndarray; using event_vecT = std::vector; { impl::populate_conj_dispatch_vectors(); @@ -122,4 +122,4 @@ void init_conj(py::module_ m) } } -} // namespace dpctl::tensor::py_internal +} // namespace dpnp::tensor::py_internal diff --git a/dpnp/tensor/libtensor/source/elementwise_functions/conj.hpp b/dpnp/tensor/libtensor/source/elementwise_functions/conj.hpp index 4c0aeb17260b..826fe484f3da 100644 --- a/dpnp/tensor/libtensor/source/elementwise_functions/conj.hpp +++ b/dpnp/tensor/libtensor/source/elementwise_functions/conj.hpp @@ -29,7 +29,7 @@ //===---------------------------------------------------------------------===// /// /// \file -/// This file defines functions of dpctl.tensor._tensor_elementwise_impl +/// This file defines functions of dpnp.tensor._tensor_elementwise_impl /// extension, specifically functions for elementwise operations. //===---------------------------------------------------------------------===// @@ -38,9 +38,9 @@ namespace py = pybind11; -namespace dpctl::tensor::py_internal +namespace dpnp::tensor::py_internal { extern void init_conj(py::module_ m); -} // namespace dpctl::tensor::py_internal +} // namespace dpnp::tensor::py_internal diff --git a/dpnp/tensor/libtensor/source/elementwise_functions/copysign.cpp b/dpnp/tensor/libtensor/source/elementwise_functions/copysign.cpp index 8dca1635459a..4891aba66b3e 100644 --- a/dpnp/tensor/libtensor/source/elementwise_functions/copysign.cpp +++ b/dpnp/tensor/libtensor/source/elementwise_functions/copysign.cpp @@ -29,7 +29,7 @@ //===---------------------------------------------------------------------===// /// /// \file -/// This file defines functions of dpctl.tensor._tensor_elementwise_impl +/// This file defines functions of dpnp.tensor._tensor_elementwise_impl /// extension, specifically functions for elementwise operations. //===---------------------------------------------------------------------===// @@ -50,13 +50,13 @@ #include "kernels/elementwise_functions/common.hpp" #include "kernels/elementwise_functions/copysign.hpp" -namespace dpctl::tensor::py_internal +namespace dpnp::tensor::py_internal { namespace py = pybind11; -namespace td_ns = dpctl::tensor::type_dispatch; +namespace td_ns = dpnp::tensor::type_dispatch; -namespace ew_cmn_ns = dpctl::tensor::kernels::elementwise_common; +namespace ew_cmn_ns = dpnp::tensor::kernels::elementwise_common; using ew_cmn_ns::binary_contig_impl_fn_ptr_t; using ew_cmn_ns::binary_contig_matrix_contig_row_broadcast_impl_fn_ptr_t; using ew_cmn_ns::binary_contig_row_contig_matrix_broadcast_impl_fn_ptr_t; @@ -65,7 +65,7 @@ using ew_cmn_ns::binary_strided_impl_fn_ptr_t; // B25: ===== COPYSIGN (x1, x2) namespace impl { -namespace copysign_fn_ns = dpctl::tensor::kernels::copysign; +namespace copysign_fn_ns = dpnp::tensor::kernels::copysign; static binary_contig_impl_fn_ptr_t copysign_contig_dispatch_table[td_ns::num_types][td_ns::num_types]; @@ -103,7 +103,7 @@ void populate_copysign_dispatch_tables(void) void init_copysign(py::module_ m) { - using arrayT = dpctl::tensor::usm_ndarray; + using arrayT = dpnp::tensor::usm_ndarray; using event_vecT = std::vector; { impl::populate_copysign_dispatch_tables(); @@ -143,4 +143,4 @@ void init_copysign(py::module_ m) } } -} // namespace dpctl::tensor::py_internal +} // namespace dpnp::tensor::py_internal diff --git a/dpnp/tensor/libtensor/source/elementwise_functions/copysign.hpp b/dpnp/tensor/libtensor/source/elementwise_functions/copysign.hpp index 875443d792c2..05f6e2b52e86 100644 --- a/dpnp/tensor/libtensor/source/elementwise_functions/copysign.hpp +++ b/dpnp/tensor/libtensor/source/elementwise_functions/copysign.hpp @@ -29,7 +29,7 @@ //===---------------------------------------------------------------------===// /// /// \file -/// This file defines functions of dpctl.tensor._tensor_elementwise_impl +/// This file defines functions of dpnp.tensor._tensor_elementwise_impl /// extension, specifically functions for elementwise operations. //===---------------------------------------------------------------------===// @@ -38,9 +38,9 @@ namespace py = pybind11; -namespace dpctl::tensor::py_internal +namespace dpnp::tensor::py_internal { extern void init_copysign(py::module_ m); -} // namespace dpctl::tensor::py_internal +} // namespace dpnp::tensor::py_internal diff --git a/dpnp/tensor/libtensor/source/elementwise_functions/cos.cpp b/dpnp/tensor/libtensor/source/elementwise_functions/cos.cpp index 966364c8b8c0..c03b1b7394d6 100644 --- a/dpnp/tensor/libtensor/source/elementwise_functions/cos.cpp +++ b/dpnp/tensor/libtensor/source/elementwise_functions/cos.cpp @@ -29,7 +29,7 @@ //===---------------------------------------------------------------------===// /// /// \file -/// This file defines functions of dpctl.tensor._tensor_elementwise_impl +/// This file defines functions of dpnp.tensor._tensor_elementwise_impl /// extension, specifically functions for elementwise operations. //===---------------------------------------------------------------------===// @@ -50,13 +50,13 @@ #include "kernels/elementwise_functions/common.hpp" #include "kernels/elementwise_functions/cos.hpp" -namespace dpctl::tensor::py_internal +namespace dpnp::tensor::py_internal { namespace py = pybind11; -namespace td_ns = dpctl::tensor::type_dispatch; +namespace td_ns = dpnp::tensor::type_dispatch; -namespace ew_cmn_ns = dpctl::tensor::kernels::elementwise_common; +namespace ew_cmn_ns = dpnp::tensor::kernels::elementwise_common; using ew_cmn_ns::unary_contig_impl_fn_ptr_t; using ew_cmn_ns::unary_strided_impl_fn_ptr_t; @@ -64,7 +64,7 @@ using ew_cmn_ns::unary_strided_impl_fn_ptr_t; namespace impl { -namespace cos_fn_ns = dpctl::tensor::kernels::cos; +namespace cos_fn_ns = dpnp::tensor::kernels::cos; static unary_contig_impl_fn_ptr_t cos_contig_dispatch_vector[td_ns::num_types]; static int cos_output_typeid_vector[td_ns::num_types]; @@ -97,7 +97,7 @@ void populate_cos_dispatch_vectors(void) void init_cos(py::module_ m) { - using arrayT = dpctl::tensor::usm_ndarray; + using arrayT = dpnp::tensor::usm_ndarray; using event_vecT = std::vector; { impl::populate_cos_dispatch_vectors(); @@ -122,4 +122,4 @@ void init_cos(py::module_ m) } } -} // namespace dpctl::tensor::py_internal +} // namespace dpnp::tensor::py_internal diff --git a/dpnp/tensor/libtensor/source/elementwise_functions/cos.hpp b/dpnp/tensor/libtensor/source/elementwise_functions/cos.hpp index 4b9ab341a355..7167f6afaf58 100644 --- a/dpnp/tensor/libtensor/source/elementwise_functions/cos.hpp +++ b/dpnp/tensor/libtensor/source/elementwise_functions/cos.hpp @@ -29,7 +29,7 @@ //===---------------------------------------------------------------------===// /// /// \file -/// This file defines functions of dpctl.tensor._tensor_elementwise_impl +/// This file defines functions of dpnp.tensor._tensor_elementwise_impl /// extension, specifically functions for elementwise operations. //===---------------------------------------------------------------------===// @@ -38,9 +38,9 @@ namespace py = pybind11; -namespace dpctl::tensor::py_internal +namespace dpnp::tensor::py_internal { extern void init_cos(py::module_ m); -} // namespace dpctl::tensor::py_internal +} // namespace dpnp::tensor::py_internal diff --git a/dpnp/tensor/libtensor/source/elementwise_functions/cosh.cpp b/dpnp/tensor/libtensor/source/elementwise_functions/cosh.cpp index 54fc5d57e4df..2169bf4a027a 100644 --- a/dpnp/tensor/libtensor/source/elementwise_functions/cosh.cpp +++ b/dpnp/tensor/libtensor/source/elementwise_functions/cosh.cpp @@ -29,7 +29,7 @@ //===---------------------------------------------------------------------===// /// /// \file -/// This file defines functions of dpctl.tensor._tensor_elementwise_impl +/// This file defines functions of dpnp.tensor._tensor_elementwise_impl /// extension, specifically functions for elementwise operations. //===---------------------------------------------------------------------===// @@ -50,13 +50,13 @@ #include "kernels/elementwise_functions/common.hpp" #include "kernels/elementwise_functions/cosh.hpp" -namespace dpctl::tensor::py_internal +namespace dpnp::tensor::py_internal { namespace py = pybind11; -namespace td_ns = dpctl::tensor::type_dispatch; +namespace td_ns = dpnp::tensor::type_dispatch; -namespace ew_cmn_ns = dpctl::tensor::kernels::elementwise_common; +namespace ew_cmn_ns = dpnp::tensor::kernels::elementwise_common; using ew_cmn_ns::unary_contig_impl_fn_ptr_t; using ew_cmn_ns::unary_strided_impl_fn_ptr_t; @@ -64,7 +64,7 @@ using ew_cmn_ns::unary_strided_impl_fn_ptr_t; namespace impl { -namespace cosh_fn_ns = dpctl::tensor::kernels::cosh; +namespace cosh_fn_ns = dpnp::tensor::kernels::cosh; static unary_contig_impl_fn_ptr_t cosh_contig_dispatch_vector[td_ns::num_types]; static int cosh_output_typeid_vector[td_ns::num_types]; @@ -97,7 +97,7 @@ void populate_cosh_dispatch_vectors(void) void init_cosh(py::module_ m) { - using arrayT = dpctl::tensor::usm_ndarray; + using arrayT = dpnp::tensor::usm_ndarray; using event_vecT = std::vector; { impl::populate_cosh_dispatch_vectors(); @@ -122,4 +122,4 @@ void init_cosh(py::module_ m) } } -} // namespace dpctl::tensor::py_internal +} // namespace dpnp::tensor::py_internal diff --git a/dpnp/tensor/libtensor/source/elementwise_functions/cosh.hpp b/dpnp/tensor/libtensor/source/elementwise_functions/cosh.hpp index 6ddfe5643b54..7e956ee978f0 100644 --- a/dpnp/tensor/libtensor/source/elementwise_functions/cosh.hpp +++ b/dpnp/tensor/libtensor/source/elementwise_functions/cosh.hpp @@ -29,7 +29,7 @@ //===---------------------------------------------------------------------===// /// /// \file -/// This file defines functions of dpctl.tensor._tensor_elementwise_impl +/// This file defines functions of dpnp.tensor._tensor_elementwise_impl /// extension, specifically functions for elementwise operations. //===---------------------------------------------------------------------===// @@ -38,9 +38,9 @@ namespace py = pybind11; -namespace dpctl::tensor::py_internal +namespace dpnp::tensor::py_internal { extern void init_cosh(py::module_ m); -} // namespace dpctl::tensor::py_internal +} // namespace dpnp::tensor::py_internal diff --git a/dpnp/tensor/libtensor/source/elementwise_functions/elementwise_common.cpp b/dpnp/tensor/libtensor/source/elementwise_functions/elementwise_common.cpp index dc09318d66ad..ccc9343d4c80 100644 --- a/dpnp/tensor/libtensor/source/elementwise_functions/elementwise_common.cpp +++ b/dpnp/tensor/libtensor/source/elementwise_functions/elementwise_common.cpp @@ -29,7 +29,7 @@ //===---------------------------------------------------------------------===// /// /// \file -/// This file defines functions of dpctl.tensor._tensor_elementwise_impl +/// This file defines functions of dpnp.tensor._tensor_elementwise_impl /// extension, specifically functions for elementwise operations. //===---------------------------------------------------------------------===// @@ -107,7 +107,7 @@ #include "true_divide.hpp" #include "trunc.hpp" -namespace dpctl::tensor::py_internal +namespace dpnp::tensor::py_internal { namespace py = pybind11; @@ -188,4 +188,4 @@ void init_elementwise_functions(py::module_ m) init_trunc(m); } -} // namespace dpctl::tensor::py_internal +} // namespace dpnp::tensor::py_internal diff --git a/dpnp/tensor/libtensor/source/elementwise_functions/elementwise_common.hpp b/dpnp/tensor/libtensor/source/elementwise_functions/elementwise_common.hpp index 0c385f2d15a5..13b90b52b0c8 100644 --- a/dpnp/tensor/libtensor/source/elementwise_functions/elementwise_common.hpp +++ b/dpnp/tensor/libtensor/source/elementwise_functions/elementwise_common.hpp @@ -29,7 +29,7 @@ //===---------------------------------------------------------------------===// /// /// \file -/// This file defines functions of dpctl.tensor._tensor_elementwise_impl +/// This file defines functions of dpnp.tensor._tensor_elementwise_impl /// extension, specifically functions for elementwise operations. //===---------------------------------------------------------------------===// @@ -38,9 +38,9 @@ namespace py = pybind11; -namespace dpctl::tensor::py_internal +namespace dpnp::tensor::py_internal { extern void init_elementwise_functions(py::module_); -} // namespace dpctl::tensor::py_internal +} // namespace dpnp::tensor::py_internal diff --git a/dpnp/tensor/libtensor/source/elementwise_functions/elementwise_functions.hpp b/dpnp/tensor/libtensor/source/elementwise_functions/elementwise_functions.hpp index 3a8dc6bfb56f..a3924c8d28a6 100644 --- a/dpnp/tensor/libtensor/source/elementwise_functions/elementwise_functions.hpp +++ b/dpnp/tensor/libtensor/source/elementwise_functions/elementwise_functions.hpp @@ -29,7 +29,7 @@ //===---------------------------------------------------------------------===// /// /// \file -/// This file defines functions of dpctl.tensor._tensor_elementwise_impl +/// This file defines functions of dpnp.tensor._tensor_elementwise_impl /// extension, specifically functions for elementwise operations. //===---------------------------------------------------------------------===// @@ -50,7 +50,7 @@ #include "elementwise_functions_type_utils.hpp" #include "kernels/alignment.hpp" -#include "kernels/dpctl_tensor_types.hpp" +#include "kernels/dpnp_tensor_types.hpp" #include "simplify_iteration_space.hpp" #include "utils/memory_overlap.hpp" #include "utils/offset_utils.hpp" @@ -58,24 +58,24 @@ #include "utils/sycl_alloc_utils.hpp" #include "utils/type_dispatch.hpp" -static_assert(std::is_same_v); +static_assert(std::is_same_v); -namespace dpctl::tensor::py_internal +namespace dpnp::tensor::py_internal { namespace py = pybind11; -namespace td_ns = dpctl::tensor::type_dispatch; +namespace td_ns = dpnp::tensor::type_dispatch; -using dpctl::tensor::kernels::alignment_utils::is_aligned; -using dpctl::tensor::kernels::alignment_utils::required_alignment; +using dpnp::tensor::kernels::alignment_utils::is_aligned; +using dpnp::tensor::kernels::alignment_utils::required_alignment; /*! @brief Template implementing Python API for unary elementwise functions */ template std::pair - py_unary_ufunc(const dpctl::tensor::usm_ndarray &src, - const dpctl::tensor::usm_ndarray &dst, + py_unary_ufunc(const dpnp::tensor::usm_ndarray &src, + const dpnp::tensor::usm_ndarray &dst, sycl::queue &q, const std::vector &depends, // @@ -99,12 +99,12 @@ std::pair } // check that queues are compatible - if (!dpctl::utils::queues_are_compatible(q, {src, dst})) { + if (!dpnp::utils::queues_are_compatible(q, {src, dst})) { throw py::value_error( "Execution queue is not compatible with allocation queues"); } - dpctl::tensor::validation::CheckWritable::throw_if_not_writable(dst); + dpnp::tensor::validation::CheckWritable::throw_if_not_writable(dst); // check that dimensions are the same int src_nd = src.get_ndim(); @@ -131,12 +131,12 @@ std::pair return std::make_pair(sycl::event(), sycl::event()); } - dpctl::tensor::validation::AmpleMemory::throw_if_not_ample(dst, src_nelems); + dpnp::tensor::validation::AmpleMemory::throw_if_not_ample(dst, src_nelems); // check memory overlap - auto const &overlap = dpctl::tensor::overlap::MemoryOverlap(); + auto const &overlap = dpnp::tensor::overlap::MemoryOverlap(); auto const &same_logical_tensors = - dpctl::tensor::overlap::SameLogicalTensors(); + dpnp::tensor::overlap::SameLogicalTensors(); if (overlap(src, dst) && !same_logical_tensors(src, dst)) { throw py::value_error("Arrays index overlapping segments of memory"); } @@ -165,7 +165,7 @@ std::pair auto comp_ev = contig_fn(q, src_nelems, src_data, dst_data, depends); sycl::event ht_ev = - dpctl::utils::keep_args_alive(q, {src, dst}, {comp_ev}); + dpnp::utils::keep_args_alive(q, {src, dst}, {comp_ev}); return std::make_pair(ht_ev, comp_ev); } @@ -210,7 +210,7 @@ std::pair dst_data + dst_elem_size * dst_offset, depends); sycl::event ht_ev = - dpctl::utils::keep_args_alive(q, {src, dst}, {comp_ev}); + dpnp::utils::keep_args_alive(q, {src, dst}, {comp_ev}); return std::make_pair(ht_ev, comp_ev); } @@ -224,7 +224,7 @@ std::pair std::to_string(src_typeid)); } - using dpctl::tensor::offset_utils::device_allocate_and_pack; + using dpnp::tensor::offset_utils::device_allocate_and_pack; std::vector host_tasks{}; host_tasks.reserve(2); @@ -241,14 +241,13 @@ std::pair dst_data, dst_offset, depends, {copy_shape_ev}); // async free of shape_strides temporary - sycl::event tmp_cleanup_ev = dpctl::tensor::alloc_utils::async_smart_free( + sycl::event tmp_cleanup_ev = dpnp::tensor::alloc_utils::async_smart_free( q, {strided_fn_ev}, shape_strides_owner); host_tasks.push_back(tmp_cleanup_ev); return std::make_pair( - dpctl::utils::keep_args_alive(q, {src, dst}, host_tasks), - strided_fn_ev); + dpnp::utils::keep_args_alive(q, {src, dst}, host_tasks), strided_fn_ev); } /*! @brief Template implementing Python API for querying of type support by @@ -257,7 +256,7 @@ template py::object py_unary_ufunc_result_type(const py::dtype &input_dtype, const output_typesT &output_types) { - int tn = input_dtype.num(); // NumPy type numbers are the same as in dpctl + int tn = input_dtype.num(); // NumPy type numbers are the same as in dpnp int src_typeid = -1; auto array_types = td_ns::usm_ndarray_types(); @@ -304,9 +303,9 @@ template std::pair py_binary_ufunc( - const dpctl::tensor::usm_ndarray &src1, - const dpctl::tensor::usm_ndarray &src2, - const dpctl::tensor::usm_ndarray &dst, // dst = op(src1, src2), elementwise + const dpnp::tensor::usm_ndarray &src1, + const dpnp::tensor::usm_ndarray &src2, + const dpnp::tensor::usm_ndarray &dst, // dst = op(src1, src2), elementwise sycl::queue &exec_q, const std::vector depends, // @@ -336,12 +335,12 @@ std::pair py_binary_ufunc( } // check that queues are compatible - if (!dpctl::utils::queues_are_compatible(exec_q, {src1, src2, dst})) { + if (!dpnp::utils::queues_are_compatible(exec_q, {src1, src2, dst})) { throw py::value_error( "Execution queue is not compatible with allocation queues"); } - dpctl::tensor::validation::CheckWritable::throw_if_not_writable(dst); + dpnp::tensor::validation::CheckWritable::throw_if_not_writable(dst); // check shapes, broadcasting is assumed done by caller // check that dimensions are the same @@ -371,11 +370,11 @@ std::pair py_binary_ufunc( return std::make_pair(sycl::event(), sycl::event()); } - dpctl::tensor::validation::AmpleMemory::throw_if_not_ample(dst, src_nelems); + dpnp::tensor::validation::AmpleMemory::throw_if_not_ample(dst, src_nelems); - auto const &overlap = dpctl::tensor::overlap::MemoryOverlap(); + auto const &overlap = dpnp::tensor::overlap::MemoryOverlap(); auto const &same_logical_tensors = - dpctl::tensor::overlap::SameLogicalTensors(); + dpnp::tensor::overlap::SameLogicalTensors(); if ((overlap(src1, dst) && !same_logical_tensors(src1, dst)) || (overlap(src2, dst) && !same_logical_tensors(src2, dst))) { throw py::value_error("Arrays index overlapping segments of memory"); @@ -407,7 +406,7 @@ std::pair py_binary_ufunc( if (contig_fn != nullptr) { auto comp_ev = contig_fn(exec_q, src_nelems, src1_data, 0, src2_data, 0, dst_data, 0, depends); - sycl::event ht_ev = dpctl::utils::keep_args_alive( + sycl::event ht_ev = dpnp::utils::keep_args_alive( exec_q, {src1, src2, dst}, {comp_ev}); return std::make_pair(ht_ev, comp_ev); @@ -451,7 +450,7 @@ std::pair py_binary_ufunc( auto comp_ev = contig_fn(exec_q, src_nelems, src1_data, src1_offset, src2_data, src2_offset, dst_data, dst_offset, depends); - sycl::event ht_ev = dpctl::utils::keep_args_alive( + sycl::event ht_ev = dpnp::utils::keep_args_alive( exec_q, {src1, src2, dst}, {comp_ev}); return std::make_pair(ht_ev, comp_ev); @@ -489,7 +488,7 @@ std::pair py_binary_ufunc( depends); return std::make_pair( - dpctl::utils::keep_args_alive( + dpnp::utils::keep_args_alive( exec_q, {src1, src2, dst}, host_tasks), comp_ev); } @@ -521,7 +520,7 @@ std::pair py_binary_ufunc( depends); return std::make_pair( - dpctl::utils::keep_args_alive( + dpnp::utils::keep_args_alive( exec_q, {src1, src2, dst}, host_tasks), comp_ev); } @@ -540,7 +539,7 @@ std::pair py_binary_ufunc( " and src2_typeid=" + std::to_string(src2_typeid)); } - using dpctl::tensor::offset_utils::device_allocate_and_pack; + using dpnp::tensor::offset_utils::device_allocate_and_pack; auto ptr_sz_event_triple_ = device_allocate_and_pack( exec_q, host_tasks, simplified_shape, simplified_src1_strides, simplified_src2_strides, simplified_dst_strides); @@ -554,12 +553,12 @@ std::pair py_binary_ufunc( src2_data, src2_offset, dst_data, dst_offset, depends, {copy_shape_ev}); // async free of shape_strides temporary - sycl::event tmp_cleanup_ev = dpctl::tensor::alloc_utils::async_smart_free( + sycl::event tmp_cleanup_ev = dpnp::tensor::alloc_utils::async_smart_free( exec_q, {strided_fn_ev}, shape_strides_owner); host_tasks.push_back(tmp_cleanup_ev); return std::make_pair( - dpctl::utils::keep_args_alive(exec_q, {src1, src2, dst}, host_tasks), + dpnp::utils::keep_args_alive(exec_q, {src1, src2, dst}, host_tasks), strided_fn_ev); } @@ -569,8 +568,8 @@ py::object py_binary_ufunc_result_type(const py::dtype &input1_dtype, const py::dtype &input2_dtype, const output_typesT &output_types_table) { - int tn1 = input1_dtype.num(); // NumPy type numbers are the same as in dpctl - int tn2 = input2_dtype.num(); // NumPy type numbers are the same as in dpctl + int tn1 = input1_dtype.num(); // NumPy type numbers are the same as in dpnp + int tn2 = input2_dtype.num(); // NumPy type numbers are the same as in dpnp int src1_typeid = -1; int src2_typeid = -1; @@ -610,8 +609,8 @@ template std::pair - py_binary_inplace_ufunc(const dpctl::tensor::usm_ndarray &lhs, - const dpctl::tensor::usm_ndarray &rhs, + py_binary_inplace_ufunc(const dpnp::tensor::usm_ndarray &lhs, + const dpnp::tensor::usm_ndarray &rhs, sycl::queue &exec_q, const std::vector depends, // @@ -621,7 +620,7 @@ std::pair const contig_row_matrix_dispatchT &contig_row_matrix_broadcast_dispatch_table) { - dpctl::tensor::validation::CheckWritable::throw_if_not_writable(lhs); + dpnp::tensor::validation::CheckWritable::throw_if_not_writable(lhs); // check type_nums int rhs_typenum = rhs.get_typenum(); @@ -639,7 +638,7 @@ std::pair } // check that queues are compatible - if (!dpctl::utils::queues_are_compatible(exec_q, {rhs, lhs})) { + if (!dpnp::utils::queues_are_compatible(exec_q, {rhs, lhs})) { throw py::value_error( "Execution queue is not compatible with allocation queues"); } @@ -670,12 +669,12 @@ std::pair return std::make_pair(sycl::event(), sycl::event()); } - dpctl::tensor::validation::AmpleMemory::throw_if_not_ample(lhs, rhs_nelems); + dpnp::tensor::validation::AmpleMemory::throw_if_not_ample(lhs, rhs_nelems); // check memory overlap auto const &same_logical_tensors = - dpctl::tensor::overlap::SameLogicalTensors(); - auto const &overlap = dpctl::tensor::overlap::MemoryOverlap(); + dpnp::tensor::overlap::SameLogicalTensors(); + auto const &overlap = dpnp::tensor::overlap::MemoryOverlap(); if (overlap(rhs, lhs) && !same_logical_tensors(rhs, lhs)) { throw py::value_error("Arrays index overlapping segments of memory"); } @@ -701,7 +700,7 @@ std::pair auto comp_ev = contig_fn(exec_q, rhs_nelems, rhs_data, 0, lhs_data, 0, depends); sycl::event ht_ev = - dpctl::utils::keep_args_alive(exec_q, {rhs, lhs}, {comp_ev}); + dpnp::utils::keep_args_alive(exec_q, {rhs, lhs}, {comp_ev}); return std::make_pair(ht_ev, comp_ev); } @@ -739,8 +738,8 @@ std::pair auto comp_ev = contig_fn(exec_q, rhs_nelems, rhs_data, rhs_offset, lhs_data, lhs_offset, depends); - sycl::event ht_ev = dpctl::utils::keep_args_alive( - exec_q, {rhs, lhs}, {comp_ev}); + sycl::event ht_ev = + dpnp::utils::keep_args_alive(exec_q, {rhs, lhs}, {comp_ev}); return std::make_pair(ht_ev, comp_ev); } @@ -762,7 +761,7 @@ std::pair exec_q, host_tasks, n0, n1, rhs_data, rhs_offset, lhs_data, lhs_offset, depends); - return std::make_pair(dpctl::utils::keep_args_alive( + return std::make_pair(dpnp::utils::keep_args_alive( exec_q, {lhs, rhs}, host_tasks), comp_ev); } @@ -780,7 +779,7 @@ std::pair " and lhs_typeid=" + std::to_string(lhs_typeid)); } - using dpctl::tensor::offset_utils::device_allocate_and_pack; + using dpnp::tensor::offset_utils::device_allocate_and_pack; auto ptr_sz_event_triple_ = device_allocate_and_pack( exec_q, host_tasks, simplified_shape, simplified_rhs_strides, simplified_lhs_strides); @@ -794,14 +793,14 @@ std::pair lhs_data, lhs_offset, depends, {copy_shape_ev}); // async free of shape_strides temporary - sycl::event tmp_cleanup_ev = dpctl::tensor::alloc_utils::async_smart_free( + sycl::event tmp_cleanup_ev = dpnp::tensor::alloc_utils::async_smart_free( exec_q, {strided_fn_ev}, shape_strides_owner); host_tasks.push_back(tmp_cleanup_ev); return std::make_pair( - dpctl::utils::keep_args_alive(exec_q, {rhs, lhs}, host_tasks), + dpnp::utils::keep_args_alive(exec_q, {rhs, lhs}, host_tasks), strided_fn_ev); } -} // namespace dpctl::tensor::py_internal +} // namespace dpnp::tensor::py_internal diff --git a/dpnp/tensor/libtensor/source/elementwise_functions/elementwise_functions_type_utils.cpp b/dpnp/tensor/libtensor/source/elementwise_functions/elementwise_functions_type_utils.cpp index 7d327ada7349..c3abb9cc1409 100644 --- a/dpnp/tensor/libtensor/source/elementwise_functions/elementwise_functions_type_utils.cpp +++ b/dpnp/tensor/libtensor/source/elementwise_functions/elementwise_functions_type_utils.cpp @@ -41,11 +41,11 @@ #include "elementwise_functions_type_utils.hpp" #include "utils/type_dispatch.hpp" -namespace dpctl::tensor::py_internal::type_utils +namespace dpnp::tensor::py_internal::type_utils { namespace py = pybind11; -namespace td_ns = dpctl::tensor::type_dispatch; +namespace td_ns = dpnp::tensor::type_dispatch; py::dtype _dtype_from_typenum(td_ns::typenum_t dst_typenum_t) { @@ -93,4 +93,4 @@ int _result_typeid(int arg_typeid, const int *fn_output_id) return fn_output_id[arg_typeid]; } -} // namespace dpctl::tensor::py_internal::type_utils +} // namespace dpnp::tensor::py_internal::type_utils diff --git a/dpnp/tensor/libtensor/source/elementwise_functions/elementwise_functions_type_utils.hpp b/dpnp/tensor/libtensor/source/elementwise_functions/elementwise_functions_type_utils.hpp index d3324feb3470..ae055c5e0c11 100644 --- a/dpnp/tensor/libtensor/source/elementwise_functions/elementwise_functions_type_utils.hpp +++ b/dpnp/tensor/libtensor/source/elementwise_functions/elementwise_functions_type_utils.hpp @@ -41,9 +41,9 @@ #include "utils/type_dispatch.hpp" namespace py = pybind11; -namespace td_ns = dpctl::tensor::type_dispatch; +namespace td_ns = dpnp::tensor::type_dispatch; -namespace dpctl::tensor::py_internal::type_utils +namespace dpnp::tensor::py_internal::type_utils { /*! @brief Produce dtype from a type number */ @@ -53,4 +53,4 @@ extern py::dtype _dtype_from_typenum(td_ns::typenum_t); * argument and the mapping table */ extern int _result_typeid(int, const int *); -} // namespace dpctl::tensor::py_internal::type_utils +} // namespace dpnp::tensor::py_internal::type_utils diff --git a/dpnp/tensor/libtensor/source/elementwise_functions/equal.cpp b/dpnp/tensor/libtensor/source/elementwise_functions/equal.cpp index 863501bea367..a1f7b4f96448 100644 --- a/dpnp/tensor/libtensor/source/elementwise_functions/equal.cpp +++ b/dpnp/tensor/libtensor/source/elementwise_functions/equal.cpp @@ -29,7 +29,7 @@ //===---------------------------------------------------------------------===// /// /// \file -/// This file defines functions of dpctl.tensor._tensor_elementwise_impl +/// This file defines functions of dpnp.tensor._tensor_elementwise_impl /// extension, specifically functions for elementwise operations. //===---------------------------------------------------------------------===// @@ -49,13 +49,13 @@ #include "kernels/elementwise_functions/common.hpp" #include "kernels/elementwise_functions/equal.hpp" -namespace dpctl::tensor::py_internal +namespace dpnp::tensor::py_internal { namespace py = pybind11; -namespace td_ns = dpctl::tensor::type_dispatch; +namespace td_ns = dpnp::tensor::type_dispatch; -namespace ew_cmn_ns = dpctl::tensor::kernels::elementwise_common; +namespace ew_cmn_ns = dpnp::tensor::kernels::elementwise_common; using ew_cmn_ns::binary_contig_impl_fn_ptr_t; using ew_cmn_ns::binary_contig_matrix_contig_row_broadcast_impl_fn_ptr_t; using ew_cmn_ns::binary_contig_row_contig_matrix_broadcast_impl_fn_ptr_t; @@ -64,7 +64,7 @@ using ew_cmn_ns::binary_strided_impl_fn_ptr_t; // B09: ===== EQUAL (x1, x2) namespace impl { -namespace equal_fn_ns = dpctl::tensor::kernels::equal; +namespace equal_fn_ns = dpnp::tensor::kernels::equal; static binary_contig_impl_fn_ptr_t equal_contig_dispatch_table[td_ns::num_types][td_ns::num_types]; @@ -102,7 +102,7 @@ void populate_equal_dispatch_tables(void) void init_equal(py::module_ m) { - using arrayT = dpctl::tensor::usm_ndarray; + using arrayT = dpnp::tensor::usm_ndarray; using event_vecT = std::vector; { impl::populate_equal_dispatch_tables(); @@ -142,4 +142,4 @@ void init_equal(py::module_ m) } } -} // namespace dpctl::tensor::py_internal +} // namespace dpnp::tensor::py_internal diff --git a/dpnp/tensor/libtensor/source/elementwise_functions/equal.hpp b/dpnp/tensor/libtensor/source/elementwise_functions/equal.hpp index 23f370111458..e62e17180f1f 100644 --- a/dpnp/tensor/libtensor/source/elementwise_functions/equal.hpp +++ b/dpnp/tensor/libtensor/source/elementwise_functions/equal.hpp @@ -29,7 +29,7 @@ //===---------------------------------------------------------------------===// /// /// \file -/// This file defines functions of dpctl.tensor._tensor_elementwise_impl +/// This file defines functions of dpnp.tensor._tensor_elementwise_impl /// extension, specifically functions for elementwise operations. //===---------------------------------------------------------------------===// @@ -38,9 +38,9 @@ namespace py = pybind11; -namespace dpctl::tensor::py_internal +namespace dpnp::tensor::py_internal { extern void init_equal(py::module_ m); -} // namespace dpctl::tensor::py_internal +} // namespace dpnp::tensor::py_internal diff --git a/dpnp/tensor/libtensor/source/elementwise_functions/exp.cpp b/dpnp/tensor/libtensor/source/elementwise_functions/exp.cpp index cd3cd65107f7..33cf3623a0f2 100644 --- a/dpnp/tensor/libtensor/source/elementwise_functions/exp.cpp +++ b/dpnp/tensor/libtensor/source/elementwise_functions/exp.cpp @@ -29,7 +29,7 @@ //===---------------------------------------------------------------------===// /// /// \file -/// This file defines functions of dpctl.tensor._tensor_elementwise_impl +/// This file defines functions of dpnp.tensor._tensor_elementwise_impl /// extension, specifically functions for elementwise operations. //===---------------------------------------------------------------------===// @@ -50,13 +50,13 @@ #include "kernels/elementwise_functions/common.hpp" #include "kernels/elementwise_functions/exp.hpp" -namespace dpctl::tensor::py_internal +namespace dpnp::tensor::py_internal { namespace py = pybind11; -namespace td_ns = dpctl::tensor::type_dispatch; +namespace td_ns = dpnp::tensor::type_dispatch; -namespace ew_cmn_ns = dpctl::tensor::kernels::elementwise_common; +namespace ew_cmn_ns = dpnp::tensor::kernels::elementwise_common; using ew_cmn_ns::unary_contig_impl_fn_ptr_t; using ew_cmn_ns::unary_strided_impl_fn_ptr_t; @@ -64,7 +64,7 @@ using ew_cmn_ns::unary_strided_impl_fn_ptr_t; namespace impl { -namespace exp_fn_ns = dpctl::tensor::kernels::exp; +namespace exp_fn_ns = dpnp::tensor::kernels::exp; static unary_contig_impl_fn_ptr_t exp_contig_dispatch_vector[td_ns::num_types]; static int exp_output_typeid_vector[td_ns::num_types]; @@ -97,7 +97,7 @@ void populate_exp_dispatch_vectors(void) void init_exp(py::module_ m) { - using arrayT = dpctl::tensor::usm_ndarray; + using arrayT = dpnp::tensor::usm_ndarray; using event_vecT = std::vector; { impl::populate_exp_dispatch_vectors(); @@ -122,4 +122,4 @@ void init_exp(py::module_ m) } } -} // namespace dpctl::tensor::py_internal +} // namespace dpnp::tensor::py_internal diff --git a/dpnp/tensor/libtensor/source/elementwise_functions/exp.hpp b/dpnp/tensor/libtensor/source/elementwise_functions/exp.hpp index 14b757a18e92..208262805d41 100644 --- a/dpnp/tensor/libtensor/source/elementwise_functions/exp.hpp +++ b/dpnp/tensor/libtensor/source/elementwise_functions/exp.hpp @@ -29,7 +29,7 @@ //===---------------------------------------------------------------------===// /// /// \file -/// This file defines functions of dpctl.tensor._tensor_elementwise_impl +/// This file defines functions of dpnp.tensor._tensor_elementwise_impl /// extension, specifically functions for elementwise operations. //===---------------------------------------------------------------------===// @@ -38,9 +38,9 @@ namespace py = pybind11; -namespace dpctl::tensor::py_internal +namespace dpnp::tensor::py_internal { extern void init_exp(py::module_ m); -} // namespace dpctl::tensor::py_internal +} // namespace dpnp::tensor::py_internal diff --git a/dpnp/tensor/libtensor/source/elementwise_functions/exp2.cpp b/dpnp/tensor/libtensor/source/elementwise_functions/exp2.cpp index fc40a8e0aab9..c3aff802f18b 100644 --- a/dpnp/tensor/libtensor/source/elementwise_functions/exp2.cpp +++ b/dpnp/tensor/libtensor/source/elementwise_functions/exp2.cpp @@ -29,7 +29,7 @@ //===---------------------------------------------------------------------===// /// /// \file -/// This file defines functions of dpctl.tensor._tensor_elementwise_impl +/// This file defines functions of dpnp.tensor._tensor_elementwise_impl /// extension, specifically functions for elementwise operations. //===---------------------------------------------------------------------===// @@ -50,13 +50,13 @@ #include "kernels/elementwise_functions/common.hpp" #include "kernels/elementwise_functions/exp2.hpp" -namespace dpctl::tensor::py_internal +namespace dpnp::tensor::py_internal { namespace py = pybind11; -namespace td_ns = dpctl::tensor::type_dispatch; +namespace td_ns = dpnp::tensor::type_dispatch; -namespace ew_cmn_ns = dpctl::tensor::kernels::elementwise_common; +namespace ew_cmn_ns = dpnp::tensor::kernels::elementwise_common; using ew_cmn_ns::unary_contig_impl_fn_ptr_t; using ew_cmn_ns::unary_strided_impl_fn_ptr_t; @@ -64,7 +64,7 @@ using ew_cmn_ns::unary_strided_impl_fn_ptr_t; namespace impl { -namespace exp2_fn_ns = dpctl::tensor::kernels::exp2; +namespace exp2_fn_ns = dpnp::tensor::kernels::exp2; static unary_contig_impl_fn_ptr_t exp2_contig_dispatch_vector[td_ns::num_types]; static int exp2_output_typeid_vector[td_ns::num_types]; @@ -97,7 +97,7 @@ void populate_exp2_dispatch_vectors(void) void init_exp2(py::module_ m) { - using arrayT = dpctl::tensor::usm_ndarray; + using arrayT = dpnp::tensor::usm_ndarray; using event_vecT = std::vector; { impl::populate_exp2_dispatch_vectors(); @@ -122,4 +122,4 @@ void init_exp2(py::module_ m) } } -} // namespace dpctl::tensor::py_internal +} // namespace dpnp::tensor::py_internal diff --git a/dpnp/tensor/libtensor/source/elementwise_functions/exp2.hpp b/dpnp/tensor/libtensor/source/elementwise_functions/exp2.hpp index f9f315d14383..fe767d8d4fe3 100644 --- a/dpnp/tensor/libtensor/source/elementwise_functions/exp2.hpp +++ b/dpnp/tensor/libtensor/source/elementwise_functions/exp2.hpp @@ -29,7 +29,7 @@ //===---------------------------------------------------------------------===// /// /// \file -/// This file defines functions of dpctl.tensor._tensor_elementwise_impl +/// This file defines functions of dpnp.tensor._tensor_elementwise_impl /// extension, specifically functions for elementwise operations. //===---------------------------------------------------------------------===// @@ -38,9 +38,9 @@ namespace py = pybind11; -namespace dpctl::tensor::py_internal +namespace dpnp::tensor::py_internal { extern void init_exp2(py::module_ m); -} // namespace dpctl::tensor::py_internal +} // namespace dpnp::tensor::py_internal diff --git a/dpnp/tensor/libtensor/source/elementwise_functions/expm1.cpp b/dpnp/tensor/libtensor/source/elementwise_functions/expm1.cpp index b4770b7b819c..e1251787e342 100644 --- a/dpnp/tensor/libtensor/source/elementwise_functions/expm1.cpp +++ b/dpnp/tensor/libtensor/source/elementwise_functions/expm1.cpp @@ -29,7 +29,7 @@ //===---------------------------------------------------------------------===// /// /// \file -/// This file defines functions of dpctl.tensor._tensor_elementwise_impl +/// This file defines functions of dpnp.tensor._tensor_elementwise_impl /// extension, specifically functions for elementwise operations. //===---------------------------------------------------------------------===// @@ -50,13 +50,13 @@ #include "kernels/elementwise_functions/common.hpp" #include "kernels/elementwise_functions/expm1.hpp" -namespace dpctl::tensor::py_internal +namespace dpnp::tensor::py_internal { namespace py = pybind11; -namespace td_ns = dpctl::tensor::type_dispatch; +namespace td_ns = dpnp::tensor::type_dispatch; -namespace ew_cmn_ns = dpctl::tensor::kernels::elementwise_common; +namespace ew_cmn_ns = dpnp::tensor::kernels::elementwise_common; using ew_cmn_ns::unary_contig_impl_fn_ptr_t; using ew_cmn_ns::unary_strided_impl_fn_ptr_t; @@ -64,7 +64,7 @@ using ew_cmn_ns::unary_strided_impl_fn_ptr_t; namespace impl { -namespace expm1_fn_ns = dpctl::tensor::kernels::expm1; +namespace expm1_fn_ns = dpnp::tensor::kernels::expm1; static unary_contig_impl_fn_ptr_t expm1_contig_dispatch_vector[td_ns::num_types]; @@ -98,7 +98,7 @@ void populate_expm1_dispatch_vectors(void) void init_expm1(py::module_ m) { - using arrayT = dpctl::tensor::usm_ndarray; + using arrayT = dpnp::tensor::usm_ndarray; using event_vecT = std::vector; { impl::populate_expm1_dispatch_vectors(); @@ -124,4 +124,4 @@ void init_expm1(py::module_ m) } } -} // namespace dpctl::tensor::py_internal +} // namespace dpnp::tensor::py_internal diff --git a/dpnp/tensor/libtensor/source/elementwise_functions/expm1.hpp b/dpnp/tensor/libtensor/source/elementwise_functions/expm1.hpp index 4f373fe67dff..b271af36a9f3 100644 --- a/dpnp/tensor/libtensor/source/elementwise_functions/expm1.hpp +++ b/dpnp/tensor/libtensor/source/elementwise_functions/expm1.hpp @@ -29,7 +29,7 @@ //===---------------------------------------------------------------------===// /// /// \file -/// This file defines functions of dpctl.tensor._tensor_elementwise_impl +/// This file defines functions of dpnp.tensor._tensor_elementwise_impl /// extension, specifically functions for elementwise operations. //===---------------------------------------------------------------------===// @@ -38,9 +38,9 @@ namespace py = pybind11; -namespace dpctl::tensor::py_internal +namespace dpnp::tensor::py_internal { extern void init_expm1(py::module_ m); -} // namespace dpctl::tensor::py_internal +} // namespace dpnp::tensor::py_internal diff --git a/dpnp/tensor/libtensor/source/elementwise_functions/floor.cpp b/dpnp/tensor/libtensor/source/elementwise_functions/floor.cpp index 2a81ce6552a9..3e013b43619c 100644 --- a/dpnp/tensor/libtensor/source/elementwise_functions/floor.cpp +++ b/dpnp/tensor/libtensor/source/elementwise_functions/floor.cpp @@ -29,7 +29,7 @@ //===---------------------------------------------------------------------===// /// /// \file -/// This file defines functions of dpctl.tensor._tensor_elementwise_impl +/// This file defines functions of dpnp.tensor._tensor_elementwise_impl /// extension, specifically functions for elementwise operations. //===---------------------------------------------------------------------===// @@ -50,13 +50,13 @@ #include "kernels/elementwise_functions/common.hpp" #include "kernels/elementwise_functions/floor.hpp" -namespace dpctl::tensor::py_internal +namespace dpnp::tensor::py_internal { namespace py = pybind11; -namespace td_ns = dpctl::tensor::type_dispatch; +namespace td_ns = dpnp::tensor::type_dispatch; -namespace ew_cmn_ns = dpctl::tensor::kernels::elementwise_common; +namespace ew_cmn_ns = dpnp::tensor::kernels::elementwise_common; using ew_cmn_ns::unary_contig_impl_fn_ptr_t; using ew_cmn_ns::unary_strided_impl_fn_ptr_t; @@ -64,7 +64,7 @@ using ew_cmn_ns::unary_strided_impl_fn_ptr_t; namespace impl { -namespace floor_fn_ns = dpctl::tensor::kernels::floor; +namespace floor_fn_ns = dpnp::tensor::kernels::floor; static unary_contig_impl_fn_ptr_t floor_contig_dispatch_vector[td_ns::num_types]; @@ -98,7 +98,7 @@ void populate_floor_dispatch_vectors(void) void init_floor(py::module_ m) { - using arrayT = dpctl::tensor::usm_ndarray; + using arrayT = dpnp::tensor::usm_ndarray; using event_vecT = std::vector; { impl::populate_floor_dispatch_vectors(); @@ -124,4 +124,4 @@ void init_floor(py::module_ m) } } -} // namespace dpctl::tensor::py_internal +} // namespace dpnp::tensor::py_internal diff --git a/dpnp/tensor/libtensor/source/elementwise_functions/floor.hpp b/dpnp/tensor/libtensor/source/elementwise_functions/floor.hpp index 5e5fe41ce313..744789f76580 100644 --- a/dpnp/tensor/libtensor/source/elementwise_functions/floor.hpp +++ b/dpnp/tensor/libtensor/source/elementwise_functions/floor.hpp @@ -29,7 +29,7 @@ //===---------------------------------------------------------------------===// /// /// \file -/// This file defines functions of dpctl.tensor._tensor_elementwise_impl +/// This file defines functions of dpnp.tensor._tensor_elementwise_impl /// extension, specifically functions for elementwise operations. //===---------------------------------------------------------------------===// @@ -38,9 +38,9 @@ namespace py = pybind11; -namespace dpctl::tensor::py_internal +namespace dpnp::tensor::py_internal { extern void init_floor(py::module_ m); -} // namespace dpctl::tensor::py_internal +} // namespace dpnp::tensor::py_internal diff --git a/dpnp/tensor/libtensor/source/elementwise_functions/floor_divide.cpp b/dpnp/tensor/libtensor/source/elementwise_functions/floor_divide.cpp index af4635a0f500..41de422d7e70 100644 --- a/dpnp/tensor/libtensor/source/elementwise_functions/floor_divide.cpp +++ b/dpnp/tensor/libtensor/source/elementwise_functions/floor_divide.cpp @@ -29,7 +29,7 @@ //===---------------------------------------------------------------------===// /// /// \file -/// This file defines functions of dpctl.tensor._tensor_elementwise_impl +/// This file defines functions of dpnp.tensor._tensor_elementwise_impl /// extension, specifically functions for elementwise operations. //===---------------------------------------------------------------------===// @@ -50,13 +50,13 @@ #include "kernels/elementwise_functions/common_inplace.hpp" #include "kernels/elementwise_functions/floor_divide.hpp" -namespace dpctl::tensor::py_internal +namespace dpnp::tensor::py_internal { namespace py = pybind11; -namespace td_ns = dpctl::tensor::type_dispatch; +namespace td_ns = dpnp::tensor::type_dispatch; -namespace ew_cmn_ns = dpctl::tensor::kernels::elementwise_common; +namespace ew_cmn_ns = dpnp::tensor::kernels::elementwise_common; using ew_cmn_ns::binary_contig_impl_fn_ptr_t; using ew_cmn_ns::binary_contig_matrix_contig_row_broadcast_impl_fn_ptr_t; using ew_cmn_ns::binary_contig_row_contig_matrix_broadcast_impl_fn_ptr_t; @@ -69,7 +69,7 @@ using ew_cmn_ns::binary_inplace_strided_impl_fn_ptr_t; // B10: ===== FLOOR_DIVIDE (x1, x2) namespace impl { -namespace floor_divide_fn_ns = dpctl::tensor::kernels::floor_divide; +namespace floor_divide_fn_ns = dpnp::tensor::kernels::floor_divide; static binary_contig_impl_fn_ptr_t floor_divide_contig_dispatch_table[td_ns::num_types][td_ns::num_types]; @@ -136,7 +136,7 @@ void populate_floor_divide_dispatch_tables(void) void init_floor_divide(py::module_ m) { - using arrayT = dpctl::tensor::usm_ndarray; + using arrayT = dpnp::tensor::usm_ndarray; using event_vecT = std::vector; { impl::populate_floor_divide_dispatch_tables(); @@ -202,4 +202,4 @@ void init_floor_divide(py::module_ m) } } -} // namespace dpctl::tensor::py_internal +} // namespace dpnp::tensor::py_internal diff --git a/dpnp/tensor/libtensor/source/elementwise_functions/floor_divide.hpp b/dpnp/tensor/libtensor/source/elementwise_functions/floor_divide.hpp index 17d493b58057..326f5ab43df3 100644 --- a/dpnp/tensor/libtensor/source/elementwise_functions/floor_divide.hpp +++ b/dpnp/tensor/libtensor/source/elementwise_functions/floor_divide.hpp @@ -29,7 +29,7 @@ //===---------------------------------------------------------------------===// /// /// \file -/// This file defines functions of dpctl.tensor._tensor_elementwise_impl +/// This file defines functions of dpnp.tensor._tensor_elementwise_impl /// extension, specifically functions for elementwise operations. //===---------------------------------------------------------------------===// @@ -38,9 +38,9 @@ namespace py = pybind11; -namespace dpctl::tensor::py_internal +namespace dpnp::tensor::py_internal { extern void init_floor_divide(py::module_ m); -} // namespace dpctl::tensor::py_internal +} // namespace dpnp::tensor::py_internal diff --git a/dpnp/tensor/libtensor/source/elementwise_functions/greater.cpp b/dpnp/tensor/libtensor/source/elementwise_functions/greater.cpp index f3cfaeae2286..c5b953ab7975 100644 --- a/dpnp/tensor/libtensor/source/elementwise_functions/greater.cpp +++ b/dpnp/tensor/libtensor/source/elementwise_functions/greater.cpp @@ -29,7 +29,7 @@ //===---------------------------------------------------------------------===// /// /// \file -/// This file defines functions of dpctl.tensor._tensor_elementwise_impl +/// This file defines functions of dpnp.tensor._tensor_elementwise_impl /// extension, specifically functions for elementwise operations. //===---------------------------------------------------------------------===// @@ -49,13 +49,13 @@ #include "kernels/elementwise_functions/common.hpp" #include "kernels/elementwise_functions/greater.hpp" -namespace dpctl::tensor::py_internal +namespace dpnp::tensor::py_internal { namespace py = pybind11; -namespace td_ns = dpctl::tensor::type_dispatch; +namespace td_ns = dpnp::tensor::type_dispatch; -namespace ew_cmn_ns = dpctl::tensor::kernels::elementwise_common; +namespace ew_cmn_ns = dpnp::tensor::kernels::elementwise_common; using ew_cmn_ns::binary_contig_impl_fn_ptr_t; using ew_cmn_ns::binary_contig_matrix_contig_row_broadcast_impl_fn_ptr_t; using ew_cmn_ns::binary_contig_row_contig_matrix_broadcast_impl_fn_ptr_t; @@ -64,7 +64,7 @@ using ew_cmn_ns::binary_strided_impl_fn_ptr_t; // B11: ===== GREATER (x1, x2) namespace impl { -namespace greater_fn_ns = dpctl::tensor::kernels::greater; +namespace greater_fn_ns = dpnp::tensor::kernels::greater; static binary_contig_impl_fn_ptr_t greater_contig_dispatch_table[td_ns::num_types][td_ns::num_types]; @@ -102,7 +102,7 @@ void populate_greater_dispatch_tables(void) void init_greater(py::module_ m) { - using arrayT = dpctl::tensor::usm_ndarray; + using arrayT = dpnp::tensor::usm_ndarray; using event_vecT = std::vector; { impl::populate_greater_dispatch_tables(); @@ -142,4 +142,4 @@ void init_greater(py::module_ m) } } -} // namespace dpctl::tensor::py_internal +} // namespace dpnp::tensor::py_internal diff --git a/dpnp/tensor/libtensor/source/elementwise_functions/greater.hpp b/dpnp/tensor/libtensor/source/elementwise_functions/greater.hpp index c8c3caa5f1fd..d6fb3d5cc16e 100644 --- a/dpnp/tensor/libtensor/source/elementwise_functions/greater.hpp +++ b/dpnp/tensor/libtensor/source/elementwise_functions/greater.hpp @@ -29,7 +29,7 @@ //===---------------------------------------------------------------------===// /// /// \file -/// This file defines functions of dpctl.tensor._tensor_elementwise_impl +/// This file defines functions of dpnp.tensor._tensor_elementwise_impl /// extension, specifically functions for elementwise operations. //===---------------------------------------------------------------------===// @@ -38,9 +38,9 @@ namespace py = pybind11; -namespace dpctl::tensor::py_internal +namespace dpnp::tensor::py_internal { extern void init_greater(py::module_ m); -} // namespace dpctl::tensor::py_internal +} // namespace dpnp::tensor::py_internal diff --git a/dpnp/tensor/libtensor/source/elementwise_functions/greater_equal.cpp b/dpnp/tensor/libtensor/source/elementwise_functions/greater_equal.cpp index ad9af91ce3d8..044b419dfa53 100644 --- a/dpnp/tensor/libtensor/source/elementwise_functions/greater_equal.cpp +++ b/dpnp/tensor/libtensor/source/elementwise_functions/greater_equal.cpp @@ -29,7 +29,7 @@ //===---------------------------------------------------------------------===// /// /// \file -/// This file defines functions of dpctl.tensor._tensor_elementwise_impl +/// This file defines functions of dpnp.tensor._tensor_elementwise_impl /// extension, specifically functions for elementwise operations. //===---------------------------------------------------------------------===// @@ -49,13 +49,13 @@ #include "kernels/elementwise_functions/common.hpp" #include "kernels/elementwise_functions/greater_equal.hpp" -namespace dpctl::tensor::py_internal +namespace dpnp::tensor::py_internal { namespace py = pybind11; -namespace td_ns = dpctl::tensor::type_dispatch; +namespace td_ns = dpnp::tensor::type_dispatch; -namespace ew_cmn_ns = dpctl::tensor::kernels::elementwise_common; +namespace ew_cmn_ns = dpnp::tensor::kernels::elementwise_common; using ew_cmn_ns::binary_contig_impl_fn_ptr_t; using ew_cmn_ns::binary_contig_matrix_contig_row_broadcast_impl_fn_ptr_t; using ew_cmn_ns::binary_contig_row_contig_matrix_broadcast_impl_fn_ptr_t; @@ -64,7 +64,7 @@ using ew_cmn_ns::binary_strided_impl_fn_ptr_t; // B12: ===== GREATER_EQUAL (x1, x2) namespace impl { -namespace greater_equal_fn_ns = dpctl::tensor::kernels::greater_equal; +namespace greater_equal_fn_ns = dpnp::tensor::kernels::greater_equal; static binary_contig_impl_fn_ptr_t greater_equal_contig_dispatch_table[td_ns::num_types][td_ns::num_types]; @@ -102,7 +102,7 @@ void populate_greater_equal_dispatch_tables(void) void init_greater_equal(py::module_ m) { - using arrayT = dpctl::tensor::usm_ndarray; + using arrayT = dpnp::tensor::usm_ndarray; using event_vecT = std::vector; { impl::populate_greater_equal_dispatch_tables(); @@ -143,4 +143,4 @@ void init_greater_equal(py::module_ m) } } -} // namespace dpctl::tensor::py_internal +} // namespace dpnp::tensor::py_internal diff --git a/dpnp/tensor/libtensor/source/elementwise_functions/greater_equal.hpp b/dpnp/tensor/libtensor/source/elementwise_functions/greater_equal.hpp index 0cf7f8e89bbf..bf6281086ce9 100644 --- a/dpnp/tensor/libtensor/source/elementwise_functions/greater_equal.hpp +++ b/dpnp/tensor/libtensor/source/elementwise_functions/greater_equal.hpp @@ -29,7 +29,7 @@ //===---------------------------------------------------------------------===// /// /// \file -/// This file defines functions of dpctl.tensor._tensor_elementwise_impl +/// This file defines functions of dpnp.tensor._tensor_elementwise_impl /// extension, specifically functions for elementwise operations. //===---------------------------------------------------------------------===// @@ -38,9 +38,9 @@ namespace py = pybind11; -namespace dpctl::tensor::py_internal +namespace dpnp::tensor::py_internal { extern void init_greater_equal(py::module_ m); -} // namespace dpctl::tensor::py_internal +} // namespace dpnp::tensor::py_internal diff --git a/dpnp/tensor/libtensor/source/elementwise_functions/hypot.cpp b/dpnp/tensor/libtensor/source/elementwise_functions/hypot.cpp index f4ce161f4cda..21205bf637e4 100644 --- a/dpnp/tensor/libtensor/source/elementwise_functions/hypot.cpp +++ b/dpnp/tensor/libtensor/source/elementwise_functions/hypot.cpp @@ -29,7 +29,7 @@ //===---------------------------------------------------------------------===// /// /// \file -/// This file defines functions of dpctl.tensor._tensor_elementwise_impl +/// This file defines functions of dpnp.tensor._tensor_elementwise_impl /// extension, specifically functions for elementwise operations. //===---------------------------------------------------------------------===// @@ -49,13 +49,13 @@ #include "kernels/elementwise_functions/common.hpp" #include "kernels/elementwise_functions/hypot.hpp" -namespace dpctl::tensor::py_internal +namespace dpnp::tensor::py_internal { namespace py = pybind11; -namespace td_ns = dpctl::tensor::type_dispatch; +namespace td_ns = dpnp::tensor::type_dispatch; -namespace ew_cmn_ns = dpctl::tensor::kernels::elementwise_common; +namespace ew_cmn_ns = dpnp::tensor::kernels::elementwise_common; using ew_cmn_ns::binary_contig_impl_fn_ptr_t; using ew_cmn_ns::binary_contig_matrix_contig_row_broadcast_impl_fn_ptr_t; using ew_cmn_ns::binary_contig_row_contig_matrix_broadcast_impl_fn_ptr_t; @@ -64,7 +64,7 @@ using ew_cmn_ns::binary_strided_impl_fn_ptr_t; // B24: ===== HYPOT (x1, x2) namespace impl { -namespace hypot_fn_ns = dpctl::tensor::kernels::hypot; +namespace hypot_fn_ns = dpnp::tensor::kernels::hypot; static binary_contig_impl_fn_ptr_t hypot_contig_dispatch_table[td_ns::num_types][td_ns::num_types]; @@ -102,7 +102,7 @@ void populate_hypot_dispatch_tables(void) void init_hypot(py::module_ m) { - using arrayT = dpctl::tensor::usm_ndarray; + using arrayT = dpnp::tensor::usm_ndarray; using event_vecT = std::vector; { impl::populate_hypot_dispatch_tables(); @@ -142,4 +142,4 @@ void init_hypot(py::module_ m) } } -} // namespace dpctl::tensor::py_internal +} // namespace dpnp::tensor::py_internal diff --git a/dpnp/tensor/libtensor/source/elementwise_functions/hypot.hpp b/dpnp/tensor/libtensor/source/elementwise_functions/hypot.hpp index 5bc73e717ad3..3b9e2bd67d24 100644 --- a/dpnp/tensor/libtensor/source/elementwise_functions/hypot.hpp +++ b/dpnp/tensor/libtensor/source/elementwise_functions/hypot.hpp @@ -29,7 +29,7 @@ //===---------------------------------------------------------------------===// /// /// \file -/// This file defines functions of dpctl.tensor._tensor_elementwise_impl +/// This file defines functions of dpnp.tensor._tensor_elementwise_impl /// extension, specifically functions for elementwise operations. //===---------------------------------------------------------------------===// @@ -38,9 +38,9 @@ namespace py = pybind11; -namespace dpctl::tensor::py_internal +namespace dpnp::tensor::py_internal { extern void init_hypot(py::module_ m); -} // namespace dpctl::tensor::py_internal +} // namespace dpnp::tensor::py_internal diff --git a/dpnp/tensor/libtensor/source/elementwise_functions/imag.cpp b/dpnp/tensor/libtensor/source/elementwise_functions/imag.cpp index 833295d22891..c5d5104ff37a 100644 --- a/dpnp/tensor/libtensor/source/elementwise_functions/imag.cpp +++ b/dpnp/tensor/libtensor/source/elementwise_functions/imag.cpp @@ -29,7 +29,7 @@ //===---------------------------------------------------------------------===// /// /// \file -/// This file defines functions of dpctl.tensor._tensor_elementwise_impl +/// This file defines functions of dpnp.tensor._tensor_elementwise_impl /// extension, specifically functions for elementwise operations. //===---------------------------------------------------------------------===// @@ -50,13 +50,13 @@ #include "kernels/elementwise_functions/common.hpp" #include "kernels/elementwise_functions/imag.hpp" -namespace dpctl::tensor::py_internal +namespace dpnp::tensor::py_internal { namespace py = pybind11; -namespace td_ns = dpctl::tensor::type_dispatch; +namespace td_ns = dpnp::tensor::type_dispatch; -namespace ew_cmn_ns = dpctl::tensor::kernels::elementwise_common; +namespace ew_cmn_ns = dpnp::tensor::kernels::elementwise_common; using ew_cmn_ns::unary_contig_impl_fn_ptr_t; using ew_cmn_ns::unary_strided_impl_fn_ptr_t; @@ -64,7 +64,7 @@ using ew_cmn_ns::unary_strided_impl_fn_ptr_t; namespace impl { -namespace imag_fn_ns = dpctl::tensor::kernels::imag; +namespace imag_fn_ns = dpnp::tensor::kernels::imag; static unary_contig_impl_fn_ptr_t imag_contig_dispatch_vector[td_ns::num_types]; static int imag_output_typeid_vector[td_ns::num_types]; @@ -97,7 +97,7 @@ void populate_imag_dispatch_vectors(void) void init_imag(py::module_ m) { - using arrayT = dpctl::tensor::usm_ndarray; + using arrayT = dpnp::tensor::usm_ndarray; using event_vecT = std::vector; { impl::populate_imag_dispatch_vectors(); @@ -122,4 +122,4 @@ void init_imag(py::module_ m) } } -} // namespace dpctl::tensor::py_internal +} // namespace dpnp::tensor::py_internal diff --git a/dpnp/tensor/libtensor/source/elementwise_functions/imag.hpp b/dpnp/tensor/libtensor/source/elementwise_functions/imag.hpp index 7cc285855328..f592fe4ee469 100644 --- a/dpnp/tensor/libtensor/source/elementwise_functions/imag.hpp +++ b/dpnp/tensor/libtensor/source/elementwise_functions/imag.hpp @@ -29,7 +29,7 @@ //===---------------------------------------------------------------------===// /// /// \file -/// This file defines functions of dpctl.tensor._tensor_elementwise_impl +/// This file defines functions of dpnp.tensor._tensor_elementwise_impl /// extension, specifically functions for elementwise operations. //===---------------------------------------------------------------------===// @@ -38,9 +38,9 @@ namespace py = pybind11; -namespace dpctl::tensor::py_internal +namespace dpnp::tensor::py_internal { extern void init_imag(py::module_ m); -} // namespace dpctl::tensor::py_internal +} // namespace dpnp::tensor::py_internal diff --git a/dpnp/tensor/libtensor/source/elementwise_functions/isfinite.cpp b/dpnp/tensor/libtensor/source/elementwise_functions/isfinite.cpp index 1882406b37f3..5a269667c0e9 100644 --- a/dpnp/tensor/libtensor/source/elementwise_functions/isfinite.cpp +++ b/dpnp/tensor/libtensor/source/elementwise_functions/isfinite.cpp @@ -29,7 +29,7 @@ //===---------------------------------------------------------------------===// /// /// \file -/// This file defines functions of dpctl.tensor._tensor_elementwise_impl +/// This file defines functions of dpnp.tensor._tensor_elementwise_impl /// extension, specifically functions for elementwise operations. //===---------------------------------------------------------------------===// @@ -50,13 +50,13 @@ #include "kernels/elementwise_functions/common.hpp" #include "kernels/elementwise_functions/isfinite.hpp" -namespace dpctl::tensor::py_internal +namespace dpnp::tensor::py_internal { namespace py = pybind11; -namespace td_ns = dpctl::tensor::type_dispatch; +namespace td_ns = dpnp::tensor::type_dispatch; -namespace ew_cmn_ns = dpctl::tensor::kernels::elementwise_common; +namespace ew_cmn_ns = dpnp::tensor::kernels::elementwise_common; using ew_cmn_ns::unary_contig_impl_fn_ptr_t; using ew_cmn_ns::unary_strided_impl_fn_ptr_t; @@ -64,7 +64,7 @@ using ew_cmn_ns::unary_strided_impl_fn_ptr_t; namespace impl { -namespace isfinite_fn_ns = dpctl::tensor::kernels::isfinite; +namespace isfinite_fn_ns = dpnp::tensor::kernels::isfinite; static unary_contig_impl_fn_ptr_t isfinite_contig_dispatch_vector[td_ns::num_types]; @@ -98,7 +98,7 @@ void populate_isfinite_dispatch_vectors(void) void init_isfinite(py::module_ m) { - using arrayT = dpctl::tensor::usm_ndarray; + using arrayT = dpnp::tensor::usm_ndarray; using event_vecT = std::vector; { impl::populate_isfinite_dispatch_vectors(); @@ -125,4 +125,4 @@ void init_isfinite(py::module_ m) } } -} // namespace dpctl::tensor::py_internal +} // namespace dpnp::tensor::py_internal diff --git a/dpnp/tensor/libtensor/source/elementwise_functions/isfinite.hpp b/dpnp/tensor/libtensor/source/elementwise_functions/isfinite.hpp index 31691916c1f8..49c8d451e72c 100644 --- a/dpnp/tensor/libtensor/source/elementwise_functions/isfinite.hpp +++ b/dpnp/tensor/libtensor/source/elementwise_functions/isfinite.hpp @@ -29,7 +29,7 @@ //===---------------------------------------------------------------------===// /// /// \file -/// This file defines functions of dpctl.tensor._tensor_elementwise_impl +/// This file defines functions of dpnp.tensor._tensor_elementwise_impl /// extension, specifically functions for elementwise operations. //===---------------------------------------------------------------------===// @@ -38,9 +38,9 @@ namespace py = pybind11; -namespace dpctl::tensor::py_internal +namespace dpnp::tensor::py_internal { extern void init_isfinite(py::module_ m); -} // namespace dpctl::tensor::py_internal +} // namespace dpnp::tensor::py_internal diff --git a/dpnp/tensor/libtensor/source/elementwise_functions/isinf.cpp b/dpnp/tensor/libtensor/source/elementwise_functions/isinf.cpp index b6bb5605412c..c464bac8384f 100644 --- a/dpnp/tensor/libtensor/source/elementwise_functions/isinf.cpp +++ b/dpnp/tensor/libtensor/source/elementwise_functions/isinf.cpp @@ -29,7 +29,7 @@ //===---------------------------------------------------------------------===// /// /// \file -/// This file defines functions of dpctl.tensor._tensor_elementwise_impl +/// This file defines functions of dpnp.tensor._tensor_elementwise_impl /// extension, specifically functions for elementwise operations. //===---------------------------------------------------------------------===// @@ -50,13 +50,13 @@ #include "kernels/elementwise_functions/common.hpp" #include "kernels/elementwise_functions/isinf.hpp" -namespace dpctl::tensor::py_internal +namespace dpnp::tensor::py_internal { namespace py = pybind11; -namespace td_ns = dpctl::tensor::type_dispatch; +namespace td_ns = dpnp::tensor::type_dispatch; -namespace ew_cmn_ns = dpctl::tensor::kernels::elementwise_common; +namespace ew_cmn_ns = dpnp::tensor::kernels::elementwise_common; using ew_cmn_ns::unary_contig_impl_fn_ptr_t; using ew_cmn_ns::unary_strided_impl_fn_ptr_t; @@ -64,7 +64,7 @@ using ew_cmn_ns::unary_strided_impl_fn_ptr_t; namespace impl { -namespace isinf_fn_ns = dpctl::tensor::kernels::isinf; +namespace isinf_fn_ns = dpnp::tensor::kernels::isinf; static unary_contig_impl_fn_ptr_t isinf_contig_dispatch_vector[td_ns::num_types]; @@ -98,7 +98,7 @@ void populate_isinf_dispatch_vectors(void) void init_isinf(py::module_ m) { - using arrayT = dpctl::tensor::usm_ndarray; + using arrayT = dpnp::tensor::usm_ndarray; using event_vecT = std::vector; { impl::populate_isinf_dispatch_vectors(); @@ -124,4 +124,4 @@ void init_isinf(py::module_ m) } } -} // namespace dpctl::tensor::py_internal +} // namespace dpnp::tensor::py_internal diff --git a/dpnp/tensor/libtensor/source/elementwise_functions/isinf.hpp b/dpnp/tensor/libtensor/source/elementwise_functions/isinf.hpp index 3dec9f20c791..21082f81bb7c 100644 --- a/dpnp/tensor/libtensor/source/elementwise_functions/isinf.hpp +++ b/dpnp/tensor/libtensor/source/elementwise_functions/isinf.hpp @@ -29,7 +29,7 @@ //===---------------------------------------------------------------------===// /// /// \file -/// This file defines functions of dpctl.tensor._tensor_elementwise_impl +/// This file defines functions of dpnp.tensor._tensor_elementwise_impl /// extension, specifically functions for elementwise operations. //===---------------------------------------------------------------------===// @@ -38,9 +38,9 @@ namespace py = pybind11; -namespace dpctl::tensor::py_internal +namespace dpnp::tensor::py_internal { extern void init_isinf(py::module_ m); -} // namespace dpctl::tensor::py_internal +} // namespace dpnp::tensor::py_internal diff --git a/dpnp/tensor/libtensor/source/elementwise_functions/isnan.cpp b/dpnp/tensor/libtensor/source/elementwise_functions/isnan.cpp index ce832d0a0ed3..add713120bfd 100644 --- a/dpnp/tensor/libtensor/source/elementwise_functions/isnan.cpp +++ b/dpnp/tensor/libtensor/source/elementwise_functions/isnan.cpp @@ -29,7 +29,7 @@ //===---------------------------------------------------------------------===// /// /// \file -/// This file defines functions of dpctl.tensor._tensor_elementwise_impl +/// This file defines functions of dpnp.tensor._tensor_elementwise_impl /// extension, specifically functions for elementwise operations. //===---------------------------------------------------------------------===// @@ -50,13 +50,13 @@ #include "kernels/elementwise_functions/common.hpp" #include "kernels/elementwise_functions/isnan.hpp" -namespace dpctl::tensor::py_internal +namespace dpnp::tensor::py_internal { namespace py = pybind11; -namespace td_ns = dpctl::tensor::type_dispatch; +namespace td_ns = dpnp::tensor::type_dispatch; -namespace ew_cmn_ns = dpctl::tensor::kernels::elementwise_common; +namespace ew_cmn_ns = dpnp::tensor::kernels::elementwise_common; using ew_cmn_ns::unary_contig_impl_fn_ptr_t; using ew_cmn_ns::unary_strided_impl_fn_ptr_t; @@ -64,7 +64,7 @@ using ew_cmn_ns::unary_strided_impl_fn_ptr_t; namespace impl { -namespace isnan_fn_ns = dpctl::tensor::kernels::isnan; +namespace isnan_fn_ns = dpnp::tensor::kernels::isnan; static unary_contig_impl_fn_ptr_t isnan_contig_dispatch_vector[td_ns::num_types]; @@ -98,7 +98,7 @@ void populate_isnan_dispatch_vectors(void) void init_isnan(py::module_ m) { - using arrayT = dpctl::tensor::usm_ndarray; + using arrayT = dpnp::tensor::usm_ndarray; using event_vecT = std::vector; { impl::populate_isnan_dispatch_vectors(); @@ -124,4 +124,4 @@ void init_isnan(py::module_ m) } } -} // namespace dpctl::tensor::py_internal +} // namespace dpnp::tensor::py_internal diff --git a/dpnp/tensor/libtensor/source/elementwise_functions/isnan.hpp b/dpnp/tensor/libtensor/source/elementwise_functions/isnan.hpp index d5a8cdae37e8..3e68cc085de0 100644 --- a/dpnp/tensor/libtensor/source/elementwise_functions/isnan.hpp +++ b/dpnp/tensor/libtensor/source/elementwise_functions/isnan.hpp @@ -29,7 +29,7 @@ //===---------------------------------------------------------------------===// /// /// \file -/// This file defines functions of dpctl.tensor._tensor_elementwise_impl +/// This file defines functions of dpnp.tensor._tensor_elementwise_impl /// extension, specifically functions for elementwise operations. //===---------------------------------------------------------------------===// @@ -38,9 +38,9 @@ namespace py = pybind11; -namespace dpctl::tensor::py_internal +namespace dpnp::tensor::py_internal { extern void init_isnan(py::module_ m); -} // namespace dpctl::tensor::py_internal +} // namespace dpnp::tensor::py_internal diff --git a/dpnp/tensor/libtensor/source/elementwise_functions/less.cpp b/dpnp/tensor/libtensor/source/elementwise_functions/less.cpp index d587ee713178..62aecd11da5c 100644 --- a/dpnp/tensor/libtensor/source/elementwise_functions/less.cpp +++ b/dpnp/tensor/libtensor/source/elementwise_functions/less.cpp @@ -29,7 +29,7 @@ //===---------------------------------------------------------------------===// /// /// \file -/// This file defines functions of dpctl.tensor._tensor_elementwise_impl +/// This file defines functions of dpnp.tensor._tensor_elementwise_impl /// extension, specifically functions for elementwise operations. //===---------------------------------------------------------------------===// @@ -49,13 +49,13 @@ #include "kernels/elementwise_functions/common.hpp" #include "kernels/elementwise_functions/less.hpp" -namespace dpctl::tensor::py_internal +namespace dpnp::tensor::py_internal { namespace py = pybind11; -namespace td_ns = dpctl::tensor::type_dispatch; +namespace td_ns = dpnp::tensor::type_dispatch; -namespace ew_cmn_ns = dpctl::tensor::kernels::elementwise_common; +namespace ew_cmn_ns = dpnp::tensor::kernels::elementwise_common; using ew_cmn_ns::binary_contig_impl_fn_ptr_t; using ew_cmn_ns::binary_contig_matrix_contig_row_broadcast_impl_fn_ptr_t; using ew_cmn_ns::binary_contig_row_contig_matrix_broadcast_impl_fn_ptr_t; @@ -64,7 +64,7 @@ using ew_cmn_ns::binary_strided_impl_fn_ptr_t; // B13: ===== LESS (x1, x2) namespace impl { -namespace less_fn_ns = dpctl::tensor::kernels::less; +namespace less_fn_ns = dpnp::tensor::kernels::less; static binary_contig_impl_fn_ptr_t less_contig_dispatch_table[td_ns::num_types] [td_ns::num_types]; @@ -102,7 +102,7 @@ void populate_less_dispatch_tables(void) void init_less(py::module_ m) { - using arrayT = dpctl::tensor::usm_ndarray; + using arrayT = dpnp::tensor::usm_ndarray; using event_vecT = std::vector; { impl::populate_less_dispatch_tables(); @@ -142,4 +142,4 @@ void init_less(py::module_ m) } } -} // namespace dpctl::tensor::py_internal +} // namespace dpnp::tensor::py_internal diff --git a/dpnp/tensor/libtensor/source/elementwise_functions/less.hpp b/dpnp/tensor/libtensor/source/elementwise_functions/less.hpp index e08d84f380da..5ad3f3493bfb 100644 --- a/dpnp/tensor/libtensor/source/elementwise_functions/less.hpp +++ b/dpnp/tensor/libtensor/source/elementwise_functions/less.hpp @@ -29,7 +29,7 @@ //===---------------------------------------------------------------------===// /// /// \file -/// This file defines functions of dpctl.tensor._tensor_elementwise_impl +/// This file defines functions of dpnp.tensor._tensor_elementwise_impl /// extension, specifically functions for elementwise operations. //===---------------------------------------------------------------------===// @@ -38,9 +38,9 @@ namespace py = pybind11; -namespace dpctl::tensor::py_internal +namespace dpnp::tensor::py_internal { extern void init_less(py::module_ m); -} // namespace dpctl::tensor::py_internal +} // namespace dpnp::tensor::py_internal diff --git a/dpnp/tensor/libtensor/source/elementwise_functions/less_equal.cpp b/dpnp/tensor/libtensor/source/elementwise_functions/less_equal.cpp index 433969cead27..f107574ae1d1 100644 --- a/dpnp/tensor/libtensor/source/elementwise_functions/less_equal.cpp +++ b/dpnp/tensor/libtensor/source/elementwise_functions/less_equal.cpp @@ -29,7 +29,7 @@ //===---------------------------------------------------------------------===// /// /// \file -/// This file defines functions of dpctl.tensor._tensor_elementwise_impl +/// This file defines functions of dpnp.tensor._tensor_elementwise_impl /// extension, specifically functions for elementwise operations. //===---------------------------------------------------------------------===// @@ -49,13 +49,13 @@ #include "kernels/elementwise_functions/common.hpp" #include "kernels/elementwise_functions/less_equal.hpp" -namespace dpctl::tensor::py_internal +namespace dpnp::tensor::py_internal { namespace py = pybind11; -namespace td_ns = dpctl::tensor::type_dispatch; +namespace td_ns = dpnp::tensor::type_dispatch; -namespace ew_cmn_ns = dpctl::tensor::kernels::elementwise_common; +namespace ew_cmn_ns = dpnp::tensor::kernels::elementwise_common; using ew_cmn_ns::binary_contig_impl_fn_ptr_t; using ew_cmn_ns::binary_contig_matrix_contig_row_broadcast_impl_fn_ptr_t; using ew_cmn_ns::binary_contig_row_contig_matrix_broadcast_impl_fn_ptr_t; @@ -64,7 +64,7 @@ using ew_cmn_ns::binary_strided_impl_fn_ptr_t; // B14: ===== LESS_EQUAL (x1, x2) namespace impl { -namespace less_equal_fn_ns = dpctl::tensor::kernels::less_equal; +namespace less_equal_fn_ns = dpnp::tensor::kernels::less_equal; static binary_contig_impl_fn_ptr_t less_equal_contig_dispatch_table[td_ns::num_types][td_ns::num_types]; @@ -102,7 +102,7 @@ void populate_less_equal_dispatch_tables(void) void init_less_equal(py::module_ m) { - using arrayT = dpctl::tensor::usm_ndarray; + using arrayT = dpnp::tensor::usm_ndarray; using event_vecT = std::vector; { impl::populate_less_equal_dispatch_tables(); @@ -142,4 +142,4 @@ void init_less_equal(py::module_ m) } } -} // namespace dpctl::tensor::py_internal +} // namespace dpnp::tensor::py_internal diff --git a/dpnp/tensor/libtensor/source/elementwise_functions/less_equal.hpp b/dpnp/tensor/libtensor/source/elementwise_functions/less_equal.hpp index 8eeb837a35a7..a08080d8ffeb 100644 --- a/dpnp/tensor/libtensor/source/elementwise_functions/less_equal.hpp +++ b/dpnp/tensor/libtensor/source/elementwise_functions/less_equal.hpp @@ -29,7 +29,7 @@ //===---------------------------------------------------------------------===// /// /// \file -/// This file defines functions of dpctl.tensor._tensor_elementwise_impl +/// This file defines functions of dpnp.tensor._tensor_elementwise_impl /// extension, specifically functions for elementwise operations. //===---------------------------------------------------------------------===// @@ -38,9 +38,9 @@ namespace py = pybind11; -namespace dpctl::tensor::py_internal +namespace dpnp::tensor::py_internal { extern void init_less_equal(py::module_ m); -} // namespace dpctl::tensor::py_internal +} // namespace dpnp::tensor::py_internal diff --git a/dpnp/tensor/libtensor/source/elementwise_functions/log.cpp b/dpnp/tensor/libtensor/source/elementwise_functions/log.cpp index 2906304eaffa..144f1460c255 100644 --- a/dpnp/tensor/libtensor/source/elementwise_functions/log.cpp +++ b/dpnp/tensor/libtensor/source/elementwise_functions/log.cpp @@ -29,7 +29,7 @@ //===---------------------------------------------------------------------===// /// /// \file -/// This file defines functions of dpctl.tensor._tensor_elementwise_impl +/// This file defines functions of dpnp.tensor._tensor_elementwise_impl /// extension, specifically functions for elementwise operations. //===---------------------------------------------------------------------===// @@ -50,13 +50,13 @@ #include "kernels/elementwise_functions/common.hpp" #include "kernels/elementwise_functions/log.hpp" -namespace dpctl::tensor::py_internal +namespace dpnp::tensor::py_internal { namespace py = pybind11; -namespace td_ns = dpctl::tensor::type_dispatch; +namespace td_ns = dpnp::tensor::type_dispatch; -namespace ew_cmn_ns = dpctl::tensor::kernels::elementwise_common; +namespace ew_cmn_ns = dpnp::tensor::kernels::elementwise_common; using ew_cmn_ns::unary_contig_impl_fn_ptr_t; using ew_cmn_ns::unary_strided_impl_fn_ptr_t; @@ -64,7 +64,7 @@ using ew_cmn_ns::unary_strided_impl_fn_ptr_t; namespace impl { -namespace log_fn_ns = dpctl::tensor::kernels::log; +namespace log_fn_ns = dpnp::tensor::kernels::log; static unary_contig_impl_fn_ptr_t log_contig_dispatch_vector[td_ns::num_types]; static int log_output_typeid_vector[td_ns::num_types]; @@ -97,7 +97,7 @@ void populate_log_dispatch_vectors(void) void init_log(py::module_ m) { - using arrayT = dpctl::tensor::usm_ndarray; + using arrayT = dpnp::tensor::usm_ndarray; using event_vecT = std::vector; { impl::populate_log_dispatch_vectors(); @@ -122,4 +122,4 @@ void init_log(py::module_ m) } } -} // namespace dpctl::tensor::py_internal +} // namespace dpnp::tensor::py_internal diff --git a/dpnp/tensor/libtensor/source/elementwise_functions/log.hpp b/dpnp/tensor/libtensor/source/elementwise_functions/log.hpp index fb065e82e037..33e2e8fa724c 100644 --- a/dpnp/tensor/libtensor/source/elementwise_functions/log.hpp +++ b/dpnp/tensor/libtensor/source/elementwise_functions/log.hpp @@ -29,7 +29,7 @@ //===---------------------------------------------------------------------===// /// /// \file -/// This file defines functions of dpctl.tensor._tensor_elementwise_impl +/// This file defines functions of dpnp.tensor._tensor_elementwise_impl /// extension, specifically functions for elementwise operations. //===---------------------------------------------------------------------===// @@ -38,9 +38,9 @@ namespace py = pybind11; -namespace dpctl::tensor::py_internal +namespace dpnp::tensor::py_internal { extern void init_log(py::module_ m); -} // namespace dpctl::tensor::py_internal +} // namespace dpnp::tensor::py_internal diff --git a/dpnp/tensor/libtensor/source/elementwise_functions/log10.cpp b/dpnp/tensor/libtensor/source/elementwise_functions/log10.cpp index 9501af987341..aa045cd17fba 100644 --- a/dpnp/tensor/libtensor/source/elementwise_functions/log10.cpp +++ b/dpnp/tensor/libtensor/source/elementwise_functions/log10.cpp @@ -29,7 +29,7 @@ //===---------------------------------------------------------------------===// /// /// \file -/// This file defines functions of dpctl.tensor._tensor_elementwise_impl +/// This file defines functions of dpnp.tensor._tensor_elementwise_impl /// extension, specifically functions for elementwise operations. //===---------------------------------------------------------------------===// @@ -50,13 +50,13 @@ #include "kernels/elementwise_functions/common.hpp" #include "kernels/elementwise_functions/log10.hpp" -namespace dpctl::tensor::py_internal +namespace dpnp::tensor::py_internal { namespace py = pybind11; -namespace td_ns = dpctl::tensor::type_dispatch; +namespace td_ns = dpnp::tensor::type_dispatch; -namespace ew_cmn_ns = dpctl::tensor::kernels::elementwise_common; +namespace ew_cmn_ns = dpnp::tensor::kernels::elementwise_common; using ew_cmn_ns::unary_contig_impl_fn_ptr_t; using ew_cmn_ns::unary_strided_impl_fn_ptr_t; @@ -64,7 +64,7 @@ using ew_cmn_ns::unary_strided_impl_fn_ptr_t; namespace impl { -namespace log10_fn_ns = dpctl::tensor::kernels::log10; +namespace log10_fn_ns = dpnp::tensor::kernels::log10; static unary_contig_impl_fn_ptr_t log10_contig_dispatch_vector[td_ns::num_types]; @@ -98,7 +98,7 @@ void populate_log10_dispatch_vectors(void) void init_log10(py::module_ m) { - using arrayT = dpctl::tensor::usm_ndarray; + using arrayT = dpnp::tensor::usm_ndarray; using event_vecT = std::vector; { impl::populate_log10_dispatch_vectors(); @@ -124,4 +124,4 @@ void init_log10(py::module_ m) } } -} // namespace dpctl::tensor::py_internal +} // namespace dpnp::tensor::py_internal diff --git a/dpnp/tensor/libtensor/source/elementwise_functions/log10.hpp b/dpnp/tensor/libtensor/source/elementwise_functions/log10.hpp index 779b15472462..fb13329ef7e8 100644 --- a/dpnp/tensor/libtensor/source/elementwise_functions/log10.hpp +++ b/dpnp/tensor/libtensor/source/elementwise_functions/log10.hpp @@ -29,7 +29,7 @@ //===---------------------------------------------------------------------===// /// /// \file -/// This file defines functions of dpctl.tensor._tensor_elementwise_impl +/// This file defines functions of dpnp.tensor._tensor_elementwise_impl /// extension, specifically functions for elementwise operations. //===---------------------------------------------------------------------===// @@ -38,9 +38,9 @@ namespace py = pybind11; -namespace dpctl::tensor::py_internal +namespace dpnp::tensor::py_internal { extern void init_log10(py::module_ m); -} // namespace dpctl::tensor::py_internal +} // namespace dpnp::tensor::py_internal diff --git a/dpnp/tensor/libtensor/source/elementwise_functions/log1p.cpp b/dpnp/tensor/libtensor/source/elementwise_functions/log1p.cpp index c94b3f3b5d7d..9878bb64a272 100644 --- a/dpnp/tensor/libtensor/source/elementwise_functions/log1p.cpp +++ b/dpnp/tensor/libtensor/source/elementwise_functions/log1p.cpp @@ -29,7 +29,7 @@ //===---------------------------------------------------------------------===// /// /// \file -/// This file defines functions of dpctl.tensor._tensor_elementwise_impl +/// This file defines functions of dpnp.tensor._tensor_elementwise_impl /// extension, specifically functions for elementwise operations. //===---------------------------------------------------------------------===// @@ -50,13 +50,13 @@ #include "kernels/elementwise_functions/common.hpp" #include "kernels/elementwise_functions/log1p.hpp" -namespace dpctl::tensor::py_internal +namespace dpnp::tensor::py_internal { namespace py = pybind11; -namespace td_ns = dpctl::tensor::type_dispatch; +namespace td_ns = dpnp::tensor::type_dispatch; -namespace ew_cmn_ns = dpctl::tensor::kernels::elementwise_common; +namespace ew_cmn_ns = dpnp::tensor::kernels::elementwise_common; using ew_cmn_ns::unary_contig_impl_fn_ptr_t; using ew_cmn_ns::unary_strided_impl_fn_ptr_t; @@ -64,7 +64,7 @@ using ew_cmn_ns::unary_strided_impl_fn_ptr_t; namespace impl { -namespace log1p_fn_ns = dpctl::tensor::kernels::log1p; +namespace log1p_fn_ns = dpnp::tensor::kernels::log1p; static unary_contig_impl_fn_ptr_t log1p_contig_dispatch_vector[td_ns::num_types]; @@ -98,7 +98,7 @@ void populate_log1p_dispatch_vectors(void) void init_log1p(py::module_ m) { - using arrayT = dpctl::tensor::usm_ndarray; + using arrayT = dpnp::tensor::usm_ndarray; using event_vecT = std::vector; { impl::populate_log1p_dispatch_vectors(); @@ -124,4 +124,4 @@ void init_log1p(py::module_ m) } } -} // namespace dpctl::tensor::py_internal +} // namespace dpnp::tensor::py_internal diff --git a/dpnp/tensor/libtensor/source/elementwise_functions/log1p.hpp b/dpnp/tensor/libtensor/source/elementwise_functions/log1p.hpp index 85bf21c8ea48..fefaea420094 100644 --- a/dpnp/tensor/libtensor/source/elementwise_functions/log1p.hpp +++ b/dpnp/tensor/libtensor/source/elementwise_functions/log1p.hpp @@ -29,7 +29,7 @@ //===---------------------------------------------------------------------===// /// /// \file -/// This file defines functions of dpctl.tensor._tensor_elementwise_impl +/// This file defines functions of dpnp.tensor._tensor_elementwise_impl /// extension, specifically functions for elementwise operations. //===---------------------------------------------------------------------===// @@ -38,9 +38,9 @@ namespace py = pybind11; -namespace dpctl::tensor::py_internal +namespace dpnp::tensor::py_internal { extern void init_log1p(py::module_ m); -} // namespace dpctl::tensor::py_internal +} // namespace dpnp::tensor::py_internal diff --git a/dpnp/tensor/libtensor/source/elementwise_functions/log2.cpp b/dpnp/tensor/libtensor/source/elementwise_functions/log2.cpp index 825d516f7820..771d8e6b557b 100644 --- a/dpnp/tensor/libtensor/source/elementwise_functions/log2.cpp +++ b/dpnp/tensor/libtensor/source/elementwise_functions/log2.cpp @@ -29,7 +29,7 @@ //===---------------------------------------------------------------------===// /// /// \file -/// This file defines functions of dpctl.tensor._tensor_elementwise_impl +/// This file defines functions of dpnp.tensor._tensor_elementwise_impl /// extension, specifically functions for elementwise operations. //===---------------------------------------------------------------------===// @@ -50,13 +50,13 @@ #include "kernels/elementwise_functions/common.hpp" #include "kernels/elementwise_functions/log2.hpp" -namespace dpctl::tensor::py_internal +namespace dpnp::tensor::py_internal { namespace py = pybind11; -namespace td_ns = dpctl::tensor::type_dispatch; +namespace td_ns = dpnp::tensor::type_dispatch; -namespace ew_cmn_ns = dpctl::tensor::kernels::elementwise_common; +namespace ew_cmn_ns = dpnp::tensor::kernels::elementwise_common; using ew_cmn_ns::unary_contig_impl_fn_ptr_t; using ew_cmn_ns::unary_strided_impl_fn_ptr_t; @@ -64,7 +64,7 @@ using ew_cmn_ns::unary_strided_impl_fn_ptr_t; namespace impl { -namespace log2_fn_ns = dpctl::tensor::kernels::log2; +namespace log2_fn_ns = dpnp::tensor::kernels::log2; static unary_contig_impl_fn_ptr_t log2_contig_dispatch_vector[td_ns::num_types]; static int log2_output_typeid_vector[td_ns::num_types]; @@ -97,7 +97,7 @@ void populate_log2_dispatch_vectors(void) void init_log2(py::module_ m) { - using arrayT = dpctl::tensor::usm_ndarray; + using arrayT = dpnp::tensor::usm_ndarray; using event_vecT = std::vector; { impl::populate_log2_dispatch_vectors(); @@ -122,4 +122,4 @@ void init_log2(py::module_ m) } } -} // namespace dpctl::tensor::py_internal +} // namespace dpnp::tensor::py_internal diff --git a/dpnp/tensor/libtensor/source/elementwise_functions/log2.hpp b/dpnp/tensor/libtensor/source/elementwise_functions/log2.hpp index 11f757b1449d..52d9cc0e43eb 100644 --- a/dpnp/tensor/libtensor/source/elementwise_functions/log2.hpp +++ b/dpnp/tensor/libtensor/source/elementwise_functions/log2.hpp @@ -29,7 +29,7 @@ //===---------------------------------------------------------------------===// /// /// \file -/// This file defines functions of dpctl.tensor._tensor_elementwise_impl +/// This file defines functions of dpnp.tensor._tensor_elementwise_impl /// extension, specifically functions for elementwise operations. //===---------------------------------------------------------------------===// @@ -38,9 +38,9 @@ namespace py = pybind11; -namespace dpctl::tensor::py_internal +namespace dpnp::tensor::py_internal { extern void init_log2(py::module_ m); -} // namespace dpctl::tensor::py_internal +} // namespace dpnp::tensor::py_internal diff --git a/dpnp/tensor/libtensor/source/elementwise_functions/logaddexp.cpp b/dpnp/tensor/libtensor/source/elementwise_functions/logaddexp.cpp index 71bc9cad4035..baff7b112e6a 100644 --- a/dpnp/tensor/libtensor/source/elementwise_functions/logaddexp.cpp +++ b/dpnp/tensor/libtensor/source/elementwise_functions/logaddexp.cpp @@ -29,7 +29,7 @@ //===---------------------------------------------------------------------===// /// /// \file -/// This file defines functions of dpctl.tensor._tensor_elementwise_impl +/// This file defines functions of dpnp.tensor._tensor_elementwise_impl /// extension, specifically functions for elementwise operations. //===---------------------------------------------------------------------===// @@ -49,13 +49,13 @@ #include "kernels/elementwise_functions/common.hpp" #include "kernels/elementwise_functions/logaddexp.hpp" -namespace dpctl::tensor::py_internal +namespace dpnp::tensor::py_internal { namespace py = pybind11; -namespace td_ns = dpctl::tensor::type_dispatch; +namespace td_ns = dpnp::tensor::type_dispatch; -namespace ew_cmn_ns = dpctl::tensor::kernels::elementwise_common; +namespace ew_cmn_ns = dpnp::tensor::kernels::elementwise_common; using ew_cmn_ns::binary_contig_impl_fn_ptr_t; using ew_cmn_ns::binary_contig_matrix_contig_row_broadcast_impl_fn_ptr_t; using ew_cmn_ns::binary_contig_row_contig_matrix_broadcast_impl_fn_ptr_t; @@ -64,7 +64,7 @@ using ew_cmn_ns::binary_strided_impl_fn_ptr_t; // B15: ===== LOGADDEXP (x1, x2) namespace impl { -namespace logaddexp_fn_ns = dpctl::tensor::kernels::logaddexp; +namespace logaddexp_fn_ns = dpnp::tensor::kernels::logaddexp; static binary_contig_impl_fn_ptr_t logaddexp_contig_dispatch_table[td_ns::num_types][td_ns::num_types]; @@ -102,7 +102,7 @@ void populate_logaddexp_dispatch_tables(void) void init_logaddexp(py::module_ m) { - using arrayT = dpctl::tensor::usm_ndarray; + using arrayT = dpnp::tensor::usm_ndarray; using event_vecT = std::vector; { impl::populate_logaddexp_dispatch_tables(); @@ -142,4 +142,4 @@ void init_logaddexp(py::module_ m) } } -} // namespace dpctl::tensor::py_internal +} // namespace dpnp::tensor::py_internal diff --git a/dpnp/tensor/libtensor/source/elementwise_functions/logaddexp.hpp b/dpnp/tensor/libtensor/source/elementwise_functions/logaddexp.hpp index 2c4efa7d0c56..5a2ef0e3300e 100644 --- a/dpnp/tensor/libtensor/source/elementwise_functions/logaddexp.hpp +++ b/dpnp/tensor/libtensor/source/elementwise_functions/logaddexp.hpp @@ -29,7 +29,7 @@ //===---------------------------------------------------------------------===// /// /// \file -/// This file defines functions of dpctl.tensor._tensor_elementwise_impl +/// This file defines functions of dpnp.tensor._tensor_elementwise_impl /// extension, specifically functions for elementwise operations. //===---------------------------------------------------------------------===// @@ -38,9 +38,9 @@ namespace py = pybind11; -namespace dpctl::tensor::py_internal +namespace dpnp::tensor::py_internal { extern void init_logaddexp(py::module_ m); -} // namespace dpctl::tensor::py_internal +} // namespace dpnp::tensor::py_internal diff --git a/dpnp/tensor/libtensor/source/elementwise_functions/logical_and.cpp b/dpnp/tensor/libtensor/source/elementwise_functions/logical_and.cpp index 90c0b52a6aa2..d4d0c0f71326 100644 --- a/dpnp/tensor/libtensor/source/elementwise_functions/logical_and.cpp +++ b/dpnp/tensor/libtensor/source/elementwise_functions/logical_and.cpp @@ -29,7 +29,7 @@ //===---------------------------------------------------------------------===// /// /// \file -/// This file defines functions of dpctl.tensor._tensor_elementwise_impl +/// This file defines functions of dpnp.tensor._tensor_elementwise_impl /// extension, specifically functions for elementwise operations. //===---------------------------------------------------------------------===// @@ -50,13 +50,13 @@ #include "kernels/elementwise_functions/common.hpp" #include "kernels/elementwise_functions/logical_and.hpp" -namespace dpctl::tensor::py_internal +namespace dpnp::tensor::py_internal { namespace py = pybind11; -namespace td_ns = dpctl::tensor::type_dispatch; +namespace td_ns = dpnp::tensor::type_dispatch; -namespace ew_cmn_ns = dpctl::tensor::kernels::elementwise_common; +namespace ew_cmn_ns = dpnp::tensor::kernels::elementwise_common; using ew_cmn_ns::binary_contig_impl_fn_ptr_t; using ew_cmn_ns::binary_contig_matrix_contig_row_broadcast_impl_fn_ptr_t; using ew_cmn_ns::binary_contig_row_contig_matrix_broadcast_impl_fn_ptr_t; @@ -65,7 +65,7 @@ using ew_cmn_ns::binary_strided_impl_fn_ptr_t; // B16: ===== LOGICAL_AND (x1, x2) namespace impl { -namespace logical_and_fn_ns = dpctl::tensor::kernels::logical_and; +namespace logical_and_fn_ns = dpnp::tensor::kernels::logical_and; static binary_contig_impl_fn_ptr_t logical_and_contig_dispatch_table[td_ns::num_types][td_ns::num_types]; @@ -103,7 +103,7 @@ void populate_logical_and_dispatch_tables(void) void init_logical_and(py::module_ m) { - using arrayT = dpctl::tensor::usm_ndarray; + using arrayT = dpnp::tensor::usm_ndarray; using event_vecT = std::vector; { impl::populate_logical_and_dispatch_tables(); @@ -143,4 +143,4 @@ void init_logical_and(py::module_ m) } } -} // namespace dpctl::tensor::py_internal +} // namespace dpnp::tensor::py_internal diff --git a/dpnp/tensor/libtensor/source/elementwise_functions/logical_and.hpp b/dpnp/tensor/libtensor/source/elementwise_functions/logical_and.hpp index c22a98f24146..0577af8a95b1 100644 --- a/dpnp/tensor/libtensor/source/elementwise_functions/logical_and.hpp +++ b/dpnp/tensor/libtensor/source/elementwise_functions/logical_and.hpp @@ -29,7 +29,7 @@ //===---------------------------------------------------------------------===// /// /// \file -/// This file defines functions of dpctl.tensor._tensor_elementwise_impl +/// This file defines functions of dpnp.tensor._tensor_elementwise_impl /// extension, specifically functions for elementwise operations. //===---------------------------------------------------------------------===// @@ -38,9 +38,9 @@ namespace py = pybind11; -namespace dpctl::tensor::py_internal +namespace dpnp::tensor::py_internal { extern void init_logical_and(py::module_ m); -} // namespace dpctl::tensor::py_internal +} // namespace dpnp::tensor::py_internal diff --git a/dpnp/tensor/libtensor/source/elementwise_functions/logical_not.cpp b/dpnp/tensor/libtensor/source/elementwise_functions/logical_not.cpp index e8f5845fac16..a3516889f53a 100644 --- a/dpnp/tensor/libtensor/source/elementwise_functions/logical_not.cpp +++ b/dpnp/tensor/libtensor/source/elementwise_functions/logical_not.cpp @@ -29,7 +29,7 @@ //===---------------------------------------------------------------------===// /// /// \file -/// This file defines functions of dpctl.tensor._tensor_elementwise_impl +/// This file defines functions of dpnp.tensor._tensor_elementwise_impl /// extension, specifically functions for elementwise operations. //===---------------------------------------------------------------------===// @@ -50,13 +50,13 @@ #include "kernels/elementwise_functions/common.hpp" #include "kernels/elementwise_functions/logical_not.hpp" -namespace dpctl::tensor::py_internal +namespace dpnp::tensor::py_internal { namespace py = pybind11; -namespace td_ns = dpctl::tensor::type_dispatch; +namespace td_ns = dpnp::tensor::type_dispatch; -namespace ew_cmn_ns = dpctl::tensor::kernels::elementwise_common; +namespace ew_cmn_ns = dpnp::tensor::kernels::elementwise_common; using ew_cmn_ns::unary_contig_impl_fn_ptr_t; using ew_cmn_ns::unary_strided_impl_fn_ptr_t; @@ -64,7 +64,7 @@ using ew_cmn_ns::unary_strided_impl_fn_ptr_t; namespace impl { -namespace logical_not_fn_ns = dpctl::tensor::kernels::logical_not; +namespace logical_not_fn_ns = dpnp::tensor::kernels::logical_not; static unary_contig_impl_fn_ptr_t logical_not_contig_dispatch_vector[td_ns::num_types]; @@ -98,7 +98,7 @@ void populate_logical_not_dispatch_vectors(void) void init_logical_not(py::module_ m) { - using arrayT = dpctl::tensor::usm_ndarray; + using arrayT = dpnp::tensor::usm_ndarray; using event_vecT = std::vector; { impl::populate_logical_not_dispatch_vectors(); @@ -126,4 +126,4 @@ void init_logical_not(py::module_ m) } } -} // namespace dpctl::tensor::py_internal +} // namespace dpnp::tensor::py_internal diff --git a/dpnp/tensor/libtensor/source/elementwise_functions/logical_not.hpp b/dpnp/tensor/libtensor/source/elementwise_functions/logical_not.hpp index f3bb79cc28cc..69f4c5101af0 100644 --- a/dpnp/tensor/libtensor/source/elementwise_functions/logical_not.hpp +++ b/dpnp/tensor/libtensor/source/elementwise_functions/logical_not.hpp @@ -29,7 +29,7 @@ //===---------------------------------------------------------------------===// /// /// \file -/// This file defines functions of dpctl.tensor._tensor_elementwise_impl +/// This file defines functions of dpnp.tensor._tensor_elementwise_impl /// extension, specifically functions for elementwise operations. //===---------------------------------------------------------------------===// @@ -38,9 +38,9 @@ namespace py = pybind11; -namespace dpctl::tensor::py_internal +namespace dpnp::tensor::py_internal { extern void init_logical_not(py::module_ m); -} // namespace dpctl::tensor::py_internal +} // namespace dpnp::tensor::py_internal diff --git a/dpnp/tensor/libtensor/source/elementwise_functions/logical_or.cpp b/dpnp/tensor/libtensor/source/elementwise_functions/logical_or.cpp index 38c981792345..c9a8456a4f98 100644 --- a/dpnp/tensor/libtensor/source/elementwise_functions/logical_or.cpp +++ b/dpnp/tensor/libtensor/source/elementwise_functions/logical_or.cpp @@ -29,7 +29,7 @@ //===---------------------------------------------------------------------===// /// /// \file -/// This file defines functions of dpctl.tensor._tensor_elementwise_impl +/// This file defines functions of dpnp.tensor._tensor_elementwise_impl /// extension, specifically functions for elementwise operations. //===---------------------------------------------------------------------===// @@ -50,13 +50,13 @@ #include "kernels/elementwise_functions/common.hpp" #include "kernels/elementwise_functions/logical_or.hpp" -namespace dpctl::tensor::py_internal +namespace dpnp::tensor::py_internal { namespace py = pybind11; -namespace td_ns = dpctl::tensor::type_dispatch; +namespace td_ns = dpnp::tensor::type_dispatch; -namespace ew_cmn_ns = dpctl::tensor::kernels::elementwise_common; +namespace ew_cmn_ns = dpnp::tensor::kernels::elementwise_common; using ew_cmn_ns::binary_contig_impl_fn_ptr_t; using ew_cmn_ns::binary_contig_matrix_contig_row_broadcast_impl_fn_ptr_t; using ew_cmn_ns::binary_contig_row_contig_matrix_broadcast_impl_fn_ptr_t; @@ -65,7 +65,7 @@ using ew_cmn_ns::binary_strided_impl_fn_ptr_t; // B17: ===== LOGICAL_OR (x1, x2) namespace impl { -namespace logical_or_fn_ns = dpctl::tensor::kernels::logical_or; +namespace logical_or_fn_ns = dpnp::tensor::kernels::logical_or; static binary_contig_impl_fn_ptr_t logical_or_contig_dispatch_table[td_ns::num_types][td_ns::num_types]; @@ -103,7 +103,7 @@ void populate_logical_or_dispatch_tables(void) void init_logical_or(py::module_ m) { - using arrayT = dpctl::tensor::usm_ndarray; + using arrayT = dpnp::tensor::usm_ndarray; using event_vecT = std::vector; { impl::populate_logical_or_dispatch_tables(); @@ -143,4 +143,4 @@ void init_logical_or(py::module_ m) } } -} // namespace dpctl::tensor::py_internal +} // namespace dpnp::tensor::py_internal diff --git a/dpnp/tensor/libtensor/source/elementwise_functions/logical_or.hpp b/dpnp/tensor/libtensor/source/elementwise_functions/logical_or.hpp index 11e83fe8cedf..61ddaef4d415 100644 --- a/dpnp/tensor/libtensor/source/elementwise_functions/logical_or.hpp +++ b/dpnp/tensor/libtensor/source/elementwise_functions/logical_or.hpp @@ -29,7 +29,7 @@ //===---------------------------------------------------------------------===// /// /// \file -/// This file defines functions of dpctl.tensor._tensor_elementwise_impl +/// This file defines functions of dpnp.tensor._tensor_elementwise_impl /// extension, specifically functions for elementwise operations. //===---------------------------------------------------------------------===// @@ -38,9 +38,9 @@ namespace py = pybind11; -namespace dpctl::tensor::py_internal +namespace dpnp::tensor::py_internal { extern void init_logical_or(py::module_ m); -} // namespace dpctl::tensor::py_internal +} // namespace dpnp::tensor::py_internal diff --git a/dpnp/tensor/libtensor/source/elementwise_functions/logical_xor.cpp b/dpnp/tensor/libtensor/source/elementwise_functions/logical_xor.cpp index 759133ca6120..a52f35f3ec38 100644 --- a/dpnp/tensor/libtensor/source/elementwise_functions/logical_xor.cpp +++ b/dpnp/tensor/libtensor/source/elementwise_functions/logical_xor.cpp @@ -29,7 +29,7 @@ //===---------------------------------------------------------------------===// /// /// \file -/// This file defines functions of dpctl.tensor._tensor_elementwise_impl +/// This file defines functions of dpnp.tensor._tensor_elementwise_impl /// extension, specifically functions for elementwise operations. //===---------------------------------------------------------------------===// @@ -50,13 +50,13 @@ #include "kernels/elementwise_functions/common.hpp" #include "kernels/elementwise_functions/logical_xor.hpp" -namespace dpctl::tensor::py_internal +namespace dpnp::tensor::py_internal { namespace py = pybind11; -namespace td_ns = dpctl::tensor::type_dispatch; +namespace td_ns = dpnp::tensor::type_dispatch; -namespace ew_cmn_ns = dpctl::tensor::kernels::elementwise_common; +namespace ew_cmn_ns = dpnp::tensor::kernels::elementwise_common; using ew_cmn_ns::binary_contig_impl_fn_ptr_t; using ew_cmn_ns::binary_contig_matrix_contig_row_broadcast_impl_fn_ptr_t; using ew_cmn_ns::binary_contig_row_contig_matrix_broadcast_impl_fn_ptr_t; @@ -65,7 +65,7 @@ using ew_cmn_ns::binary_strided_impl_fn_ptr_t; // B18: ===== LOGICAL_XOR (x1, x2) namespace impl { -namespace logical_xor_fn_ns = dpctl::tensor::kernels::logical_xor; +namespace logical_xor_fn_ns = dpnp::tensor::kernels::logical_xor; static binary_contig_impl_fn_ptr_t logical_xor_contig_dispatch_table[td_ns::num_types][td_ns::num_types]; @@ -103,7 +103,7 @@ void populate_logical_xor_dispatch_tables(void) void init_logical_xor(py::module_ m) { - using arrayT = dpctl::tensor::usm_ndarray; + using arrayT = dpnp::tensor::usm_ndarray; using event_vecT = std::vector; { impl::populate_logical_xor_dispatch_tables(); @@ -143,4 +143,4 @@ void init_logical_xor(py::module_ m) } } -} // namespace dpctl::tensor::py_internal +} // namespace dpnp::tensor::py_internal diff --git a/dpnp/tensor/libtensor/source/elementwise_functions/logical_xor.hpp b/dpnp/tensor/libtensor/source/elementwise_functions/logical_xor.hpp index 24c163249128..93906f1036c9 100644 --- a/dpnp/tensor/libtensor/source/elementwise_functions/logical_xor.hpp +++ b/dpnp/tensor/libtensor/source/elementwise_functions/logical_xor.hpp @@ -29,7 +29,7 @@ //===---------------------------------------------------------------------===// /// /// \file -/// This file defines functions of dpctl.tensor._tensor_elementwise_impl +/// This file defines functions of dpnp.tensor._tensor_elementwise_impl /// extension, specifically functions for elementwise operations. //===---------------------------------------------------------------------===// @@ -38,9 +38,9 @@ namespace py = pybind11; -namespace dpctl::tensor::py_internal +namespace dpnp::tensor::py_internal { extern void init_logical_xor(py::module_ m); -} // namespace dpctl::tensor::py_internal +} // namespace dpnp::tensor::py_internal diff --git a/dpnp/tensor/libtensor/source/elementwise_functions/maximum.cpp b/dpnp/tensor/libtensor/source/elementwise_functions/maximum.cpp index 8fda65c43dca..fd73d4ef8f87 100644 --- a/dpnp/tensor/libtensor/source/elementwise_functions/maximum.cpp +++ b/dpnp/tensor/libtensor/source/elementwise_functions/maximum.cpp @@ -29,7 +29,7 @@ //===---------------------------------------------------------------------===// /// /// \file -/// This file defines functions of dpctl.tensor._tensor_elementwise_impl +/// This file defines functions of dpnp.tensor._tensor_elementwise_impl /// extension, specifically functions for elementwise operations. //===---------------------------------------------------------------------===// @@ -50,13 +50,13 @@ #include "kernels/elementwise_functions/common.hpp" #include "kernels/elementwise_functions/maximum.hpp" -namespace dpctl::tensor::py_internal +namespace dpnp::tensor::py_internal { namespace py = pybind11; -namespace td_ns = dpctl::tensor::type_dispatch; +namespace td_ns = dpnp::tensor::type_dispatch; -namespace ew_cmn_ns = dpctl::tensor::kernels::elementwise_common; +namespace ew_cmn_ns = dpnp::tensor::kernels::elementwise_common; using ew_cmn_ns::binary_contig_impl_fn_ptr_t; using ew_cmn_ns::binary_contig_matrix_contig_row_broadcast_impl_fn_ptr_t; using ew_cmn_ns::binary_contig_row_contig_matrix_broadcast_impl_fn_ptr_t; @@ -65,7 +65,7 @@ using ew_cmn_ns::binary_strided_impl_fn_ptr_t; // B26: ===== MAXIMUM (x1, x2) namespace impl { -namespace maximum_fn_ns = dpctl::tensor::kernels::maximum; +namespace maximum_fn_ns = dpnp::tensor::kernels::maximum; static binary_contig_impl_fn_ptr_t maximum_contig_dispatch_table[td_ns::num_types][td_ns::num_types]; @@ -103,7 +103,7 @@ void populate_maximum_dispatch_tables(void) void init_maximum(py::module_ m) { - using arrayT = dpctl::tensor::usm_ndarray; + using arrayT = dpnp::tensor::usm_ndarray; using event_vecT = std::vector; { impl::populate_maximum_dispatch_tables(); @@ -143,4 +143,4 @@ void init_maximum(py::module_ m) } } -} // namespace dpctl::tensor::py_internal +} // namespace dpnp::tensor::py_internal diff --git a/dpnp/tensor/libtensor/source/elementwise_functions/maximum.hpp b/dpnp/tensor/libtensor/source/elementwise_functions/maximum.hpp index 1f8fc027ac1d..b13716cc4ae0 100644 --- a/dpnp/tensor/libtensor/source/elementwise_functions/maximum.hpp +++ b/dpnp/tensor/libtensor/source/elementwise_functions/maximum.hpp @@ -29,7 +29,7 @@ //===---------------------------------------------------------------------===// /// /// \file -/// This file defines functions of dpctl.tensor._tensor_elementwise_impl +/// This file defines functions of dpnp.tensor._tensor_elementwise_impl /// extension, specifically functions for elementwise operations. //===---------------------------------------------------------------------===// @@ -38,9 +38,9 @@ namespace py = pybind11; -namespace dpctl::tensor::py_internal +namespace dpnp::tensor::py_internal { extern void init_maximum(py::module_ m); -} // namespace dpctl::tensor::py_internal +} // namespace dpnp::tensor::py_internal diff --git a/dpnp/tensor/libtensor/source/elementwise_functions/minimum.cpp b/dpnp/tensor/libtensor/source/elementwise_functions/minimum.cpp index 7055ce5c72f5..f59513af7db9 100644 --- a/dpnp/tensor/libtensor/source/elementwise_functions/minimum.cpp +++ b/dpnp/tensor/libtensor/source/elementwise_functions/minimum.cpp @@ -29,7 +29,7 @@ //===---------------------------------------------------------------------===// /// /// \file -/// This file defines functions of dpctl.tensor._tensor_elementwise_impl +/// This file defines functions of dpnp.tensor._tensor_elementwise_impl /// extension, specifically functions for elementwise operations. //===---------------------------------------------------------------------===// @@ -50,13 +50,13 @@ #include "kernels/elementwise_functions/common.hpp" #include "kernels/elementwise_functions/minimum.hpp" -namespace dpctl::tensor::py_internal +namespace dpnp::tensor::py_internal { namespace py = pybind11; -namespace td_ns = dpctl::tensor::type_dispatch; +namespace td_ns = dpnp::tensor::type_dispatch; -namespace ew_cmn_ns = dpctl::tensor::kernels::elementwise_common; +namespace ew_cmn_ns = dpnp::tensor::kernels::elementwise_common; using ew_cmn_ns::binary_contig_impl_fn_ptr_t; using ew_cmn_ns::binary_contig_matrix_contig_row_broadcast_impl_fn_ptr_t; using ew_cmn_ns::binary_contig_row_contig_matrix_broadcast_impl_fn_ptr_t; @@ -65,7 +65,7 @@ using ew_cmn_ns::binary_strided_impl_fn_ptr_t; // B27: ===== MINIMUM (x1, x2) namespace impl { -namespace minimum_fn_ns = dpctl::tensor::kernels::minimum; +namespace minimum_fn_ns = dpnp::tensor::kernels::minimum; static binary_contig_impl_fn_ptr_t minimum_contig_dispatch_table[td_ns::num_types][td_ns::num_types]; @@ -103,7 +103,7 @@ void populate_minimum_dispatch_tables(void) void init_minimum(py::module_ m) { - using arrayT = dpctl::tensor::usm_ndarray; + using arrayT = dpnp::tensor::usm_ndarray; using event_vecT = std::vector; { impl::populate_minimum_dispatch_tables(); @@ -143,4 +143,4 @@ void init_minimum(py::module_ m) } } -} // namespace dpctl::tensor::py_internal +} // namespace dpnp::tensor::py_internal diff --git a/dpnp/tensor/libtensor/source/elementwise_functions/minimum.hpp b/dpnp/tensor/libtensor/source/elementwise_functions/minimum.hpp index be2e18a9b37c..ba9e1cd31880 100644 --- a/dpnp/tensor/libtensor/source/elementwise_functions/minimum.hpp +++ b/dpnp/tensor/libtensor/source/elementwise_functions/minimum.hpp @@ -29,7 +29,7 @@ //===---------------------------------------------------------------------===// /// /// \file -/// This file defines functions of dpctl.tensor._tensor_elementwise_impl +/// This file defines functions of dpnp.tensor._tensor_elementwise_impl /// extension, specifically functions for elementwise operations. //===---------------------------------------------------------------------===// @@ -38,9 +38,9 @@ namespace py = pybind11; -namespace dpctl::tensor::py_internal +namespace dpnp::tensor::py_internal { extern void init_minimum(py::module_ m); -} // namespace dpctl::tensor::py_internal +} // namespace dpnp::tensor::py_internal diff --git a/dpnp/tensor/libtensor/source/elementwise_functions/multiply.cpp b/dpnp/tensor/libtensor/source/elementwise_functions/multiply.cpp index 5d25f8cc7b19..5eac5f7e06cf 100644 --- a/dpnp/tensor/libtensor/source/elementwise_functions/multiply.cpp +++ b/dpnp/tensor/libtensor/source/elementwise_functions/multiply.cpp @@ -29,7 +29,7 @@ //===---------------------------------------------------------------------===// /// /// \file -/// This file defines functions of dpctl.tensor._tensor_elementwise_impl +/// This file defines functions of dpnp.tensor._tensor_elementwise_impl /// extension, specifically functions for elementwise operations. //===---------------------------------------------------------------------===// @@ -51,13 +51,13 @@ #include "kernels/elementwise_functions/common_inplace.hpp" #include "kernels/elementwise_functions/multiply.hpp" -namespace dpctl::tensor::py_internal +namespace dpnp::tensor::py_internal { namespace py = pybind11; -namespace td_ns = dpctl::tensor::type_dispatch; +namespace td_ns = dpnp::tensor::type_dispatch; -namespace ew_cmn_ns = dpctl::tensor::kernels::elementwise_common; +namespace ew_cmn_ns = dpnp::tensor::kernels::elementwise_common; using ew_cmn_ns::binary_contig_impl_fn_ptr_t; using ew_cmn_ns::binary_contig_matrix_contig_row_broadcast_impl_fn_ptr_t; using ew_cmn_ns::binary_contig_row_contig_matrix_broadcast_impl_fn_ptr_t; @@ -71,7 +71,7 @@ using ew_cmn_ns::binary_inplace_strided_impl_fn_ptr_t; namespace impl { -namespace multiply_fn_ns = dpctl::tensor::kernels::multiply; +namespace multiply_fn_ns = dpnp::tensor::kernels::multiply; static binary_contig_impl_fn_ptr_t multiply_contig_dispatch_table[td_ns::num_types][td_ns::num_types]; @@ -176,7 +176,7 @@ void populate_multiply_dispatch_tables(void) void init_multiply(py::module_ m) { - using arrayT = dpctl::tensor::usm_ndarray; + using arrayT = dpnp::tensor::usm_ndarray; using event_vecT = std::vector; { impl::populate_multiply_dispatch_tables(); @@ -241,4 +241,4 @@ void init_multiply(py::module_ m) } } -} // namespace dpctl::tensor::py_internal +} // namespace dpnp::tensor::py_internal diff --git a/dpnp/tensor/libtensor/source/elementwise_functions/multiply.hpp b/dpnp/tensor/libtensor/source/elementwise_functions/multiply.hpp index a4ed946a8501..728ba00b56ba 100644 --- a/dpnp/tensor/libtensor/source/elementwise_functions/multiply.hpp +++ b/dpnp/tensor/libtensor/source/elementwise_functions/multiply.hpp @@ -29,7 +29,7 @@ //===---------------------------------------------------------------------===// /// /// \file -/// This file defines functions of dpctl.tensor._tensor_elementwise_impl +/// This file defines functions of dpnp.tensor._tensor_elementwise_impl /// extension, specifically functions for elementwise operations. //===---------------------------------------------------------------------===// @@ -38,9 +38,9 @@ namespace py = pybind11; -namespace dpctl::tensor::py_internal +namespace dpnp::tensor::py_internal { extern void init_multiply(py::module_ m); -} // namespace dpctl::tensor::py_internal +} // namespace dpnp::tensor::py_internal diff --git a/dpnp/tensor/libtensor/source/elementwise_functions/negative.cpp b/dpnp/tensor/libtensor/source/elementwise_functions/negative.cpp index 8510a15eab00..79e9921b4c71 100644 --- a/dpnp/tensor/libtensor/source/elementwise_functions/negative.cpp +++ b/dpnp/tensor/libtensor/source/elementwise_functions/negative.cpp @@ -29,7 +29,7 @@ //===---------------------------------------------------------------------===// /// /// \file -/// This file defines functions of dpctl.tensor._tensor_elementwise_impl +/// This file defines functions of dpnp.tensor._tensor_elementwise_impl /// extension, specifically functions for elementwise operations. //===---------------------------------------------------------------------===// @@ -50,13 +50,13 @@ #include "kernels/elementwise_functions/common.hpp" #include "kernels/elementwise_functions/negative.hpp" -namespace dpctl::tensor::py_internal +namespace dpnp::tensor::py_internal { namespace py = pybind11; -namespace td_ns = dpctl::tensor::type_dispatch; +namespace td_ns = dpnp::tensor::type_dispatch; -namespace ew_cmn_ns = dpctl::tensor::kernels::elementwise_common; +namespace ew_cmn_ns = dpnp::tensor::kernels::elementwise_common; using ew_cmn_ns::unary_contig_impl_fn_ptr_t; using ew_cmn_ns::unary_strided_impl_fn_ptr_t; @@ -64,7 +64,7 @@ using ew_cmn_ns::unary_strided_impl_fn_ptr_t; namespace impl { -namespace negative_fn_ns = dpctl::tensor::kernels::negative; +namespace negative_fn_ns = dpnp::tensor::kernels::negative; static unary_contig_impl_fn_ptr_t negative_contig_dispatch_vector[td_ns::num_types]; @@ -98,7 +98,7 @@ void populate_negative_dispatch_vectors(void) void init_negative(py::module_ m) { - using arrayT = dpctl::tensor::usm_ndarray; + using arrayT = dpnp::tensor::usm_ndarray; using event_vecT = std::vector; { impl::populate_negative_dispatch_vectors(); @@ -125,4 +125,4 @@ void init_negative(py::module_ m) } } -} // namespace dpctl::tensor::py_internal +} // namespace dpnp::tensor::py_internal diff --git a/dpnp/tensor/libtensor/source/elementwise_functions/negative.hpp b/dpnp/tensor/libtensor/source/elementwise_functions/negative.hpp index 083df516b435..8f167988cf5e 100644 --- a/dpnp/tensor/libtensor/source/elementwise_functions/negative.hpp +++ b/dpnp/tensor/libtensor/source/elementwise_functions/negative.hpp @@ -29,7 +29,7 @@ //===---------------------------------------------------------------------===// /// /// \file -/// This file defines functions of dpctl.tensor._tensor_elementwise_impl +/// This file defines functions of dpnp.tensor._tensor_elementwise_impl /// extension, specifically functions for elementwise operations. //===---------------------------------------------------------------------===// @@ -38,9 +38,9 @@ namespace py = pybind11; -namespace dpctl::tensor::py_internal +namespace dpnp::tensor::py_internal { extern void init_negative(py::module_ m); -} // namespace dpctl::tensor::py_internal +} // namespace dpnp::tensor::py_internal diff --git a/dpnp/tensor/libtensor/source/elementwise_functions/nextafter.cpp b/dpnp/tensor/libtensor/source/elementwise_functions/nextafter.cpp index 42e1ac9bd4c3..1e7c8ee26ed1 100644 --- a/dpnp/tensor/libtensor/source/elementwise_functions/nextafter.cpp +++ b/dpnp/tensor/libtensor/source/elementwise_functions/nextafter.cpp @@ -29,7 +29,7 @@ //===---------------------------------------------------------------------===// /// /// \file -/// This file defines functions of dpctl.tensor._tensor_elementwise_impl +/// This file defines functions of dpnp.tensor._tensor_elementwise_impl /// extension, specifically functions for elementwise operations. //===---------------------------------------------------------------------===// @@ -50,13 +50,13 @@ #include "kernels/elementwise_functions/common.hpp" #include "kernels/elementwise_functions/nextafter.hpp" -namespace dpctl::tensor::py_internal +namespace dpnp::tensor::py_internal { namespace py = pybind11; -namespace td_ns = dpctl::tensor::type_dispatch; +namespace td_ns = dpnp::tensor::type_dispatch; -namespace ew_cmn_ns = dpctl::tensor::kernels::elementwise_common; +namespace ew_cmn_ns = dpnp::tensor::kernels::elementwise_common; using ew_cmn_ns::binary_contig_impl_fn_ptr_t; using ew_cmn_ns::binary_contig_matrix_contig_row_broadcast_impl_fn_ptr_t; using ew_cmn_ns::binary_contig_row_contig_matrix_broadcast_impl_fn_ptr_t; @@ -65,7 +65,7 @@ using ew_cmn_ns::binary_strided_impl_fn_ptr_t; // B28: ===== NEXTAFTER (x1, x2) namespace impl { -namespace nextafter_fn_ns = dpctl::tensor::kernels::nextafter; +namespace nextafter_fn_ns = dpnp::tensor::kernels::nextafter; static binary_contig_impl_fn_ptr_t nextafter_contig_dispatch_table[td_ns::num_types][td_ns::num_types]; @@ -103,7 +103,7 @@ void populate_nextafter_dispatch_tables(void) void init_nextafter(py::module_ m) { - using arrayT = dpctl::tensor::usm_ndarray; + using arrayT = dpnp::tensor::usm_ndarray; using event_vecT = std::vector; { impl::populate_nextafter_dispatch_tables(); @@ -143,4 +143,4 @@ void init_nextafter(py::module_ m) } } -} // namespace dpctl::tensor::py_internal +} // namespace dpnp::tensor::py_internal diff --git a/dpnp/tensor/libtensor/source/elementwise_functions/nextafter.hpp b/dpnp/tensor/libtensor/source/elementwise_functions/nextafter.hpp index 76ad701d4012..b176c5e7a698 100644 --- a/dpnp/tensor/libtensor/source/elementwise_functions/nextafter.hpp +++ b/dpnp/tensor/libtensor/source/elementwise_functions/nextafter.hpp @@ -29,7 +29,7 @@ //===---------------------------------------------------------------------===// /// /// \file -/// This file defines functions of dpctl.tensor._tensor_elementwise_impl +/// This file defines functions of dpnp.tensor._tensor_elementwise_impl /// extension, specifically functions for elementwise operations. //===---------------------------------------------------------------------===// @@ -38,9 +38,9 @@ namespace py = pybind11; -namespace dpctl::tensor::py_internal +namespace dpnp::tensor::py_internal { extern void init_nextafter(py::module_ m); -} // namespace dpctl::tensor::py_internal +} // namespace dpnp::tensor::py_internal diff --git a/dpnp/tensor/libtensor/source/elementwise_functions/not_equal.cpp b/dpnp/tensor/libtensor/source/elementwise_functions/not_equal.cpp index dcbbf0cf015e..40c275458578 100644 --- a/dpnp/tensor/libtensor/source/elementwise_functions/not_equal.cpp +++ b/dpnp/tensor/libtensor/source/elementwise_functions/not_equal.cpp @@ -29,7 +29,7 @@ //===---------------------------------------------------------------------===// /// /// \file -/// This file defines functions of dpctl.tensor._tensor_elementwise_impl +/// This file defines functions of dpnp.tensor._tensor_elementwise_impl /// extension, specifically functions for elementwise operations. //===---------------------------------------------------------------------===// @@ -50,13 +50,13 @@ #include "kernels/elementwise_functions/common.hpp" #include "kernels/elementwise_functions/not_equal.hpp" -namespace dpctl::tensor::py_internal +namespace dpnp::tensor::py_internal { namespace py = pybind11; -namespace td_ns = dpctl::tensor::type_dispatch; +namespace td_ns = dpnp::tensor::type_dispatch; -namespace ew_cmn_ns = dpctl::tensor::kernels::elementwise_common; +namespace ew_cmn_ns = dpnp::tensor::kernels::elementwise_common; using ew_cmn_ns::binary_contig_impl_fn_ptr_t; using ew_cmn_ns::binary_contig_matrix_contig_row_broadcast_impl_fn_ptr_t; using ew_cmn_ns::binary_contig_row_contig_matrix_broadcast_impl_fn_ptr_t; @@ -65,7 +65,7 @@ using ew_cmn_ns::binary_strided_impl_fn_ptr_t; // B20: ===== NOT_EQUAL (x1, x2) namespace impl { -namespace not_equal_fn_ns = dpctl::tensor::kernels::not_equal; +namespace not_equal_fn_ns = dpnp::tensor::kernels::not_equal; static binary_contig_impl_fn_ptr_t not_equal_contig_dispatch_table[td_ns::num_types][td_ns::num_types]; @@ -103,7 +103,7 @@ void populate_not_equal_dispatch_tables(void) void init_not_equal(py::module_ m) { - using arrayT = dpctl::tensor::usm_ndarray; + using arrayT = dpnp::tensor::usm_ndarray; using event_vecT = std::vector; { impl::populate_not_equal_dispatch_tables(); @@ -143,4 +143,4 @@ void init_not_equal(py::module_ m) } } -} // namespace dpctl::tensor::py_internal +} // namespace dpnp::tensor::py_internal diff --git a/dpnp/tensor/libtensor/source/elementwise_functions/not_equal.hpp b/dpnp/tensor/libtensor/source/elementwise_functions/not_equal.hpp index c6c99bb793bc..378efc53b11b 100644 --- a/dpnp/tensor/libtensor/source/elementwise_functions/not_equal.hpp +++ b/dpnp/tensor/libtensor/source/elementwise_functions/not_equal.hpp @@ -29,7 +29,7 @@ //===---------------------------------------------------------------------===// /// /// \file -/// This file defines functions of dpctl.tensor._tensor_elementwise_impl +/// This file defines functions of dpnp.tensor._tensor_elementwise_impl /// extension, specifically functions for elementwise operations. //===---------------------------------------------------------------------===// @@ -38,9 +38,9 @@ namespace py = pybind11; -namespace dpctl::tensor::py_internal +namespace dpnp::tensor::py_internal { extern void init_not_equal(py::module_ m); -} // namespace dpctl::tensor::py_internal +} // namespace dpnp::tensor::py_internal diff --git a/dpnp/tensor/libtensor/source/elementwise_functions/positive.cpp b/dpnp/tensor/libtensor/source/elementwise_functions/positive.cpp index 6518b10a77c0..b4319c6584ac 100644 --- a/dpnp/tensor/libtensor/source/elementwise_functions/positive.cpp +++ b/dpnp/tensor/libtensor/source/elementwise_functions/positive.cpp @@ -29,7 +29,7 @@ //===---------------------------------------------------------------------===// /// /// \file -/// This file defines functions of dpctl.tensor._tensor_elementwise_impl +/// This file defines functions of dpnp.tensor._tensor_elementwise_impl /// extension, specifically functions for elementwise operations. //===---------------------------------------------------------------------===// @@ -50,13 +50,13 @@ #include "kernels/elementwise_functions/common.hpp" #include "kernels/elementwise_functions/positive.hpp" -namespace dpctl::tensor::py_internal +namespace dpnp::tensor::py_internal { namespace py = pybind11; -namespace td_ns = dpctl::tensor::type_dispatch; +namespace td_ns = dpnp::tensor::type_dispatch; -namespace ew_cmn_ns = dpctl::tensor::kernels::elementwise_common; +namespace ew_cmn_ns = dpnp::tensor::kernels::elementwise_common; using ew_cmn_ns::unary_contig_impl_fn_ptr_t; using ew_cmn_ns::unary_strided_impl_fn_ptr_t; @@ -64,7 +64,7 @@ using ew_cmn_ns::unary_strided_impl_fn_ptr_t; namespace impl { -namespace positive_fn_ns = dpctl::tensor::kernels::positive; +namespace positive_fn_ns = dpnp::tensor::kernels::positive; static unary_contig_impl_fn_ptr_t positive_contig_dispatch_vector[td_ns::num_types]; @@ -98,7 +98,7 @@ void populate_positive_dispatch_vectors(void) void init_positive(py::module_ m) { - using arrayT = dpctl::tensor::usm_ndarray; + using arrayT = dpnp::tensor::usm_ndarray; using event_vecT = std::vector; { impl::populate_positive_dispatch_vectors(); @@ -125,4 +125,4 @@ void init_positive(py::module_ m) } } -} // namespace dpctl::tensor::py_internal +} // namespace dpnp::tensor::py_internal diff --git a/dpnp/tensor/libtensor/source/elementwise_functions/positive.hpp b/dpnp/tensor/libtensor/source/elementwise_functions/positive.hpp index 05bd04b577af..8a827984809f 100644 --- a/dpnp/tensor/libtensor/source/elementwise_functions/positive.hpp +++ b/dpnp/tensor/libtensor/source/elementwise_functions/positive.hpp @@ -29,7 +29,7 @@ //===---------------------------------------------------------------------===// /// /// \file -/// This file defines functions of dpctl.tensor._tensor_elementwise_impl +/// This file defines functions of dpnp.tensor._tensor_elementwise_impl /// extension, specifically functions for elementwise operations. //===---------------------------------------------------------------------===// @@ -38,9 +38,9 @@ namespace py = pybind11; -namespace dpctl::tensor::py_internal +namespace dpnp::tensor::py_internal { extern void init_positive(py::module_ m); -} // namespace dpctl::tensor::py_internal +} // namespace dpnp::tensor::py_internal diff --git a/dpnp/tensor/libtensor/source/elementwise_functions/pow.cpp b/dpnp/tensor/libtensor/source/elementwise_functions/pow.cpp index 990515fa5402..08c8b8e38cba 100644 --- a/dpnp/tensor/libtensor/source/elementwise_functions/pow.cpp +++ b/dpnp/tensor/libtensor/source/elementwise_functions/pow.cpp @@ -29,7 +29,7 @@ //===---------------------------------------------------------------------===// /// /// \file -/// This file defines functions of dpctl.tensor._tensor_elementwise_impl +/// This file defines functions of dpnp.tensor._tensor_elementwise_impl /// extension, specifically functions for elementwise operations. //===---------------------------------------------------------------------===// @@ -51,13 +51,13 @@ #include "kernels/elementwise_functions/common_inplace.hpp" #include "kernels/elementwise_functions/pow.hpp" -namespace dpctl::tensor::py_internal +namespace dpnp::tensor::py_internal { namespace py = pybind11; -namespace td_ns = dpctl::tensor::type_dispatch; +namespace td_ns = dpnp::tensor::type_dispatch; -namespace ew_cmn_ns = dpctl::tensor::kernels::elementwise_common; +namespace ew_cmn_ns = dpnp::tensor::kernels::elementwise_common; using ew_cmn_ns::binary_contig_impl_fn_ptr_t; using ew_cmn_ns::binary_contig_matrix_contig_row_broadcast_impl_fn_ptr_t; using ew_cmn_ns::binary_contig_row_contig_matrix_broadcast_impl_fn_ptr_t; @@ -71,7 +71,7 @@ using ew_cmn_ns::binary_inplace_strided_impl_fn_ptr_t; namespace impl { -namespace pow_fn_ns = dpctl::tensor::kernels::pow; +namespace pow_fn_ns = dpnp::tensor::kernels::pow; static binary_contig_impl_fn_ptr_t pow_contig_dispatch_table[td_ns::num_types] [td_ns::num_types]; @@ -135,7 +135,7 @@ void populate_pow_dispatch_tables(void) void init_pow(py::module_ m) { - using arrayT = dpctl::tensor::usm_ndarray; + using arrayT = dpnp::tensor::usm_ndarray; using event_vecT = std::vector; { impl::populate_pow_dispatch_tables(); @@ -200,4 +200,4 @@ void init_pow(py::module_ m) } } -} // namespace dpctl::tensor::py_internal +} // namespace dpnp::tensor::py_internal diff --git a/dpnp/tensor/libtensor/source/elementwise_functions/pow.hpp b/dpnp/tensor/libtensor/source/elementwise_functions/pow.hpp index 197a23b80d8a..f3be3d2a82fb 100644 --- a/dpnp/tensor/libtensor/source/elementwise_functions/pow.hpp +++ b/dpnp/tensor/libtensor/source/elementwise_functions/pow.hpp @@ -29,7 +29,7 @@ //===---------------------------------------------------------------------===// /// /// \file -/// This file defines functions of dpctl.tensor._tensor_elementwise_impl +/// This file defines functions of dpnp.tensor._tensor_elementwise_impl /// extension, specifically functions for elementwise operations. //===---------------------------------------------------------------------===// @@ -38,9 +38,9 @@ namespace py = pybind11; -namespace dpctl::tensor::py_internal +namespace dpnp::tensor::py_internal { extern void init_pow(py::module_ m); -} // namespace dpctl::tensor::py_internal +} // namespace dpnp::tensor::py_internal diff --git a/dpnp/tensor/libtensor/source/elementwise_functions/proj.cpp b/dpnp/tensor/libtensor/source/elementwise_functions/proj.cpp index 9583de8bd195..38a73df193b3 100644 --- a/dpnp/tensor/libtensor/source/elementwise_functions/proj.cpp +++ b/dpnp/tensor/libtensor/source/elementwise_functions/proj.cpp @@ -29,7 +29,7 @@ //===---------------------------------------------------------------------===// /// /// \file -/// This file defines functions of dpctl.tensor._tensor_elementwise_impl +/// This file defines functions of dpnp.tensor._tensor_elementwise_impl /// extension, specifically functions for elementwise operations. //===---------------------------------------------------------------------===// @@ -50,13 +50,13 @@ #include "kernels/elementwise_functions/common.hpp" #include "kernels/elementwise_functions/proj.hpp" -namespace dpctl::tensor::py_internal +namespace dpnp::tensor::py_internal { namespace py = pybind11; -namespace td_ns = dpctl::tensor::type_dispatch; +namespace td_ns = dpnp::tensor::type_dispatch; -namespace ew_cmn_ns = dpctl::tensor::kernels::elementwise_common; +namespace ew_cmn_ns = dpnp::tensor::kernels::elementwise_common; using ew_cmn_ns::unary_contig_impl_fn_ptr_t; using ew_cmn_ns::unary_strided_impl_fn_ptr_t; @@ -64,7 +64,7 @@ using ew_cmn_ns::unary_strided_impl_fn_ptr_t; namespace impl { -namespace proj_fn_ns = dpctl::tensor::kernels::proj; +namespace proj_fn_ns = dpnp::tensor::kernels::proj; static unary_contig_impl_fn_ptr_t proj_contig_dispatch_vector[td_ns::num_types]; static int proj_output_typeid_vector[td_ns::num_types]; @@ -97,7 +97,7 @@ void populate_proj_dispatch_vectors(void) void init_proj(py::module_ m) { - using arrayT = dpctl::tensor::usm_ndarray; + using arrayT = dpnp::tensor::usm_ndarray; using event_vecT = std::vector; { impl::populate_proj_dispatch_vectors(); @@ -122,4 +122,4 @@ void init_proj(py::module_ m) } } -} // namespace dpctl::tensor::py_internal +} // namespace dpnp::tensor::py_internal diff --git a/dpnp/tensor/libtensor/source/elementwise_functions/proj.hpp b/dpnp/tensor/libtensor/source/elementwise_functions/proj.hpp index 3cdc0e8271b0..99edfb1ac4ee 100644 --- a/dpnp/tensor/libtensor/source/elementwise_functions/proj.hpp +++ b/dpnp/tensor/libtensor/source/elementwise_functions/proj.hpp @@ -29,7 +29,7 @@ //===---------------------------------------------------------------------===// /// /// \file -/// This file defines functions of dpctl.tensor._tensor_elementwise_impl +/// This file defines functions of dpnp.tensor._tensor_elementwise_impl /// extension, specifically functions for elementwise operations. //===---------------------------------------------------------------------===// @@ -38,9 +38,9 @@ namespace py = pybind11; -namespace dpctl::tensor::py_internal +namespace dpnp::tensor::py_internal { extern void init_proj(py::module_ m); -} // namespace dpctl::tensor::py_internal +} // namespace dpnp::tensor::py_internal diff --git a/dpnp/tensor/libtensor/source/elementwise_functions/real.cpp b/dpnp/tensor/libtensor/source/elementwise_functions/real.cpp index 6ed3f5fdc404..f1ac29639c81 100644 --- a/dpnp/tensor/libtensor/source/elementwise_functions/real.cpp +++ b/dpnp/tensor/libtensor/source/elementwise_functions/real.cpp @@ -29,7 +29,7 @@ //===---------------------------------------------------------------------===// /// /// \file -/// This file defines functions of dpctl.tensor._tensor_elementwise_impl +/// This file defines functions of dpnp.tensor._tensor_elementwise_impl /// extension, specifically functions for elementwise operations. //===---------------------------------------------------------------------===// @@ -50,13 +50,13 @@ #include "kernels/elementwise_functions/common.hpp" #include "kernels/elementwise_functions/real.hpp" -namespace dpctl::tensor::py_internal +namespace dpnp::tensor::py_internal { namespace py = pybind11; -namespace td_ns = dpctl::tensor::type_dispatch; +namespace td_ns = dpnp::tensor::type_dispatch; -namespace ew_cmn_ns = dpctl::tensor::kernels::elementwise_common; +namespace ew_cmn_ns = dpnp::tensor::kernels::elementwise_common; using ew_cmn_ns::unary_contig_impl_fn_ptr_t; using ew_cmn_ns::unary_strided_impl_fn_ptr_t; @@ -64,7 +64,7 @@ using ew_cmn_ns::unary_strided_impl_fn_ptr_t; namespace impl { -namespace real_fn_ns = dpctl::tensor::kernels::real; +namespace real_fn_ns = dpnp::tensor::kernels::real; static unary_contig_impl_fn_ptr_t real_contig_dispatch_vector[td_ns::num_types]; static int real_output_typeid_vector[td_ns::num_types]; @@ -97,7 +97,7 @@ void populate_real_dispatch_vectors(void) void init_real(py::module_ m) { - using arrayT = dpctl::tensor::usm_ndarray; + using arrayT = dpnp::tensor::usm_ndarray; using event_vecT = std::vector; { impl::populate_real_dispatch_vectors(); @@ -122,4 +122,4 @@ void init_real(py::module_ m) } } -} // namespace dpctl::tensor::py_internal +} // namespace dpnp::tensor::py_internal diff --git a/dpnp/tensor/libtensor/source/elementwise_functions/real.hpp b/dpnp/tensor/libtensor/source/elementwise_functions/real.hpp index 81f4743e823b..2535f3718fba 100644 --- a/dpnp/tensor/libtensor/source/elementwise_functions/real.hpp +++ b/dpnp/tensor/libtensor/source/elementwise_functions/real.hpp @@ -29,7 +29,7 @@ //===---------------------------------------------------------------------===// /// /// \file -/// This file defines functions of dpctl.tensor._tensor_elementwise_impl +/// This file defines functions of dpnp.tensor._tensor_elementwise_impl /// extension, specifically functions for elementwise operations. //===---------------------------------------------------------------------===// @@ -38,9 +38,9 @@ namespace py = pybind11; -namespace dpctl::tensor::py_internal +namespace dpnp::tensor::py_internal { extern void init_real(py::module_ m); -} // namespace dpctl::tensor::py_internal +} // namespace dpnp::tensor::py_internal diff --git a/dpnp/tensor/libtensor/source/elementwise_functions/reciprocal.cpp b/dpnp/tensor/libtensor/source/elementwise_functions/reciprocal.cpp index cdb0f43dfbe0..a346d1d16535 100644 --- a/dpnp/tensor/libtensor/source/elementwise_functions/reciprocal.cpp +++ b/dpnp/tensor/libtensor/source/elementwise_functions/reciprocal.cpp @@ -29,7 +29,7 @@ //===---------------------------------------------------------------------===// /// /// \file -/// This file defines functions of dpctl.tensor._tensor_elementwise_impl +/// This file defines functions of dpnp.tensor._tensor_elementwise_impl /// extension, specifically functions for elementwise operations. //===---------------------------------------------------------------------===// @@ -50,13 +50,13 @@ #include "kernels/elementwise_functions/common.hpp" #include "kernels/elementwise_functions/reciprocal.hpp" -namespace dpctl::tensor::py_internal +namespace dpnp::tensor::py_internal { namespace py = pybind11; -namespace td_ns = dpctl::tensor::type_dispatch; +namespace td_ns = dpnp::tensor::type_dispatch; -namespace ew_cmn_ns = dpctl::tensor::kernels::elementwise_common; +namespace ew_cmn_ns = dpnp::tensor::kernels::elementwise_common; using ew_cmn_ns::unary_contig_impl_fn_ptr_t; using ew_cmn_ns::unary_strided_impl_fn_ptr_t; @@ -64,7 +64,7 @@ using ew_cmn_ns::unary_strided_impl_fn_ptr_t; namespace impl { -namespace reciprocal_fn_ns = dpctl::tensor::kernels::reciprocal; +namespace reciprocal_fn_ns = dpnp::tensor::kernels::reciprocal; static unary_contig_impl_fn_ptr_t reciprocal_contig_dispatch_vector[td_ns::num_types]; @@ -98,7 +98,7 @@ void populate_reciprocal_dispatch_vectors(void) void init_reciprocal(py::module_ m) { - using arrayT = dpctl::tensor::usm_ndarray; + using arrayT = dpnp::tensor::usm_ndarray; using event_vecT = std::vector; { impl::populate_reciprocal_dispatch_vectors(); @@ -126,4 +126,4 @@ void init_reciprocal(py::module_ m) } } -} // namespace dpctl::tensor::py_internal +} // namespace dpnp::tensor::py_internal diff --git a/dpnp/tensor/libtensor/source/elementwise_functions/reciprocal.hpp b/dpnp/tensor/libtensor/source/elementwise_functions/reciprocal.hpp index 1d2156f3464e..a0add8e3b738 100644 --- a/dpnp/tensor/libtensor/source/elementwise_functions/reciprocal.hpp +++ b/dpnp/tensor/libtensor/source/elementwise_functions/reciprocal.hpp @@ -29,7 +29,7 @@ //===---------------------------------------------------------------------===// /// /// \file -/// This file defines functions of dpctl.tensor._tensor_elementwise_impl +/// This file defines functions of dpnp.tensor._tensor_elementwise_impl /// extension, specifically functions for elementwise operations. //===---------------------------------------------------------------------===// @@ -38,9 +38,9 @@ namespace py = pybind11; -namespace dpctl::tensor::py_internal +namespace dpnp::tensor::py_internal { extern void init_reciprocal(py::module_ m); -} // namespace dpctl::tensor::py_internal +} // namespace dpnp::tensor::py_internal diff --git a/dpnp/tensor/libtensor/source/elementwise_functions/remainder.cpp b/dpnp/tensor/libtensor/source/elementwise_functions/remainder.cpp index 8bdcdbe1b3dd..10008e228333 100644 --- a/dpnp/tensor/libtensor/source/elementwise_functions/remainder.cpp +++ b/dpnp/tensor/libtensor/source/elementwise_functions/remainder.cpp @@ -29,7 +29,7 @@ //===---------------------------------------------------------------------===// /// /// \file -/// This file defines functions of dpctl.tensor._tensor_elementwise_impl +/// This file defines functions of dpnp.tensor._tensor_elementwise_impl /// extension, specifically functions for elementwise operations. //===---------------------------------------------------------------------===// @@ -51,13 +51,13 @@ #include "kernels/elementwise_functions/common_inplace.hpp" #include "kernels/elementwise_functions/remainder.hpp" -namespace dpctl::tensor::py_internal +namespace dpnp::tensor::py_internal { namespace py = pybind11; -namespace td_ns = dpctl::tensor::type_dispatch; +namespace td_ns = dpnp::tensor::type_dispatch; -namespace ew_cmn_ns = dpctl::tensor::kernels::elementwise_common; +namespace ew_cmn_ns = dpnp::tensor::kernels::elementwise_common; using ew_cmn_ns::binary_contig_impl_fn_ptr_t; using ew_cmn_ns::binary_contig_matrix_contig_row_broadcast_impl_fn_ptr_t; using ew_cmn_ns::binary_contig_row_contig_matrix_broadcast_impl_fn_ptr_t; @@ -71,7 +71,7 @@ using ew_cmn_ns::binary_inplace_strided_impl_fn_ptr_t; namespace impl { -namespace remainder_fn_ns = dpctl::tensor::kernels::remainder; +namespace remainder_fn_ns = dpnp::tensor::kernels::remainder; static binary_contig_impl_fn_ptr_t remainder_contig_dispatch_table[td_ns::num_types][td_ns::num_types]; @@ -137,7 +137,7 @@ void populate_remainder_dispatch_tables(void) void init_remainder(py::module_ m) { - using arrayT = dpctl::tensor::usm_ndarray; + using arrayT = dpnp::tensor::usm_ndarray; using event_vecT = std::vector; { impl::populate_remainder_dispatch_tables(); @@ -202,4 +202,4 @@ void init_remainder(py::module_ m) } } -} // namespace dpctl::tensor::py_internal +} // namespace dpnp::tensor::py_internal diff --git a/dpnp/tensor/libtensor/source/elementwise_functions/remainder.hpp b/dpnp/tensor/libtensor/source/elementwise_functions/remainder.hpp index c00bdc9e0e6c..4ef22155723d 100644 --- a/dpnp/tensor/libtensor/source/elementwise_functions/remainder.hpp +++ b/dpnp/tensor/libtensor/source/elementwise_functions/remainder.hpp @@ -29,7 +29,7 @@ //===---------------------------------------------------------------------===// /// /// \file -/// This file defines functions of dpctl.tensor._tensor_elementwise_impl +/// This file defines functions of dpnp.tensor._tensor_elementwise_impl /// extension, specifically functions for elementwise operations. //===---------------------------------------------------------------------===// @@ -38,9 +38,9 @@ namespace py = pybind11; -namespace dpctl::tensor::py_internal +namespace dpnp::tensor::py_internal { extern void init_remainder(py::module_ m); -} // namespace dpctl::tensor::py_internal +} // namespace dpnp::tensor::py_internal diff --git a/dpnp/tensor/libtensor/source/elementwise_functions/round.cpp b/dpnp/tensor/libtensor/source/elementwise_functions/round.cpp index d651b567c3c1..62a697e59e8d 100644 --- a/dpnp/tensor/libtensor/source/elementwise_functions/round.cpp +++ b/dpnp/tensor/libtensor/source/elementwise_functions/round.cpp @@ -29,7 +29,7 @@ //===---------------------------------------------------------------------===// /// /// \file -/// This file defines functions of dpctl.tensor._tensor_elementwise_impl +/// This file defines functions of dpnp.tensor._tensor_elementwise_impl /// extension, specifically functions for elementwise operations. //===---------------------------------------------------------------------===// @@ -50,12 +50,12 @@ #include "kernels/elementwise_functions/common.hpp" #include "kernels/elementwise_functions/round.hpp" -namespace dpctl::tensor::py_internal +namespace dpnp::tensor::py_internal { namespace py = pybind11; -namespace td_ns = dpctl::tensor::type_dispatch; +namespace td_ns = dpnp::tensor::type_dispatch; -namespace ew_cmn_ns = dpctl::tensor::kernels::elementwise_common; +namespace ew_cmn_ns = dpnp::tensor::kernels::elementwise_common; using ew_cmn_ns::unary_contig_impl_fn_ptr_t; using ew_cmn_ns::unary_strided_impl_fn_ptr_t; @@ -63,7 +63,7 @@ using ew_cmn_ns::unary_strided_impl_fn_ptr_t; namespace impl { -namespace round_fn_ns = dpctl::tensor::kernels::round; +namespace round_fn_ns = dpnp::tensor::kernels::round; static unary_contig_impl_fn_ptr_t round_contig_dispatch_vector[td_ns::num_types]; @@ -97,7 +97,7 @@ void populate_round_dispatch_vectors(void) void init_round(py::module_ m) { - using arrayT = dpctl::tensor::usm_ndarray; + using arrayT = dpnp::tensor::usm_ndarray; using event_vecT = std::vector; { impl::populate_round_dispatch_vectors(); @@ -123,4 +123,4 @@ void init_round(py::module_ m) } } -} // namespace dpctl::tensor::py_internal +} // namespace dpnp::tensor::py_internal diff --git a/dpnp/tensor/libtensor/source/elementwise_functions/round.hpp b/dpnp/tensor/libtensor/source/elementwise_functions/round.hpp index ca56e110eec5..2656deb54c8b 100644 --- a/dpnp/tensor/libtensor/source/elementwise_functions/round.hpp +++ b/dpnp/tensor/libtensor/source/elementwise_functions/round.hpp @@ -29,7 +29,7 @@ //===---------------------------------------------------------------------===// /// /// \file -/// This file defines functions of dpctl.tensor._tensor_elementwise_impl +/// This file defines functions of dpnp.tensor._tensor_elementwise_impl /// extension, specifically functions for elementwise operations. //===---------------------------------------------------------------------===// @@ -38,9 +38,9 @@ namespace py = pybind11; -namespace dpctl::tensor::py_internal +namespace dpnp::tensor::py_internal { extern void init_round(py::module_ m); -} // namespace dpctl::tensor::py_internal +} // namespace dpnp::tensor::py_internal diff --git a/dpnp/tensor/libtensor/source/elementwise_functions/rsqrt.cpp b/dpnp/tensor/libtensor/source/elementwise_functions/rsqrt.cpp index 738bef333d75..9aeac2614e0b 100644 --- a/dpnp/tensor/libtensor/source/elementwise_functions/rsqrt.cpp +++ b/dpnp/tensor/libtensor/source/elementwise_functions/rsqrt.cpp @@ -29,7 +29,7 @@ //===---------------------------------------------------------------------===// /// /// \file -/// This file defines functions of dpctl.tensor._tensor_elementwise_impl +/// This file defines functions of dpnp.tensor._tensor_elementwise_impl /// extension, specifically functions for elementwise operations. //===---------------------------------------------------------------------===// @@ -50,13 +50,13 @@ #include "kernels/elementwise_functions/common.hpp" #include "kernels/elementwise_functions/rsqrt.hpp" -namespace dpctl::tensor::py_internal +namespace dpnp::tensor::py_internal { namespace py = pybind11; -namespace td_ns = dpctl::tensor::type_dispatch; +namespace td_ns = dpnp::tensor::type_dispatch; -namespace ew_cmn_ns = dpctl::tensor::kernels::elementwise_common; +namespace ew_cmn_ns = dpnp::tensor::kernels::elementwise_common; using ew_cmn_ns::unary_contig_impl_fn_ptr_t; using ew_cmn_ns::unary_strided_impl_fn_ptr_t; @@ -64,7 +64,7 @@ using ew_cmn_ns::unary_strided_impl_fn_ptr_t; namespace impl { -namespace rsqrt_fn_ns = dpctl::tensor::kernels::rsqrt; +namespace rsqrt_fn_ns = dpnp::tensor::kernels::rsqrt; static unary_contig_impl_fn_ptr_t rsqrt_contig_dispatch_vector[td_ns::num_types]; @@ -98,7 +98,7 @@ void populate_rsqrt_dispatch_vectors(void) void init_rsqrt(py::module_ m) { - using arrayT = dpctl::tensor::usm_ndarray; + using arrayT = dpnp::tensor::usm_ndarray; using event_vecT = std::vector; { impl::populate_rsqrt_dispatch_vectors(); @@ -124,4 +124,4 @@ void init_rsqrt(py::module_ m) } } -} // namespace dpctl::tensor::py_internal +} // namespace dpnp::tensor::py_internal diff --git a/dpnp/tensor/libtensor/source/elementwise_functions/rsqrt.hpp b/dpnp/tensor/libtensor/source/elementwise_functions/rsqrt.hpp index 4ba740a31777..34a7a0b322bc 100644 --- a/dpnp/tensor/libtensor/source/elementwise_functions/rsqrt.hpp +++ b/dpnp/tensor/libtensor/source/elementwise_functions/rsqrt.hpp @@ -29,7 +29,7 @@ //===---------------------------------------------------------------------===// /// /// \file -/// This file defines functions of dpctl.tensor._tensor_elementwise_impl +/// This file defines functions of dpnp.tensor._tensor_elementwise_impl /// extension, specifically functions for elementwise operations. //===---------------------------------------------------------------------===// @@ -38,9 +38,9 @@ namespace py = pybind11; -namespace dpctl::tensor::py_internal +namespace dpnp::tensor::py_internal { extern void init_rsqrt(py::module_ m); -} // namespace dpctl::tensor::py_internal +} // namespace dpnp::tensor::py_internal diff --git a/dpnp/tensor/libtensor/source/elementwise_functions/sign.cpp b/dpnp/tensor/libtensor/source/elementwise_functions/sign.cpp index 5051926e7470..a7e360978697 100644 --- a/dpnp/tensor/libtensor/source/elementwise_functions/sign.cpp +++ b/dpnp/tensor/libtensor/source/elementwise_functions/sign.cpp @@ -29,7 +29,7 @@ //===---------------------------------------------------------------------===// /// /// \file -/// This file defines functions of dpctl.tensor._tensor_elementwise_impl +/// This file defines functions of dpnp.tensor._tensor_elementwise_impl /// extension, specifically functions for elementwise operations. //===---------------------------------------------------------------------===// @@ -50,13 +50,13 @@ #include "kernels/elementwise_functions/common.hpp" #include "kernels/elementwise_functions/sign.hpp" -namespace dpctl::tensor::py_internal +namespace dpnp::tensor::py_internal { namespace py = pybind11; -namespace td_ns = dpctl::tensor::type_dispatch; +namespace td_ns = dpnp::tensor::type_dispatch; -namespace ew_cmn_ns = dpctl::tensor::kernels::elementwise_common; +namespace ew_cmn_ns = dpnp::tensor::kernels::elementwise_common; using ew_cmn_ns::unary_contig_impl_fn_ptr_t; using ew_cmn_ns::unary_strided_impl_fn_ptr_t; @@ -64,7 +64,7 @@ using ew_cmn_ns::unary_strided_impl_fn_ptr_t; namespace impl { -namespace sign_fn_ns = dpctl::tensor::kernels::sign; +namespace sign_fn_ns = dpnp::tensor::kernels::sign; static unary_contig_impl_fn_ptr_t sign_contig_dispatch_vector[td_ns::num_types]; static int sign_output_typeid_vector[td_ns::num_types]; @@ -97,7 +97,7 @@ void populate_sign_dispatch_vectors(void) void init_sign(py::module_ m) { - using arrayT = dpctl::tensor::usm_ndarray; + using arrayT = dpnp::tensor::usm_ndarray; using event_vecT = std::vector; { impl::populate_sign_dispatch_vectors(); @@ -122,4 +122,4 @@ void init_sign(py::module_ m) } } -} // namespace dpctl::tensor::py_internal +} // namespace dpnp::tensor::py_internal diff --git a/dpnp/tensor/libtensor/source/elementwise_functions/sign.hpp b/dpnp/tensor/libtensor/source/elementwise_functions/sign.hpp index 19686ada3dbf..93715acef608 100644 --- a/dpnp/tensor/libtensor/source/elementwise_functions/sign.hpp +++ b/dpnp/tensor/libtensor/source/elementwise_functions/sign.hpp @@ -29,7 +29,7 @@ //===---------------------------------------------------------------------===// /// /// \file -/// This file defines functions of dpctl.tensor._tensor_elementwise_impl +/// This file defines functions of dpnp.tensor._tensor_elementwise_impl /// extension, specifically functions for elementwise operations. //===---------------------------------------------------------------------===// @@ -38,9 +38,9 @@ namespace py = pybind11; -namespace dpctl::tensor::py_internal +namespace dpnp::tensor::py_internal { extern void init_sign(py::module_ m); -} // namespace dpctl::tensor::py_internal +} // namespace dpnp::tensor::py_internal diff --git a/dpnp/tensor/libtensor/source/elementwise_functions/signbit.cpp b/dpnp/tensor/libtensor/source/elementwise_functions/signbit.cpp index eeef1de50331..d721239d68a6 100644 --- a/dpnp/tensor/libtensor/source/elementwise_functions/signbit.cpp +++ b/dpnp/tensor/libtensor/source/elementwise_functions/signbit.cpp @@ -29,7 +29,7 @@ //===---------------------------------------------------------------------===// /// /// \file -/// This file defines functions of dpctl.tensor._tensor_elementwise_impl +/// This file defines functions of dpnp.tensor._tensor_elementwise_impl /// extension, specifically functions for elementwise operations. //===---------------------------------------------------------------------===// @@ -50,13 +50,13 @@ #include "kernels/elementwise_functions/common.hpp" #include "kernels/elementwise_functions/signbit.hpp" -namespace dpctl::tensor::py_internal +namespace dpnp::tensor::py_internal { namespace py = pybind11; -namespace td_ns = dpctl::tensor::type_dispatch; +namespace td_ns = dpnp::tensor::type_dispatch; -namespace ew_cmn_ns = dpctl::tensor::kernels::elementwise_common; +namespace ew_cmn_ns = dpnp::tensor::kernels::elementwise_common; using ew_cmn_ns::unary_contig_impl_fn_ptr_t; using ew_cmn_ns::unary_strided_impl_fn_ptr_t; @@ -64,7 +64,7 @@ using ew_cmn_ns::unary_strided_impl_fn_ptr_t; namespace impl { -namespace signbit_fn_ns = dpctl::tensor::kernels::signbit; +namespace signbit_fn_ns = dpnp::tensor::kernels::signbit; static unary_contig_impl_fn_ptr_t signbit_contig_dispatch_vector[td_ns::num_types]; @@ -98,7 +98,7 @@ void populate_signbit_dispatch_vectors(void) void init_signbit(py::module_ m) { - using arrayT = dpctl::tensor::usm_ndarray; + using arrayT = dpnp::tensor::usm_ndarray; using event_vecT = std::vector; { impl::populate_signbit_dispatch_vectors(); @@ -125,4 +125,4 @@ void init_signbit(py::module_ m) } } -} // namespace dpctl::tensor::py_internal +} // namespace dpnp::tensor::py_internal diff --git a/dpnp/tensor/libtensor/source/elementwise_functions/signbit.hpp b/dpnp/tensor/libtensor/source/elementwise_functions/signbit.hpp index 292386b174fc..a16d16019c96 100644 --- a/dpnp/tensor/libtensor/source/elementwise_functions/signbit.hpp +++ b/dpnp/tensor/libtensor/source/elementwise_functions/signbit.hpp @@ -29,7 +29,7 @@ //===---------------------------------------------------------------------===// /// /// \file -/// This file defines functions of dpctl.tensor._tensor_elementwise_impl +/// This file defines functions of dpnp.tensor._tensor_elementwise_impl /// extension, specifically functions for elementwise operations. //===---------------------------------------------------------------------===// @@ -38,9 +38,9 @@ namespace py = pybind11; -namespace dpctl::tensor::py_internal +namespace dpnp::tensor::py_internal { extern void init_signbit(py::module_ m); -} // namespace dpctl::tensor::py_internal +} // namespace dpnp::tensor::py_internal diff --git a/dpnp/tensor/libtensor/source/elementwise_functions/sin.cpp b/dpnp/tensor/libtensor/source/elementwise_functions/sin.cpp index 7db753e27c4b..f0286fb6d60a 100644 --- a/dpnp/tensor/libtensor/source/elementwise_functions/sin.cpp +++ b/dpnp/tensor/libtensor/source/elementwise_functions/sin.cpp @@ -29,7 +29,7 @@ //===---------------------------------------------------------------------===// /// /// \file -/// This file defines functions of dpctl.tensor._tensor_elementwise_impl +/// This file defines functions of dpnp.tensor._tensor_elementwise_impl /// extension, specifically functions for elementwise operations. //===---------------------------------------------------------------------===// @@ -50,13 +50,13 @@ #include "kernels/elementwise_functions/common.hpp" #include "kernels/elementwise_functions/sin.hpp" -namespace dpctl::tensor::py_internal +namespace dpnp::tensor::py_internal { namespace py = pybind11; -namespace td_ns = dpctl::tensor::type_dispatch; +namespace td_ns = dpnp::tensor::type_dispatch; -namespace ew_cmn_ns = dpctl::tensor::kernels::elementwise_common; +namespace ew_cmn_ns = dpnp::tensor::kernels::elementwise_common; using ew_cmn_ns::unary_contig_impl_fn_ptr_t; using ew_cmn_ns::unary_strided_impl_fn_ptr_t; @@ -64,7 +64,7 @@ using ew_cmn_ns::unary_strided_impl_fn_ptr_t; namespace impl { -namespace sin_fn_ns = dpctl::tensor::kernels::sin; +namespace sin_fn_ns = dpnp::tensor::kernels::sin; static unary_contig_impl_fn_ptr_t sin_contig_dispatch_vector[td_ns::num_types]; static int sin_output_typeid_vector[td_ns::num_types]; @@ -97,7 +97,7 @@ void populate_sin_dispatch_vectors(void) void init_sin(py::module_ m) { - using arrayT = dpctl::tensor::usm_ndarray; + using arrayT = dpnp::tensor::usm_ndarray; using event_vecT = std::vector; { impl::populate_sin_dispatch_vectors(); @@ -122,4 +122,4 @@ void init_sin(py::module_ m) } } -} // namespace dpctl::tensor::py_internal +} // namespace dpnp::tensor::py_internal diff --git a/dpnp/tensor/libtensor/source/elementwise_functions/sin.hpp b/dpnp/tensor/libtensor/source/elementwise_functions/sin.hpp index a4b3da08b7fc..0509ae406277 100644 --- a/dpnp/tensor/libtensor/source/elementwise_functions/sin.hpp +++ b/dpnp/tensor/libtensor/source/elementwise_functions/sin.hpp @@ -29,7 +29,7 @@ //===---------------------------------------------------------------------===// /// /// \file -/// This file defines functions of dpctl.tensor._tensor_elementwise_impl +/// This file defines functions of dpnp.tensor._tensor_elementwise_impl /// extension, specifically functions for elementwise operations. //===---------------------------------------------------------------------===// @@ -38,9 +38,9 @@ namespace py = pybind11; -namespace dpctl::tensor::py_internal +namespace dpnp::tensor::py_internal { extern void init_sin(py::module_ m); -} // namespace dpctl::tensor::py_internal +} // namespace dpnp::tensor::py_internal diff --git a/dpnp/tensor/libtensor/source/elementwise_functions/sinh.cpp b/dpnp/tensor/libtensor/source/elementwise_functions/sinh.cpp index e56a28e0c2aa..5ff0eda52033 100644 --- a/dpnp/tensor/libtensor/source/elementwise_functions/sinh.cpp +++ b/dpnp/tensor/libtensor/source/elementwise_functions/sinh.cpp @@ -29,7 +29,7 @@ //===---------------------------------------------------------------------===// /// /// \file -/// This file defines functions of dpctl.tensor._tensor_elementwise_impl +/// This file defines functions of dpnp.tensor._tensor_elementwise_impl /// extension, specifically functions for elementwise operations. //===---------------------------------------------------------------------===// @@ -50,13 +50,13 @@ #include "kernels/elementwise_functions/common.hpp" #include "kernels/elementwise_functions/sinh.hpp" -namespace dpctl::tensor::py_internal +namespace dpnp::tensor::py_internal { namespace py = pybind11; -namespace td_ns = dpctl::tensor::type_dispatch; +namespace td_ns = dpnp::tensor::type_dispatch; -namespace ew_cmn_ns = dpctl::tensor::kernels::elementwise_common; +namespace ew_cmn_ns = dpnp::tensor::kernels::elementwise_common; using ew_cmn_ns::unary_contig_impl_fn_ptr_t; using ew_cmn_ns::unary_strided_impl_fn_ptr_t; @@ -64,7 +64,7 @@ using ew_cmn_ns::unary_strided_impl_fn_ptr_t; namespace impl { -namespace sinh_fn_ns = dpctl::tensor::kernels::sinh; +namespace sinh_fn_ns = dpnp::tensor::kernels::sinh; static unary_contig_impl_fn_ptr_t sinh_contig_dispatch_vector[td_ns::num_types]; static int sinh_output_typeid_vector[td_ns::num_types]; @@ -97,7 +97,7 @@ void populate_sinh_dispatch_vectors(void) void init_sinh(py::module_ m) { - using arrayT = dpctl::tensor::usm_ndarray; + using arrayT = dpnp::tensor::usm_ndarray; using event_vecT = std::vector; { impl::populate_sinh_dispatch_vectors(); @@ -122,4 +122,4 @@ void init_sinh(py::module_ m) } } -} // namespace dpctl::tensor::py_internal +} // namespace dpnp::tensor::py_internal diff --git a/dpnp/tensor/libtensor/source/elementwise_functions/sinh.hpp b/dpnp/tensor/libtensor/source/elementwise_functions/sinh.hpp index 4a0d90d24c8c..f948e687a875 100644 --- a/dpnp/tensor/libtensor/source/elementwise_functions/sinh.hpp +++ b/dpnp/tensor/libtensor/source/elementwise_functions/sinh.hpp @@ -29,7 +29,7 @@ //===---------------------------------------------------------------------===// /// /// \file -/// This file defines functions of dpctl.tensor._tensor_elementwise_impl +/// This file defines functions of dpnp.tensor._tensor_elementwise_impl /// extension, specifically functions for elementwise operations. //===---------------------------------------------------------------------===// @@ -38,9 +38,9 @@ namespace py = pybind11; -namespace dpctl::tensor::py_internal +namespace dpnp::tensor::py_internal { extern void init_sinh(py::module_ m); -} // namespace dpctl::tensor::py_internal +} // namespace dpnp::tensor::py_internal diff --git a/dpnp/tensor/libtensor/source/elementwise_functions/sqrt.cpp b/dpnp/tensor/libtensor/source/elementwise_functions/sqrt.cpp index a4a715147055..aa7e3ff9dccf 100644 --- a/dpnp/tensor/libtensor/source/elementwise_functions/sqrt.cpp +++ b/dpnp/tensor/libtensor/source/elementwise_functions/sqrt.cpp @@ -29,7 +29,7 @@ //===---------------------------------------------------------------------===// /// /// \file -/// This file defines functions of dpctl.tensor._tensor_elementwise_impl +/// This file defines functions of dpnp.tensor._tensor_elementwise_impl /// extension, specifically functions for elementwise operations. //===---------------------------------------------------------------------===// @@ -50,13 +50,13 @@ #include "kernels/elementwise_functions/common.hpp" #include "kernels/elementwise_functions/sqrt.hpp" -namespace dpctl::tensor::py_internal +namespace dpnp::tensor::py_internal { namespace py = pybind11; -namespace td_ns = dpctl::tensor::type_dispatch; +namespace td_ns = dpnp::tensor::type_dispatch; -namespace ew_cmn_ns = dpctl::tensor::kernels::elementwise_common; +namespace ew_cmn_ns = dpnp::tensor::kernels::elementwise_common; using ew_cmn_ns::unary_contig_impl_fn_ptr_t; using ew_cmn_ns::unary_strided_impl_fn_ptr_t; @@ -64,7 +64,7 @@ using ew_cmn_ns::unary_strided_impl_fn_ptr_t; namespace impl { -namespace sqrt_fn_ns = dpctl::tensor::kernels::sqrt; +namespace sqrt_fn_ns = dpnp::tensor::kernels::sqrt; static unary_contig_impl_fn_ptr_t sqrt_contig_dispatch_vector[td_ns::num_types]; static int sqrt_output_typeid_vector[td_ns::num_types]; @@ -97,7 +97,7 @@ void populate_sqrt_dispatch_vectors(void) void init_sqrt(py::module_ m) { - using arrayT = dpctl::tensor::usm_ndarray; + using arrayT = dpnp::tensor::usm_ndarray; using event_vecT = std::vector; { impl::populate_sqrt_dispatch_vectors(); @@ -122,4 +122,4 @@ void init_sqrt(py::module_ m) } } -} // namespace dpctl::tensor::py_internal +} // namespace dpnp::tensor::py_internal diff --git a/dpnp/tensor/libtensor/source/elementwise_functions/sqrt.hpp b/dpnp/tensor/libtensor/source/elementwise_functions/sqrt.hpp index e8f7014c1afc..7656a795c785 100644 --- a/dpnp/tensor/libtensor/source/elementwise_functions/sqrt.hpp +++ b/dpnp/tensor/libtensor/source/elementwise_functions/sqrt.hpp @@ -29,7 +29,7 @@ //===---------------------------------------------------------------------===// /// /// \file -/// This file defines functions of dpctl.tensor._tensor_elementwise_impl +/// This file defines functions of dpnp.tensor._tensor_elementwise_impl /// extension, specifically functions for elementwise operations. //===---------------------------------------------------------------------===// @@ -38,9 +38,9 @@ namespace py = pybind11; -namespace dpctl::tensor::py_internal +namespace dpnp::tensor::py_internal { extern void init_sqrt(py::module_ m); -} // namespace dpctl::tensor::py_internal +} // namespace dpnp::tensor::py_internal diff --git a/dpnp/tensor/libtensor/source/elementwise_functions/square.cpp b/dpnp/tensor/libtensor/source/elementwise_functions/square.cpp index d3e229ae42fc..617cd954d06b 100644 --- a/dpnp/tensor/libtensor/source/elementwise_functions/square.cpp +++ b/dpnp/tensor/libtensor/source/elementwise_functions/square.cpp @@ -29,7 +29,7 @@ //===---------------------------------------------------------------------===// /// /// \file -/// This file defines functions of dpctl.tensor._tensor_elementwise_impl +/// This file defines functions of dpnp.tensor._tensor_elementwise_impl /// extension, specifically functions for elementwise operations. //===---------------------------------------------------------------------===// @@ -50,13 +50,13 @@ #include "kernels/elementwise_functions/common.hpp" #include "kernels/elementwise_functions/square.hpp" -namespace dpctl::tensor::py_internal +namespace dpnp::tensor::py_internal { namespace py = pybind11; -namespace td_ns = dpctl::tensor::type_dispatch; +namespace td_ns = dpnp::tensor::type_dispatch; -namespace ew_cmn_ns = dpctl::tensor::kernels::elementwise_common; +namespace ew_cmn_ns = dpnp::tensor::kernels::elementwise_common; using ew_cmn_ns::unary_contig_impl_fn_ptr_t; using ew_cmn_ns::unary_strided_impl_fn_ptr_t; @@ -64,7 +64,7 @@ using ew_cmn_ns::unary_strided_impl_fn_ptr_t; namespace impl { -namespace square_fn_ns = dpctl::tensor::kernels::square; +namespace square_fn_ns = dpnp::tensor::kernels::square; static unary_contig_impl_fn_ptr_t square_contig_dispatch_vector[td_ns::num_types]; @@ -98,7 +98,7 @@ void populate_square_dispatch_vectors(void) void init_square(py::module_ m) { - using arrayT = dpctl::tensor::usm_ndarray; + using arrayT = dpnp::tensor::usm_ndarray; using event_vecT = std::vector; { impl::populate_square_dispatch_vectors(); @@ -124,4 +124,4 @@ void init_square(py::module_ m) } } -} // namespace dpctl::tensor::py_internal +} // namespace dpnp::tensor::py_internal diff --git a/dpnp/tensor/libtensor/source/elementwise_functions/square.hpp b/dpnp/tensor/libtensor/source/elementwise_functions/square.hpp index 3f23f184499c..25876a7c8d86 100644 --- a/dpnp/tensor/libtensor/source/elementwise_functions/square.hpp +++ b/dpnp/tensor/libtensor/source/elementwise_functions/square.hpp @@ -29,7 +29,7 @@ //===---------------------------------------------------------------------===// /// /// \file -/// This file defines functions of dpctl.tensor._tensor_elementwise_impl +/// This file defines functions of dpnp.tensor._tensor_elementwise_impl /// extension, specifically functions for elementwise operations. //===---------------------------------------------------------------------===// @@ -38,9 +38,9 @@ namespace py = pybind11; -namespace dpctl::tensor::py_internal +namespace dpnp::tensor::py_internal { extern void init_square(py::module_ m); -} // namespace dpctl::tensor::py_internal +} // namespace dpnp::tensor::py_internal diff --git a/dpnp/tensor/libtensor/source/elementwise_functions/subtract.cpp b/dpnp/tensor/libtensor/source/elementwise_functions/subtract.cpp index ec6edaa52dd5..f073845c4e73 100644 --- a/dpnp/tensor/libtensor/source/elementwise_functions/subtract.cpp +++ b/dpnp/tensor/libtensor/source/elementwise_functions/subtract.cpp @@ -29,7 +29,7 @@ //===---------------------------------------------------------------------===// /// /// \file -/// This file defines functions of dpctl.tensor._tensor_elementwise_impl +/// This file defines functions of dpnp.tensor._tensor_elementwise_impl /// extension, specifically functions for elementwise operations. //===---------------------------------------------------------------------===// @@ -51,13 +51,13 @@ #include "kernels/elementwise_functions/common_inplace.hpp" #include "kernels/elementwise_functions/subtract.hpp" -namespace dpctl::tensor::py_internal +namespace dpnp::tensor::py_internal { namespace py = pybind11; -namespace td_ns = dpctl::tensor::type_dispatch; +namespace td_ns = dpnp::tensor::type_dispatch; -namespace ew_cmn_ns = dpctl::tensor::kernels::elementwise_common; +namespace ew_cmn_ns = dpnp::tensor::kernels::elementwise_common; using ew_cmn_ns::binary_contig_impl_fn_ptr_t; using ew_cmn_ns::binary_contig_matrix_contig_row_broadcast_impl_fn_ptr_t; using ew_cmn_ns::binary_contig_row_contig_matrix_broadcast_impl_fn_ptr_t; @@ -70,7 +70,7 @@ using ew_cmn_ns::binary_inplace_strided_impl_fn_ptr_t; // B23: ===== SUBTRACT (x1, x2) namespace impl { -namespace subtract_fn_ns = dpctl::tensor::kernels::subtract; +namespace subtract_fn_ns = dpnp::tensor::kernels::subtract; static binary_contig_impl_fn_ptr_t subtract_contig_dispatch_table[td_ns::num_types][td_ns::num_types]; @@ -175,7 +175,7 @@ void populate_subtract_dispatch_tables(void) void init_subtract(py::module_ m) { - using arrayT = dpctl::tensor::usm_ndarray; + using arrayT = dpnp::tensor::usm_ndarray; using event_vecT = std::vector; { impl::populate_subtract_dispatch_tables(); @@ -240,4 +240,4 @@ void init_subtract(py::module_ m) } } -} // namespace dpctl::tensor::py_internal +} // namespace dpnp::tensor::py_internal diff --git a/dpnp/tensor/libtensor/source/elementwise_functions/subtract.hpp b/dpnp/tensor/libtensor/source/elementwise_functions/subtract.hpp index 89cdfd6d0ea0..d463395764c0 100644 --- a/dpnp/tensor/libtensor/source/elementwise_functions/subtract.hpp +++ b/dpnp/tensor/libtensor/source/elementwise_functions/subtract.hpp @@ -1,42 +1,46 @@ -//===----------- Implementation of _tensor_impl module ---------*-C++-*-/===// +//***************************************************************************** +// Copyright (c) 2026, Intel Corporation +// All rights reserved. // -// Data Parallel Control (dpctl) +// 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. // -// Copyright 2020-2025 Intel Corporation +// 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. +//***************************************************************************** // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -//===----------------------------------------------------------------------===// +//===---------------------------------------------------------------------===// /// /// \file -/// This file defines functions of dpctl.tensor._tensor_impl extensions, -/// specifically functions for elementwise operations. -//===----------------------------------------------------------------------===// +/// This file defines functions of dpnp.tensor._tensor_elementwise_impl +/// extension, specifically functions for elementwise operations. +//===---------------------------------------------------------------------===// #pragma once #include namespace py = pybind11; -namespace dpctl -{ -namespace tensor -{ -namespace py_internal +namespace dpnp::tensor::py_internal { extern void init_subtract(py::module_ m); -} // namespace py_internal -} // namespace tensor -} // namespace dpctl +} // namespace dpnp::tensor::py_internal diff --git a/dpnp/tensor/libtensor/source/elementwise_functions/tan.cpp b/dpnp/tensor/libtensor/source/elementwise_functions/tan.cpp index 8abdea0e5283..0615caf15360 100644 --- a/dpnp/tensor/libtensor/source/elementwise_functions/tan.cpp +++ b/dpnp/tensor/libtensor/source/elementwise_functions/tan.cpp @@ -29,7 +29,7 @@ //===---------------------------------------------------------------------===// /// /// \file -/// This file defines functions of dpctl.tensor._tensor_elementwise_impl +/// This file defines functions of dpnp.tensor._tensor_elementwise_impl /// extension, specifically functions for elementwise operations. //===---------------------------------------------------------------------===// @@ -50,13 +50,13 @@ #include "kernels/elementwise_functions/common.hpp" #include "kernels/elementwise_functions/tan.hpp" -namespace dpctl::tensor::py_internal +namespace dpnp::tensor::py_internal { namespace py = pybind11; -namespace td_ns = dpctl::tensor::type_dispatch; +namespace td_ns = dpnp::tensor::type_dispatch; -namespace ew_cmn_ns = dpctl::tensor::kernels::elementwise_common; +namespace ew_cmn_ns = dpnp::tensor::kernels::elementwise_common; using ew_cmn_ns::unary_contig_impl_fn_ptr_t; using ew_cmn_ns::unary_strided_impl_fn_ptr_t; @@ -64,7 +64,7 @@ using ew_cmn_ns::unary_strided_impl_fn_ptr_t; namespace impl { -namespace tan_fn_ns = dpctl::tensor::kernels::tan; +namespace tan_fn_ns = dpnp::tensor::kernels::tan; static unary_contig_impl_fn_ptr_t tan_contig_dispatch_vector[td_ns::num_types]; static int tan_output_typeid_vector[td_ns::num_types]; @@ -97,7 +97,7 @@ void populate_tan_dispatch_vectors(void) void init_tan(py::module_ m) { - using arrayT = dpctl::tensor::usm_ndarray; + using arrayT = dpnp::tensor::usm_ndarray; using event_vecT = std::vector; { impl::populate_tan_dispatch_vectors(); @@ -122,4 +122,4 @@ void init_tan(py::module_ m) } } -} // namespace dpctl::tensor::py_internal +} // namespace dpnp::tensor::py_internal diff --git a/dpnp/tensor/libtensor/source/elementwise_functions/tan.hpp b/dpnp/tensor/libtensor/source/elementwise_functions/tan.hpp index b0818a9a85c2..cb058d491e4e 100644 --- a/dpnp/tensor/libtensor/source/elementwise_functions/tan.hpp +++ b/dpnp/tensor/libtensor/source/elementwise_functions/tan.hpp @@ -29,7 +29,7 @@ //===---------------------------------------------------------------------===// /// /// \file -/// This file defines functions of dpctl.tensor._tensor_elementwise_impl +/// This file defines functions of dpnp.tensor._tensor_elementwise_impl /// extension, specifically functions for elementwise operations. //===---------------------------------------------------------------------===// @@ -38,9 +38,9 @@ namespace py = pybind11; -namespace dpctl::tensor::py_internal +namespace dpnp::tensor::py_internal { extern void init_tan(py::module_ m); -} // namespace dpctl::tensor::py_internal +} // namespace dpnp::tensor::py_internal diff --git a/dpnp/tensor/libtensor/source/elementwise_functions/tanh.cpp b/dpnp/tensor/libtensor/source/elementwise_functions/tanh.cpp index bf8ff205c0af..db887a2edec9 100644 --- a/dpnp/tensor/libtensor/source/elementwise_functions/tanh.cpp +++ b/dpnp/tensor/libtensor/source/elementwise_functions/tanh.cpp @@ -29,7 +29,7 @@ //===---------------------------------------------------------------------===// /// /// \file -/// This file defines functions of dpctl.tensor._tensor_elementwise_impl +/// This file defines functions of dpnp.tensor._tensor_elementwise_impl /// extension, specifically functions for elementwise operations. //===---------------------------------------------------------------------===// @@ -50,13 +50,13 @@ #include "kernels/elementwise_functions/common.hpp" #include "kernels/elementwise_functions/tanh.hpp" -namespace dpctl::tensor::py_internal +namespace dpnp::tensor::py_internal { namespace py = pybind11; -namespace td_ns = dpctl::tensor::type_dispatch; +namespace td_ns = dpnp::tensor::type_dispatch; -namespace ew_cmn_ns = dpctl::tensor::kernels::elementwise_common; +namespace ew_cmn_ns = dpnp::tensor::kernels::elementwise_common; using ew_cmn_ns::unary_contig_impl_fn_ptr_t; using ew_cmn_ns::unary_strided_impl_fn_ptr_t; @@ -64,7 +64,7 @@ using ew_cmn_ns::unary_strided_impl_fn_ptr_t; namespace impl { -namespace tanh_fn_ns = dpctl::tensor::kernels::tanh; +namespace tanh_fn_ns = dpnp::tensor::kernels::tanh; static unary_contig_impl_fn_ptr_t tanh_contig_dispatch_vector[td_ns::num_types]; static int tanh_output_typeid_vector[td_ns::num_types]; @@ -97,7 +97,7 @@ void populate_tanh_dispatch_vectors(void) void init_tanh(py::module_ m) { - using arrayT = dpctl::tensor::usm_ndarray; + using arrayT = dpnp::tensor::usm_ndarray; using event_vecT = std::vector; { impl::populate_tanh_dispatch_vectors(); @@ -122,4 +122,4 @@ void init_tanh(py::module_ m) } } -} // namespace dpctl::tensor::py_internal +} // namespace dpnp::tensor::py_internal diff --git a/dpnp/tensor/libtensor/source/elementwise_functions/tanh.hpp b/dpnp/tensor/libtensor/source/elementwise_functions/tanh.hpp index d29c924d5e73..ebb93afbb3b3 100644 --- a/dpnp/tensor/libtensor/source/elementwise_functions/tanh.hpp +++ b/dpnp/tensor/libtensor/source/elementwise_functions/tanh.hpp @@ -29,7 +29,7 @@ //===---------------------------------------------------------------------===// /// /// \file -/// This file defines functions of dpctl.tensor._tensor_elementwise_impl +/// This file defines functions of dpnp.tensor._tensor_elementwise_impl /// extension, specifically functions for elementwise operations. //===---------------------------------------------------------------------===// @@ -38,9 +38,9 @@ namespace py = pybind11; -namespace dpctl::tensor::py_internal +namespace dpnp::tensor::py_internal { extern void init_tanh(py::module_ m); -} // namespace dpctl::tensor::py_internal +} // namespace dpnp::tensor::py_internal diff --git a/dpnp/tensor/libtensor/source/elementwise_functions/true_divide.cpp b/dpnp/tensor/libtensor/source/elementwise_functions/true_divide.cpp index 4c1a117fbcae..08ad29b63ac9 100644 --- a/dpnp/tensor/libtensor/source/elementwise_functions/true_divide.cpp +++ b/dpnp/tensor/libtensor/source/elementwise_functions/true_divide.cpp @@ -29,7 +29,7 @@ //===---------------------------------------------------------------------===// /// /// \file -/// This file defines functions of dpctl.tensor._tensor_elementwise_impl +/// This file defines functions of dpnp.tensor._tensor_elementwise_impl /// extension, specifically functions for elementwise operations. //===---------------------------------------------------------------------===// @@ -63,13 +63,13 @@ #include "kernels/elementwise_functions/common_inplace.hpp" #include "kernels/elementwise_functions/true_divide.hpp" -namespace dpctl::tensor::py_internal +namespace dpnp::tensor::py_internal { namespace py = pybind11; -namespace td_ns = dpctl::tensor::type_dispatch; +namespace td_ns = dpnp::tensor::type_dispatch; -namespace ew_cmn_ns = dpctl::tensor::kernels::elementwise_common; +namespace ew_cmn_ns = dpnp::tensor::kernels::elementwise_common; using ew_cmn_ns::binary_contig_impl_fn_ptr_t; using ew_cmn_ns::binary_contig_matrix_contig_row_broadcast_impl_fn_ptr_t; using ew_cmn_ns::binary_contig_row_contig_matrix_broadcast_impl_fn_ptr_t; @@ -82,7 +82,7 @@ using ew_cmn_ns::binary_inplace_strided_impl_fn_ptr_t; // B08: ===== DIVIDE (x1, x2) namespace impl { -namespace true_divide_fn_ns = dpctl::tensor::kernels::true_divide; +namespace true_divide_fn_ns = dpnp::tensor::kernels::true_divide; static binary_contig_impl_fn_ptr_t true_divide_contig_dispatch_table[td_ns::num_types][td_ns::num_types]; @@ -218,13 +218,13 @@ sycl::event divide_by_scalar(sycl::queue &exec_q, cgh.depends_on(depends); using BinOpT = - dpctl::tensor::kernels::true_divide::TrueDivideFunctor; + dpnp::tensor::kernels::true_divide::TrueDivideFunctor; auto op = BinOpT(); using IndexerT = - typename dpctl::tensor::offset_utils::TwoOffsets_StridedIndexer; + typename dpnp::tensor::offset_utils::TwoOffsets_StridedIndexer; const IndexerT two_offsets_indexer{nd, arg_offset, res_offset, shape_and_strides}; @@ -246,9 +246,9 @@ sycl::event divide_by_scalar(sycl::queue &exec_q, } std::pair - py_divide_by_scalar(const dpctl::tensor::usm_ndarray &src, + py_divide_by_scalar(const dpnp::tensor::usm_ndarray &src, double scalar, - const dpctl::tensor::usm_ndarray &dst, + const dpnp::tensor::usm_ndarray &dst, sycl::queue &exec_q, const std::vector &depends = {}) { @@ -265,12 +265,12 @@ std::pair } // check that queues are compatible - if (!dpctl::utils::queues_are_compatible(exec_q, {src, dst})) { + if (!dpnp::utils::queues_are_compatible(exec_q, {src, dst})) { throw py::value_error( "Execution queue is not compatible with allocation queues"); } - dpctl::tensor::validation::CheckWritable::throw_if_not_writable(dst); + dpnp::tensor::validation::CheckWritable::throw_if_not_writable(dst); // check shapes, broadcasting is assumed done by caller // check that dimensions are the same int dst_nd = dst.get_ndim(); @@ -297,11 +297,11 @@ std::pair return std::make_pair(sycl::event(), sycl::event()); } - dpctl::tensor::validation::AmpleMemory::throw_if_not_ample(dst, src_nelems); + dpnp::tensor::validation::AmpleMemory::throw_if_not_ample(dst, src_nelems); - auto const &overlap = dpctl::tensor::overlap::MemoryOverlap(); + auto const &overlap = dpnp::tensor::overlap::MemoryOverlap(); auto const &same_logical_tensors = - dpctl::tensor::overlap::SameLogicalTensors(); + dpnp::tensor::overlap::SameLogicalTensors(); if ((overlap(src, dst) && !same_logical_tensors(src, dst))) { throw py::value_error("Arrays index overlapping segments of memory"); } @@ -392,7 +392,7 @@ std::pair dst_offset = 0; } - using dpctl::tensor::offset_utils::device_allocate_and_pack; + using dpnp::tensor::offset_utils::device_allocate_and_pack; auto ptr_sz_event_triple_ = device_allocate_and_pack( exec_q, host_tasks, simplified_shape, simplified_src_strides, simplified_dst_strides); @@ -412,20 +412,20 @@ std::pair scalar_alloc, dst_data, dst_offset, all_deps); // async free of shape_strides temporary - sycl::event tmp_cleanup_ev = dpctl::tensor::alloc_utils::async_smart_free( + sycl::event tmp_cleanup_ev = dpnp::tensor::alloc_utils::async_smart_free( exec_q, {div_ev}, shape_strides_owner); host_tasks.push_back(tmp_cleanup_ev); return std::make_pair( - dpctl::utils::keep_args_alive(exec_q, {src, dst}, host_tasks), div_ev); + dpnp::utils::keep_args_alive(exec_q, {src, dst}, host_tasks), div_ev); } } // namespace impl void init_divide(py::module_ m) { - using arrayT = dpctl::tensor::usm_ndarray; + using arrayT = dpnp::tensor::usm_ndarray; using event_vecT = std::vector; { impl::populate_true_divide_dispatch_tables(); @@ -497,4 +497,4 @@ void init_divide(py::module_ m) } } -} // namespace dpctl::tensor::py_internal +} // namespace dpnp::tensor::py_internal diff --git a/dpnp/tensor/libtensor/source/elementwise_functions/true_divide.hpp b/dpnp/tensor/libtensor/source/elementwise_functions/true_divide.hpp index 941384beaf8d..7e0b5a0d97f1 100644 --- a/dpnp/tensor/libtensor/source/elementwise_functions/true_divide.hpp +++ b/dpnp/tensor/libtensor/source/elementwise_functions/true_divide.hpp @@ -29,7 +29,7 @@ //===---------------------------------------------------------------------===// /// /// \file -/// This file defines functions of dpctl.tensor._tensor_elementwise_impl +/// This file defines functions of dpnp.tensor._tensor_elementwise_impl /// extension, specifically functions for elementwise operations. //===---------------------------------------------------------------------===// @@ -38,9 +38,9 @@ namespace py = pybind11; -namespace dpctl::tensor::py_internal +namespace dpnp::tensor::py_internal { extern void init_divide(py::module_ m); -} // namespace dpctl::tensor::py_internal +} // namespace dpnp::tensor::py_internal diff --git a/dpnp/tensor/libtensor/source/elementwise_functions/trunc.cpp b/dpnp/tensor/libtensor/source/elementwise_functions/trunc.cpp index 3a798d8e110d..a5b297e983c8 100644 --- a/dpnp/tensor/libtensor/source/elementwise_functions/trunc.cpp +++ b/dpnp/tensor/libtensor/source/elementwise_functions/trunc.cpp @@ -29,7 +29,7 @@ //===---------------------------------------------------------------------===// /// /// \file -/// This file defines functions of dpctl.tensor._tensor_elementwise_impl +/// This file defines functions of dpnp.tensor._tensor_elementwise_impl /// extension, specifically functions for elementwise operations. //===---------------------------------------------------------------------===// @@ -50,13 +50,13 @@ #include "kernels/elementwise_functions/common.hpp" #include "kernels/elementwise_functions/trunc.hpp" -namespace dpctl::tensor::py_internal +namespace dpnp::tensor::py_internal { namespace py = pybind11; -namespace td_ns = dpctl::tensor::type_dispatch; +namespace td_ns = dpnp::tensor::type_dispatch; -namespace ew_cmn_ns = dpctl::tensor::kernels::elementwise_common; +namespace ew_cmn_ns = dpnp::tensor::kernels::elementwise_common; using ew_cmn_ns::unary_contig_impl_fn_ptr_t; using ew_cmn_ns::unary_strided_impl_fn_ptr_t; @@ -64,7 +64,7 @@ using ew_cmn_ns::unary_strided_impl_fn_ptr_t; namespace impl { -namespace trunc_fn_ns = dpctl::tensor::kernels::trunc; +namespace trunc_fn_ns = dpnp::tensor::kernels::trunc; static unary_contig_impl_fn_ptr_t trunc_contig_dispatch_vector[td_ns::num_types]; @@ -98,7 +98,7 @@ void populate_trunc_dispatch_vectors(void) void init_trunc(py::module_ m) { - using arrayT = dpctl::tensor::usm_ndarray; + using arrayT = dpnp::tensor::usm_ndarray; using event_vecT = std::vector; { impl::populate_trunc_dispatch_vectors(); @@ -124,4 +124,4 @@ void init_trunc(py::module_ m) } } -} // namespace dpctl::tensor::py_internal +} // namespace dpnp::tensor::py_internal diff --git a/dpnp/tensor/libtensor/source/elementwise_functions/trunc.hpp b/dpnp/tensor/libtensor/source/elementwise_functions/trunc.hpp index 79ed6b5ded14..af537e347cb5 100644 --- a/dpnp/tensor/libtensor/source/elementwise_functions/trunc.hpp +++ b/dpnp/tensor/libtensor/source/elementwise_functions/trunc.hpp @@ -29,7 +29,7 @@ //===---------------------------------------------------------------------===// /// /// \file -/// This file defines functions of dpctl.tensor._tensor_elementwise_impl +/// This file defines functions of dpnp.tensor._tensor_elementwise_impl /// extension, specifically functions for elementwise operations. //===---------------------------------------------------------------------===// @@ -38,9 +38,9 @@ namespace py = pybind11; -namespace dpctl::tensor::py_internal +namespace dpnp::tensor::py_internal { extern void init_trunc(py::module_ m); -} // namespace dpctl::tensor::py_internal +} // namespace dpnp::tensor::py_internal diff --git a/dpnp/tensor/libtensor/source/eye_ctor.cpp b/dpnp/tensor/libtensor/source/eye_ctor.cpp index 025a7d58d06e..ea3765d04e13 100644 --- a/dpnp/tensor/libtensor/source/eye_ctor.cpp +++ b/dpnp/tensor/libtensor/source/eye_ctor.cpp @@ -29,7 +29,7 @@ //===--------------------------------------------------------------------===// /// /// \file -/// This file defines functions of dpctl.tensor._tensor_impl extensions +/// This file defines functions of dpnp.tensor._tensor_impl extensions //===--------------------------------------------------------------------===// #include @@ -48,19 +48,19 @@ #include "utils/type_dispatch.hpp" namespace py = pybind11; -namespace td_ns = dpctl::tensor::type_dispatch; +namespace td_ns = dpnp::tensor::type_dispatch; -namespace dpctl::tensor::py_internal +namespace dpnp::tensor::py_internal { -using dpctl::utils::keep_args_alive; +using dpnp::utils::keep_args_alive; -using dpctl::tensor::kernels::constructors::eye_fn_ptr_t; +using dpnp::tensor::kernels::constructors::eye_fn_ptr_t; static eye_fn_ptr_t eye_dispatch_vector[td_ns::num_types]; std::pair usm_ndarray_eye(py::ssize_t k, - const dpctl::tensor::usm_ndarray &dst, + const dpnp::tensor::usm_ndarray &dst, sycl::queue &exec_q, const std::vector &depends) { @@ -71,12 +71,12 @@ std::pair "usm_ndarray_eye: Expecting 2D array to populate"); } - if (!dpctl::utils::queues_are_compatible(exec_q, {dst})) { + if (!dpnp::utils::queues_are_compatible(exec_q, {dst})) { throw py::value_error("Execution queue is not compatible with the " "allocation queue"); } - dpctl::tensor::validation::CheckWritable::throw_if_not_writable(dst); + dpnp::tensor::validation::CheckWritable::throw_if_not_writable(dst); auto array_types = td_ns::usm_ndarray_types(); int dst_typenum = dst.get_typenum(); @@ -131,7 +131,7 @@ std::pair void init_eye_ctor_dispatch_vectors(void) { using namespace td_ns; - using dpctl::tensor::kernels::constructors::EyeFactory; + using dpnp::tensor::kernels::constructors::EyeFactory; DispatchVectorBuilder dvb; dvb.populate_dispatch_vector(eye_dispatch_vector); @@ -139,4 +139,4 @@ void init_eye_ctor_dispatch_vectors(void) return; } -} // namespace dpctl::tensor::py_internal +} // namespace dpnp::tensor::py_internal diff --git a/dpnp/tensor/libtensor/source/eye_ctor.hpp b/dpnp/tensor/libtensor/source/eye_ctor.hpp index dda7f2c4813a..765537f2ab29 100644 --- a/dpnp/tensor/libtensor/source/eye_ctor.hpp +++ b/dpnp/tensor/libtensor/source/eye_ctor.hpp @@ -29,7 +29,7 @@ //===--------------------------------------------------------------------===// /// /// \file -/// This file defines functions of dpctl.tensor._tensor_impl extensions +/// This file defines functions of dpnp.tensor._tensor_impl extensions //===--------------------------------------------------------------------===// #pragma once @@ -43,15 +43,15 @@ namespace py = pybind11; -namespace dpctl::tensor::py_internal +namespace dpnp::tensor::py_internal { extern std::pair usm_ndarray_eye(py::ssize_t k, - const dpctl::tensor::usm_ndarray &dst, + const dpnp::tensor::usm_ndarray &dst, sycl::queue &exec_q, const std::vector &depends = {}); extern void init_eye_ctor_dispatch_vectors(void); -} // namespace dpctl::tensor::py_internal +} // namespace dpnp::tensor::py_internal diff --git a/dpnp/tensor/libtensor/source/full_ctor.cpp b/dpnp/tensor/libtensor/source/full_ctor.cpp index 8d7fcd22b914..8345014f29b4 100644 --- a/dpnp/tensor/libtensor/source/full_ctor.cpp +++ b/dpnp/tensor/libtensor/source/full_ctor.cpp @@ -29,7 +29,7 @@ //===--------------------------------------------------------------------===// /// /// \file -/// This file defines functions of dpctl.tensor._tensor_impl extensions +/// This file defines functions of dpnp.tensor._tensor_impl extensions //===--------------------------------------------------------------------===// #include @@ -54,12 +54,12 @@ #include "full_ctor.hpp" namespace py = pybind11; -namespace td_ns = dpctl::tensor::type_dispatch; +namespace td_ns = dpnp::tensor::type_dispatch; -namespace dpctl::tensor::py_internal +namespace dpnp::tensor::py_internal { -using dpctl::utils::keep_args_alive; +using dpnp::utils::keep_args_alive; typedef sycl::event (*full_contig_fn_ptr_t)(sycl::queue &, std::size_t, @@ -145,7 +145,7 @@ sycl::event full_contig_impl(sycl::queue &exec_q, }); } else { - using dpctl::tensor::kernels::constructors::full_contig_impl; + using dpnp::tensor::kernels::constructors::full_contig_impl; fill_ev = full_contig_impl(exec_q, nelems, fill_v, dst_p, depends); @@ -203,7 +203,7 @@ sycl::event full_strided_impl(sycl::queue &exec_q, { dstTy fill_v = py::cast(py_value); - using dpctl::tensor::kernels::constructors::full_strided_impl; + using dpnp::tensor::kernels::constructors::full_strided_impl; sycl::event fill_ev = full_strided_impl( exec_q, nd, nelems, shape_strides, fill_v, dst_p, depends); @@ -225,7 +225,7 @@ static full_strided_fn_ptr_t full_strided_dispatch_vector[td_ns::num_types]; std::pair usm_ndarray_full(const py::object &py_value, - const dpctl::tensor::usm_ndarray &dst, + const dpnp::tensor::usm_ndarray &dst, sycl::queue &exec_q, const std::vector &depends) { @@ -238,12 +238,12 @@ std::pair return std::make_pair(sycl::event(), sycl::event()); } - if (!dpctl::utils::queues_are_compatible(exec_q, {dst})) { + if (!dpnp::utils::queues_are_compatible(exec_q, {dst})) { throw py::value_error( "Execution queue is not compatible with the allocation queue"); } - dpctl::tensor::validation::CheckWritable::throw_if_not_writable(dst); + dpnp::tensor::validation::CheckWritable::throw_if_not_writable(dst); auto array_types = td_ns::usm_ndarray_types(); int dst_typenum = dst.get_typenum(); @@ -271,7 +271,7 @@ std::pair std::vector host_task_events; host_task_events.reserve(2); - using dpctl::tensor::offset_utils::device_allocate_and_pack; + using dpnp::tensor::offset_utils::device_allocate_and_pack; auto ptr_size_event_tuple = device_allocate_and_pack( exec_q, host_task_events, dst_shape, dst_strides); auto shape_strides_owner = std::move(std::get<0>(ptr_size_event_tuple)); @@ -284,7 +284,7 @@ std::pair // free shape_strides const auto &temporaries_cleanup_ev = - dpctl::tensor::alloc_utils::async_smart_free( + dpnp::tensor::alloc_utils::async_smart_free( exec_q, {full_strided_ev}, shape_strides_owner); host_task_events.push_back(temporaries_cleanup_ev); @@ -306,4 +306,4 @@ void init_full_ctor_dispatch_vectors(void) dvb2.populate_dispatch_vector(full_strided_dispatch_vector); } -} // namespace dpctl::tensor::py_internal +} // namespace dpnp::tensor::py_internal diff --git a/dpnp/tensor/libtensor/source/full_ctor.hpp b/dpnp/tensor/libtensor/source/full_ctor.hpp index 18c15de87a40..bae3fcfeb672 100644 --- a/dpnp/tensor/libtensor/source/full_ctor.hpp +++ b/dpnp/tensor/libtensor/source/full_ctor.hpp @@ -29,7 +29,7 @@ //===--------------------------------------------------------------------===// /// /// \file -/// This file defines functions of dpctl.tensor._tensor_impl extensions +/// This file defines functions of dpnp.tensor._tensor_impl extensions //===--------------------------------------------------------------------===// #pragma once @@ -43,15 +43,15 @@ namespace py = pybind11; -namespace dpctl::tensor::py_internal +namespace dpnp::tensor::py_internal { extern std::pair usm_ndarray_full(const py::object &py_value, - const dpctl::tensor::usm_ndarray &dst, + const dpnp::tensor::usm_ndarray &dst, sycl::queue &exec_q, const std::vector &depends = {}); extern void init_full_ctor_dispatch_vectors(void); -} // namespace dpctl::tensor::py_internal +} // namespace dpnp::tensor::py_internal diff --git a/dpnp/tensor/libtensor/source/integer_advanced_indexing.cpp b/dpnp/tensor/libtensor/source/integer_advanced_indexing.cpp index c6021bdfd2d1..9d363f8bbca5 100644 --- a/dpnp/tensor/libtensor/source/integer_advanced_indexing.cpp +++ b/dpnp/tensor/libtensor/source/integer_advanced_indexing.cpp @@ -29,8 +29,8 @@ //===----------------------------------------------------------------------===// /// /// \file -/// This file defines implementation functions of dpctl.tensor.take and -/// dpctl.tensor.put +/// This file defines implementation functions of dpnp.tensor.take and +/// dpnp.tensor.put //===----------------------------------------------------------------------===// #include @@ -61,13 +61,13 @@ #define WRAP_MODE 0 #define CLIP_MODE 1 -namespace dpctl::tensor::py_internal +namespace dpnp::tensor::py_internal { -namespace td_ns = dpctl::tensor::type_dispatch; +namespace td_ns = dpnp::tensor::type_dispatch; -using dpctl::tensor::kernels::indexing::put_fn_ptr_t; -using dpctl::tensor::kernels::indexing::take_fn_ptr_t; +using dpnp::tensor::kernels::indexing::put_fn_ptr_t; +using dpnp::tensor::kernels::indexing::take_fn_ptr_t; static take_fn_ptr_t take_dispatch_table[INDEXING_MODES][td_ns::num_types] [td_ns::num_types]; @@ -77,7 +77,7 @@ static put_fn_ptr_t put_dispatch_table[INDEXING_MODES][td_ns::num_types] namespace py = pybind11; -using dpctl::utils::keep_args_alive; +using dpnp::utils::keep_args_alive; std::vector _populate_kernel_params(sycl::queue &exec_q, @@ -103,7 +103,7 @@ std::vector { using usm_host_allocator_T = - dpctl::tensor::alloc_utils::usm_host_allocator; + dpnp::tensor::alloc_utils::usm_host_allocator; using ptrT = std::vector; usm_host_allocator_T ptr_allocator(exec_q); @@ -111,7 +111,7 @@ std::vector std::make_shared(k, ptr_allocator); using usm_host_allocatorT = - dpctl::tensor::alloc_utils::usm_host_allocator; + dpnp::tensor::alloc_utils::usm_host_allocator; using shT = std::vector; usm_host_allocatorT sz_allocator(exec_q); @@ -217,20 +217,20 @@ std::vector } /* Utility to parse python object py_ind into vector of `usm_ndarray`s */ -std::vector parse_py_ind(const sycl::queue &q, - const py::object &py_ind) +std::vector parse_py_ind(const sycl::queue &q, + const py::object &py_ind) { std::size_t ind_count = py::len(py_ind); - std::vector res; + std::vector res; res.reserve(ind_count); bool nd_is_known = false; int nd = -1; for (std::size_t i = 0; i < ind_count; ++i) { py::object el_i = py_ind[py::cast(i)]; - dpctl::tensor::usm_ndarray arr_i = - py::cast(el_i); - if (!dpctl::utils::queues_are_compatible(q, {arr_i})) { + dpnp::tensor::usm_ndarray arr_i = + py::cast(el_i); + if (!dpnp::utils::queues_are_compatible(q, {arr_i})) { throw py::value_error("Index allocation queue is not compatible " "with execution queue"); } @@ -251,15 +251,15 @@ std::vector parse_py_ind(const sycl::queue &q, } std::pair - usm_ndarray_take(const dpctl::tensor::usm_ndarray &src, + usm_ndarray_take(const dpnp::tensor::usm_ndarray &src, const py::object &py_ind, - const dpctl::tensor::usm_ndarray &dst, + const dpnp::tensor::usm_ndarray &dst, int axis_start, std::uint8_t mode, sycl::queue &exec_q, const std::vector &depends) { - std::vector ind = parse_py_ind(exec_q, py_ind); + std::vector ind = parse_py_ind(exec_q, py_ind); int k = ind.size(); @@ -275,9 +275,9 @@ std::pair throw py::value_error("Mode must be 0 or 1."); } - dpctl::tensor::validation::CheckWritable::throw_if_not_writable(dst); + dpnp::tensor::validation::CheckWritable::throw_if_not_writable(dst); - const dpctl::tensor::usm_ndarray ind_rep = ind[0]; + const dpnp::tensor::usm_ndarray ind_rep = ind[0]; int src_nd = src.get_ndim(); int dst_nd = dst.get_ndim(); @@ -328,12 +328,12 @@ std::pair char *src_data = src.get_data(); char *dst_data = dst.get_data(); - if (!dpctl::utils::queues_are_compatible(exec_q, {src, dst})) { + if (!dpnp::utils::queues_are_compatible(exec_q, {src, dst})) { throw py::value_error( "Execution queue is not compatible with allocation queues"); } - auto const &overlap = dpctl::tensor::overlap::MemoryOverlap(); + auto const &overlap = dpnp::tensor::overlap::MemoryOverlap(); if (overlap(src, dst)) { throw py::value_error("Array memory overlap."); } @@ -367,7 +367,7 @@ std::pair } } - dpctl::tensor::validation::AmpleMemory::throw_if_not_ample( + dpnp::tensor::validation::AmpleMemory::throw_if_not_ample( dst, orthog_nelems * ind_nelems); int ind_sh_elems = std::max(ind_nd, 1); @@ -383,9 +383,9 @@ std::pair std::copy(ind_shape, ind_shape + ind_nd, ind_sh_sts.begin()); } for (int i = 0; i < k; ++i) { - dpctl::tensor::usm_ndarray ind_ = ind[i]; + dpnp::tensor::usm_ndarray ind_ = ind[i]; - if (!dpctl::utils::queues_are_compatible(exec_q, {ind_})) { + if (!dpnp::utils::queues_are_compatible(exec_q, {ind_})) { throw py::value_error( "Execution queue is not compatible with allocation queues"); } @@ -434,7 +434,7 @@ std::pair } auto packed_ind_ptrs_owner = - dpctl::tensor::alloc_utils::smart_malloc_device(k, exec_q); + dpnp::tensor::alloc_utils::smart_malloc_device(k, exec_q); char **packed_ind_ptrs = packed_ind_ptrs_owner.get(); // rearrange to past where indices shapes are checked @@ -443,13 +443,13 @@ std::pair // ..., // ind[k] strides] auto packed_ind_shapes_strides_owner = - dpctl::tensor::alloc_utils::smart_malloc_device( + dpnp::tensor::alloc_utils::smart_malloc_device( (k + 1) * ind_sh_elems, exec_q); py::ssize_t *packed_ind_shapes_strides = packed_ind_shapes_strides_owner.get(); auto packed_ind_offsets_owner = - dpctl::tensor::alloc_utils::smart_malloc_device(k, exec_q); + dpnp::tensor::alloc_utils::smart_malloc_device(k, exec_q); py::ssize_t *packed_ind_offsets = packed_ind_offsets_owner.get(); int orthog_sh_elems = std::max(src_nd - k, 1); @@ -459,7 +459,7 @@ std::pair // dst_strides[:axis] + // dst_strides[axis+ind.ndim:]] auto packed_shapes_strides_owner = - dpctl::tensor::alloc_utils::smart_malloc_device( + dpnp::tensor::alloc_utils::smart_malloc_device( 3 * orthog_sh_elems, exec_q); py::ssize_t *packed_shapes_strides = packed_shapes_strides_owner.get(); @@ -468,7 +468,7 @@ std::pair // dst_shape[axis:axis+ind.ndim], // dst_strides[axis:axis+ind.ndim]] auto packed_axes_shapes_strides_owner = - dpctl::tensor::alloc_utils::smart_malloc_device( + dpnp::tensor::alloc_utils::smart_malloc_device( 2 * (k + ind_sh_elems), exec_q); py::ssize_t *packed_axes_shapes_strides = packed_axes_shapes_strides_owner.get(); @@ -508,7 +508,7 @@ std::pair // free packed temporaries sycl::event temporaries_cleanup_ev = - dpctl::tensor::alloc_utils::async_smart_free( + dpnp::tensor::alloc_utils::async_smart_free( exec_q, {take_generic_ev}, packed_shapes_strides_owner, packed_axes_shapes_strides_owner, packed_ind_shapes_strides_owner, packed_ind_ptrs_owner, packed_ind_offsets_owner); @@ -521,15 +521,15 @@ std::pair } std::pair - usm_ndarray_put(const dpctl::tensor::usm_ndarray &dst, + usm_ndarray_put(const dpnp::tensor::usm_ndarray &dst, const py::object &py_ind, - const dpctl::tensor::usm_ndarray &val, + const dpnp::tensor::usm_ndarray &val, int axis_start, std::uint8_t mode, sycl::queue &exec_q, const std::vector &depends) { - std::vector ind = parse_py_ind(exec_q, py_ind); + std::vector ind = parse_py_ind(exec_q, py_ind); int k = ind.size(); if (k == 0) { @@ -545,9 +545,9 @@ std::pair throw py::value_error("Mode must be 0 or 1."); } - dpctl::tensor::validation::CheckWritable::throw_if_not_writable(dst); + dpnp::tensor::validation::CheckWritable::throw_if_not_writable(dst); - const dpctl::tensor::usm_ndarray ind_rep = ind[0]; + const dpnp::tensor::usm_ndarray ind_rep = ind[0]; int dst_nd = dst.get_ndim(); int val_nd = val.get_ndim(); @@ -600,12 +600,12 @@ std::pair char *dst_data = dst.get_data(); char *val_data = val.get_data(); - if (!dpctl::utils::queues_are_compatible(exec_q, {dst, val})) { + if (!dpnp::utils::queues_are_compatible(exec_q, {dst, val})) { throw py::value_error( "Execution queue is not compatible with allocation queues"); } - auto const &overlap = dpctl::tensor::overlap::MemoryOverlap(); + auto const &overlap = dpnp::tensor::overlap::MemoryOverlap(); if (overlap(val, dst)) { throw py::value_error("Arrays index overlapping segments of memory"); } @@ -613,7 +613,7 @@ std::pair py::ssize_t dst_offset = py::ssize_t(0); py::ssize_t val_offset = py::ssize_t(0); - dpctl::tensor::validation::AmpleMemory::throw_if_not_ample(dst, dst_nelems); + dpnp::tensor::validation::AmpleMemory::throw_if_not_ample(dst, dst_nelems); int dst_typenum = dst.get_typenum(); int val_typenum = val.get_typenum(); @@ -652,9 +652,9 @@ std::pair std::copy(ind_shape, ind_shape + ind_sh_elems, ind_sh_sts.begin()); } for (int i = 0; i < k; ++i) { - dpctl::tensor::usm_ndarray ind_ = ind[i]; + dpnp::tensor::usm_ndarray ind_ = ind[i]; - if (!dpctl::utils::queues_are_compatible(exec_q, {ind_})) { + if (!dpnp::utils::queues_are_compatible(exec_q, {ind_})) { throw py::value_error( "Execution queue is not compatible with allocation queues"); } @@ -703,7 +703,7 @@ std::pair } auto packed_ind_ptrs_owner = - dpctl::tensor::alloc_utils::smart_malloc_device(k, exec_q); + dpnp::tensor::alloc_utils::smart_malloc_device(k, exec_q); char **packed_ind_ptrs = packed_ind_ptrs_owner.get(); // packed_ind_shapes_strides = [ind_shape, @@ -711,13 +711,13 @@ std::pair // ..., // ind[k] strides] auto packed_ind_shapes_strides_owner = - dpctl::tensor::alloc_utils::smart_malloc_device( + dpnp::tensor::alloc_utils::smart_malloc_device( (k + 1) * ind_sh_elems, exec_q); py::ssize_t *packed_ind_shapes_strides = packed_ind_shapes_strides_owner.get(); auto packed_ind_offsets_owner = - dpctl::tensor::alloc_utils::smart_malloc_device(k, exec_q); + dpnp::tensor::alloc_utils::smart_malloc_device(k, exec_q); py::ssize_t *packed_ind_offsets = packed_ind_offsets_owner.get(); int orthog_sh_elems = std::max(dst_nd - k, 1); @@ -727,7 +727,7 @@ std::pair // val_strides[:axis] + // val_strides[axis+ind.ndim:]] auto packed_shapes_strides_owner = - dpctl::tensor::alloc_utils::smart_malloc_device( + dpnp::tensor::alloc_utils::smart_malloc_device( 3 * orthog_sh_elems, exec_q); py::ssize_t *packed_shapes_strides = packed_shapes_strides_owner.get(); @@ -736,7 +736,7 @@ std::pair // val_shape[axis:axis+ind.ndim], // val_strides[axis:axis+ind.ndim]] auto packed_axes_shapes_strides_owner = - dpctl::tensor::alloc_utils::smart_malloc_device( + dpnp::tensor::alloc_utils::smart_malloc_device( 2 * (k + ind_sh_elems), exec_q); py::ssize_t *packed_axes_shapes_strides = packed_axes_shapes_strides_owner.get(); @@ -776,7 +776,7 @@ std::pair // free packed temporaries sycl::event temporaries_cleanup_ev = - dpctl::tensor::alloc_utils::async_smart_free( + dpnp::tensor::alloc_utils::async_smart_free( exec_q, {put_generic_ev}, packed_shapes_strides_owner, packed_axes_shapes_strides_owner, packed_ind_shapes_strides_owner, packed_ind_ptrs_owner, packed_ind_offsets_owner); @@ -792,23 +792,23 @@ void init_advanced_indexing_dispatch_tables(void) { using namespace td_ns; - using dpctl::tensor::kernels::indexing::TakeClipFactory; + using dpnp::tensor::kernels::indexing::TakeClipFactory; DispatchTableBuilder dtb_takeclip; dtb_takeclip.populate_dispatch_table(take_dispatch_table[CLIP_MODE]); - using dpctl::tensor::kernels::indexing::TakeWrapFactory; + using dpnp::tensor::kernels::indexing::TakeWrapFactory; DispatchTableBuilder dtb_takewrap; dtb_takewrap.populate_dispatch_table(take_dispatch_table[WRAP_MODE]); - using dpctl::tensor::kernels::indexing::PutClipFactory; + using dpnp::tensor::kernels::indexing::PutClipFactory; DispatchTableBuilder dtb_putclip; dtb_putclip.populate_dispatch_table(put_dispatch_table[CLIP_MODE]); - using dpctl::tensor::kernels::indexing::PutWrapFactory; + using dpnp::tensor::kernels::indexing::PutWrapFactory; DispatchTableBuilder dtb_putwrap; dtb_putwrap.populate_dispatch_table(put_dispatch_table[WRAP_MODE]); } -} // namespace dpctl::tensor::py_internal +} // namespace dpnp::tensor::py_internal diff --git a/dpnp/tensor/libtensor/source/integer_advanced_indexing.hpp b/dpnp/tensor/libtensor/source/integer_advanced_indexing.hpp index bc0136288e1c..52d9542e501e 100644 --- a/dpnp/tensor/libtensor/source/integer_advanced_indexing.hpp +++ b/dpnp/tensor/libtensor/source/integer_advanced_indexing.hpp @@ -30,7 +30,7 @@ /// /// \file /// This file declares Python API for implementation functions of -/// dpctl.tensor.take and dpctl.tensor.put +/// dpnp.tensor.take and dpnp.tensor.put //===----------------------------------------------------------------------===// #pragma once @@ -45,22 +45,22 @@ namespace py = pybind11; -namespace dpctl::tensor::py_internal +namespace dpnp::tensor::py_internal { extern std::pair - usm_ndarray_take(const dpctl::tensor::usm_ndarray &, + usm_ndarray_take(const dpnp::tensor::usm_ndarray &, const py::object &, - const dpctl::tensor::usm_ndarray &, + const dpnp::tensor::usm_ndarray &, int, std::uint8_t, sycl::queue &, const std::vector & = {}); extern std::pair - usm_ndarray_put(const dpctl::tensor::usm_ndarray &, + usm_ndarray_put(const dpnp::tensor::usm_ndarray &, const py::object &, - const dpctl::tensor::usm_ndarray &, + const dpnp::tensor::usm_ndarray &, int, std::uint8_t, sycl::queue &, @@ -68,4 +68,4 @@ extern std::pair extern void init_advanced_indexing_dispatch_tables(void); -} // namespace dpctl::tensor::py_internal +} // namespace dpnp::tensor::py_internal diff --git a/dpnp/tensor/libtensor/source/linalg_functions/dot.cpp b/dpnp/tensor/libtensor/source/linalg_functions/dot.cpp index 9621ebc3277f..4bb98d5f990a 100644 --- a/dpnp/tensor/libtensor/source/linalg_functions/dot.cpp +++ b/dpnp/tensor/libtensor/source/linalg_functions/dot.cpp @@ -29,7 +29,7 @@ //===---------------------------------------------------------------------===// /// /// \file -/// This file defines functions of dpctl.tensor._tensor_impl extensions +/// This file defines functions of dpnp.tensor._tensor_impl extensions //===--------------------------------------------------------------------===// #include @@ -63,49 +63,49 @@ #include "utils/type_dispatch.hpp" #include "utils/type_dispatch_building.hpp" -namespace dpctl::tensor::py_internal +namespace dpnp::tensor::py_internal { -namespace td_ns = dpctl::tensor::type_dispatch; +namespace td_ns = dpnp::tensor::type_dispatch; static int dot_output_id_table[td_ns::num_types][td_ns::num_types]; -using dpctl::tensor::kernels::dot_product_impl_fn_ptr_t; +using dpnp::tensor::kernels::dot_product_impl_fn_ptr_t; static dot_product_impl_fn_ptr_t dot_product_dispatch_table[td_ns::num_types] [td_ns::num_types]; static dot_product_impl_fn_ptr_t dot_product_temps_dispatch_table[td_ns::num_types][td_ns::num_types]; -using dpctl::tensor::kernels::dot_product_contig_impl_fn_ptr_t; +using dpnp::tensor::kernels::dot_product_contig_impl_fn_ptr_t; static dot_product_contig_impl_fn_ptr_t dot_product_contig_dispatch_table[td_ns::num_types][td_ns::num_types]; static dot_product_contig_impl_fn_ptr_t dot_product_contig_temps_dispatch_table[td_ns::num_types][td_ns::num_types]; -using dpctl::tensor::kernels::gemm_impl_fn_ptr_t; +using dpnp::tensor::kernels::gemm_impl_fn_ptr_t; static gemm_impl_fn_ptr_t gemm_atomic_dispatch_table[td_ns::num_types] [td_ns::num_types]; static gemm_impl_fn_ptr_t gemm_temps_dispatch_table[td_ns::num_types] [td_ns::num_types]; -using dpctl::tensor::kernels::gemm_contig_impl_fn_ptr_t; +using dpnp::tensor::kernels::gemm_contig_impl_fn_ptr_t; static gemm_contig_impl_fn_ptr_t gemm_contig_atomic_dispatch_table[td_ns::num_types][td_ns::num_types]; static gemm_contig_impl_fn_ptr_t gemm_contig_temps_dispatch_table[td_ns::num_types][td_ns::num_types]; -using dpctl::tensor::kernels::gemm_batch_impl_fn_ptr_t; +using dpnp::tensor::kernels::gemm_batch_impl_fn_ptr_t; static gemm_batch_impl_fn_ptr_t gemm_batch_atomic_dispatch_table[td_ns::num_types][td_ns::num_types]; static gemm_batch_impl_fn_ptr_t gemm_batch_temps_dispatch_table[td_ns::num_types][td_ns::num_types]; -using dpctl::tensor::kernels::gemm_batch_contig_impl_fn_ptr_t; +using dpnp::tensor::kernels::gemm_batch_contig_impl_fn_ptr_t; static gemm_batch_contig_impl_fn_ptr_t gemm_batch_contig_atomic_dispatch_table[td_ns::num_types][td_ns::num_types]; @@ -193,22 +193,22 @@ void init_dot_atomic_support_vector(void) } std::pair - py_dot(const dpctl::tensor::usm_ndarray &x1, - const dpctl::tensor::usm_ndarray &x2, + py_dot(const dpnp::tensor::usm_ndarray &x1, + const dpnp::tensor::usm_ndarray &x2, int batch_dims, int x1_outer_dims, int x2_outer_dims, int inner_dims, - const dpctl::tensor::usm_ndarray &dst, + const dpnp::tensor::usm_ndarray &dst, sycl::queue &exec_q, const std::vector &depends) { - if (!dpctl::utils::queues_are_compatible(exec_q, {x1, x2, dst})) { + if (!dpnp::utils::queues_are_compatible(exec_q, {x1, x2, dst})) { throw py::value_error( "Execution queue is not compatible with allocation queues"); } - dpctl::tensor::validation::CheckWritable::throw_if_not_writable(dst); + dpnp::tensor::validation::CheckWritable::throw_if_not_writable(dst); if (inner_dims == 0) { throw py::value_error("No inner dimension for dot"); @@ -274,9 +274,9 @@ std::pair throw py::value_error("dst shape and size mismatch"); } - dpctl::tensor::validation::AmpleMemory::throw_if_not_ample(dst, dst_nelems); + dpnp::tensor::validation::AmpleMemory::throw_if_not_ample(dst, dst_nelems); - auto const &overlap = dpctl::tensor::overlap::MemoryOverlap(); + auto const &overlap = dpnp::tensor::overlap::MemoryOverlap(); // check that dst does not intersect with x1 or x2 if (overlap(dst, x1) || overlap(dst, x2)) { throw py::value_error("Result array overlaps with inputs"); @@ -350,7 +350,7 @@ std::pair zero_offset, // lhs reduction offset zero_offset, // rhs reduction offset depends); - return std::make_pair(dpctl::utils::keep_args_alive( + return std::make_pair(dpnp::utils::keep_args_alive( exec_q, {x1, x2, dst}, {dot_ev}), dot_ev); } @@ -446,7 +446,7 @@ std::pair inner_x1_offset, // lhs reduction offset inner_x2_offset, // rhs reduction offset depends); - return std::make_pair(dpctl::utils::keep_args_alive( + return std::make_pair(dpnp::utils::keep_args_alive( exec_q, {x1, x2, dst}, {dot_ev}), dot_ev); } @@ -467,7 +467,7 @@ std::pair } } - using dpctl::tensor::offset_utils::device_allocate_and_pack; + using dpnp::tensor::offset_utils::device_allocate_and_pack; auto arrays_metainfo_packing_triple_ = device_allocate_and_pack( exec_q, host_task_events, @@ -501,8 +501,8 @@ std::pair inner_shape_stride, inner_x1_offset, inner_x2_offset, all_deps); sycl::event temp_cleanup_ev = - dpctl::tensor::alloc_utils::async_smart_free(exec_q, {dot_ev}, - tmp_alloc_owner); + dpnp::tensor::alloc_utils::async_smart_free(exec_q, {dot_ev}, + tmp_alloc_owner); host_task_events.push_back(temp_cleanup_ev); } else { // if (!call_vecdot) @@ -522,7 +522,7 @@ std::pair inner_nelems, // k x2_outer_nelems, // m depends); - return std::make_pair(dpctl::utils::keep_args_alive( + return std::make_pair(dpnp::utils::keep_args_alive( exec_q, {x1, x2, dst}, {dot_ev}), dot_ev); } @@ -540,7 +540,7 @@ std::pair " and x2_typeid=" + std::to_string(x2_typeid)); } } - using dpctl::tensor::offset_utils::device_allocate_and_pack; + using dpnp::tensor::offset_utils::device_allocate_and_pack; auto ptr_size_event_tuple1 = device_allocate_and_pack( exec_q, host_task_events, x1_shape_vec, x1_strides_vec, x2_shape_vec, x2_strides_vec, dst_shape_vec, dst_strides_vec); @@ -570,7 +570,7 @@ std::pair x1_outer_dims + x2_outer_dims, dst_shape_strides, all_deps); sycl::event cleanup_tmp_allocations_ev = - dpctl::tensor::alloc_utils::async_smart_free( + dpnp::tensor::alloc_utils::async_smart_free( exec_q, {dot_ev}, packed_shapes_strides_owner); host_task_events.push_back(cleanup_tmp_allocations_ev); } @@ -598,7 +598,7 @@ std::pair inner_nelems, // k x2_outer_nelems, // m zero_offset, zero_offset, zero_offset, depends); - return std::make_pair(dpctl::utils::keep_args_alive( + return std::make_pair(dpnp::utils::keep_args_alive( exec_q, {x1, x2, dst}, {dot_ev}), dot_ev); } @@ -700,8 +700,8 @@ std::pair x1_batch_offset, x2_batch_offset, dst_batch_offset, depends); return std::make_pair( - dpctl::utils::keep_args_alive(exec_q, {x1, x2, dst}, - {dot_ev}), + dpnp::utils::keep_args_alive(exec_q, {x1, x2, dst}, + {dot_ev}), dot_ev); } } @@ -720,7 +720,7 @@ std::pair " and x2_typeid=" + std::to_string(x2_typeid)); } } - using dpctl::tensor::offset_utils::device_allocate_and_pack; + using dpnp::tensor::offset_utils::device_allocate_and_pack; auto ptr_size_event_tuple1 = device_allocate_and_pack( exec_q, host_task_events, simplified_batch_shape, simplified_batch_x1_strides, simplified_batch_x2_strides, @@ -767,13 +767,13 @@ std::pair dst_outer_shapes_strides, dst_full_shape_strides, all_deps); sycl::event cleanup_tmp_allocations_ev = - dpctl::tensor::alloc_utils::async_smart_free( + dpnp::tensor::alloc_utils::async_smart_free( exec_q, {dot_ev}, packed_shapes_strides_owner); host_task_events.push_back(cleanup_tmp_allocations_ev); } } return std::make_pair( - dpctl::utils::keep_args_alive(exec_q, {x1, x2, dst}, host_task_events), + dpnp::utils::keep_args_alive(exec_q, {x1, x2, dst}, host_task_events), dot_ev); } @@ -782,8 +782,8 @@ py::object py_dot_result_type(const py::dtype &input1_dtype, const py::dtype &input2_dtype, const output_typesT &output_types_table) { - int tn1 = input1_dtype.num(); // NumPy type numbers are the same as in dpctl - int tn2 = input2_dtype.num(); // NumPy type numbers are the same as in dpctl + int tn1 = input1_dtype.num(); // NumPy type numbers are the same as in dpnp + int tn2 = input2_dtype.num(); // NumPy type numbers are the same as in dpnp int src1_typeid = -1; int src2_typeid = -1; @@ -831,4 +831,4 @@ void init_dot(py::module_ m) m.def("_dot_result_type", dot_result_type_pyapi, ""); } -} // namespace dpctl::tensor::py_internal +} // namespace dpnp::tensor::py_internal diff --git a/dpnp/tensor/libtensor/source/linalg_functions/dot.hpp b/dpnp/tensor/libtensor/source/linalg_functions/dot.hpp index f6a23ace5cd9..a340bba3ac68 100644 --- a/dpnp/tensor/libtensor/source/linalg_functions/dot.hpp +++ b/dpnp/tensor/libtensor/source/linalg_functions/dot.hpp @@ -29,7 +29,7 @@ //===---------------------------------------------------------------------===// /// /// \file -/// This file defines functions of dpctl.tensor._tensor_impl extensions +/// This file defines functions of dpnp.tensor._tensor_impl extensions //===--------------------------------------------------------------------===// #pragma once @@ -37,9 +37,9 @@ namespace py = pybind11; -namespace dpctl::tensor::py_internal +namespace dpnp::tensor::py_internal { extern void init_dot(py::module_ m); -} // namespace dpctl::tensor::py_internal +} // namespace dpnp::tensor::py_internal diff --git a/dpnp/tensor/libtensor/source/linalg_functions/dot_atomic_support.hpp b/dpnp/tensor/libtensor/source/linalg_functions/dot_atomic_support.hpp index 66b9b5004575..ce017cc181dc 100644 --- a/dpnp/tensor/libtensor/source/linalg_functions/dot_atomic_support.hpp +++ b/dpnp/tensor/libtensor/source/linalg_functions/dot_atomic_support.hpp @@ -29,7 +29,7 @@ //===---------------------------------------------------------------------===// /// /// \file -/// This file defines functions of dpctl.tensor._tensor_impl extensions +/// This file defines functions of dpnp.tensor._tensor_impl extensions //===--------------------------------------------------------------------===// #pragma once @@ -37,7 +37,7 @@ #include "reductions/reduction_atomic_support.hpp" #include "utils/type_utils.hpp" -namespace dpctl::tensor::py_internal::atomic_support +namespace dpnp::tensor::py_internal::atomic_support { template @@ -45,7 +45,7 @@ struct DotAtomicSupportFactory { fnT get() { - using dpctl::tensor::type_utils::is_complex; + using dpnp::tensor::type_utils::is_complex; if constexpr (is_complex::value) { return atomic_support::fixed_decision; } @@ -55,4 +55,4 @@ struct DotAtomicSupportFactory } }; -} // namespace dpctl::tensor::py_internal::atomic_support +} // namespace dpnp::tensor::py_internal::atomic_support diff --git a/dpnp/tensor/libtensor/source/linalg_functions/dot_dispatch.hpp b/dpnp/tensor/libtensor/source/linalg_functions/dot_dispatch.hpp index 984f71a4c183..6f4ec7c8309d 100644 --- a/dpnp/tensor/libtensor/source/linalg_functions/dot_dispatch.hpp +++ b/dpnp/tensor/libtensor/source/linalg_functions/dot_dispatch.hpp @@ -29,7 +29,7 @@ //===---------------------------------------------------------------------===// /// /// \file -/// This file defines functions of dpctl.tensor._tensor_impl extensions +/// This file defines functions of dpnp.tensor._tensor_impl extensions //===--------------------------------------------------------------------===// #pragma once @@ -42,10 +42,10 @@ #include "kernels/linalg_functions/gemm.hpp" #include "utils/type_dispatch_building.hpp" -namespace dpctl::tensor::py_internal +namespace dpnp::tensor::py_internal { -namespace td_ns = dpctl::tensor::type_dispatch; +namespace td_ns = dpnp::tensor::type_dispatch; template struct DotAtomicOutputType @@ -196,7 +196,7 @@ struct GemmBatchAtomicFactory return fn; } else { - using dpctl::tensor::kernels::gemm_batch_impl; + using dpnp::tensor::kernels::gemm_batch_impl; using T3 = typename DotAtomicOutputType::value_type; fnT fn = gemm_batch_impl; return fn; @@ -214,7 +214,7 @@ struct GemmBatchContigAtomicFactory return fn; } else { - using dpctl::tensor::kernels::gemm_batch_contig_impl; + using dpnp::tensor::kernels::gemm_batch_contig_impl; using T3 = typename DotAtomicOutputType::value_type; fnT fn = gemm_batch_contig_impl; return fn; @@ -232,7 +232,7 @@ struct GemmAtomicFactory return fn; } else { - using dpctl::tensor::kernels::gemm_impl; + using dpnp::tensor::kernels::gemm_impl; using T3 = typename DotAtomicOutputType::value_type; fnT fn = gemm_impl; return fn; @@ -250,7 +250,7 @@ struct GemmContigAtomicFactory return fn; } else { - using dpctl::tensor::kernels::gemm_contig_impl; + using dpnp::tensor::kernels::gemm_contig_impl; using T3 = typename DotAtomicOutputType::value_type; fnT fn = gemm_contig_impl; return fn; @@ -268,7 +268,7 @@ struct GemmTempsFactory return fn; } else { - using dpctl::tensor::kernels::gemm_tree_impl; + using dpnp::tensor::kernels::gemm_tree_impl; using T3 = typename DotNoAtomicOutputType::value_type; fnT fn = gemm_tree_impl; return fn; @@ -286,7 +286,7 @@ struct GemmContigTempsFactory return fn; } else { - using dpctl::tensor::kernels::gemm_contig_tree_impl; + using dpnp::tensor::kernels::gemm_contig_tree_impl; using T3 = typename DotNoAtomicOutputType::value_type; fnT fn = gemm_contig_tree_impl; return fn; @@ -304,7 +304,7 @@ struct GemmBatchTempsFactory return fn; } else { - using dpctl::tensor::kernels::gemm_batch_tree_impl; + using dpnp::tensor::kernels::gemm_batch_tree_impl; using T3 = typename DotNoAtomicOutputType::value_type; fnT fn = gemm_batch_tree_impl; return fn; @@ -322,7 +322,7 @@ struct GemmBatchContigTempsFactory return fn; } else { - using dpctl::tensor::kernels::gemm_batch_contig_tree_impl; + using dpnp::tensor::kernels::gemm_batch_contig_tree_impl; using T3 = typename DotNoAtomicOutputType::value_type; fnT fn = gemm_batch_contig_tree_impl; return fn; @@ -340,7 +340,7 @@ struct DotProductAtomicFactory return fn; } else { - using dpctl::tensor::kernels::dot_product_impl; + using dpnp::tensor::kernels::dot_product_impl; using T3 = typename DotAtomicOutputType::value_type; fnT fn = dot_product_impl; return fn; @@ -358,7 +358,7 @@ struct DotProductNoAtomicFactory return fn; } else { - using dpctl::tensor::kernels::dot_product_tree_impl; + using dpnp::tensor::kernels::dot_product_tree_impl; using T3 = typename DotNoAtomicOutputType::value_type; fnT fn = dot_product_tree_impl; return fn; @@ -376,7 +376,7 @@ struct DotProductContigAtomicFactory return fn; } else { - using dpctl::tensor::kernels::dot_product_contig_impl; + using dpnp::tensor::kernels::dot_product_contig_impl; using T3 = typename DotAtomicOutputType::value_type; fnT fn = dot_product_contig_impl; return fn; @@ -394,7 +394,7 @@ struct DotProductContigNoAtomicFactory return fn; } else { - using dpctl::tensor::kernels::dot_product_contig_tree_impl; + using dpnp::tensor::kernels::dot_product_contig_tree_impl; using T3 = typename DotNoAtomicOutputType::value_type; fnT fn = dot_product_contig_tree_impl; return fn; @@ -402,4 +402,4 @@ struct DotProductContigNoAtomicFactory } }; -} // namespace dpctl::tensor::py_internal +} // namespace dpnp::tensor::py_internal diff --git a/dpnp/tensor/libtensor/source/linear_sequences.cpp b/dpnp/tensor/libtensor/source/linear_sequences.cpp index 9a7bf2dbcc0f..2905498ab55c 100644 --- a/dpnp/tensor/libtensor/source/linear_sequences.cpp +++ b/dpnp/tensor/libtensor/source/linear_sequences.cpp @@ -29,7 +29,7 @@ //===---------------------------------------------------------------------===// /// /// \file -/// This file defines functions of dpctl.tensor._tensor_impl extensions +/// This file defines functions of dpnp.tensor._tensor_impl extensions //===---------------------------------------------------------------------===// #include @@ -48,11 +48,11 @@ #include "linear_sequences.hpp" -namespace dpctl::tensor::py_internal +namespace dpnp::tensor::py_internal { namespace py = pybind11; -namespace td_ns = dpctl::tensor::type_dispatch; +namespace td_ns = dpnp::tensor::type_dispatch; // Constructor to populate tensor with linear sequence defined by // start and step data @@ -95,7 +95,7 @@ sycl::event lin_space_step_impl(sycl::queue &exec_q, Ty start_v = py::cast(start); Ty step_v = py::cast(step); - using dpctl::tensor::kernels::constructors::lin_space_step_impl; + using dpnp::tensor::kernels::constructors::lin_space_step_impl; auto lin_space_step_event = lin_space_step_impl( exec_q, nelems, start_v, step_v, array_data, depends); @@ -144,7 +144,7 @@ sycl::event lin_space_affine_impl(sycl::queue &exec_q, Ty start_v = py::cast(start); Ty end_v = py::cast(end); - using dpctl::tensor::kernels::constructors::lin_space_affine_impl; + using dpnp::tensor::kernels::constructors::lin_space_affine_impl; auto lin_space_affine_event = lin_space_affine_impl( exec_q, nelems, start_v, end_v, include_endpoint, array_data, depends); @@ -152,7 +152,7 @@ sycl::event lin_space_affine_impl(sycl::queue &exec_q, return lin_space_affine_event; } -using dpctl::utils::keep_args_alive; +using dpnp::utils::keep_args_alive; static lin_space_step_fn_ptr_t lin_space_step_dispatch_vector[td_ns::num_types]; @@ -162,7 +162,7 @@ static lin_space_affine_fn_ptr_t std::pair usm_ndarray_linear_sequence_step(const py::object &start, const py::object &dt, - const dpctl::tensor::usm_ndarray &dst, + const dpnp::tensor::usm_ndarray &dst, sycl::queue &exec_q, const std::vector &depends) { @@ -179,12 +179,12 @@ std::pair "usm_ndarray_linspace: Non-contiguous arrays are not supported"); } - if (!dpctl::utils::queues_are_compatible(exec_q, {dst})) { + if (!dpnp::utils::queues_are_compatible(exec_q, {dst})) { throw py::value_error( "Execution queue is not compatible with the allocation queue"); } - dpctl::tensor::validation::CheckWritable::throw_if_not_writable(dst); + dpnp::tensor::validation::CheckWritable::throw_if_not_writable(dst); auto array_types = td_ns::usm_ndarray_types(); int dst_typenum = dst.get_typenum(); @@ -211,7 +211,7 @@ std::pair std::pair usm_ndarray_linear_sequence_affine(const py::object &start, const py::object &end, - const dpctl::tensor::usm_ndarray &dst, + const dpnp::tensor::usm_ndarray &dst, bool include_endpoint, sycl::queue &exec_q, const std::vector &depends) @@ -229,12 +229,12 @@ std::pair "usm_ndarray_linspace: Non-contiguous arrays are not supported"); } - if (!dpctl::utils::queues_are_compatible(exec_q, {dst})) { + if (!dpnp::utils::queues_are_compatible(exec_q, {dst})) { throw py::value_error( "Execution queue context is not the same as allocation context"); } - dpctl::tensor::validation::CheckWritable::throw_if_not_writable(dst); + dpnp::tensor::validation::CheckWritable::throw_if_not_writable(dst); auto array_types = td_ns::usm_ndarray_types(); int dst_typenum = dst.get_typenum(); @@ -303,4 +303,4 @@ void init_linear_sequences_dispatch_vectors(void) dvb2.populate_dispatch_vector(lin_space_affine_dispatch_vector); } -} // namespace dpctl::tensor::py_internal +} // namespace dpnp::tensor::py_internal diff --git a/dpnp/tensor/libtensor/source/linear_sequences.hpp b/dpnp/tensor/libtensor/source/linear_sequences.hpp index 45cf45153462..7de0acfa5e30 100644 --- a/dpnp/tensor/libtensor/source/linear_sequences.hpp +++ b/dpnp/tensor/libtensor/source/linear_sequences.hpp @@ -29,7 +29,7 @@ //===---------------------------------------------------------------------===// /// /// \file -/// This file defines functions of dpctl.tensor._tensor_impl extensions +/// This file defines functions of dpnp.tensor._tensor_impl extensions //===---------------------------------------------------------------------===// #pragma once @@ -43,24 +43,24 @@ namespace py = pybind11; -namespace dpctl::tensor::py_internal +namespace dpnp::tensor::py_internal { extern std::pair usm_ndarray_linear_sequence_step( const py::object &start, const py::object &dt, - const dpctl::tensor::usm_ndarray &dst, + const dpnp::tensor::usm_ndarray &dst, sycl::queue &exec_q, const std::vector &depends = {}); extern std::pair usm_ndarray_linear_sequence_affine( const py::object &start, const py::object &end, - const dpctl::tensor::usm_ndarray &dst, + const dpnp::tensor::usm_ndarray &dst, bool include_endpoint, sycl::queue &exec_q, const std::vector &depends = {}); extern void init_linear_sequences_dispatch_vectors(void); -} // namespace dpctl::tensor::py_internal +} // namespace dpnp::tensor::py_internal diff --git a/dpnp/tensor/libtensor/source/reductions/all.cpp b/dpnp/tensor/libtensor/source/reductions/all.cpp index a901b9e1d9a3..8c54a36119a9 100644 --- a/dpnp/tensor/libtensor/source/reductions/all.cpp +++ b/dpnp/tensor/libtensor/source/reductions/all.cpp @@ -29,7 +29,7 @@ //===---------------------------------------------------------------------===// /// /// \file -/// This file defines functions of dpctl.tensor._tensor_reductions_impl +/// This file defines functions of dpnp.tensor._tensor_reductions_impl /// extension. //===---------------------------------------------------------------------===// @@ -47,20 +47,20 @@ #include "reduction_over_axis.hpp" #include "utils/type_dispatch.hpp" -namespace dpctl::tensor::py_internal +namespace dpnp::tensor::py_internal { namespace py = pybind11; -namespace td_ns = dpctl::tensor::type_dispatch; +namespace td_ns = dpnp::tensor::type_dispatch; namespace impl { -using dpctl::tensor::kernels::reduction_strided_impl_fn_ptr; +using dpnp::tensor::kernels::reduction_strided_impl_fn_ptr; static reduction_strided_impl_fn_ptr all_reduction_strided_dispatch_vector[td_ns::num_types]; -using dpctl::tensor::kernels::reduction_contig_impl_fn_ptr; +using dpnp::tensor::kernels::reduction_contig_impl_fn_ptr; static reduction_contig_impl_fn_ptr all_reduction_axis1_contig_dispatch_vector[td_ns::num_types]; static reduction_contig_impl_fn_ptr @@ -73,7 +73,7 @@ struct AllStridedFactory { using dstTy = std::int32_t; using ReductionOpT = sycl::logical_and; - return dpctl::tensor::kernels:: + return dpnp::tensor::kernels:: reduction_over_group_with_atomics_strided_impl; } @@ -86,7 +86,7 @@ struct AllAxis1ContigFactory { using dstTy = std::int32_t; using ReductionOpT = sycl::logical_and; - return dpctl::tensor::kernels:: + return dpnp::tensor::kernels:: reduction_axis1_over_group_with_atomics_contig_impl; } @@ -99,7 +99,7 @@ struct AllAxis0ContigFactory { using dstTy = std::int32_t; using ReductionOpT = sycl::logical_and; - return dpctl::tensor::kernels:: + return dpnp::tensor::kernels:: reduction_axis0_over_group_with_atomics_contig_impl; } @@ -136,7 +136,7 @@ static atomic_support_fn_ptr_t all_atomic_support = void init_all(py::module_ m) { - using arrayT = dpctl::tensor::usm_ndarray; + using arrayT = dpnp::tensor::usm_ndarray; using event_vecT = std::vector; { impl::populate_all_dispatch_vectors(); @@ -161,4 +161,4 @@ void init_all(py::module_ m) } } -} // namespace dpctl::tensor::py_internal +} // namespace dpnp::tensor::py_internal diff --git a/dpnp/tensor/libtensor/source/reductions/all.hpp b/dpnp/tensor/libtensor/source/reductions/all.hpp index 5fb184e37c66..1a23740ad34e 100644 --- a/dpnp/tensor/libtensor/source/reductions/all.hpp +++ b/dpnp/tensor/libtensor/source/reductions/all.hpp @@ -29,7 +29,7 @@ //===---------------------------------------------------------------------===// /// /// \file -/// This file defines functions of dpctl.tensor._tensor_reductions_impl +/// This file defines functions of dpnp.tensor._tensor_reductions_impl /// extension. //===---------------------------------------------------------------------===// @@ -38,9 +38,9 @@ namespace py = pybind11; -namespace dpctl::tensor::py_internal +namespace dpnp::tensor::py_internal { extern void init_all(py::module_ m); -} // namespace dpctl::tensor::py_internal +} // namespace dpnp::tensor::py_internal diff --git a/dpnp/tensor/libtensor/source/reductions/any.cpp b/dpnp/tensor/libtensor/source/reductions/any.cpp index 6859e46cbc4a..fc7d12ba33ae 100644 --- a/dpnp/tensor/libtensor/source/reductions/any.cpp +++ b/dpnp/tensor/libtensor/source/reductions/any.cpp @@ -29,7 +29,7 @@ //===---------------------------------------------------------------------===// /// /// \file -/// This file defines functions of dpctl.tensor._tensor_reductions_impl +/// This file defines functions of dpnp.tensor._tensor_reductions_impl /// extension. //===---------------------------------------------------------------------===// @@ -47,20 +47,20 @@ #include "reduction_over_axis.hpp" #include "utils/type_dispatch.hpp" -namespace dpctl::tensor::py_internal +namespace dpnp::tensor::py_internal { namespace py = pybind11; -namespace td_ns = dpctl::tensor::type_dispatch; +namespace td_ns = dpnp::tensor::type_dispatch; namespace impl { -using dpctl::tensor::kernels::reduction_strided_impl_fn_ptr; +using dpnp::tensor::kernels::reduction_strided_impl_fn_ptr; static reduction_strided_impl_fn_ptr any_reduction_strided_dispatch_vector[td_ns::num_types]; -using dpctl::tensor::kernels::reduction_contig_impl_fn_ptr; +using dpnp::tensor::kernels::reduction_contig_impl_fn_ptr; static reduction_contig_impl_fn_ptr any_reduction_axis1_contig_dispatch_vector[td_ns::num_types]; static reduction_contig_impl_fn_ptr @@ -73,7 +73,7 @@ struct AnyStridedFactory { using dstTy = std::int32_t; using ReductionOpT = sycl::logical_or; - return dpctl::tensor::kernels:: + return dpnp::tensor::kernels:: reduction_over_group_with_atomics_strided_impl; } @@ -86,7 +86,7 @@ struct AnyAxis1ContigFactory { using dstTy = std::int32_t; using ReductionOpT = sycl::logical_or; - return dpctl::tensor::kernels:: + return dpnp::tensor::kernels:: reduction_axis1_over_group_with_atomics_contig_impl; } @@ -99,7 +99,7 @@ struct AnyAxis0ContigFactory { using dstTy = std::int32_t; using ReductionOpT = sycl::logical_or; - return dpctl::tensor::kernels:: + return dpnp::tensor::kernels:: reduction_axis0_over_group_with_atomics_contig_impl; } @@ -136,7 +136,7 @@ static atomic_support_fn_ptr_t any_atomic_support = void init_any(py::module_ m) { - using arrayT = dpctl::tensor::usm_ndarray; + using arrayT = dpnp::tensor::usm_ndarray; using event_vecT = std::vector; { impl::populate_any_dispatch_vectors(); @@ -161,4 +161,4 @@ void init_any(py::module_ m) } } -} // namespace dpctl::tensor::py_internal +} // namespace dpnp::tensor::py_internal diff --git a/dpnp/tensor/libtensor/source/reductions/any.hpp b/dpnp/tensor/libtensor/source/reductions/any.hpp index 4e368a674615..fd78eabf32d4 100644 --- a/dpnp/tensor/libtensor/source/reductions/any.hpp +++ b/dpnp/tensor/libtensor/source/reductions/any.hpp @@ -29,7 +29,7 @@ //===---------------------------------------------------------------------===// /// /// \file -/// This file defines functions of dpctl.tensor._tensor_reductions_impl +/// This file defines functions of dpnp.tensor._tensor_reductions_impl /// extension. //===---------------------------------------------------------------------===// @@ -38,9 +38,9 @@ namespace py = pybind11; -namespace dpctl::tensor::py_internal +namespace dpnp::tensor::py_internal { extern void init_any(py::module_ m); -} // namespace dpctl::tensor::py_internal +} // namespace dpnp::tensor::py_internal diff --git a/dpnp/tensor/libtensor/source/reductions/argmax.cpp b/dpnp/tensor/libtensor/source/reductions/argmax.cpp index af602371dfc5..88b0bf7d58de 100644 --- a/dpnp/tensor/libtensor/source/reductions/argmax.cpp +++ b/dpnp/tensor/libtensor/source/reductions/argmax.cpp @@ -29,7 +29,7 @@ //===---------------------------------------------------------------------===// /// /// \file -/// This file defines functions of dpctl.tensor._tensor_reductions_impl +/// This file defines functions of dpnp.tensor._tensor_reductions_impl /// extension. //===---------------------------------------------------------------------===// @@ -49,26 +49,26 @@ #include "utils/sycl_utils.hpp" #include "utils/type_dispatch_building.hpp" -namespace dpctl::tensor::py_internal +namespace dpnp::tensor::py_internal { namespace py = pybind11; -namespace td_ns = dpctl::tensor::type_dispatch; -namespace su_ns = dpctl::tensor::sycl_utils; +namespace td_ns = dpnp::tensor::type_dispatch; +namespace su_ns = dpnp::tensor::sycl_utils; namespace impl { -using dpctl::tensor::kernels::search_strided_impl_fn_ptr; +using dpnp::tensor::kernels::search_strided_impl_fn_ptr; static search_strided_impl_fn_ptr argmax_over_axis_strided_temps_dispatch_table[td_ns::num_types] [td_ns::num_types]; -using dpctl::tensor::kernels::search_contig_impl_fn_ptr; +using dpnp::tensor::kernels::search_contig_impl_fn_ptr; static search_contig_impl_fn_ptr argmax_over_axis1_contig_temps_dispatch_table[td_ns::num_types] [td_ns::num_types]; -using dpctl::tensor::kernels::search_contig_impl_fn_ptr; +using dpnp::tensor::kernels::search_contig_impl_fn_ptr; static search_contig_impl_fn_ptr argmax_over_axis0_contig_temps_dispatch_table[td_ns::num_types] [td_ns::num_types]; @@ -139,7 +139,7 @@ struct ArgmaxOverAxisTempsStridedFactory using ReductionOpT = sycl::maximum; // op for indices using IndexOpT = sycl::minimum; - return dpctl::tensor::kernels:: + return dpnp::tensor::kernels:: search_over_group_temps_strided_impl< srcTy, dstTy, ReductionOpT, IndexOpT>; } @@ -148,7 +148,7 @@ struct ArgmaxOverAxisTempsStridedFactory using ReductionOpT = su_ns::Maximum; // op for indices using IndexOpT = sycl::minimum; - return dpctl::tensor::kernels:: + return dpnp::tensor::kernels:: search_over_group_temps_strided_impl< srcTy, dstTy, ReductionOpT, IndexOpT>; } @@ -172,7 +172,7 @@ struct ArgmaxOverAxis1TempsContigFactory using ReductionOpT = sycl::maximum; // op for indices using IndexOpT = sycl::minimum; - return dpctl::tensor::kernels:: + return dpnp::tensor::kernels:: search_axis1_over_group_temps_contig_impl< srcTy, dstTy, ReductionOpT, IndexOpT>; } @@ -181,7 +181,7 @@ struct ArgmaxOverAxis1TempsContigFactory using ReductionOpT = su_ns::Maximum; // op for indices using IndexOpT = sycl::minimum; - return dpctl::tensor::kernels:: + return dpnp::tensor::kernels:: search_axis1_over_group_temps_contig_impl< srcTy, dstTy, ReductionOpT, IndexOpT>; } @@ -205,7 +205,7 @@ struct ArgmaxOverAxis0TempsContigFactory using ReductionOpT = sycl::maximum; // op for indices using IndexOpT = sycl::minimum; - return dpctl::tensor::kernels:: + return dpnp::tensor::kernels:: search_axis0_over_group_temps_contig_impl< srcTy, dstTy, ReductionOpT, IndexOpT>; } @@ -214,7 +214,7 @@ struct ArgmaxOverAxis0TempsContigFactory using ReductionOpT = su_ns::Maximum; // op for indices using IndexOpT = sycl::minimum; - return dpctl::tensor::kernels:: + return dpnp::tensor::kernels:: search_axis0_over_group_temps_contig_impl< srcTy, dstTy, ReductionOpT, IndexOpT>; } @@ -249,7 +249,7 @@ void populate_argmax_over_axis_dispatch_tables(void) void init_argmax(py::module_ m) { - using arrayT = dpctl::tensor::usm_ndarray; + using arrayT = dpnp::tensor::usm_ndarray; using event_vecT = std::vector; { using impl::populate_argmax_over_axis_dispatch_tables; @@ -273,4 +273,4 @@ void init_argmax(py::module_ m) } } -} // namespace dpctl::tensor::py_internal +} // namespace dpnp::tensor::py_internal diff --git a/dpnp/tensor/libtensor/source/reductions/argmax.hpp b/dpnp/tensor/libtensor/source/reductions/argmax.hpp index 3274f8c7d0cb..b8a8eb4e3688 100644 --- a/dpnp/tensor/libtensor/source/reductions/argmax.hpp +++ b/dpnp/tensor/libtensor/source/reductions/argmax.hpp @@ -29,7 +29,7 @@ //===---------------------------------------------------------------------===// /// /// \file -/// This file defines functions of dpctl.tensor._tensor_reductions_impl +/// This file defines functions of dpnp.tensor._tensor_reductions_impl /// extension. //===---------------------------------------------------------------------===// @@ -38,9 +38,9 @@ namespace py = pybind11; -namespace dpctl::tensor::py_internal +namespace dpnp::tensor::py_internal { extern void init_argmax(py::module_ m); -} // namespace dpctl::tensor::py_internal +} // namespace dpnp::tensor::py_internal diff --git a/dpnp/tensor/libtensor/source/reductions/argmin.cpp b/dpnp/tensor/libtensor/source/reductions/argmin.cpp index 4869b75eacf9..b7887f24ae2d 100644 --- a/dpnp/tensor/libtensor/source/reductions/argmin.cpp +++ b/dpnp/tensor/libtensor/source/reductions/argmin.cpp @@ -29,7 +29,7 @@ //===---------------------------------------------------------------------===// /// /// \file -/// This file defines functions of dpctl.tensor._tensor_reductions_impl +/// This file defines functions of dpnp.tensor._tensor_reductions_impl /// extension. //===---------------------------------------------------------------------===// @@ -49,26 +49,26 @@ #include "utils/sycl_utils.hpp" #include "utils/type_dispatch_building.hpp" -namespace dpctl::tensor::py_internal +namespace dpnp::tensor::py_internal { namespace py = pybind11; -namespace td_ns = dpctl::tensor::type_dispatch; -namespace su_ns = dpctl::tensor::sycl_utils; +namespace td_ns = dpnp::tensor::type_dispatch; +namespace su_ns = dpnp::tensor::sycl_utils; namespace impl { -using dpctl::tensor::kernels::search_strided_impl_fn_ptr; +using dpnp::tensor::kernels::search_strided_impl_fn_ptr; static search_strided_impl_fn_ptr argmin_over_axis_strided_temps_dispatch_table[td_ns::num_types] [td_ns::num_types]; -using dpctl::tensor::kernels::search_contig_impl_fn_ptr; +using dpnp::tensor::kernels::search_contig_impl_fn_ptr; static search_contig_impl_fn_ptr argmin_over_axis1_contig_temps_dispatch_table[td_ns::num_types] [td_ns::num_types]; -using dpctl::tensor::kernels::search_contig_impl_fn_ptr; +using dpnp::tensor::kernels::search_contig_impl_fn_ptr; static search_contig_impl_fn_ptr argmin_over_axis0_contig_temps_dispatch_table[td_ns::num_types] [td_ns::num_types]; @@ -139,7 +139,7 @@ struct ArgminOverAxisTempsStridedFactory using ReductionOpT = sycl::minimum; // op for indices using IndexOpT = sycl::minimum; - return dpctl::tensor::kernels:: + return dpnp::tensor::kernels:: search_over_group_temps_strided_impl< srcTy, dstTy, ReductionOpT, IndexOpT>; } @@ -148,7 +148,7 @@ struct ArgminOverAxisTempsStridedFactory using ReductionOpT = su_ns::Minimum; // op for indices using IndexOpT = sycl::minimum; - return dpctl::tensor::kernels:: + return dpnp::tensor::kernels:: search_over_group_temps_strided_impl< srcTy, dstTy, ReductionOpT, IndexOpT>; } @@ -172,7 +172,7 @@ struct ArgminOverAxis1TempsContigFactory using ReductionOpT = sycl::minimum; // op for indices using IndexOpT = sycl::minimum; - return dpctl::tensor::kernels:: + return dpnp::tensor::kernels:: search_axis1_over_group_temps_contig_impl< srcTy, dstTy, ReductionOpT, IndexOpT>; } @@ -181,7 +181,7 @@ struct ArgminOverAxis1TempsContigFactory using ReductionOpT = su_ns::Minimum; // op for indices using IndexOpT = sycl::minimum; - return dpctl::tensor::kernels:: + return dpnp::tensor::kernels:: search_axis1_over_group_temps_contig_impl< srcTy, dstTy, ReductionOpT, IndexOpT>; } @@ -205,7 +205,7 @@ struct ArgminOverAxis0TempsContigFactory using ReductionOpT = sycl::minimum; // op for indices using IndexOpT = sycl::minimum; - return dpctl::tensor::kernels:: + return dpnp::tensor::kernels:: search_axis0_over_group_temps_contig_impl< srcTy, dstTy, ReductionOpT, IndexOpT>; } @@ -214,7 +214,7 @@ struct ArgminOverAxis0TempsContigFactory using ReductionOpT = su_ns::Minimum; // op for indices using IndexOpT = sycl::minimum; - return dpctl::tensor::kernels:: + return dpnp::tensor::kernels:: search_axis0_over_group_temps_contig_impl< srcTy, dstTy, ReductionOpT, IndexOpT>; } @@ -249,7 +249,7 @@ void populate_argmin_over_axis_dispatch_tables(void) void init_argmin(py::module_ m) { - using arrayT = dpctl::tensor::usm_ndarray; + using arrayT = dpnp::tensor::usm_ndarray; using event_vecT = std::vector; { using impl::populate_argmin_over_axis_dispatch_tables; @@ -273,4 +273,4 @@ void init_argmin(py::module_ m) } } -} // namespace dpctl::tensor::py_internal +} // namespace dpnp::tensor::py_internal diff --git a/dpnp/tensor/libtensor/source/reductions/argmin.hpp b/dpnp/tensor/libtensor/source/reductions/argmin.hpp index 1865c258a527..0ea66023bfec 100644 --- a/dpnp/tensor/libtensor/source/reductions/argmin.hpp +++ b/dpnp/tensor/libtensor/source/reductions/argmin.hpp @@ -29,7 +29,7 @@ //===---------------------------------------------------------------------===// /// /// \file -/// This file defines functions of dpctl.tensor._tensor_reductions_impl +/// This file defines functions of dpnp.tensor._tensor_reductions_impl /// extension. //===---------------------------------------------------------------------===// @@ -38,9 +38,9 @@ namespace py = pybind11; -namespace dpctl::tensor::py_internal +namespace dpnp::tensor::py_internal { extern void init_argmin(py::module_ m); -} // namespace dpctl::tensor::py_internal +} // namespace dpnp::tensor::py_internal diff --git a/dpnp/tensor/libtensor/source/reductions/logsumexp.cpp b/dpnp/tensor/libtensor/source/reductions/logsumexp.cpp index 351eab82ee6b..0bf632d4f41d 100644 --- a/dpnp/tensor/libtensor/source/reductions/logsumexp.cpp +++ b/dpnp/tensor/libtensor/source/reductions/logsumexp.cpp @@ -29,7 +29,7 @@ //===---------------------------------------------------------------------===// /// /// \file -/// This file defines functions of dpctl.tensor._tensor_reductions_impl +/// This file defines functions of dpnp.tensor._tensor_reductions_impl /// extension. //===---------------------------------------------------------------------===// @@ -49,22 +49,22 @@ #include "utils/sycl_utils.hpp" #include "utils/type_dispatch_building.hpp" -namespace dpctl::tensor::py_internal +namespace dpnp::tensor::py_internal { namespace py = pybind11; -namespace td_ns = dpctl::tensor::type_dispatch; -namespace su_ns = dpctl::tensor::sycl_utils; +namespace td_ns = dpnp::tensor::type_dispatch; +namespace su_ns = dpnp::tensor::sycl_utils; namespace impl { -using dpctl::tensor::kernels::reduction_strided_impl_fn_ptr; +using dpnp::tensor::kernels::reduction_strided_impl_fn_ptr; static reduction_strided_impl_fn_ptr logsumexp_over_axis_strided_temps_dispatch_table[td_ns::num_types] [td_ns::num_types]; -using dpctl::tensor::kernels::reduction_contig_impl_fn_ptr; +using dpnp::tensor::kernels::reduction_contig_impl_fn_ptr; static reduction_contig_impl_fn_ptr logsumexp_over_axis1_contig_temps_dispatch_table[td_ns::num_types] [td_ns::num_types]; @@ -140,7 +140,7 @@ struct LogSumExpOverAxisTempsStridedFactory if constexpr (TypePairSupportDataForLogSumExpReductionTemps< srcTy, dstTy>::is_defined) { using ReductionOpT = su_ns::LogSumExp; - return dpctl::tensor::kernels:: + return dpnp::tensor::kernels:: reduction_over_group_temps_strided_impl; } @@ -158,7 +158,7 @@ struct LogSumExpOverAxis1TempsContigFactory if constexpr (TypePairSupportDataForLogSumExpReductionTemps< srcTy, dstTy>::is_defined) { using ReductionOpT = su_ns::LogSumExp; - return dpctl::tensor::kernels:: + return dpnp::tensor::kernels:: reduction_axis1_over_group_temps_contig_impl; } @@ -176,7 +176,7 @@ struct LogSumExpOverAxis0TempsContigFactory if constexpr (TypePairSupportDataForLogSumExpReductionTemps< srcTy, dstTy>::is_defined) { using ReductionOpT = su_ns::LogSumExp; - return dpctl::tensor::kernels:: + return dpnp::tensor::kernels:: reduction_axis0_over_group_temps_contig_impl; } @@ -188,8 +188,8 @@ struct LogSumExpOverAxis0TempsContigFactory void populate_logsumexp_over_axis_dispatch_tables(void) { - using dpctl::tensor::kernels::reduction_contig_impl_fn_ptr; - using dpctl::tensor::kernels::reduction_strided_impl_fn_ptr; + using dpnp::tensor::kernels::reduction_contig_impl_fn_ptr; + using dpnp::tensor::kernels::reduction_strided_impl_fn_ptr; using namespace td_ns; DispatchTableBuilder; { using impl::populate_logsumexp_over_axis_dispatch_tables; @@ -224,8 +224,8 @@ void init_logsumexp(py::module_ m) using impl::logsumexp_over_axis1_contig_temps_dispatch_table; using impl::logsumexp_over_axis_strided_temps_dispatch_table; - using dpctl::tensor::kernels::reduction_contig_impl_fn_ptr; - using dpctl::tensor::kernels::reduction_strided_impl_fn_ptr; + using dpnp::tensor::kernels::reduction_contig_impl_fn_ptr; + using dpnp::tensor::kernels::reduction_strided_impl_fn_ptr; auto logsumexp_pyapi = [&](const arrayT &src, int trailing_dims_to_reduce, @@ -252,4 +252,4 @@ void init_logsumexp(py::module_ m) } } -} // namespace dpctl::tensor::py_internal +} // namespace dpnp::tensor::py_internal diff --git a/dpnp/tensor/libtensor/source/reductions/logsumexp.hpp b/dpnp/tensor/libtensor/source/reductions/logsumexp.hpp index 2e2c19877db6..16cbb00875c1 100644 --- a/dpnp/tensor/libtensor/source/reductions/logsumexp.hpp +++ b/dpnp/tensor/libtensor/source/reductions/logsumexp.hpp @@ -29,7 +29,7 @@ //===---------------------------------------------------------------------===// /// /// \file -/// This file defines functions of dpctl.tensor._tensor_reductions_impl +/// This file defines functions of dpnp.tensor._tensor_reductions_impl /// extension. //===---------------------------------------------------------------------===// @@ -38,9 +38,9 @@ namespace py = pybind11; -namespace dpctl::tensor::py_internal +namespace dpnp::tensor::py_internal { extern void init_logsumexp(py::module_ m); -} // namespace dpctl::tensor::py_internal +} // namespace dpnp::tensor::py_internal diff --git a/dpnp/tensor/libtensor/source/reductions/max.cpp b/dpnp/tensor/libtensor/source/reductions/max.cpp index 628f7cfe8606..34d24031390d 100644 --- a/dpnp/tensor/libtensor/source/reductions/max.cpp +++ b/dpnp/tensor/libtensor/source/reductions/max.cpp @@ -29,7 +29,7 @@ //===---------------------------------------------------------------------===// /// /// \file -/// This file defines functions of dpctl.tensor._tensor_reductions_impl +/// This file defines functions of dpnp.tensor._tensor_reductions_impl /// extension. //===---------------------------------------------------------------------===// @@ -51,17 +51,17 @@ #include "reduction_atomic_support.hpp" #include "reduction_over_axis.hpp" -namespace dpctl::tensor::py_internal +namespace dpnp::tensor::py_internal { namespace py = pybind11; -namespace td_ns = dpctl::tensor::type_dispatch; -namespace su_ns = dpctl::tensor::sycl_utils; +namespace td_ns = dpnp::tensor::type_dispatch; +namespace su_ns = dpnp::tensor::sycl_utils; namespace impl { -using dpctl::tensor::kernels::reduction_strided_impl_fn_ptr; +using dpnp::tensor::kernels::reduction_strided_impl_fn_ptr; static reduction_strided_impl_fn_ptr max_over_axis_strided_atomic_dispatch_table[td_ns::num_types] [td_ns::num_types]; @@ -69,7 +69,7 @@ static reduction_strided_impl_fn_ptr max_over_axis_strided_temps_dispatch_table[td_ns::num_types] [td_ns::num_types]; -using dpctl::tensor::kernels::reduction_contig_impl_fn_ptr; +using dpnp::tensor::kernels::reduction_contig_impl_fn_ptr; static reduction_contig_impl_fn_ptr max_over_axis1_contig_atomic_dispatch_table[td_ns::num_types] [td_ns::num_types]; @@ -166,13 +166,13 @@ struct MaxOverAxisAtomicStridedFactory srcTy, dstTy>::is_defined) { if constexpr (std::is_floating_point::value) { using ReductionOpT = su_ns::Maximum; - return dpctl::tensor::kernels:: + return dpnp::tensor::kernels:: reduction_over_group_with_atomics_strided_impl< srcTy, dstTy, ReductionOpT>; } else { using ReductionOpT = sycl::maximum; - return dpctl::tensor::kernels:: + return dpnp::tensor::kernels:: reduction_over_group_with_atomics_strided_impl< srcTy, dstTy, ReductionOpT>; } @@ -193,13 +193,13 @@ struct MaxOverAxisTempsStridedFactory if constexpr (std::is_integral_v && !std::is_same_v) { using ReductionOpT = sycl::maximum; - return dpctl::tensor::kernels:: + return dpnp::tensor::kernels:: reduction_over_group_temps_strided_impl; } else { using ReductionOpT = su_ns::Maximum; - return dpctl::tensor::kernels:: + return dpnp::tensor::kernels:: reduction_over_group_temps_strided_impl; } @@ -219,13 +219,13 @@ struct MaxOverAxis1AtomicContigFactory srcTy, dstTy>::is_defined) { if constexpr (std::is_floating_point::value) { using ReductionOpT = su_ns::Maximum; - return dpctl::tensor::kernels:: + return dpnp::tensor::kernels:: reduction_axis1_over_group_with_atomics_contig_impl< srcTy, dstTy, ReductionOpT>; } else { using ReductionOpT = sycl::maximum; - return dpctl::tensor::kernels:: + return dpnp::tensor::kernels:: reduction_axis1_over_group_with_atomics_contig_impl< srcTy, dstTy, ReductionOpT>; } @@ -245,13 +245,13 @@ struct MaxOverAxis0AtomicContigFactory srcTy, dstTy>::is_defined) { if constexpr (std::is_floating_point::value) { using ReductionOpT = su_ns::Maximum; - return dpctl::tensor::kernels:: + return dpnp::tensor::kernels:: reduction_axis0_over_group_with_atomics_contig_impl< srcTy, dstTy, ReductionOpT>; } else { using ReductionOpT = sycl::maximum; - return dpctl::tensor::kernels:: + return dpnp::tensor::kernels:: reduction_axis0_over_group_with_atomics_contig_impl< srcTy, dstTy, ReductionOpT>; } @@ -272,13 +272,13 @@ struct MaxOverAxis1TempsContigFactory if constexpr (std::is_integral_v && !std::is_same_v) { using ReductionOpT = sycl::maximum; - return dpctl::tensor::kernels:: + return dpnp::tensor::kernels:: reduction_axis1_over_group_temps_contig_impl; } else { using ReductionOpT = su_ns::Maximum; - return dpctl::tensor::kernels:: + return dpnp::tensor::kernels:: reduction_axis1_over_group_temps_contig_impl; } @@ -299,13 +299,13 @@ struct MaxOverAxis0TempsContigFactory if constexpr (std::is_integral_v && !std::is_same_v) { using ReductionOpT = sycl::maximum; - return dpctl::tensor::kernels:: + return dpnp::tensor::kernels:: reduction_axis0_over_group_temps_contig_impl; } else { using ReductionOpT = su_ns::Maximum; - return dpctl::tensor::kernels:: + return dpnp::tensor::kernels:: reduction_axis0_over_group_temps_contig_impl; } @@ -369,7 +369,7 @@ void populate_max_atomic_support_dispatch_vector(void) void init_max(py::module_ m) { - using arrayT = dpctl::tensor::usm_ndarray; + using arrayT = dpnp::tensor::usm_ndarray; using event_vecT = std::vector; { using impl::populate_max_over_axis_dispatch_tables; @@ -404,4 +404,4 @@ void init_max(py::module_ m) } } -} // namespace dpctl::tensor::py_internal +} // namespace dpnp::tensor::py_internal diff --git a/dpnp/tensor/libtensor/source/reductions/max.hpp b/dpnp/tensor/libtensor/source/reductions/max.hpp index bc242dc8d74b..fb09d7cdcb06 100644 --- a/dpnp/tensor/libtensor/source/reductions/max.hpp +++ b/dpnp/tensor/libtensor/source/reductions/max.hpp @@ -29,7 +29,7 @@ //===---------------------------------------------------------------------===// /// /// \file -/// This file defines functions of dpctl.tensor._tensor_reductions_impl +/// This file defines functions of dpnp.tensor._tensor_reductions_impl /// extension. //===---------------------------------------------------------------------===// @@ -38,9 +38,9 @@ namespace py = pybind11; -namespace dpctl::tensor::py_internal +namespace dpnp::tensor::py_internal { extern void init_max(py::module_ m); -} // namespace dpctl::tensor::py_internal +} // namespace dpnp::tensor::py_internal diff --git a/dpnp/tensor/libtensor/source/reductions/min.cpp b/dpnp/tensor/libtensor/source/reductions/min.cpp index 68bfdb583b0b..7379c234eef1 100644 --- a/dpnp/tensor/libtensor/source/reductions/min.cpp +++ b/dpnp/tensor/libtensor/source/reductions/min.cpp @@ -29,7 +29,7 @@ //===---------------------------------------------------------------------===// /// /// \file -/// This file defines functions of dpctl.tensor._tensor_reductions_impl +/// This file defines functions of dpnp.tensor._tensor_reductions_impl /// extension. //===---------------------------------------------------------------------===// @@ -51,17 +51,17 @@ #include "reduction_atomic_support.hpp" #include "reduction_over_axis.hpp" -namespace dpctl::tensor::py_internal +namespace dpnp::tensor::py_internal { namespace py = pybind11; -namespace td_ns = dpctl::tensor::type_dispatch; -namespace su_ns = dpctl::tensor::sycl_utils; +namespace td_ns = dpnp::tensor::type_dispatch; +namespace su_ns = dpnp::tensor::sycl_utils; namespace impl { -using dpctl::tensor::kernels::reduction_strided_impl_fn_ptr; +using dpnp::tensor::kernels::reduction_strided_impl_fn_ptr; static reduction_strided_impl_fn_ptr min_over_axis_strided_atomic_dispatch_table[td_ns::num_types] [td_ns::num_types]; @@ -69,7 +69,7 @@ static reduction_strided_impl_fn_ptr min_over_axis_strided_temps_dispatch_table[td_ns::num_types] [td_ns::num_types]; -using dpctl::tensor::kernels::reduction_contig_impl_fn_ptr; +using dpnp::tensor::kernels::reduction_contig_impl_fn_ptr; static reduction_contig_impl_fn_ptr min_over_axis1_contig_atomic_dispatch_table[td_ns::num_types] [td_ns::num_types]; @@ -166,13 +166,13 @@ struct MinOverAxisAtomicStridedFactory srcTy, dstTy>::is_defined) { if constexpr (std::is_floating_point::value) { using ReductionOpT = su_ns::Minimum; - return dpctl::tensor::kernels:: + return dpnp::tensor::kernels:: reduction_over_group_with_atomics_strided_impl< srcTy, dstTy, ReductionOpT>; } else { using ReductionOpT = sycl::minimum; - return dpctl::tensor::kernels:: + return dpnp::tensor::kernels:: reduction_over_group_with_atomics_strided_impl< srcTy, dstTy, ReductionOpT>; } @@ -193,13 +193,13 @@ struct MinOverAxisTempsStridedFactory if constexpr (std::is_integral_v && !std::is_same_v) { using ReductionOpT = sycl::minimum; - return dpctl::tensor::kernels:: + return dpnp::tensor::kernels:: reduction_over_group_temps_strided_impl; } else { using ReductionOpT = su_ns::Minimum; - return dpctl::tensor::kernels:: + return dpnp::tensor::kernels:: reduction_over_group_temps_strided_impl; } @@ -219,13 +219,13 @@ struct MinOverAxis1AtomicContigFactory srcTy, dstTy>::is_defined) { if constexpr (std::is_floating_point::value) { using ReductionOpT = su_ns::Minimum; - return dpctl::tensor::kernels:: + return dpnp::tensor::kernels:: reduction_axis1_over_group_with_atomics_contig_impl< srcTy, dstTy, ReductionOpT>; } else { using ReductionOpT = sycl::minimum; - return dpctl::tensor::kernels:: + return dpnp::tensor::kernels:: reduction_axis1_over_group_with_atomics_contig_impl< srcTy, dstTy, ReductionOpT>; } @@ -245,13 +245,13 @@ struct MinOverAxis0AtomicContigFactory srcTy, dstTy>::is_defined) { if constexpr (std::is_floating_point::value) { using ReductionOpT = su_ns::Minimum; - return dpctl::tensor::kernels:: + return dpnp::tensor::kernels:: reduction_axis0_over_group_with_atomics_contig_impl< srcTy, dstTy, ReductionOpT>; } else { using ReductionOpT = sycl::minimum; - return dpctl::tensor::kernels:: + return dpnp::tensor::kernels:: reduction_axis0_over_group_with_atomics_contig_impl< srcTy, dstTy, ReductionOpT>; } @@ -272,13 +272,13 @@ struct MinOverAxis1TempsContigFactory if constexpr (std::is_integral_v && !std::is_same_v) { using ReductionOpT = sycl::minimum; - return dpctl::tensor::kernels:: + return dpnp::tensor::kernels:: reduction_axis1_over_group_temps_contig_impl; } else { using ReductionOpT = su_ns::Minimum; - return dpctl::tensor::kernels:: + return dpnp::tensor::kernels:: reduction_axis1_over_group_temps_contig_impl; } @@ -299,13 +299,13 @@ struct MinOverAxis0TempsContigFactory if constexpr (std::is_integral_v && !std::is_same_v) { using ReductionOpT = sycl::minimum; - return dpctl::tensor::kernels:: + return dpnp::tensor::kernels:: reduction_axis0_over_group_temps_contig_impl; } else { using ReductionOpT = su_ns::Minimum; - return dpctl::tensor::kernels:: + return dpnp::tensor::kernels:: reduction_axis0_over_group_temps_contig_impl; } @@ -318,8 +318,8 @@ struct MinOverAxis0TempsContigFactory void populate_min_over_axis_dispatch_tables(void) { - using dpctl::tensor::kernels::reduction_contig_impl_fn_ptr; - using dpctl::tensor::kernels::reduction_strided_impl_fn_ptr; + using dpnp::tensor::kernels::reduction_contig_impl_fn_ptr; + using dpnp::tensor::kernels::reduction_strided_impl_fn_ptr; using td_ns::DispatchTableBuilder; DispatchTableBuilder; { using impl::populate_min_over_axis_dispatch_tables; @@ -406,4 +406,4 @@ void init_min(py::module_ m) } } -} // namespace dpctl::tensor::py_internal +} // namespace dpnp::tensor::py_internal diff --git a/dpnp/tensor/libtensor/source/reductions/min.hpp b/dpnp/tensor/libtensor/source/reductions/min.hpp index e054f44539f3..aa50600bc793 100644 --- a/dpnp/tensor/libtensor/source/reductions/min.hpp +++ b/dpnp/tensor/libtensor/source/reductions/min.hpp @@ -29,7 +29,7 @@ //===---------------------------------------------------------------------===// /// /// \file -/// This file defines functions of dpctl.tensor._tensor_reductions_impl +/// This file defines functions of dpnp.tensor._tensor_reductions_impl /// extension. //===---------------------------------------------------------------------===// @@ -38,9 +38,9 @@ namespace py = pybind11; -namespace dpctl::tensor::py_internal +namespace dpnp::tensor::py_internal { extern void init_min(py::module_ m); -} // namespace dpctl::tensor::py_internal +} // namespace dpnp::tensor::py_internal diff --git a/dpnp/tensor/libtensor/source/reductions/prod.cpp b/dpnp/tensor/libtensor/source/reductions/prod.cpp index 9ecd403159b0..3db10ab6b9ff 100644 --- a/dpnp/tensor/libtensor/source/reductions/prod.cpp +++ b/dpnp/tensor/libtensor/source/reductions/prod.cpp @@ -29,7 +29,7 @@ //===---------------------------------------------------------------------===// /// /// \file -/// This file defines functions of dpctl.tensor._tensor_reductions_impl +/// This file defines functions of dpnp.tensor._tensor_reductions_impl /// extension. //===---------------------------------------------------------------------===// @@ -52,16 +52,16 @@ #include "reduction_atomic_support.hpp" #include "reduction_over_axis.hpp" -namespace dpctl::tensor::py_internal +namespace dpnp::tensor::py_internal { namespace py = pybind11; -namespace td_ns = dpctl::tensor::type_dispatch; +namespace td_ns = dpnp::tensor::type_dispatch; namespace impl { -using dpctl::tensor::kernels::reduction_strided_impl_fn_ptr; +using dpnp::tensor::kernels::reduction_strided_impl_fn_ptr; static reduction_strided_impl_fn_ptr prod_over_axis_strided_atomic_dispatch_table[td_ns::num_types] [td_ns::num_types]; @@ -69,7 +69,7 @@ static reduction_strided_impl_fn_ptr prod_over_axis_strided_temps_dispatch_table[td_ns::num_types] [td_ns::num_types]; -using dpctl::tensor::kernels::reduction_contig_impl_fn_ptr; +using dpnp::tensor::kernels::reduction_contig_impl_fn_ptr; static reduction_contig_impl_fn_ptr prod_over_axis1_contig_atomic_dispatch_table[td_ns::num_types] [td_ns::num_types]; @@ -248,7 +248,7 @@ struct ProductOverAxisAtomicStridedFactory if constexpr (TypePairSupportDataForProductReductionAtomic< srcTy, dstTy>::is_defined) { using ReductionOpT = sycl::multiplies; - return dpctl::tensor::kernels:: + return dpnp::tensor::kernels:: reduction_over_group_with_atomics_strided_impl; } @@ -268,7 +268,7 @@ struct ProductOverAxisTempsStridedFactory using ReductionOpT = std::conditional_t, sycl::logical_and, sycl::multiplies>; - return dpctl::tensor::kernels:: + return dpnp::tensor::kernels:: reduction_over_group_temps_strided_impl; } @@ -286,7 +286,7 @@ struct ProductOverAxis1AtomicContigFactory if constexpr (TypePairSupportDataForProductReductionAtomic< srcTy, dstTy>::is_defined) { using ReductionOpT = sycl::multiplies; - return dpctl::tensor::kernels:: + return dpnp::tensor::kernels:: reduction_axis1_over_group_with_atomics_contig_impl< srcTy, dstTy, ReductionOpT>; } @@ -304,7 +304,7 @@ struct ProductOverAxis0AtomicContigFactory if constexpr (TypePairSupportDataForProductReductionAtomic< srcTy, dstTy>::is_defined) { using ReductionOpT = sycl::multiplies; - return dpctl::tensor::kernels:: + return dpnp::tensor::kernels:: reduction_axis0_over_group_with_atomics_contig_impl< srcTy, dstTy, ReductionOpT>; } @@ -324,7 +324,7 @@ struct ProductOverAxis1TempsContigFactory using ReductionOpT = std::conditional_t, sycl::logical_and, sycl::multiplies>; - return dpctl::tensor::kernels:: + return dpnp::tensor::kernels:: reduction_axis1_over_group_temps_contig_impl; } @@ -344,7 +344,7 @@ struct ProductOverAxis0TempsContigFactory using ReductionOpT = std::conditional_t, sycl::logical_and, sycl::multiplies>; - return dpctl::tensor::kernels:: + return dpnp::tensor::kernels:: reduction_axis0_over_group_temps_contig_impl; } @@ -356,8 +356,8 @@ struct ProductOverAxis0TempsContigFactory void populate_prod_over_axis_dispatch_tables(void) { - using dpctl::tensor::kernels::reduction_contig_impl_fn_ptr; - using dpctl::tensor::kernels::reduction_strided_impl_fn_ptr; + using dpnp::tensor::kernels::reduction_contig_impl_fn_ptr; + using dpnp::tensor::kernels::reduction_strided_impl_fn_ptr; using namespace td_ns; DispatchTableBuilder; { using impl::populate_prod_over_axis_dispatch_tables; @@ -457,4 +457,4 @@ void init_prod(py::module_ m) } } -} // namespace dpctl::tensor::py_internal +} // namespace dpnp::tensor::py_internal diff --git a/dpnp/tensor/libtensor/source/reductions/prod.hpp b/dpnp/tensor/libtensor/source/reductions/prod.hpp index 15b1c07e5ddd..a9a309d586c5 100644 --- a/dpnp/tensor/libtensor/source/reductions/prod.hpp +++ b/dpnp/tensor/libtensor/source/reductions/prod.hpp @@ -29,7 +29,7 @@ //===---------------------------------------------------------------------===// /// /// \file -/// This file defines functions of dpctl.tensor._tensor_reductions_impl +/// This file defines functions of dpnp.tensor._tensor_reductions_impl /// extension. //===---------------------------------------------------------------------===// @@ -38,9 +38,9 @@ namespace py = pybind11; -namespace dpctl::tensor::py_internal +namespace dpnp::tensor::py_internal { extern void init_prod(py::module_ m); -} // namespace dpctl::tensor::py_internal +} // namespace dpnp::tensor::py_internal diff --git a/dpnp/tensor/libtensor/source/reductions/reduce_hypot.cpp b/dpnp/tensor/libtensor/source/reductions/reduce_hypot.cpp index b8a042e9a55b..80bab9a67795 100644 --- a/dpnp/tensor/libtensor/source/reductions/reduce_hypot.cpp +++ b/dpnp/tensor/libtensor/source/reductions/reduce_hypot.cpp @@ -29,7 +29,7 @@ //===---------------------------------------------------------------------===// /// /// \file -/// This file defines functions of dpctl.tensor._tensor_reductions_impl +/// This file defines functions of dpnp.tensor._tensor_reductions_impl /// extension. //===---------------------------------------------------------------------===// @@ -50,22 +50,22 @@ #include "reduction_over_axis.hpp" -namespace dpctl::tensor::py_internal +namespace dpnp::tensor::py_internal { namespace py = pybind11; -namespace td_ns = dpctl::tensor::type_dispatch; -namespace su_ns = dpctl::tensor::sycl_utils; +namespace td_ns = dpnp::tensor::type_dispatch; +namespace su_ns = dpnp::tensor::sycl_utils; namespace impl { -using dpctl::tensor::kernels::reduction_strided_impl_fn_ptr; +using dpnp::tensor::kernels::reduction_strided_impl_fn_ptr; static reduction_strided_impl_fn_ptr hypot_over_axis_strided_temps_dispatch_table[td_ns::num_types] [td_ns::num_types]; -using dpctl::tensor::kernels::reduction_contig_impl_fn_ptr; +using dpnp::tensor::kernels::reduction_contig_impl_fn_ptr; static reduction_contig_impl_fn_ptr hypot_over_axis1_contig_temps_dispatch_table[td_ns::num_types] [td_ns::num_types]; @@ -140,7 +140,7 @@ struct HypotOverAxisTempsStridedFactory if constexpr (TypePairSupportDataForHypotReductionTemps< srcTy, dstTy>::is_defined) { using ReductionOpT = su_ns::Hypot; - return dpctl::tensor::kernels:: + return dpnp::tensor::kernels:: reduction_over_group_temps_strided_impl; } @@ -158,7 +158,7 @@ struct HypotOverAxis1TempsContigFactory if constexpr (TypePairSupportDataForHypotReductionTemps< srcTy, dstTy>::is_defined) { using ReductionOpT = su_ns::Hypot; - return dpctl::tensor::kernels:: + return dpnp::tensor::kernels:: reduction_axis1_over_group_temps_contig_impl; } @@ -176,7 +176,7 @@ struct HypotOverAxis0TempsContigFactory if constexpr (TypePairSupportDataForHypotReductionTemps< srcTy, dstTy>::is_defined) { using ReductionOpT = su_ns::Hypot; - return dpctl::tensor::kernels:: + return dpnp::tensor::kernels:: reduction_axis0_over_group_temps_contig_impl; } @@ -188,8 +188,8 @@ struct HypotOverAxis0TempsContigFactory void populate_hypot_over_axis_dispatch_tables(void) { - using dpctl::tensor::kernels::reduction_contig_impl_fn_ptr; - using dpctl::tensor::kernels::reduction_strided_impl_fn_ptr; + using dpnp::tensor::kernels::reduction_contig_impl_fn_ptr; + using dpnp::tensor::kernels::reduction_strided_impl_fn_ptr; using namespace td_ns; DispatchTableBuilder; { using impl::populate_hypot_over_axis_dispatch_tables; @@ -221,8 +221,8 @@ void init_reduce_hypot(py::module_ m) using impl::hypot_over_axis1_contig_temps_dispatch_table; using impl::hypot_over_axis_strided_temps_dispatch_table; - using dpctl::tensor::kernels::reduction_contig_impl_fn_ptr; - using dpctl::tensor::kernels::reduction_strided_impl_fn_ptr; + using dpnp::tensor::kernels::reduction_contig_impl_fn_ptr; + using dpnp::tensor::kernels::reduction_strided_impl_fn_ptr; auto hypot_pyapi = [&](const arrayT &src, int trailing_dims_to_reduce, const arrayT &dst, sycl::queue &exec_q, @@ -248,4 +248,4 @@ void init_reduce_hypot(py::module_ m) } } -} // namespace dpctl::tensor::py_internal +} // namespace dpnp::tensor::py_internal diff --git a/dpnp/tensor/libtensor/source/reductions/reduce_hypot.hpp b/dpnp/tensor/libtensor/source/reductions/reduce_hypot.hpp index c0a16345af75..1c56d1cad05f 100644 --- a/dpnp/tensor/libtensor/source/reductions/reduce_hypot.hpp +++ b/dpnp/tensor/libtensor/source/reductions/reduce_hypot.hpp @@ -29,7 +29,7 @@ //===---------------------------------------------------------------------===// /// /// \file -/// This file defines functions of dpctl.tensor._tensor_reductions_impl +/// This file defines functions of dpnp.tensor._tensor_reductions_impl /// extension. //===---------------------------------------------------------------------===// @@ -38,9 +38,9 @@ namespace py = pybind11; -namespace dpctl::tensor::py_internal +namespace dpnp::tensor::py_internal { extern void init_reduce_hypot(py::module_ m); -} // namespace dpctl::tensor::py_internal +} // namespace dpnp::tensor::py_internal diff --git a/dpnp/tensor/libtensor/source/reductions/reduction_atomic_support.hpp b/dpnp/tensor/libtensor/source/reductions/reduction_atomic_support.hpp index af6c3f0d513a..b8c37458577c 100644 --- a/dpnp/tensor/libtensor/source/reductions/reduction_atomic_support.hpp +++ b/dpnp/tensor/libtensor/source/reductions/reduction_atomic_support.hpp @@ -29,7 +29,7 @@ //===---------------------------------------------------------------------===// /// /// \file -/// This file defines functions of dpctl.tensor._tensor_reductions_impl +/// This file defines functions of dpnp.tensor._tensor_reductions_impl /// extension. //===---------------------------------------------------------------------===// @@ -40,7 +40,7 @@ #include "utils/type_utils.hpp" -namespace dpctl::tensor::py_internal::atomic_support +namespace dpnp::tensor::py_internal::atomic_support { typedef bool (*atomic_support_fn_ptr_t)(const sycl::queue &, sycl::usm::alloc); @@ -59,7 +59,7 @@ bool check_atomic_support(const sycl::queue &exec_q, { static constexpr bool atomic32 = (sizeof(T) == 4); static constexpr bool atomic64 = (sizeof(T) == 8); - using dpctl::tensor::type_utils::is_complex; + using dpnp::tensor::type_utils::is_complex; if constexpr ((!atomic32 && !atomic64) || is_complex::value) { return fixed_decision(exec_q, usm_alloc_type); } @@ -95,7 +95,7 @@ struct ArithmeticAtomicSupportFactory { fnT get() { - using dpctl::tensor::type_utils::is_complex; + using dpnp::tensor::type_utils::is_complex; if constexpr (std::is_floating_point_v || std::is_same_v || is_complex::value) { // for real- and complex- floating point types, tree reduction has @@ -140,4 +140,4 @@ struct ProductAtomicSupportFactory { }; -} // namespace dpctl::tensor::py_internal::atomic_support +} // namespace dpnp::tensor::py_internal::atomic_support diff --git a/dpnp/tensor/libtensor/source/reductions/reduction_common.cpp b/dpnp/tensor/libtensor/source/reductions/reduction_common.cpp index fca5e09e2fe5..b99cfce24d41 100644 --- a/dpnp/tensor/libtensor/source/reductions/reduction_common.cpp +++ b/dpnp/tensor/libtensor/source/reductions/reduction_common.cpp @@ -29,7 +29,7 @@ //===---------------------------------------------------------------------===// /// /// \file -/// This file defines functions of dpctl.tensor._tensor_reductions_impl +/// This file defines functions of dpnp.tensor._tensor_reductions_impl /// extension. //===---------------------------------------------------------------------===// @@ -48,7 +48,7 @@ namespace py = pybind11; -namespace dpctl::tensor::py_internal +namespace dpnp::tensor::py_internal { /*! @brief Add reduction functions to Python module */ @@ -66,4 +66,4 @@ void init_reduction_functions(py::module_ m) init_sum(m); } -} // namespace dpctl::tensor::py_internal +} // namespace dpnp::tensor::py_internal diff --git a/dpnp/tensor/libtensor/source/reductions/reduction_common.hpp b/dpnp/tensor/libtensor/source/reductions/reduction_common.hpp index 4df67c16bc4e..3dd1356820c1 100644 --- a/dpnp/tensor/libtensor/source/reductions/reduction_common.hpp +++ b/dpnp/tensor/libtensor/source/reductions/reduction_common.hpp @@ -29,7 +29,7 @@ //===---------------------------------------------------------------------===// /// /// \file -/// This file defines functions of dpctl.tensor._tensor_reductions_impl +/// This file defines functions of dpnp.tensor._tensor_reductions_impl /// extension. //===---------------------------------------------------------------------===// @@ -38,9 +38,9 @@ namespace py = pybind11; -namespace dpctl::tensor::py_internal +namespace dpnp::tensor::py_internal { extern void init_reduction_functions(py::module_); -} // namespace dpctl::tensor::py_internal +} // namespace dpnp::tensor::py_internal diff --git a/dpnp/tensor/libtensor/source/reductions/reduction_over_axis.hpp b/dpnp/tensor/libtensor/source/reductions/reduction_over_axis.hpp index 8224163ccb19..ee65cd8b45ac 100644 --- a/dpnp/tensor/libtensor/source/reductions/reduction_over_axis.hpp +++ b/dpnp/tensor/libtensor/source/reductions/reduction_over_axis.hpp @@ -29,7 +29,7 @@ //===---------------------------------------------------------------------===// /// /// \file -/// This file defines functions of dpctl.tensor._tensor_reductions_impl +/// This file defines functions of dpnp.tensor._tensor_reductions_impl /// extension, specifically functions for reductions. //===---------------------------------------------------------------------===// @@ -59,11 +59,11 @@ #include "utils/sycl_alloc_utils.hpp" #include "utils/type_dispatch.hpp" -namespace dpctl::tensor::py_internal +namespace dpnp::tensor::py_internal { namespace py = pybind11; -namespace td_ns = dpctl::tensor::type_dispatch; +namespace td_ns = dpnp::tensor::type_dispatch; /* ====================== dtype supported ======================== */ @@ -80,9 +80,9 @@ bool py_reduction_dtype_supported( const CheckAtomicSupportFnT &check_atomic_support) { int arg_tn = - input_dtype.num(); // NumPy type numbers are the same as in dpctl + input_dtype.num(); // NumPy type numbers are the same as in dpnp int out_tn = - output_dtype.num(); // NumPy type numbers are the same as in dpctl + output_dtype.num(); // NumPy type numbers are the same as in dpnp int arg_typeid = -1; int out_typeid = -1; @@ -141,9 +141,9 @@ bool py_tree_reduction_dtype_supported(const py::dtype &input_dtype, const fnT &temps_dispatch_table) { int arg_tn = - input_dtype.num(); // NumPy type numbers are the same as in dpctl + input_dtype.num(); // NumPy type numbers are the same as in dpnp int out_tn = - output_dtype.num(); // NumPy type numbers are the same as in dpctl + output_dtype.num(); // NumPy type numbers are the same as in dpnp int arg_typeid = -1; int out_typeid = -1; @@ -172,9 +172,9 @@ bool py_tree_reduction_dtype_supported(const py::dtype &input_dtype, * support atomics */ template std::pair py_reduction_over_axis( - const dpctl::tensor::usm_ndarray &src, + const dpnp::tensor::usm_ndarray &src, int trailing_dims_to_reduce, // comp over this many trailing indexes - const dpctl::tensor::usm_ndarray &dst, + const dpnp::tensor::usm_ndarray &dst, sycl::queue &exec_q, const std::vector &depends, const strided_fnT &atomic_dispatch_table, @@ -211,12 +211,12 @@ std::pair py_reduction_over_axis( "dimensions of the input shape"); } - if (!dpctl::utils::queues_are_compatible(exec_q, {src, dst})) { + if (!dpnp::utils::queues_are_compatible(exec_q, {src, dst})) { throw py::value_error( "Execution queue is not compatible with allocation queues"); } - dpctl::tensor::validation::CheckWritable::throw_if_not_writable(dst); + dpnp::tensor::validation::CheckWritable::throw_if_not_writable(dst); std::size_t dst_nelems = dst.get_size(); @@ -230,17 +230,17 @@ std::pair py_reduction_over_axis( } // check that dst and src do not overlap - auto const &overlap = dpctl::tensor::overlap::MemoryOverlap(); + auto const &overlap = dpnp::tensor::overlap::MemoryOverlap(); if (overlap(src, dst)) { throw py::value_error("Arrays index overlapping segments of memory"); } - dpctl::tensor::validation::AmpleMemory::throw_if_not_ample(dst, dst_nelems); + dpnp::tensor::validation::AmpleMemory::throw_if_not_ample(dst, dst_nelems); int src_typenum = src.get_typenum(); int dst_typenum = dst.get_typenum(); - namespace td_ns = dpctl::tensor::type_dispatch; + namespace td_ns = dpnp::tensor::type_dispatch; const auto &array_types = td_ns::usm_ndarray_types(); int src_typeid = array_types.typenum_to_lookup_id(src_typenum); int dst_typeid = array_types.typenum_to_lookup_id(dst_typenum); @@ -281,7 +281,7 @@ std::pair py_reduction_over_axis( zero_offset, // reduction_src_offset depends); - sycl::event keep_args_event = dpctl::utils::keep_args_alive( + sycl::event keep_args_event = dpnp::utils::keep_args_alive( exec_q, {src, dst}, {reduction_over_axis_contig_ev}); return std::make_pair(keep_args_event, @@ -313,7 +313,7 @@ std::pair py_reduction_over_axis( zero_offset, // reduction_src_offset depends); - sycl::event keep_args_event = dpctl::utils::keep_args_alive( + sycl::event keep_args_event = dpnp::utils::keep_args_alive( exec_q, {src, dst}, {reduction_over_axis_contig_ev}); return std::make_pair(keep_args_event, @@ -409,7 +409,7 @@ std::pair py_reduction_over_axis( dst.get_data(), iteration_src_offset, iteration_dst_offset, reduction_src_offset, depends); - sycl::event keep_args_event = dpctl::utils::keep_args_alive( + sycl::event keep_args_event = dpnp::utils::keep_args_alive( exec_q, {src, dst}, {reduction_over_axis1_contig_ev}); return std::make_pair(keep_args_event, @@ -432,7 +432,7 @@ std::pair py_reduction_over_axis( dst.get_data(), iteration_src_offset, iteration_dst_offset, reduction_src_offset, depends); - sycl::event keep_args_event = dpctl::utils::keep_args_alive( + sycl::event keep_args_event = dpnp::utils::keep_args_alive( exec_q, {src, dst}, {reduction_over_axis0_contig_ev}); return std::make_pair(keep_args_event, @@ -459,7 +459,7 @@ std::pair py_reduction_over_axis( } std::vector host_task_events{}; - using dpctl::tensor::offset_utils::device_allocate_and_pack; + using dpnp::tensor::offset_utils::device_allocate_and_pack; auto arrays_metainfo_packing_triple_ = device_allocate_and_pack( exec_q, host_task_events, @@ -490,12 +490,12 @@ std::pair py_reduction_over_axis( reduction_nd, // number dimensions being reduced reduction_shape_stride, reduction_src_offset, all_deps); - sycl::event temp_cleanup_ev = dpctl::tensor::alloc_utils::async_smart_free( + sycl::event temp_cleanup_ev = dpnp::tensor::alloc_utils::async_smart_free( exec_q, {reduction_ev}, tmp_alloc_owner); host_task_events.push_back(temp_cleanup_ev); sycl::event keep_args_event = - dpctl::utils::keep_args_alive(exec_q, {src, dst}, host_task_events); + dpnp::utils::keep_args_alive(exec_q, {src, dst}, host_task_events); return std::make_pair(keep_args_event, reduction_ev); } @@ -506,9 +506,9 @@ std::pair py_reduction_over_axis( * atomics */ template std::pair py_tree_reduction_over_axis( - const dpctl::tensor::usm_ndarray &src, + const dpnp::tensor::usm_ndarray &src, int trailing_dims_to_reduce, // comp over this many trailing indexes - const dpctl::tensor::usm_ndarray &dst, + const dpnp::tensor::usm_ndarray &dst, sycl::queue &exec_q, const std::vector &depends, const strided_fnT &temps_dispatch_table, @@ -541,12 +541,12 @@ std::pair py_tree_reduction_over_axis( "dimensions of the input shape"); } - if (!dpctl::utils::queues_are_compatible(exec_q, {src, dst})) { + if (!dpnp::utils::queues_are_compatible(exec_q, {src, dst})) { throw py::value_error( "Execution queue is not compatible with allocation queues"); } - dpctl::tensor::validation::CheckWritable::throw_if_not_writable(dst); + dpnp::tensor::validation::CheckWritable::throw_if_not_writable(dst); std::size_t dst_nelems = dst.get_size(); @@ -560,17 +560,17 @@ std::pair py_tree_reduction_over_axis( } // check that dst and src do not overlap - auto const &overlap = dpctl::tensor::overlap::MemoryOverlap(); + auto const &overlap = dpnp::tensor::overlap::MemoryOverlap(); if (overlap(src, dst)) { throw py::value_error("Arrays index overlapping segments of memory"); } - dpctl::tensor::validation::AmpleMemory::throw_if_not_ample(dst, dst_nelems); + dpnp::tensor::validation::AmpleMemory::throw_if_not_ample(dst, dst_nelems); int src_typenum = src.get_typenum(); int dst_typenum = dst.get_typenum(); - namespace td_ns = dpctl::tensor::type_dispatch; + namespace td_ns = dpnp::tensor::type_dispatch; const auto &array_types = td_ns::usm_ndarray_types(); int src_typeid = array_types.typenum_to_lookup_id(src_typenum); int dst_typeid = array_types.typenum_to_lookup_id(dst_typenum); @@ -596,7 +596,7 @@ std::pair py_tree_reduction_over_axis( zero_offset, // reduction_src_offset depends); - sycl::event keep_args_event = dpctl::utils::keep_args_alive( + sycl::event keep_args_event = dpnp::utils::keep_args_alive( exec_q, {src, dst}, {reduction_over_axis_contig_ev}); return std::make_pair(keep_args_event, @@ -619,7 +619,7 @@ std::pair py_tree_reduction_over_axis( zero_offset, // reduction_src_offset depends); - sycl::event keep_args_event = dpctl::utils::keep_args_alive( + sycl::event keep_args_event = dpnp::utils::keep_args_alive( exec_q, {src, dst}, {reduction_over_axis_contig_ev}); return std::make_pair(keep_args_event, @@ -706,7 +706,7 @@ std::pair py_tree_reduction_over_axis( dst.get_data(), iteration_src_offset, iteration_dst_offset, reduction_src_offset, depends); - sycl::event keep_args_event = dpctl::utils::keep_args_alive( + sycl::event keep_args_event = dpnp::utils::keep_args_alive( exec_q, {src, dst}, {reduction_over_axis1_contig_ev}); return std::make_pair(keep_args_event, @@ -721,7 +721,7 @@ std::pair py_tree_reduction_over_axis( dst.get_data(), iteration_src_offset, iteration_dst_offset, reduction_src_offset, depends); - sycl::event keep_args_event = dpctl::utils::keep_args_alive( + sycl::event keep_args_event = dpnp::utils::keep_args_alive( exec_q, {src, dst}, {reduction_over_axis0_contig_ev}); return std::make_pair(keep_args_event, @@ -736,7 +736,7 @@ std::pair py_tree_reduction_over_axis( } std::vector host_task_events{}; - using dpctl::tensor::offset_utils::device_allocate_and_pack; + using dpnp::tensor::offset_utils::device_allocate_and_pack; auto arrays_metainfo_packing_triple_ = device_allocate_and_pack( exec_q, host_task_events, @@ -766,12 +766,12 @@ std::pair py_tree_reduction_over_axis( reduction_nd, // number dimensions being reduced reduction_shape_stride, reduction_src_offset, all_deps); - sycl::event temp_cleanup_ev = dpctl::tensor::alloc_utils::async_smart_free( + sycl::event temp_cleanup_ev = dpnp::tensor::alloc_utils::async_smart_free( exec_q, {reduction_ev}, tmp_owner); host_task_events.push_back(temp_cleanup_ev); sycl::event keep_args_event = - dpctl::utils::keep_args_alive(exec_q, {src, dst}, host_task_events); + dpnp::utils::keep_args_alive(exec_q, {src, dst}, host_task_events); return std::make_pair(keep_args_event, reduction_ev); } @@ -779,9 +779,9 @@ std::pair py_tree_reduction_over_axis( /*! @brief Template implementing Python API for searching over an axis */ template std::pair py_search_over_axis( - const dpctl::tensor::usm_ndarray &src, + const dpnp::tensor::usm_ndarray &src, int trailing_dims_to_reduce, // comp over this many trailing indexes - const dpctl::tensor::usm_ndarray &dst, + const dpnp::tensor::usm_ndarray &dst, sycl::queue &exec_q, const std::vector &depends, const strided_fnT &strided_dispatch_table, @@ -814,12 +814,12 @@ std::pair py_search_over_axis( "dimensions of the input shape"); } - if (!dpctl::utils::queues_are_compatible(exec_q, {src, dst})) { + if (!dpnp::utils::queues_are_compatible(exec_q, {src, dst})) { throw py::value_error( "Execution queue is not compatible with allocation queues"); } - dpctl::tensor::validation::CheckWritable::throw_if_not_writable(dst); + dpnp::tensor::validation::CheckWritable::throw_if_not_writable(dst); std::size_t dst_nelems = dst.get_size(); @@ -833,17 +833,17 @@ std::pair py_search_over_axis( } // check that dst and src do not overlap - auto const &overlap = dpctl::tensor::overlap::MemoryOverlap(); + auto const &overlap = dpnp::tensor::overlap::MemoryOverlap(); if (overlap(src, dst)) { throw py::value_error("Arrays index overlapping segments of memory"); } - dpctl::tensor::validation::AmpleMemory::throw_if_not_ample(dst, dst_nelems); + dpnp::tensor::validation::AmpleMemory::throw_if_not_ample(dst, dst_nelems); int src_typenum = src.get_typenum(); int dst_typenum = dst.get_typenum(); - namespace td_ns = dpctl::tensor::type_dispatch; + namespace td_ns = dpnp::tensor::type_dispatch; const auto &array_types = td_ns::usm_ndarray_types(); int src_typeid = array_types.typenum_to_lookup_id(src_typenum); int dst_typeid = array_types.typenum_to_lookup_id(dst_typenum); @@ -868,7 +868,7 @@ std::pair py_search_over_axis( zero_offset, // reduction_src_offset depends); - sycl::event keep_args_event = dpctl::utils::keep_args_alive( + sycl::event keep_args_event = dpnp::utils::keep_args_alive( exec_q, {src, dst}, {reduction_over_axis_contig_ev}); return std::make_pair(keep_args_event, @@ -890,7 +890,7 @@ std::pair py_search_over_axis( zero_offset, // reduction_src_offset depends); - sycl::event keep_args_event = dpctl::utils::keep_args_alive( + sycl::event keep_args_event = dpnp::utils::keep_args_alive( exec_q, {src, dst}, {reduction_over_axis_contig_ev}); return std::make_pair(keep_args_event, @@ -975,7 +975,7 @@ std::pair py_search_over_axis( dst.get_data(), iteration_src_offset, iteration_dst_offset, reduction_src_offset, depends); - sycl::event keep_args_event = dpctl::utils::keep_args_alive( + sycl::event keep_args_event = dpnp::utils::keep_args_alive( exec_q, {src, dst}, {reduction_over_axis1_contig_ev}); return std::make_pair(keep_args_event, @@ -990,7 +990,7 @@ std::pair py_search_over_axis( dst.get_data(), iteration_src_offset, iteration_dst_offset, reduction_src_offset, depends); - sycl::event keep_args_event = dpctl::utils::keep_args_alive( + sycl::event keep_args_event = dpnp::utils::keep_args_alive( exec_q, {src, dst}, {reduction_over_axis0_contig_ev}); return std::make_pair(keep_args_event, @@ -1006,7 +1006,7 @@ std::pair py_search_over_axis( std::vector host_task_events{}; - using dpctl::tensor::offset_utils::device_allocate_and_pack; + using dpnp::tensor::offset_utils::device_allocate_and_pack; auto arrays_metainfo_packing_triple_ = device_allocate_and_pack( @@ -1036,12 +1036,12 @@ std::pair py_search_over_axis( reduction_nd, // number dimensions being reduced reduction_shape_stride, reduction_src_offset, all_deps); - sycl::event temp_cleanup_ev = dpctl::tensor::alloc_utils::async_smart_free( + sycl::event temp_cleanup_ev = dpnp::tensor::alloc_utils::async_smart_free( exec_q, {comp_ev}, tmp_owner); host_task_events.push_back(temp_cleanup_ev); sycl::event keep_args_event = - dpctl::utils::keep_args_alive(exec_q, {src, dst}, host_task_events); + dpnp::utils::keep_args_alive(exec_q, {src, dst}, host_task_events); return std::make_pair(keep_args_event, comp_ev); } @@ -1054,9 +1054,9 @@ template std::pair - py_boolean_reduction(const dpctl::tensor::usm_ndarray &src, + py_boolean_reduction(const dpnp::tensor::usm_ndarray &src, int trailing_dims_to_reduce, - const dpctl::tensor::usm_ndarray &dst, + const dpnp::tensor::usm_ndarray &dst, sycl::queue &exec_q, const std::vector &depends, const contig_dispatchT &axis1_contig_dispatch_vector, @@ -1090,12 +1090,12 @@ std::pair "dimensions of the input shape"); } - if (!dpctl::utils::queues_are_compatible(exec_q, {src, dst})) { + if (!dpnp::utils::queues_are_compatible(exec_q, {src, dst})) { throw py::value_error( "Execution queue is not compatible with allocation queues"); } - dpctl::tensor::validation::CheckWritable::throw_if_not_writable(dst); + dpnp::tensor::validation::CheckWritable::throw_if_not_writable(dst); std::size_t dst_nelems = dst.get_size(); @@ -1104,12 +1104,12 @@ std::pair red_nelems *= static_cast(src_shape_ptr[i]); } - auto const &overlap = dpctl::tensor::overlap::MemoryOverlap(); + auto const &overlap = dpnp::tensor::overlap::MemoryOverlap(); if (overlap(dst, src)) { throw py::value_error("Arrays are expected to have no memory overlap"); } - dpctl::tensor::validation::AmpleMemory::throw_if_not_ample(dst, dst_nelems); + dpnp::tensor::validation::AmpleMemory::throw_if_not_ample(dst, dst_nelems); const char *src_data = src.get_data(); char *dst_data = dst.get_data(); @@ -1153,7 +1153,7 @@ std::pair zero_offset, zero_offset, depends); sycl::event keep_args_event = - dpctl::utils::keep_args_alive(exec_q, {src, dst}, {red_ev}); + dpnp::utils::keep_args_alive(exec_q, {src, dst}, {red_ev}); return std::make_pair(keep_args_event, red_ev); } @@ -1167,7 +1167,7 @@ std::pair zero_offset, zero_offset, depends); sycl::event keep_args_event = - dpctl::utils::keep_args_alive(exec_q, {src, dst}, {red_ev}); + dpnp::utils::keep_args_alive(exec_q, {src, dst}, {red_ev}); return std::make_pair(keep_args_event, red_ev); } @@ -1244,7 +1244,7 @@ std::pair iter_src_offset, iter_dst_offset, red_src_offset, depends); sycl::event keep_args_event = - dpctl::utils::keep_args_alive(exec_q, {src, dst}, {red_ev}); + dpnp::utils::keep_args_alive(exec_q, {src, dst}, {red_ev}); return std::make_pair(keep_args_event, red_ev); } @@ -1256,7 +1256,7 @@ std::pair iter_src_offset, iter_dst_offset, red_src_offset, depends); sycl::event keep_args_event = - dpctl::utils::keep_args_alive(exec_q, {src, dst}, {red_ev}); + dpnp::utils::keep_args_alive(exec_q, {src, dst}, {red_ev}); return std::make_pair(keep_args_event, red_ev); } @@ -1266,7 +1266,7 @@ std::pair std::vector host_task_events{}; auto iter_red_metadata_packing_triple_ = - dpctl::tensor::offset_utils::device_allocate_and_pack( + dpnp::tensor::offset_utils::device_allocate_and_pack( exec_q, host_task_events, simplified_iter_shape, simplified_iter_src_strides, simplified_iter_dst_strides, simplified_red_shape, simplified_red_src_strides); @@ -1292,16 +1292,16 @@ std::pair iter_shape_and_strides, iter_src_offset, iter_dst_offset, simplified_red_nd, red_shape_stride, red_src_offset, all_deps); - sycl::event temp_cleanup_ev = dpctl::tensor::alloc_utils::async_smart_free( + sycl::event temp_cleanup_ev = dpnp::tensor::alloc_utils::async_smart_free( exec_q, {red_ev}, packed_shapes_strides_owner); host_task_events.push_back(temp_cleanup_ev); sycl::event keep_args_event = - dpctl::utils::keep_args_alive(exec_q, {src, dst}, host_task_events); + dpnp::utils::keep_args_alive(exec_q, {src, dst}, host_task_events); return std::make_pair(keep_args_event, red_ev); } extern void init_reduction_functions(py::module_ m); -} // namespace dpctl::tensor::py_internal +} // namespace dpnp::tensor::py_internal diff --git a/dpnp/tensor/libtensor/source/reductions/sum.cpp b/dpnp/tensor/libtensor/source/reductions/sum.cpp index 9a0d212ed8da..6c4cc7067afe 100644 --- a/dpnp/tensor/libtensor/source/reductions/sum.cpp +++ b/dpnp/tensor/libtensor/source/reductions/sum.cpp @@ -29,7 +29,7 @@ //===---------------------------------------------------------------------===// /// /// \file -/// This file defines functions of dpctl.tensor._tensor_reductions_impl +/// This file defines functions of dpnp.tensor._tensor_reductions_impl /// extension. //===---------------------------------------------------------------------===// @@ -52,16 +52,16 @@ #include "reduction_atomic_support.hpp" #include "reduction_over_axis.hpp" -namespace dpctl::tensor::py_internal +namespace dpnp::tensor::py_internal { namespace py = pybind11; -namespace td_ns = dpctl::tensor::type_dispatch; +namespace td_ns = dpnp::tensor::type_dispatch; namespace impl { -using dpctl::tensor::kernels::reduction_strided_impl_fn_ptr; +using dpnp::tensor::kernels::reduction_strided_impl_fn_ptr; static reduction_strided_impl_fn_ptr sum_over_axis_strided_atomic_dispatch_table[td_ns::num_types] [td_ns::num_types]; @@ -69,7 +69,7 @@ static reduction_strided_impl_fn_ptr sum_over_axis_strided_temps_dispatch_table[td_ns::num_types] [td_ns::num_types]; -using dpctl::tensor::kernels::reduction_contig_impl_fn_ptr; +using dpnp::tensor::kernels::reduction_contig_impl_fn_ptr; static reduction_contig_impl_fn_ptr sum_over_axis1_contig_atomic_dispatch_table[td_ns::num_types] [td_ns::num_types]; @@ -248,7 +248,7 @@ struct SumOverAxisAtomicStridedFactory if constexpr (TypePairSupportDataForSumReductionAtomic< srcTy, dstTy>::is_defined) { using ReductionOpT = sycl::plus; - return dpctl::tensor::kernels:: + return dpnp::tensor::kernels:: reduction_over_group_with_atomics_strided_impl; } @@ -268,7 +268,7 @@ struct SumOverAxisTempsStridedFactory using ReductionOpT = std::conditional_t, sycl::logical_or, sycl::plus>; - return dpctl::tensor::kernels:: + return dpnp::tensor::kernels:: reduction_over_group_temps_strided_impl; } @@ -286,7 +286,7 @@ struct SumOverAxis1AtomicContigFactory if constexpr (TypePairSupportDataForSumReductionAtomic< srcTy, dstTy>::is_defined) { using ReductionOpT = sycl::plus; - return dpctl::tensor::kernels:: + return dpnp::tensor::kernels:: reduction_axis1_over_group_with_atomics_contig_impl< srcTy, dstTy, ReductionOpT>; } @@ -304,7 +304,7 @@ struct SumOverAxis0AtomicContigFactory if constexpr (TypePairSupportDataForSumReductionAtomic< srcTy, dstTy>::is_defined) { using ReductionOpT = sycl::plus; - return dpctl::tensor::kernels:: + return dpnp::tensor::kernels:: reduction_axis0_over_group_with_atomics_contig_impl< srcTy, dstTy, ReductionOpT>; } @@ -324,7 +324,7 @@ struct SumOverAxis1TempsContigFactory using ReductionOpT = std::conditional_t, sycl::logical_or, sycl::plus>; - return dpctl::tensor::kernels:: + return dpnp::tensor::kernels:: reduction_axis1_over_group_temps_contig_impl; } @@ -344,7 +344,7 @@ struct SumOverAxis0TempsContigFactory using ReductionOpT = std::conditional_t, sycl::logical_or, sycl::plus>; - return dpctl::tensor::kernels:: + return dpnp::tensor::kernels:: reduction_axis0_over_group_temps_contig_impl; } @@ -356,8 +356,8 @@ struct SumOverAxis0TempsContigFactory void populate_sum_over_axis_dispatch_tables(void) { - using dpctl::tensor::kernels::reduction_contig_impl_fn_ptr; - using dpctl::tensor::kernels::reduction_strided_impl_fn_ptr; + using dpnp::tensor::kernels::reduction_contig_impl_fn_ptr; + using dpnp::tensor::kernels::reduction_strided_impl_fn_ptr; using namespace td_ns; DispatchTableBuilder; { using impl::populate_sum_over_axis_dispatch_tables; @@ -457,4 +457,4 @@ void init_sum(py::module_ m) } } -} // namespace dpctl::tensor::py_internal +} // namespace dpnp::tensor::py_internal diff --git a/dpnp/tensor/libtensor/source/reductions/sum.hpp b/dpnp/tensor/libtensor/source/reductions/sum.hpp index 08add902a049..cb118c42a940 100644 --- a/dpnp/tensor/libtensor/source/reductions/sum.hpp +++ b/dpnp/tensor/libtensor/source/reductions/sum.hpp @@ -29,7 +29,7 @@ //===---------------------------------------------------------------------===// /// /// \file -/// This file defines functions of dpctl.tensor._tensor_reductions_impl +/// This file defines functions of dpnp.tensor._tensor_reductions_impl /// extension. //===---------------------------------------------------------------------===// @@ -38,9 +38,9 @@ namespace py = pybind11; -namespace dpctl::tensor::py_internal +namespace dpnp::tensor::py_internal { extern void init_sum(py::module_ m); -} // namespace dpctl::tensor::py_internal +} // namespace dpnp::tensor::py_internal diff --git a/dpnp/tensor/libtensor/source/repeat.cpp b/dpnp/tensor/libtensor/source/repeat.cpp index b809160e257b..bbb004006a41 100644 --- a/dpnp/tensor/libtensor/source/repeat.cpp +++ b/dpnp/tensor/libtensor/source/repeat.cpp @@ -29,7 +29,7 @@ //===--------------------------------------------------------------------===// /// /// \file -/// This file defines functions of dpctl.tensor._tensor_impl extensions +/// This file defines functions of dpnp.tensor._tensor_impl extensions //===--------------------------------------------------------------------===// #include @@ -53,49 +53,49 @@ #include "simplify_iteration_space.hpp" -namespace dpctl::tensor::py_internal +namespace dpnp::tensor::py_internal { namespace py = pybind11; -namespace td_ns = dpctl::tensor::type_dispatch; +namespace td_ns = dpnp::tensor::type_dispatch; -using dpctl::tensor::kernels::repeat::repeat_by_sequence_fn_ptr_t; +using dpnp::tensor::kernels::repeat::repeat_by_sequence_fn_ptr_t; static repeat_by_sequence_fn_ptr_t repeat_by_sequence_dispatch_vector[td_ns::num_types]; -using dpctl::tensor::kernels::repeat::repeat_by_sequence_1d_fn_ptr_t; +using dpnp::tensor::kernels::repeat::repeat_by_sequence_1d_fn_ptr_t; static repeat_by_sequence_1d_fn_ptr_t repeat_by_sequence_1d_dispatch_vector[td_ns::num_types]; -using dpctl::tensor::kernels::repeat::repeat_by_scalar_fn_ptr_t; +using dpnp::tensor::kernels::repeat::repeat_by_scalar_fn_ptr_t; static repeat_by_scalar_fn_ptr_t repeat_by_scalar_dispatch_vector[td_ns::num_types]; -using dpctl::tensor::kernels::repeat::repeat_by_scalar_1d_fn_ptr_t; +using dpnp::tensor::kernels::repeat::repeat_by_scalar_1d_fn_ptr_t; static repeat_by_scalar_1d_fn_ptr_t repeat_by_scalar_1d_dispatch_vector[td_ns::num_types]; void init_repeat_dispatch_vectors(void) { - using dpctl::tensor::kernels::repeat::RepeatSequenceFactory; + using dpnp::tensor::kernels::repeat::RepeatSequenceFactory; td_ns::DispatchVectorBuilder dvb1; dvb1.populate_dispatch_vector(repeat_by_sequence_dispatch_vector); - using dpctl::tensor::kernels::repeat::RepeatSequence1DFactory; + using dpnp::tensor::kernels::repeat::RepeatSequence1DFactory; td_ns::DispatchVectorBuilder dvb2; dvb2.populate_dispatch_vector(repeat_by_sequence_1d_dispatch_vector); - using dpctl::tensor::kernels::repeat::RepeatScalarFactory; + using dpnp::tensor::kernels::repeat::RepeatScalarFactory; td_ns::DispatchVectorBuilder dvb3; dvb3.populate_dispatch_vector(repeat_by_scalar_dispatch_vector); - using dpctl::tensor::kernels::repeat::RepeatScalar1DFactory; + using dpnp::tensor::kernels::repeat::RepeatScalar1DFactory; td_ns::DispatchVectorBuilder dvb4; @@ -103,10 +103,10 @@ void init_repeat_dispatch_vectors(void) } std::pair - py_repeat_by_sequence(const dpctl::tensor::usm_ndarray &src, - const dpctl::tensor::usm_ndarray &dst, - const dpctl::tensor::usm_ndarray &reps, - const dpctl::tensor::usm_ndarray &cumsum, + py_repeat_by_sequence(const dpnp::tensor::usm_ndarray &src, + const dpnp::tensor::usm_ndarray &dst, + const dpnp::tensor::usm_ndarray &reps, + const dpnp::tensor::usm_ndarray &cumsum, int axis, sycl::queue &exec_q, const std::vector &depends) @@ -136,13 +136,12 @@ std::pair throw py::value_error("Expecting `cumsum` array to be C-contiguous."); } - if (!dpctl::utils::queues_are_compatible(exec_q, - {src, reps, cumsum, dst})) { + if (!dpnp::utils::queues_are_compatible(exec_q, {src, reps, cumsum, dst})) { throw py::value_error( "Execution queue is not compatible with allocation queues"); } - dpctl::tensor::validation::CheckWritable::throw_if_not_writable(dst); + dpnp::tensor::validation::CheckWritable::throw_if_not_writable(dst); std::size_t reps_sz = reps.get_size(); std::size_t cumsum_sz = cumsum.get_size(); @@ -178,10 +177,10 @@ std::pair return std::make_pair(sycl::event(), sycl::event()); } - dpctl::tensor::validation::AmpleMemory::throw_if_not_ample( + dpnp::tensor::validation::AmpleMemory::throw_if_not_ample( dst, orthog_nelems * dst_axis_nelems); - auto const &overlap = dpctl::tensor::overlap::MemoryOverlap(); + auto const &overlap = dpnp::tensor::overlap::MemoryOverlap(); // check that dst does not intersect with src or reps if (overlap(dst, src) || overlap(dst, reps) || overlap(dst, cumsum)) { throw py::value_error("Destination array overlaps with inputs"); @@ -245,7 +244,7 @@ std::pair src_strides_vec = {0}; } - using dpctl::tensor::offset_utils::device_allocate_and_pack; + using dpnp::tensor::offset_utils::device_allocate_and_pack; auto ptr_size_event_tuple1 = device_allocate_and_pack( exec_q, host_task_events, src_shape_vec, src_strides_vec); auto packed_src_shape_strides_owner = @@ -268,7 +267,7 @@ std::pair reps_strides_vec[0], all_deps); sycl::event cleanup_tmp_allocations_ev = - dpctl::tensor::alloc_utils::async_smart_free( + dpnp::tensor::alloc_utils::async_smart_free( exec_q, {repeat_ev}, packed_src_shape_strides_owner); host_task_events.push_back(cleanup_tmp_allocations_ev); } @@ -316,7 +315,7 @@ std::pair simplified_orthog_dst_strides, orthog_src_offset, orthog_dst_offset); - using dpctl::tensor::offset_utils::device_allocate_and_pack; + using dpnp::tensor::offset_utils::device_allocate_and_pack; auto ptr_size_event_tuple1 = device_allocate_and_pack( exec_q, host_task_events, simplified_orthog_shape, simplified_orthog_src_strides, simplified_orthog_dst_strides); @@ -346,22 +345,22 @@ std::pair reps_shape_vec[0], reps_strides_vec[0], all_deps); sycl::event cleanup_tmp_allocations_ev = - dpctl::tensor::alloc_utils::async_smart_free( + dpnp::tensor::alloc_utils::async_smart_free( exec_q, {repeat_ev}, packed_shapes_strides_owner); host_task_events.push_back(cleanup_tmp_allocations_ev); } - sycl::event py_obj_management_host_task_ev = dpctl::utils::keep_args_alive( + sycl::event py_obj_management_host_task_ev = dpnp::utils::keep_args_alive( exec_q, {src, reps, cumsum, dst}, host_task_events); return std::make_pair(py_obj_management_host_task_ev, repeat_ev); } std::pair - py_repeat_by_sequence(const dpctl::tensor::usm_ndarray &src, - const dpctl::tensor::usm_ndarray &dst, - const dpctl::tensor::usm_ndarray &reps, - const dpctl::tensor::usm_ndarray &cumsum, + py_repeat_by_sequence(const dpnp::tensor::usm_ndarray &src, + const dpnp::tensor::usm_ndarray &dst, + const dpnp::tensor::usm_ndarray &reps, + const dpnp::tensor::usm_ndarray &cumsum, sycl::queue &exec_q, const std::vector &depends) { @@ -385,13 +384,12 @@ std::pair throw py::value_error("Expecting `cumsum` array to be C-contiguous."); } - if (!dpctl::utils::queues_are_compatible(exec_q, - {src, reps, cumsum, dst})) { + if (!dpnp::utils::queues_are_compatible(exec_q, {src, reps, cumsum, dst})) { throw py::value_error( "Execution queue is not compatible with allocation queues"); } - dpctl::tensor::validation::CheckWritable::throw_if_not_writable(dst); + dpnp::tensor::validation::CheckWritable::throw_if_not_writable(dst); std::size_t src_sz = src.get_size(); std::size_t reps_sz = reps.get_size(); @@ -406,10 +404,10 @@ std::pair return std::make_pair(sycl::event(), sycl::event()); } - dpctl::tensor::validation::AmpleMemory::throw_if_not_ample(dst, - dst.get_size()); + dpnp::tensor::validation::AmpleMemory::throw_if_not_ample(dst, + dst.get_size()); - auto const &overlap = dpctl::tensor::overlap::MemoryOverlap(); + auto const &overlap = dpnp::tensor::overlap::MemoryOverlap(); // check that dst does not intersect with src, cumsum, or reps if (overlap(dst, src) || overlap(dst, reps) || overlap(dst, cumsum)) { throw py::value_error("Destination array overlaps with inputs"); @@ -467,7 +465,7 @@ std::pair auto fn = repeat_by_sequence_1d_dispatch_vector[src_typeid]; - using dpctl::tensor::offset_utils::device_allocate_and_pack; + using dpnp::tensor::offset_utils::device_allocate_and_pack; auto ptr_size_event_tuple1 = device_allocate_and_pack( exec_q, host_task_events, src_shape_vec, src_strides_vec); auto packed_src_shapes_strides_owner = @@ -489,19 +487,19 @@ std::pair reps_shape_vec[0], reps_strides_vec[0], all_deps); sycl::event cleanup_tmp_allocations_ev = - dpctl::tensor::alloc_utils::async_smart_free( + dpnp::tensor::alloc_utils::async_smart_free( exec_q, {repeat_ev}, packed_src_shapes_strides_owner); host_task_events.push_back(cleanup_tmp_allocations_ev); - sycl::event py_obj_management_host_task_ev = dpctl::utils::keep_args_alive( + sycl::event py_obj_management_host_task_ev = dpnp::utils::keep_args_alive( exec_q, {src, reps, cumsum, dst}, host_task_events); return std::make_pair(py_obj_management_host_task_ev, repeat_ev); } std::pair - py_repeat_by_scalar(const dpctl::tensor::usm_ndarray &src, - const dpctl::tensor::usm_ndarray &dst, + py_repeat_by_scalar(const dpnp::tensor::usm_ndarray &src, + const dpnp::tensor::usm_ndarray &dst, const py::ssize_t reps, int axis, sycl::queue &exec_q, @@ -519,12 +517,12 @@ std::pair "arrays is not consistent"); } - if (!dpctl::utils::queues_are_compatible(exec_q, {src, dst})) { + if (!dpnp::utils::queues_are_compatible(exec_q, {src, dst})) { throw py::value_error( "Execution queue is not compatible with allocation queues"); } - dpctl::tensor::validation::CheckWritable::throw_if_not_writable(dst); + dpnp::tensor::validation::CheckWritable::throw_if_not_writable(dst); const py::ssize_t *src_shape = src.get_shape_raw(); const py::ssize_t *dst_shape = dst.get_shape_raw(); @@ -557,10 +555,10 @@ std::pair return std::make_pair(sycl::event(), sycl::event()); } - dpctl::tensor::validation::AmpleMemory::throw_if_not_ample( + dpnp::tensor::validation::AmpleMemory::throw_if_not_ample( dst, orthog_nelems * (src_axis_nelems * reps)); - auto const &overlap = dpctl::tensor::overlap::MemoryOverlap(); + auto const &overlap = dpnp::tensor::overlap::MemoryOverlap(); // check that dst does not intersect with src if (overlap(dst, src)) { throw py::value_error("Destination array overlaps with inputs"); @@ -602,7 +600,7 @@ std::pair src_strides_vec = {0}; } - using dpctl::tensor::offset_utils::device_allocate_and_pack; + using dpnp::tensor::offset_utils::device_allocate_and_pack; auto ptr_size_event_tuple1 = device_allocate_and_pack( exec_q, host_task_events, src_shape_vec, src_strides_vec); auto packed_src_shape_strides_owner = @@ -623,7 +621,7 @@ std::pair dst_strides_vec[0], all_deps); sycl::event cleanup_tmp_allocations_ev = - dpctl::tensor::alloc_utils::async_smart_free( + dpnp::tensor::alloc_utils::async_smart_free( exec_q, {repeat_ev}, packed_src_shape_strides_owner); host_task_events.push_back(cleanup_tmp_allocations_ev); @@ -673,7 +671,7 @@ std::pair simplified_orthog_dst_strides, orthog_src_offset, orthog_dst_offset); - using dpctl::tensor::offset_utils::device_allocate_and_pack; + using dpnp::tensor::offset_utils::device_allocate_and_pack; auto ptr_size_event_tuple1 = device_allocate_and_pack( exec_q, host_task_events, simplified_orthog_shape, simplified_orthog_src_strides, simplified_orthog_dst_strides); @@ -701,20 +699,20 @@ std::pair axis_dst_shape[0], axis_dst_stride[0], all_deps); sycl::event cleanup_tmp_allocations_ev = - dpctl::tensor::alloc_utils::async_smart_free( + dpnp::tensor::alloc_utils::async_smart_free( exec_q, {repeat_ev}, packed_shapes_strides_owner); host_task_events.push_back(cleanup_tmp_allocations_ev); } sycl::event py_obj_management_host_task_ev = - dpctl::utils::keep_args_alive(exec_q, {src, dst}, host_task_events); + dpnp::utils::keep_args_alive(exec_q, {src, dst}, host_task_events); return std::make_pair(py_obj_management_host_task_ev, repeat_ev); } std::pair - py_repeat_by_scalar(const dpctl::tensor::usm_ndarray &src, - const dpctl::tensor::usm_ndarray &dst, + py_repeat_by_scalar(const dpnp::tensor::usm_ndarray &src, + const dpnp::tensor::usm_ndarray &dst, const py::ssize_t reps, sycl::queue &exec_q, const std::vector &depends) @@ -725,12 +723,12 @@ std::pair "`dst` array must be 1-dimensional when repeating a full array"); } - if (!dpctl::utils::queues_are_compatible(exec_q, {src, dst})) { + if (!dpnp::utils::queues_are_compatible(exec_q, {src, dst})) { throw py::value_error( "Execution queue is not compatible with allocation queues"); } - dpctl::tensor::validation::CheckWritable::throw_if_not_writable(dst); + dpnp::tensor::validation::CheckWritable::throw_if_not_writable(dst); std::size_t src_sz = src.get_size(); std::size_t dst_sz = dst.get_size(); @@ -745,10 +743,10 @@ std::pair return std::make_pair(sycl::event(), sycl::event()); } - dpctl::tensor::validation::AmpleMemory::throw_if_not_ample(dst, - src_sz * reps); + dpnp::tensor::validation::AmpleMemory::throw_if_not_ample(dst, + src_sz * reps); - auto const &overlap = dpctl::tensor::overlap::MemoryOverlap(); + auto const &overlap = dpnp::tensor::overlap::MemoryOverlap(); // check that dst does not intersect with src if (overlap(dst, src)) { throw py::value_error("Destination array overlaps with inputs"); @@ -785,7 +783,7 @@ std::pair auto fn = repeat_by_scalar_1d_dispatch_vector[src_typeid]; - using dpctl::tensor::offset_utils::device_allocate_and_pack; + using dpnp::tensor::offset_utils::device_allocate_and_pack; auto ptr_size_event_tuple1 = device_allocate_and_pack( exec_q, host_task_events, src_shape_vec, src_strides_vec); auto packed_src_shape_strides_owner = @@ -806,14 +804,14 @@ std::pair dst_shape_vec[0], dst_strides_vec[0], all_deps); sycl::event cleanup_tmp_allocations_ev = - dpctl::tensor::alloc_utils::async_smart_free( + dpnp::tensor::alloc_utils::async_smart_free( exec_q, {repeat_ev}, packed_src_shape_strides_owner); host_task_events.push_back(cleanup_tmp_allocations_ev); sycl::event py_obj_management_host_task_ev = - dpctl::utils::keep_args_alive(exec_q, {src, dst}, host_task_events); + dpnp::utils::keep_args_alive(exec_q, {src, dst}, host_task_events); return std::make_pair(py_obj_management_host_task_ev, repeat_ev); } -} // namespace dpctl::tensor::py_internal +} // namespace dpnp::tensor::py_internal diff --git a/dpnp/tensor/libtensor/source/repeat.hpp b/dpnp/tensor/libtensor/source/repeat.hpp index 5835377fb29c..cfa309021927 100644 --- a/dpnp/tensor/libtensor/source/repeat.hpp +++ b/dpnp/tensor/libtensor/source/repeat.hpp @@ -29,7 +29,7 @@ //===--------------------------------------------------------------------===// /// /// \file -/// This file defines functions of dpctl.tensor._tensor_impl extensions +/// This file defines functions of dpnp.tensor._tensor_impl extensions //===--------------------------------------------------------------------===// #pragma once @@ -43,41 +43,41 @@ namespace py = pybind11; -namespace dpctl::tensor::py_internal +namespace dpnp::tensor::py_internal { extern void init_repeat_dispatch_vectors(void); extern std::pair - py_repeat_by_sequence(const dpctl::tensor::usm_ndarray &src, - const dpctl::tensor::usm_ndarray &dst, - const dpctl::tensor::usm_ndarray &reps, - const dpctl::tensor::usm_ndarray &cumsum, + py_repeat_by_sequence(const dpnp::tensor::usm_ndarray &src, + const dpnp::tensor::usm_ndarray &dst, + const dpnp::tensor::usm_ndarray &reps, + const dpnp::tensor::usm_ndarray &cumsum, int axis, sycl::queue &exec_q, const std::vector &depends); extern std::pair - py_repeat_by_sequence(const dpctl::tensor::usm_ndarray &src, - const dpctl::tensor::usm_ndarray &dst, - const dpctl::tensor::usm_ndarray &reps, - const dpctl::tensor::usm_ndarray &cumsum, + py_repeat_by_sequence(const dpnp::tensor::usm_ndarray &src, + const dpnp::tensor::usm_ndarray &dst, + const dpnp::tensor::usm_ndarray &reps, + const dpnp::tensor::usm_ndarray &cumsum, sycl::queue &exec_q, const std::vector &depends); extern std::pair - py_repeat_by_scalar(const dpctl::tensor::usm_ndarray &src, - const dpctl::tensor::usm_ndarray &dst, + py_repeat_by_scalar(const dpnp::tensor::usm_ndarray &src, + const dpnp::tensor::usm_ndarray &dst, const py::ssize_t reps, int axis, sycl::queue &exec_q, const std::vector &depends); extern std::pair - py_repeat_by_scalar(const dpctl::tensor::usm_ndarray &src, - const dpctl::tensor::usm_ndarray &dst, + py_repeat_by_scalar(const dpnp::tensor::usm_ndarray &src, + const dpnp::tensor::usm_ndarray &dst, const py::ssize_t reps, sycl::queue &exec_q, const std::vector &depends); -} // namespace dpctl::tensor::py_internal +} // namespace dpnp::tensor::py_internal diff --git a/dpnp/tensor/libtensor/source/simplify_iteration_space.cpp b/dpnp/tensor/libtensor/source/simplify_iteration_space.cpp index 573aaeb0a60b..440dd11f3605 100644 --- a/dpnp/tensor/libtensor/source/simplify_iteration_space.cpp +++ b/dpnp/tensor/libtensor/source/simplify_iteration_space.cpp @@ -29,7 +29,7 @@ //===--------------------------------------------------------------------===// /// /// \file -/// This file defines functions of dpctl.tensor._tensor_impl extensions +/// This file defines functions of dpnp.tensor._tensor_impl extensions //===--------------------------------------------------------------------===// #include @@ -43,7 +43,7 @@ #include "simplify_iteration_space.hpp" #include "utils/strided_iters.hpp" -namespace dpctl::tensor::py_internal +namespace dpnp::tensor::py_internal { namespace py = pybind11; @@ -56,7 +56,7 @@ void simplify_iteration_space_1(int &nd, std::vector &simplified_strides, py::ssize_t &offset) { - using dpctl::tensor::strides::simplify_iteration_stride; + using dpnp::tensor::strides::simplify_iteration_stride; if (nd > 1) { // Simplify iteration space to reduce dimensionality // and improve access pattern @@ -107,7 +107,7 @@ void simplify_iteration_space(int &nd, py::ssize_t &src_offset, py::ssize_t &dst_offset) { - using dpctl::tensor::strides::simplify_iteration_two_strides; + using dpnp::tensor::strides::simplify_iteration_two_strides; if (nd > 1) { // Simplify iteration space to reduce dimensionality // and improve access pattern @@ -187,7 +187,7 @@ void simplify_iteration_space_3( py::ssize_t &src2_offset, py::ssize_t &dst_offset) { - using dpctl::tensor::strides::simplify_iteration_three_strides; + using dpnp::tensor::strides::simplify_iteration_three_strides; if (nd > 1) { // Simplify iteration space to reduce dimensionality // and improve access pattern @@ -285,7 +285,7 @@ void simplify_iteration_space_4( py::ssize_t &src3_offset, py::ssize_t &dst_offset) { - using dpctl::tensor::strides::simplify_iteration_four_strides; + using dpnp::tensor::strides::simplify_iteration_four_strides; if (nd > 1) { // Simplify iteration space to reduce dimensionality // and improve access pattern @@ -383,7 +383,7 @@ void compact_iteration_space(int &nd, std::vector &compact_shape, std::vector &compact_strides) { - using dpctl::tensor::strides::compact_iteration; + using dpnp::tensor::strides::compact_iteration; if (nd > 1) { // Compact iteration space to reduce dimensionality // and improve access pattern @@ -539,4 +539,4 @@ std::vector _unravel_index_f(py::ssize_t flat_index, return mi; } -} // namespace dpctl::tensor::py_internal +} // namespace dpnp::tensor::py_internal diff --git a/dpnp/tensor/libtensor/source/simplify_iteration_space.hpp b/dpnp/tensor/libtensor/source/simplify_iteration_space.hpp index acbc833157d1..b0add7777f09 100644 --- a/dpnp/tensor/libtensor/source/simplify_iteration_space.hpp +++ b/dpnp/tensor/libtensor/source/simplify_iteration_space.hpp @@ -29,14 +29,14 @@ //===--------------------------------------------------------------------===// /// /// \file -/// This file defines functions of dpctl.tensor._tensor_impl extensions +/// This file defines functions of dpnp.tensor._tensor_impl extensions //===--------------------------------------------------------------------===// #pragma once #include #include -namespace dpctl::tensor::py_internal +namespace dpnp::tensor::py_internal { namespace py = pybind11; @@ -122,4 +122,4 @@ std::vector _unravel_index_c(py::ssize_t, std::vector _unravel_index_f(py::ssize_t, std::vector const &); -} // namespace dpctl::tensor::py_internal +} // namespace dpnp::tensor::py_internal diff --git a/dpnp/tensor/libtensor/source/sorting/isin.cpp b/dpnp/tensor/libtensor/source/sorting/isin.cpp index f1ae5863bbb9..7c917930b237 100644 --- a/dpnp/tensor/libtensor/source/sorting/isin.cpp +++ b/dpnp/tensor/libtensor/source/sorting/isin.cpp @@ -29,7 +29,7 @@ //===----------------------------------------------------------------------===// /// /// \file -/// This file defines functions of dpctl.tensor._tensor_sorting_impl +/// This file defines functions of dpnp.tensor._tensor_sorting_impl /// extension. //===----------------------------------------------------------------------===// @@ -55,14 +55,14 @@ #include "simplify_iteration_space.hpp" namespace py = pybind11; -namespace td_ns = dpctl::tensor::type_dispatch; +namespace td_ns = dpnp::tensor::type_dispatch; -namespace dpctl::tensor::py_internal +namespace dpnp::tensor::py_internal { namespace detail { -using dpctl::tensor::kernels::isin_contig_impl_fp_ptr_t; +using dpnp::tensor::kernels::isin_contig_impl_fp_ptr_t; static isin_contig_impl_fp_ptr_t isin_contig_impl_dispatch_vector[td_ns::num_types]; @@ -74,12 +74,12 @@ struct IsinContigFactory fnT get() const { - using dpctl::tensor::kernels::isin_contig_impl; + using dpnp::tensor::kernels::isin_contig_impl; return isin_contig_impl; } }; -using dpctl::tensor::kernels::isin_strided_impl_fp_ptr_t; +using dpnp::tensor::kernels::isin_strided_impl_fp_ptr_t; static isin_strided_impl_fp_ptr_t isin_strided_impl_dispatch_vector[td_ns::num_types]; @@ -91,7 +91,7 @@ struct IsinStridedFactory fnT get() const { - using dpctl::tensor::kernels::isin_strided_impl; + using dpnp::tensor::kernels::isin_strided_impl; return isin_strided_impl; } }; @@ -116,9 +116,9 @@ void init_isin_dispatch_vector(void) /*! @brief search for needle from needles in sorted hay */ std::pair - py_isin(const dpctl::tensor::usm_ndarray &needles, - const dpctl::tensor::usm_ndarray &hay, - const dpctl::tensor::usm_ndarray &dst, + py_isin(const dpnp::tensor::usm_ndarray &needles, + const dpnp::tensor::usm_ndarray &hay, + const dpnp::tensor::usm_ndarray &dst, sycl::queue &exec_q, const bool invert, const std::vector &depends) @@ -155,20 +155,20 @@ std::pair } // check that dst is ample enough - dpctl::tensor::validation::AmpleMemory::throw_if_not_ample(dst, - needles_nelems); + dpnp::tensor::validation::AmpleMemory::throw_if_not_ample(dst, + needles_nelems); // check that dst is writable - dpctl::tensor::validation::CheckWritable::throw_if_not_writable(dst); + dpnp::tensor::validation::CheckWritable::throw_if_not_writable(dst); // check that queues are compatible - if (!dpctl::utils::queues_are_compatible(exec_q, {hay, needles, dst})) { + if (!dpnp::utils::queues_are_compatible(exec_q, {hay, needles, dst})) { throw py::value_error( "Execution queue is not compatible with allocation queues"); } // if output array overlaps with input arrays, race condition results - auto const &overlap = dpctl::tensor::overlap::MemoryOverlap(); + auto const &overlap = dpnp::tensor::overlap::MemoryOverlap(); if (overlap(dst, hay) || overlap(dst, needles)) { throw py::value_error("Destination array overlaps with input."); } @@ -229,7 +229,7 @@ std::pair hay_data, zero_offset, needles_data, zero_offset, dst_data, zero_offset, depends); - return std::make_pair(dpctl::utils::keep_args_alive( + return std::make_pair(dpnp::utils::keep_args_alive( exec_q, {hay, needles, dst}, {comp_ev}), comp_ev); } @@ -268,7 +268,7 @@ std::pair std::vector host_task_events; host_task_events.reserve(2); - using dpctl::tensor::offset_utils::device_allocate_and_pack; + using dpnp::tensor::offset_utils::device_allocate_and_pack; auto ptr_size_event_tuple = device_allocate_and_pack( exec_q, host_task_events, @@ -303,11 +303,11 @@ std::pair // free packed temporaries sycl::event temporaries_cleanup_ev = - dpctl::tensor::alloc_utils::async_smart_free( - exec_q, {comp_ev}, packed_shape_strides_owner); + dpnp::tensor::alloc_utils::async_smart_free(exec_q, {comp_ev}, + packed_shape_strides_owner); host_task_events.push_back(temporaries_cleanup_ev); - const sycl::event &ht_ev = dpctl::utils::keep_args_alive( + const sycl::event &ht_ev = dpnp::utils::keep_args_alive( exec_q, {hay, needles, dst}, host_task_events); return std::make_pair(ht_ev, comp_ev); @@ -322,4 +322,4 @@ void init_isin_functions(py::module_ m) py::arg("depends") = py::list()); } -} // namespace dpctl::tensor::py_internal +} // namespace dpnp::tensor::py_internal diff --git a/dpnp/tensor/libtensor/source/sorting/isin.hpp b/dpnp/tensor/libtensor/source/sorting/isin.hpp index 236e8b5898c6..c6d19c1c274a 100644 --- a/dpnp/tensor/libtensor/source/sorting/isin.hpp +++ b/dpnp/tensor/libtensor/source/sorting/isin.hpp @@ -29,7 +29,7 @@ //===----------------------------------------------------------------------===// /// /// \file -/// This file defines functions of dpctl.tensor._tensor_sorting_impl +/// This file defines functions of dpnp.tensor._tensor_sorting_impl /// extension. //===----------------------------------------------------------------------===// @@ -39,9 +39,9 @@ namespace py = pybind11; -namespace dpctl::tensor::py_internal +namespace dpnp::tensor::py_internal { extern void init_isin_functions(py::module_ m); -} // namespace dpctl::tensor::py_internal +} // namespace dpnp::tensor::py_internal diff --git a/dpnp/tensor/libtensor/source/sorting/merge_argsort.cpp b/dpnp/tensor/libtensor/source/sorting/merge_argsort.cpp index 11df5cd2ef47..11dbc2956617 100644 --- a/dpnp/tensor/libtensor/source/sorting/merge_argsort.cpp +++ b/dpnp/tensor/libtensor/source/sorting/merge_argsort.cpp @@ -29,7 +29,7 @@ //===----------------------------------------------------------------------===// /// /// \file -/// This file defines functions of dpctl.tensor._tensor_sorting_impl +/// This file defines functions of dpnp.tensor._tensor_sorting_impl /// extension. //===----------------------------------------------------------------------===// @@ -53,13 +53,13 @@ #include "merge_argsort.hpp" #include "py_argsort_common.hpp" -namespace dpctl::tensor::py_internal +namespace dpnp::tensor::py_internal { namespace py = pybind11; -namespace td_ns = dpctl::tensor::type_dispatch; +namespace td_ns = dpnp::tensor::type_dispatch; -using dpctl::tensor::kernels::sort_contig_fn_ptr_t; +using dpnp::tensor::kernels::sort_contig_fn_ptr_t; static sort_contig_fn_ptr_t ascending_argsort_contig_dispatch_table[td_ns::num_types][td_ns::num_types]; static sort_contig_fn_ptr_t @@ -73,10 +73,10 @@ struct AscendingArgSortContigFactory { if constexpr (std::is_same_v || std::is_same_v) { - using dpctl::tensor::rich_comparisons::AscendingSorter; + using dpnp::tensor::rich_comparisons::AscendingSorter; using Comp = typename AscendingSorter::type; - using dpctl::tensor::kernels::stable_argsort_axis1_contig_impl; + using dpnp::tensor::kernels::stable_argsort_axis1_contig_impl; return stable_argsort_axis1_contig_impl; } else { @@ -92,10 +92,10 @@ struct DescendingArgSortContigFactory { if constexpr (std::is_same_v || std::is_same_v) { - using dpctl::tensor::rich_comparisons::DescendingSorter; + using dpnp::tensor::rich_comparisons::DescendingSorter; using Comp = typename DescendingSorter::type; - using dpctl::tensor::kernels::stable_argsort_axis1_contig_impl; + using dpnp::tensor::kernels::stable_argsort_axis1_contig_impl; return stable_argsort_axis1_contig_impl; } else { @@ -106,7 +106,7 @@ struct DescendingArgSortContigFactory void init_merge_argsort_dispatch_tables(void) { - using dpctl::tensor::kernels::sort_contig_fn_ptr_t; + using dpnp::tensor::kernels::sort_contig_fn_ptr_t; td_ns::DispatchTableBuilder @@ -123,9 +123,9 @@ void init_merge_argsort_functions(py::module_ m) { init_merge_argsort_dispatch_tables(); - auto py_argsort_ascending = [](const dpctl::tensor::usm_ndarray &src, + auto py_argsort_ascending = [](const dpnp::tensor::usm_ndarray &src, const int trailing_dims_to_sort, - const dpctl::tensor::usm_ndarray &dst, + const dpnp::tensor::usm_ndarray &dst, sycl::queue &exec_q, const std::vector &depends) -> std::pair { @@ -136,9 +136,9 @@ void init_merge_argsort_functions(py::module_ m) py::arg("trailing_dims_to_sort"), py::arg("dst"), py::arg("sycl_queue"), py::arg("depends") = py::list()); - auto py_argsort_descending = [](const dpctl::tensor::usm_ndarray &src, + auto py_argsort_descending = [](const dpnp::tensor::usm_ndarray &src, const int trailing_dims_to_sort, - const dpctl::tensor::usm_ndarray &dst, + const dpnp::tensor::usm_ndarray &dst, sycl::queue &exec_q, const std::vector &depends) -> std::pair { @@ -152,4 +152,4 @@ void init_merge_argsort_functions(py::module_ m) return; } -} // namespace dpctl::tensor::py_internal +} // namespace dpnp::tensor::py_internal diff --git a/dpnp/tensor/libtensor/source/sorting/merge_argsort.hpp b/dpnp/tensor/libtensor/source/sorting/merge_argsort.hpp index 10777b4bc2fd..04d7f6fa5362 100644 --- a/dpnp/tensor/libtensor/source/sorting/merge_argsort.hpp +++ b/dpnp/tensor/libtensor/source/sorting/merge_argsort.hpp @@ -29,7 +29,7 @@ //===----------------------------------------------------------------------===// /// /// \file -/// This file defines functions of dpctl.tensor._tensor_sorting_impl +/// This file defines functions of dpnp.tensor._tensor_sorting_impl /// extension. //===----------------------------------------------------------------------===// @@ -39,9 +39,9 @@ namespace py = pybind11; -namespace dpctl::tensor::py_internal +namespace dpnp::tensor::py_internal { extern void init_merge_argsort_functions(py::module_); -} // namespace dpctl::tensor::py_internal +} // namespace dpnp::tensor::py_internal diff --git a/dpnp/tensor/libtensor/source/sorting/merge_sort.cpp b/dpnp/tensor/libtensor/source/sorting/merge_sort.cpp index fbd60621b3bb..5aad634e25dd 100644 --- a/dpnp/tensor/libtensor/source/sorting/merge_sort.cpp +++ b/dpnp/tensor/libtensor/source/sorting/merge_sort.cpp @@ -29,7 +29,7 @@ //===----------------------------------------------------------------------===// /// /// \file -/// This file defines functions of dpctl.tensor._tensor_sorting_impl +/// This file defines functions of dpnp.tensor._tensor_sorting_impl /// extension. //===----------------------------------------------------------------------===// @@ -51,12 +51,12 @@ #include "merge_sort.hpp" #include "py_sort_common.hpp" -namespace td_ns = dpctl::tensor::type_dispatch; +namespace td_ns = dpnp::tensor::type_dispatch; -namespace dpctl::tensor::py_internal +namespace dpnp::tensor::py_internal { -using dpctl::tensor::kernels::sort_contig_fn_ptr_t; +using dpnp::tensor::kernels::sort_contig_fn_ptr_t; static sort_contig_fn_ptr_t ascending_sort_contig_dispatch_vector[td_ns::num_types]; static sort_contig_fn_ptr_t @@ -67,10 +67,10 @@ struct AscendingSortContigFactory { fnT get() { - using dpctl::tensor::rich_comparisons::AscendingSorter; + using dpnp::tensor::rich_comparisons::AscendingSorter; using Comp = typename AscendingSorter::type; - using dpctl::tensor::kernels::stable_sort_axis1_contig_impl; + using dpnp::tensor::kernels::stable_sort_axis1_contig_impl; return stable_sort_axis1_contig_impl; } }; @@ -80,17 +80,17 @@ struct DescendingSortContigFactory { fnT get() { - using dpctl::tensor::rich_comparisons::DescendingSorter; + using dpnp::tensor::rich_comparisons::DescendingSorter; using Comp = typename DescendingSorter::type; - using dpctl::tensor::kernels::stable_sort_axis1_contig_impl; + using dpnp::tensor::kernels::stable_sort_axis1_contig_impl; return stable_sort_axis1_contig_impl; } }; void init_merge_sort_dispatch_vectors(void) { - using dpctl::tensor::kernels::sort_contig_fn_ptr_t; + using dpnp::tensor::kernels::sort_contig_fn_ptr_t; td_ns::DispatchVectorBuilder @@ -107,9 +107,9 @@ void init_merge_sort_functions(py::module_ m) { init_merge_sort_dispatch_vectors(); - auto py_sort_ascending = [](const dpctl::tensor::usm_ndarray &src, + auto py_sort_ascending = [](const dpnp::tensor::usm_ndarray &src, const int trailing_dims_to_sort, - const dpctl::tensor::usm_ndarray &dst, + const dpnp::tensor::usm_ndarray &dst, sycl::queue &exec_q, const std::vector &depends) -> std::pair { @@ -120,9 +120,9 @@ void init_merge_sort_functions(py::module_ m) py::arg("trailing_dims_to_sort"), py::arg("dst"), py::arg("sycl_queue"), py::arg("depends") = py::list()); - auto py_sort_descending = [](const dpctl::tensor::usm_ndarray &src, + auto py_sort_descending = [](const dpnp::tensor::usm_ndarray &src, const int trailing_dims_to_sort, - const dpctl::tensor::usm_ndarray &dst, + const dpnp::tensor::usm_ndarray &dst, sycl::queue &exec_q, const std::vector &depends) -> std::pair { @@ -136,4 +136,4 @@ void init_merge_sort_functions(py::module_ m) return; } -} // namespace dpctl::tensor::py_internal +} // namespace dpnp::tensor::py_internal diff --git a/dpnp/tensor/libtensor/source/sorting/merge_sort.hpp b/dpnp/tensor/libtensor/source/sorting/merge_sort.hpp index a6bdd0a4efe9..81cff792c931 100644 --- a/dpnp/tensor/libtensor/source/sorting/merge_sort.hpp +++ b/dpnp/tensor/libtensor/source/sorting/merge_sort.hpp @@ -29,7 +29,7 @@ //===----------------------------------------------------------------------===// /// /// \file -/// This file defines functions of dpctl.tensor._tensor_sorting_impl +/// This file defines functions of dpnp.tensor._tensor_sorting_impl /// extension. //===----------------------------------------------------------------------===// @@ -39,9 +39,9 @@ namespace py = pybind11; -namespace dpctl::tensor::py_internal +namespace dpnp::tensor::py_internal { extern void init_merge_sort_functions(py::module_); -} // namespace dpctl::tensor::py_internal +} // namespace dpnp::tensor::py_internal diff --git a/dpnp/tensor/libtensor/source/sorting/py_argsort_common.hpp b/dpnp/tensor/libtensor/source/sorting/py_argsort_common.hpp index 018f3166a0ad..a3f4774b90c4 100644 --- a/dpnp/tensor/libtensor/source/sorting/py_argsort_common.hpp +++ b/dpnp/tensor/libtensor/source/sorting/py_argsort_common.hpp @@ -29,7 +29,7 @@ //===----------------------------------------------------------------------===// /// /// \file -/// This file defines functions of dpctl.tensor._tensor_sorting_impl +/// This file defines functions of dpnp.tensor._tensor_sorting_impl /// extension. //===----------------------------------------------------------------------===// @@ -49,16 +49,16 @@ #include "utils/output_validation.hpp" #include "utils/type_dispatch.hpp" -namespace td_ns = dpctl::tensor::type_dispatch; +namespace td_ns = dpnp::tensor::type_dispatch; -namespace dpctl::tensor::py_internal +namespace dpnp::tensor::py_internal { template std::pair - py_argsort(const dpctl::tensor::usm_ndarray &src, + py_argsort(const dpnp::tensor::usm_ndarray &src, const int trailing_dims_to_sort, - const dpctl::tensor::usm_ndarray &dst, + const dpnp::tensor::usm_ndarray &dst, sycl::queue &exec_q, const std::vector &depends, const sorting_contig_impl_fnT &sort_contig_fns) @@ -99,12 +99,12 @@ std::pair "Destination shape does not match the input shape"); } - if (!dpctl::utils::queues_are_compatible(exec_q, {src, dst})) { + if (!dpnp::utils::queues_are_compatible(exec_q, {src, dst})) { throw py::value_error( "Execution queue is not compatible with allocation queues"); } - dpctl::tensor::validation::CheckWritable::throw_if_not_writable(dst); + dpnp::tensor::validation::CheckWritable::throw_if_not_writable(dst); if ((iter_nelems == 0) || (sort_nelems == 0)) { // Nothing to do @@ -112,12 +112,12 @@ std::pair } // check that dst and src do not overlap - auto const &overlap = dpctl::tensor::overlap::MemoryOverlap(); + auto const &overlap = dpnp::tensor::overlap::MemoryOverlap(); if (overlap(src, dst)) { throw py::value_error("Arrays index overlapping segments of memory"); } - dpctl::tensor::validation::AmpleMemory::throw_if_not_ample( + dpnp::tensor::validation::AmpleMemory::throw_if_not_ample( dst, sort_nelems * iter_nelems); int src_typenum = src.get_typenum(); @@ -153,7 +153,7 @@ std::pair zero_offset, depends); sycl::event keep_args_alive_ev = - dpctl::utils::keep_args_alive(exec_q, {src, dst}, {comp_ev}); + dpnp::utils::keep_args_alive(exec_q, {src, dst}, {comp_ev}); return std::make_pair(keep_args_alive_ev, comp_ev); } @@ -170,7 +170,7 @@ std::pair }); sycl::event keep_args_alive_ev = - dpctl::utils::keep_args_alive(exec_q, {src, dst}, {fill_ev}); + dpnp::utils::keep_args_alive(exec_q, {src, dst}, {fill_ev}); return std::make_pair(keep_args_alive_ev, fill_ev); } @@ -180,4 +180,4 @@ std::pair "Both source and destination arrays must be C-contiguous"); } -} // namespace dpctl::tensor::py_internal +} // namespace dpnp::tensor::py_internal diff --git a/dpnp/tensor/libtensor/source/sorting/py_sort_common.hpp b/dpnp/tensor/libtensor/source/sorting/py_sort_common.hpp index ee8777f35077..a80063a85f62 100644 --- a/dpnp/tensor/libtensor/source/sorting/py_sort_common.hpp +++ b/dpnp/tensor/libtensor/source/sorting/py_sort_common.hpp @@ -29,7 +29,7 @@ //===----------------------------------------------------------------------===// /// /// \file -/// This file defines functions of dpctl.tensor._tensor_sorting_impl +/// This file defines functions of dpnp.tensor._tensor_sorting_impl /// extension. //===----------------------------------------------------------------------===// @@ -50,16 +50,16 @@ #include "utils/type_dispatch.hpp" namespace py = pybind11; -namespace td_ns = dpctl::tensor::type_dispatch; +namespace td_ns = dpnp::tensor::type_dispatch; -namespace dpctl::tensor::py_internal +namespace dpnp::tensor::py_internal { template std::pair - py_sort(const dpctl::tensor::usm_ndarray &src, + py_sort(const dpnp::tensor::usm_ndarray &src, const int trailing_dims_to_sort, - const dpctl::tensor::usm_ndarray &dst, + const dpnp::tensor::usm_ndarray &dst, sycl::queue &exec_q, const std::vector &depends, const sorting_contig_impl_fnT &sort_contig_fns) @@ -100,12 +100,12 @@ std::pair "Destination shape does not match the input shape"); } - if (!dpctl::utils::queues_are_compatible(exec_q, {src, dst})) { + if (!dpnp::utils::queues_are_compatible(exec_q, {src, dst})) { throw py::value_error( "Execution queue is not compatible with allocation queues"); } - dpctl::tensor::validation::CheckWritable::throw_if_not_writable(dst); + dpnp::tensor::validation::CheckWritable::throw_if_not_writable(dst); if ((iter_nelems == 0) || (sort_nelems == 0)) { // Nothing to do @@ -113,12 +113,12 @@ std::pair } // check that dst and src do not overlap - auto const &overlap = dpctl::tensor::overlap::MemoryOverlap(); + auto const &overlap = dpnp::tensor::overlap::MemoryOverlap(); if (overlap(src, dst)) { throw py::value_error("Arrays index overlapping segments of memory"); } - dpctl::tensor::validation::AmpleMemory::throw_if_not_ample( + dpnp::tensor::validation::AmpleMemory::throw_if_not_ample( dst, sort_nelems * iter_nelems); int src_typenum = src.get_typenum(); @@ -153,7 +153,7 @@ std::pair zero_offset, depends); sycl::event keep_args_alive_ev = - dpctl::utils::keep_args_alive(exec_q, {src, dst}, {comp_ev}); + dpnp::utils::keep_args_alive(exec_q, {src, dst}, {comp_ev}); return std::make_pair(keep_args_alive_ev, comp_ev); } @@ -166,7 +166,7 @@ std::pair src_elemsize * iter_nelems, depends); return std::make_pair( - dpctl::utils::keep_args_alive(exec_q, {src, dst}, {copy_ev}), + dpnp::utils::keep_args_alive(exec_q, {src, dst}, {copy_ev}), copy_ev); } } @@ -175,4 +175,4 @@ std::pair "Both source and destination arrays must be C-contiguous"); } -} // namespace dpctl::tensor::py_internal +} // namespace dpnp::tensor::py_internal diff --git a/dpnp/tensor/libtensor/source/sorting/radix_argsort.cpp b/dpnp/tensor/libtensor/source/sorting/radix_argsort.cpp index 0eec8fba9ded..f2d0de615f69 100644 --- a/dpnp/tensor/libtensor/source/sorting/radix_argsort.cpp +++ b/dpnp/tensor/libtensor/source/sorting/radix_argsort.cpp @@ -29,7 +29,7 @@ //===----------------------------------------------------------------------===// /// /// \file -/// This file defines functions of dpctl.tensor._tensor_sorting_impl +/// This file defines functions of dpnp.tensor._tensor_sorting_impl /// extension. //===----------------------------------------------------------------------===// @@ -47,7 +47,7 @@ #include "utils/type_dispatch.hpp" -#include "kernels/dpctl_tensor_types.hpp" +#include "kernels/dpnp_tensor_types.hpp" #include "kernels/sorting/radix_sort.hpp" #include "kernels/sorting/sort_impl_fn_ptr_t.hpp" @@ -55,15 +55,15 @@ #include "radix_argsort.hpp" #include "radix_sort_support.hpp" -namespace dpctl::tensor::py_internal +namespace dpnp::tensor::py_internal { namespace py = pybind11; -namespace td_ns = dpctl::tensor::type_dispatch; -namespace impl_ns = dpctl::tensor::kernels::radix_sort_details; +namespace td_ns = dpnp::tensor::type_dispatch; +namespace impl_ns = dpnp::tensor::kernels::radix_sort_details; -using dpctl::tensor::ssize_t; -using dpctl::tensor::kernels::sort_contig_fn_ptr_t; +using dpnp::tensor::ssize_t; +using dpnp::tensor::kernels::sort_contig_fn_ptr_t; static sort_contig_fn_ptr_t ascending_radix_argsort_contig_dispatch_table[td_ns::num_types] @@ -87,7 +87,7 @@ sycl::event argsort_axis1_contig_caller(sycl::queue &q, ssize_t sort_res_offset, const std::vector &depends) { - using dpctl::tensor::kernels::radix_argsort_axis1_contig_impl; + using dpnp::tensor::kernels::radix_argsort_axis1_contig_impl; return radix_argsort_axis1_contig_impl( q, is_ascending, iter_nelems, sort_nelems, arg_cp, res_cp, @@ -133,7 +133,7 @@ struct DescendingRadixArgSortContigFactory void init_radix_argsort_dispatch_tables(void) { - using dpctl::tensor::kernels::sort_contig_fn_ptr_t; + using dpnp::tensor::kernels::sort_contig_fn_ptr_t; td_ns::DispatchTableBuilder &depends) -> std::pair { return py_argsort(src, trailing_dims_to_sort, dst, exec_q, depends, @@ -167,9 +167,9 @@ void init_radix_argsort_functions(py::module_ m) py::arg("sycl_queue"), py::arg("depends") = py::list()); auto py_radix_argsort_descending = - [](const dpctl::tensor::usm_ndarray &src, + [](const dpnp::tensor::usm_ndarray &src, const int trailing_dims_to_sort, - const dpctl::tensor::usm_ndarray &dst, sycl::queue &exec_q, + const dpnp::tensor::usm_ndarray &dst, sycl::queue &exec_q, const std::vector &depends) -> std::pair { return py_argsort(src, trailing_dims_to_sort, dst, exec_q, depends, @@ -182,4 +182,4 @@ void init_radix_argsort_functions(py::module_ m) return; } -} // namespace dpctl::tensor::py_internal +} // namespace dpnp::tensor::py_internal diff --git a/dpnp/tensor/libtensor/source/sorting/radix_argsort.hpp b/dpnp/tensor/libtensor/source/sorting/radix_argsort.hpp index 89013fbb1bdc..cffa452e07bf 100644 --- a/dpnp/tensor/libtensor/source/sorting/radix_argsort.hpp +++ b/dpnp/tensor/libtensor/source/sorting/radix_argsort.hpp @@ -29,7 +29,7 @@ //===----------------------------------------------------------------------===// /// /// \file -/// This file defines functions of dpctl.tensor._tensor_sorting_impl +/// This file defines functions of dpnp.tensor._tensor_sorting_impl /// extension. //===----------------------------------------------------------------------===// @@ -39,9 +39,9 @@ namespace py = pybind11; -namespace dpctl::tensor::py_internal +namespace dpnp::tensor::py_internal { extern void init_radix_argsort_functions(py::module_); -} // namespace dpctl::tensor::py_internal +} // namespace dpnp::tensor::py_internal diff --git a/dpnp/tensor/libtensor/source/sorting/radix_sort.cpp b/dpnp/tensor/libtensor/source/sorting/radix_sort.cpp index 35c71a0eb7d3..3837ea51c15e 100644 --- a/dpnp/tensor/libtensor/source/sorting/radix_sort.cpp +++ b/dpnp/tensor/libtensor/source/sorting/radix_sort.cpp @@ -29,7 +29,7 @@ //===----------------------------------------------------------------------===// /// /// \file -/// This file defines functions of dpctl.tensor._tensor_sorting_impl +/// This file defines functions of dpnp.tensor._tensor_sorting_impl /// extension. //===----------------------------------------------------------------------===// @@ -46,7 +46,7 @@ #include "utils/type_dispatch.hpp" -#include "kernels/dpctl_tensor_types.hpp" +#include "kernels/dpnp_tensor_types.hpp" #include "kernels/sorting/radix_sort.hpp" #include "kernels/sorting/sort_impl_fn_ptr_t.hpp" @@ -54,15 +54,15 @@ #include "radix_sort.hpp" #include "radix_sort_support.hpp" -namespace dpctl::tensor::py_internal +namespace dpnp::tensor::py_internal { namespace py = pybind11; -namespace td_ns = dpctl::tensor::type_dispatch; -namespace impl_ns = dpctl::tensor::kernels::radix_sort_details; +namespace td_ns = dpnp::tensor::type_dispatch; +namespace impl_ns = dpnp::tensor::kernels::radix_sort_details; -using dpctl::tensor::ssize_t; -using dpctl::tensor::kernels::sort_contig_fn_ptr_t; +using dpnp::tensor::ssize_t; +using dpnp::tensor::kernels::sort_contig_fn_ptr_t; static sort_contig_fn_ptr_t ascending_radix_sort_contig_dispatch_vector[td_ns::num_types]; static sort_contig_fn_ptr_t @@ -83,7 +83,7 @@ sycl::event sort_axis1_contig_caller(sycl::queue &q, ssize_t sort_res_offset, const std::vector &depends) { - using dpctl::tensor::kernels::radix_sort_axis1_contig_impl; + using dpnp::tensor::kernels::radix_sort_axis1_contig_impl; return radix_sort_axis1_contig_impl( q, is_ascending, iter_nelems, sort_nelems, arg_cp, res_cp, @@ -123,7 +123,7 @@ struct DescendingRadixSortContigFactory void init_radix_sort_dispatch_vectors(void) { - using dpctl::tensor::kernels::sort_contig_fn_ptr_t; + using dpnp::tensor::kernels::sort_contig_fn_ptr_t; td_ns::DispatchVectorBuilder< sort_contig_fn_ptr_t, AscendingRadixSortContigFactory, td_ns::num_types> @@ -154,9 +154,9 @@ void init_radix_sort_functions(py::module_ m) { init_radix_sort_dispatch_vectors(); - auto py_radix_sort_ascending = [](const dpctl::tensor::usm_ndarray &src, + auto py_radix_sort_ascending = [](const dpnp::tensor::usm_ndarray &src, const int trailing_dims_to_sort, - const dpctl::tensor::usm_ndarray &dst, + const dpnp::tensor::usm_ndarray &dst, sycl::queue &exec_q, const std::vector &depends) -> std::pair { @@ -167,9 +167,9 @@ void init_radix_sort_functions(py::module_ m) py::arg("trailing_dims_to_sort"), py::arg("dst"), py::arg("sycl_queue"), py::arg("depends") = py::list()); - auto py_radix_sort_descending = [](const dpctl::tensor::usm_ndarray &src, + auto py_radix_sort_descending = [](const dpnp::tensor::usm_ndarray &src, const int trailing_dims_to_sort, - const dpctl::tensor::usm_ndarray &dst, + const dpnp::tensor::usm_ndarray &dst, sycl::queue &exec_q, const std::vector &depends) -> std::pair { @@ -185,4 +185,4 @@ void init_radix_sort_functions(py::module_ m) return; } -} // namespace dpctl::tensor::py_internal +} // namespace dpnp::tensor::py_internal diff --git a/dpnp/tensor/libtensor/source/sorting/radix_sort.hpp b/dpnp/tensor/libtensor/source/sorting/radix_sort.hpp index 5f3c771b464b..29b8e4303d83 100644 --- a/dpnp/tensor/libtensor/source/sorting/radix_sort.hpp +++ b/dpnp/tensor/libtensor/source/sorting/radix_sort.hpp @@ -29,7 +29,7 @@ //===----------------------------------------------------------------------===// /// /// \file -/// This file defines functions of dpctl.tensor._tensor_sorting_impl +/// This file defines functions of dpnp.tensor._tensor_sorting_impl /// extension. //===----------------------------------------------------------------------===// @@ -39,9 +39,9 @@ namespace py = pybind11; -namespace dpctl::tensor::py_internal +namespace dpnp::tensor::py_internal { extern void init_radix_sort_functions(py::module_); -} // namespace dpctl::tensor::py_internal +} // namespace dpnp::tensor::py_internal diff --git a/dpnp/tensor/libtensor/source/sorting/radix_sort_support.hpp b/dpnp/tensor/libtensor/source/sorting/radix_sort_support.hpp index 8d7e55a5cd28..d730e5080059 100644 --- a/dpnp/tensor/libtensor/source/sorting/radix_sort_support.hpp +++ b/dpnp/tensor/libtensor/source/sorting/radix_sort_support.hpp @@ -29,7 +29,7 @@ //===----------------------------------------------------------------------===// /// /// \file -/// This file defines functions of dpctl.tensor._tensor_sorting_impl +/// This file defines functions of dpnp.tensor._tensor_sorting_impl /// extension. //===----------------------------------------------------------------------===// @@ -40,7 +40,7 @@ #include -namespace dpctl::tensor::py_internal +namespace dpnp::tensor::py_internal { template @@ -75,4 +75,4 @@ struct RadixSortSupportVector static constexpr bool is_defined = resolver_t::is_defined; }; -} // namespace dpctl::tensor::py_internal +} // namespace dpnp::tensor::py_internal diff --git a/dpnp/tensor/libtensor/source/sorting/searchsorted.cpp b/dpnp/tensor/libtensor/source/sorting/searchsorted.cpp index 6c50b0cbc08c..512df8e0342a 100644 --- a/dpnp/tensor/libtensor/source/sorting/searchsorted.cpp +++ b/dpnp/tensor/libtensor/source/sorting/searchsorted.cpp @@ -29,7 +29,7 @@ //===----------------------------------------------------------------------===// /// /// \file -/// This file defines functions of dpctl.tensor._tensor_sorting_impl +/// This file defines functions of dpnp.tensor._tensor_sorting_impl /// extension. //===----------------------------------------------------------------------===// @@ -58,15 +58,15 @@ #include "simplify_iteration_space.hpp" namespace py = pybind11; -namespace td_ns = dpctl::tensor::type_dispatch; +namespace td_ns = dpnp::tensor::type_dispatch; -namespace dpctl::tensor::py_internal +namespace dpnp::tensor::py_internal { namespace detail { -using dpctl::tensor::kernels::searchsorted_contig_impl_fp_ptr_t; +using dpnp::tensor::kernels::searchsorted_contig_impl_fp_ptr_t; static searchsorted_contig_impl_fp_ptr_t left_side_searchsorted_contig_impl[td_ns::num_types][td_ns::num_types]; @@ -84,8 +84,8 @@ struct LeftSideSearchSortedContigFactory if constexpr (std::is_same_v || std::is_same_v) { static constexpr bool left_side_search(true); - using dpctl::tensor::kernels::searchsorted_contig_impl; - using dpctl::tensor::rich_comparisons::AscendingSorter; + using dpnp::tensor::kernels::searchsorted_contig_impl; + using dpnp::tensor::rich_comparisons::AscendingSorter; using Compare = typename AscendingSorter::type; @@ -109,8 +109,8 @@ struct RightSideSearchSortedContigFactory std::is_same_v) { static constexpr bool right_side_search(false); - using dpctl::tensor::kernels::searchsorted_contig_impl; - using dpctl::tensor::rich_comparisons::AscendingSorter; + using dpnp::tensor::kernels::searchsorted_contig_impl; + using dpnp::tensor::rich_comparisons::AscendingSorter; using Compare = typename AscendingSorter::type; @@ -123,7 +123,7 @@ struct RightSideSearchSortedContigFactory } }; -using dpctl::tensor::kernels::searchsorted_strided_impl_fp_ptr_t; +using dpnp::tensor::kernels::searchsorted_strided_impl_fp_ptr_t; static searchsorted_strided_impl_fp_ptr_t left_side_searchsorted_strided_impl[td_ns::num_types][td_ns::num_types]; @@ -141,8 +141,8 @@ struct LeftSideSearchSortedStridedFactory if constexpr (std::is_same_v || std::is_same_v) { static constexpr bool left_side_search(true); - using dpctl::tensor::kernels::searchsorted_strided_impl; - using dpctl::tensor::rich_comparisons::AscendingSorter; + using dpnp::tensor::kernels::searchsorted_strided_impl; + using dpnp::tensor::rich_comparisons::AscendingSorter; using Compare = typename AscendingSorter::type; @@ -165,8 +165,8 @@ struct RightSideSearchSortedStridedFactory if constexpr (std::is_same_v || std::is_same_v) { static constexpr bool right_side_search(false); - using dpctl::tensor::kernels::searchsorted_strided_impl; - using dpctl::tensor::rich_comparisons::AscendingSorter; + using dpnp::tensor::kernels::searchsorted_strided_impl; + using dpnp::tensor::rich_comparisons::AscendingSorter; using Compare = typename AscendingSorter::type; @@ -213,9 +213,9 @@ void init_searchsorted_dispatch_table(void) /*! @brief search for needle from needles in sorted hay */ std::pair - py_searchsorted(const dpctl::tensor::usm_ndarray &hay, - const dpctl::tensor::usm_ndarray &needles, - const dpctl::tensor::usm_ndarray &positions, + py_searchsorted(const dpnp::tensor::usm_ndarray &hay, + const dpnp::tensor::usm_ndarray &needles, + const dpnp::tensor::usm_ndarray &positions, sycl::queue &exec_q, const bool search_left_side, const std::vector &depends) @@ -252,21 +252,21 @@ std::pair } // check that positions is ample enough - dpctl::tensor::validation::AmpleMemory::throw_if_not_ample(positions, - needles_nelems); + dpnp::tensor::validation::AmpleMemory::throw_if_not_ample(positions, + needles_nelems); // check that positions is writable - dpctl::tensor::validation::CheckWritable::throw_if_not_writable(positions); + dpnp::tensor::validation::CheckWritable::throw_if_not_writable(positions); // check that queues are compatible - if (!dpctl::utils::queues_are_compatible(exec_q, - {hay, needles, positions})) { + if (!dpnp::utils::queues_are_compatible(exec_q, + {hay, needles, positions})) { throw py::value_error( "Execution queue is not compatible with allocation queues"); } // if output array overlaps with input arrays, race condition results - auto const &overlap = dpctl::tensor::overlap::MemoryOverlap(); + auto const &overlap = dpnp::tensor::overlap::MemoryOverlap(); if (overlap(positions, hay) || overlap(positions, needles)) { throw py::value_error("Destination array overlaps with input."); } @@ -339,8 +339,8 @@ std::pair depends); return std::make_pair( - dpctl::utils::keep_args_alive(exec_q, {hay, needles, positions}, - {comp_ev}), + dpnp::utils::keep_args_alive(exec_q, {hay, needles, positions}, + {comp_ev}), comp_ev); } } @@ -379,7 +379,7 @@ std::pair std::vector host_task_events; host_task_events.reserve(2); - using dpctl::tensor::offset_utils::device_allocate_and_pack; + using dpnp::tensor::offset_utils::device_allocate_and_pack; auto ptr_size_event_tuple = device_allocate_and_pack( exec_q, host_task_events, @@ -419,11 +419,11 @@ std::pair // free packed temporaries sycl::event temporaries_cleanup_ev = - dpctl::tensor::alloc_utils::async_smart_free( - exec_q, {comp_ev}, packed_shape_strides_owner); + dpnp::tensor::alloc_utils::async_smart_free(exec_q, {comp_ev}, + packed_shape_strides_owner); host_task_events.push_back(temporaries_cleanup_ev); - const sycl::event &ht_ev = dpctl::utils::keep_args_alive( + const sycl::event &ht_ev = dpnp::utils::keep_args_alive( exec_q, {hay, needles, positions}, host_task_events); return std::make_pair(ht_ev, comp_ev); @@ -433,9 +433,9 @@ std::pair * hay[pos] <= needle < hay[pos + 1] */ std::pair - py_searchsorted_left(const dpctl::tensor::usm_ndarray &hay, - const dpctl::tensor::usm_ndarray &needles, - const dpctl::tensor::usm_ndarray &positions, + py_searchsorted_left(const dpnp::tensor::usm_ndarray &hay, + const dpnp::tensor::usm_ndarray &needles, + const dpnp::tensor::usm_ndarray &positions, sycl::queue &exec_q, const std::vector &depends) { @@ -447,9 +447,9 @@ std::pair * hay[pos] < needle <= hay[pos + 1] */ std::pair - py_searchsorted_right(const dpctl::tensor::usm_ndarray &hay, - const dpctl::tensor::usm_ndarray &needles, - const dpctl::tensor::usm_ndarray &positions, + py_searchsorted_right(const dpnp::tensor::usm_ndarray &hay, + const dpnp::tensor::usm_ndarray &needles, + const dpnp::tensor::usm_ndarray &positions, sycl::queue &exec_q, const std::vector &depends) { @@ -470,4 +470,4 @@ void init_searchsorted_functions(py::module_ m) py::arg("depends") = py::list()); } -} // namespace dpctl::tensor::py_internal +} // namespace dpnp::tensor::py_internal diff --git a/dpnp/tensor/libtensor/source/sorting/searchsorted.hpp b/dpnp/tensor/libtensor/source/sorting/searchsorted.hpp index b60dae1e0ec9..6dcf1ed0c6dd 100644 --- a/dpnp/tensor/libtensor/source/sorting/searchsorted.hpp +++ b/dpnp/tensor/libtensor/source/sorting/searchsorted.hpp @@ -29,7 +29,7 @@ //===----------------------------------------------------------------------===// /// /// \file -/// This file defines functions of dpctl.tensor._tensor_sorting_impl +/// This file defines functions of dpnp.tensor._tensor_sorting_impl /// extension. //===----------------------------------------------------------------------===// @@ -39,9 +39,9 @@ namespace py = pybind11; -namespace dpctl::tensor::py_internal +namespace dpnp::tensor::py_internal { extern void init_searchsorted_functions(py::module_ m); -} // namespace dpctl::tensor::py_internal +} // namespace dpnp::tensor::py_internal diff --git a/dpnp/tensor/libtensor/source/sorting/topk.cpp b/dpnp/tensor/libtensor/source/sorting/topk.cpp index 6b8344df12c8..0103839f3004 100644 --- a/dpnp/tensor/libtensor/source/sorting/topk.cpp +++ b/dpnp/tensor/libtensor/source/sorting/topk.cpp @@ -29,7 +29,7 @@ //===----------------------------------------------------------------------===// /// /// \file -/// This file defines functions of dpctl.tensor._tensor_sorting_impl +/// This file defines functions of dpnp.tensor._tensor_sorting_impl /// extension. //===----------------------------------------------------------------------===// @@ -54,10 +54,10 @@ #include "topk.hpp" -namespace dpctl::tensor::py_internal +namespace dpnp::tensor::py_internal { -namespace td_ns = dpctl::tensor::type_dispatch; +namespace td_ns = dpnp::tensor::type_dispatch; typedef sycl::event (*topk_impl_fn_ptr_t)(sycl::queue &, std::size_t, @@ -103,17 +103,17 @@ sycl::event topk_caller(sycl::queue &exec_q, const std::vector &depends) { if constexpr (use_radix_sort::value) { - using dpctl::tensor::kernels::topk_radix_impl; + using dpnp::tensor::kernels::topk_radix_impl; auto ascending = !largest; return topk_radix_impl(exec_q, iter_nelems, axis_nelems, k, ascending, arg_cp, vals_cp, inds_cp, depends); } else { - using dpctl::tensor::kernels::topk_merge_impl; + using dpnp::tensor::kernels::topk_merge_impl; if (largest) { using CompTy = - typename dpctl::tensor::rich_comparisons::DescendingSorter< + typename dpnp::tensor::rich_comparisons::DescendingSorter< argTy>::type; return topk_merge_impl( exec_q, iter_nelems, axis_nelems, k, arg_cp, vals_cp, inds_cp, @@ -121,7 +121,7 @@ sycl::event topk_caller(sycl::queue &exec_q, } else { using CompTy = - typename dpctl::tensor::rich_comparisons::AscendingSorter< + typename dpnp::tensor::rich_comparisons::AscendingSorter< argTy>::type; return topk_merge_impl( exec_q, iter_nelems, axis_nelems, k, arg_cp, vals_cp, inds_cp, @@ -133,12 +133,12 @@ sycl::event topk_caller(sycl::queue &exec_q, } // namespace std::pair - py_topk(const dpctl::tensor::usm_ndarray &src, + py_topk(const dpnp::tensor::usm_ndarray &src, std::optional trailing_dims_to_search, const std::size_t k, const bool largest, - const dpctl::tensor::usm_ndarray &vals, - const dpctl::tensor::usm_ndarray &inds, + const dpnp::tensor::usm_ndarray &vals, + const dpnp::tensor::usm_ndarray &inds, sycl::queue &exec_q, const std::vector &depends) { @@ -211,29 +211,29 @@ std::pair } } - if (!dpctl::utils::queues_are_compatible(exec_q, {src, vals, inds})) { + if (!dpnp::utils::queues_are_compatible(exec_q, {src, vals, inds})) { throw py::value_error( "Execution queue is not compatible with allocation queues"); } - dpctl::tensor::validation::CheckWritable::throw_if_not_writable(vals); - dpctl::tensor::validation::CheckWritable::throw_if_not_writable(inds); + dpnp::tensor::validation::CheckWritable::throw_if_not_writable(vals); + dpnp::tensor::validation::CheckWritable::throw_if_not_writable(inds); if ((iter_nelems == 0) || (axis_nelems == 0)) { // Nothing to do return std::make_pair(sycl::event(), sycl::event()); } - auto const &overlap = dpctl::tensor::overlap::MemoryOverlap(); + auto const &overlap = dpnp::tensor::overlap::MemoryOverlap(); if (overlap(src, vals) || overlap(src, inds)) { throw py::value_error("Arrays index overlapping segments of memory"); } - dpctl::tensor::validation::AmpleMemory::throw_if_not_ample(vals, - k * iter_nelems); + dpnp::tensor::validation::AmpleMemory::throw_if_not_ample(vals, + k * iter_nelems); - dpctl::tensor::validation::AmpleMemory::throw_if_not_ample(inds, - k * iter_nelems); + dpnp::tensor::validation::AmpleMemory::throw_if_not_ample(inds, + k * iter_nelems); int src_typenum = src.get_typenum(); int vals_typenum = vals.get_typenum(); @@ -265,7 +265,7 @@ std::pair vals.get_data(), inds.get_data(), depends); sycl::event keep_args_alive_ev = - dpctl::utils::keep_args_alive(exec_q, {src, vals, inds}, {comp_ev}); + dpnp::utils::keep_args_alive(exec_q, {src, vals, inds}, {comp_ev}); return std::make_pair(keep_args_alive_ev, comp_ev); } @@ -300,4 +300,4 @@ void init_topk_functions(py::module_ m) py::arg("sycl_queue"), py::arg("depends") = py::list()); } -} // namespace dpctl::tensor::py_internal +} // namespace dpnp::tensor::py_internal diff --git a/dpnp/tensor/libtensor/source/sorting/topk.hpp b/dpnp/tensor/libtensor/source/sorting/topk.hpp index d39c0eefdb93..618f35ab9b4a 100644 --- a/dpnp/tensor/libtensor/source/sorting/topk.hpp +++ b/dpnp/tensor/libtensor/source/sorting/topk.hpp @@ -29,7 +29,7 @@ //===----------------------------------------------------------------------===// /// /// \file -/// This file defines functions of dpctl.tensor._tensor_sorting_impl +/// This file defines functions of dpnp.tensor._tensor_sorting_impl /// extension. //===----------------------------------------------------------------------===// @@ -39,9 +39,9 @@ namespace py = pybind11; -namespace dpctl::tensor::py_internal +namespace dpnp::tensor::py_internal { extern void init_topk_functions(py::module_); -} // namespace dpctl::tensor::py_internal +} // namespace dpnp::tensor::py_internal diff --git a/dpnp/tensor/libtensor/source/tensor_accumulation.cpp b/dpnp/tensor/libtensor/source/tensor_accumulation.cpp index faa3fc8b52c6..4b9184e266bf 100644 --- a/dpnp/tensor/libtensor/source/tensor_accumulation.cpp +++ b/dpnp/tensor/libtensor/source/tensor_accumulation.cpp @@ -29,7 +29,7 @@ //===----------------------------------------------------------------------===// /// /// \file -/// This file defines functions of dpctl.tensor._tensor_accumulation_impl +/// This file defines functions of dpnp.tensor._tensor_accumulation_impl // extensions //===----------------------------------------------------------------------===// @@ -39,5 +39,5 @@ PYBIND11_MODULE(_tensor_accumulation_impl, m) { - dpctl::tensor::py_internal::init_accumulator_functions(m); + dpnp::tensor::py_internal::init_accumulator_functions(m); } diff --git a/dpnp/tensor/libtensor/source/tensor_ctors.cpp b/dpnp/tensor/libtensor/source/tensor_ctors.cpp index cdd6e43ed9c5..fff4c2174d64 100644 --- a/dpnp/tensor/libtensor/source/tensor_ctors.cpp +++ b/dpnp/tensor/libtensor/source/tensor_ctors.cpp @@ -29,7 +29,7 @@ //===----------------------------------------------------------------------===// /// /// \file -/// This file defines functions of dpctl.tensor._tensor_impl extensions +/// This file defines functions of dpnp.tensor._tensor_impl extensions //===----------------------------------------------------------------------===// #include @@ -55,7 +55,7 @@ #include "eye_ctor.hpp" #include "full_ctor.hpp" #include "integer_advanced_indexing.hpp" -#include "kernels/dpctl_tensor_types.hpp" +#include "kernels/dpnp_tensor_types.hpp" #include "linear_sequences.hpp" #include "repeat.hpp" #include "simplify_iteration_space.hpp" @@ -67,77 +67,77 @@ namespace py = pybind11; -static_assert(std::is_same_v); +static_assert(std::is_same_v); namespace { -using dpctl::tensor::overlap::MemoryOverlap; -using dpctl::tensor::overlap::SameLogicalTensors; +using dpnp::tensor::overlap::MemoryOverlap; +using dpnp::tensor::overlap::SameLogicalTensors; -using dpctl::tensor::py_internal::copy_usm_ndarray_into_usm_ndarray; -using dpctl::tensor::py_internal::py_as_c_contig; -using dpctl::tensor::py_internal::py_as_f_contig; +using dpnp::tensor::py_internal::copy_usm_ndarray_into_usm_ndarray; +using dpnp::tensor::py_internal::py_as_c_contig; +using dpnp::tensor::py_internal::py_as_f_contig; /* =========================== Copy for reshape ============================= */ -using dpctl::tensor::py_internal::copy_usm_ndarray_for_reshape; +using dpnp::tensor::py_internal::copy_usm_ndarray_for_reshape; /* =========================== Copy for roll ============================= */ -using dpctl::tensor::py_internal::copy_usm_ndarray_for_roll_1d; -using dpctl::tensor::py_internal::copy_usm_ndarray_for_roll_nd; +using dpnp::tensor::py_internal::copy_usm_ndarray_for_roll_1d; +using dpnp::tensor::py_internal::copy_usm_ndarray_for_roll_nd; /* ============= Copy from numpy.ndarray to usm_ndarray ==================== */ -using dpctl::tensor::py_internal::copy_numpy_ndarray_into_usm_ndarray; +using dpnp::tensor::py_internal::copy_numpy_ndarray_into_usm_ndarray; /* ============= linear-sequence ==================== */ -using dpctl::tensor::py_internal::usm_ndarray_linear_sequence_affine; -using dpctl::tensor::py_internal::usm_ndarray_linear_sequence_step; +using dpnp::tensor::py_internal::usm_ndarray_linear_sequence_affine; +using dpnp::tensor::py_internal::usm_ndarray_linear_sequence_step; /* ================ Full ================== */ -using dpctl::tensor::py_internal::usm_ndarray_full; +using dpnp::tensor::py_internal::usm_ndarray_full; /* ================ Zeros ================== */ -using dpctl::tensor::py_internal::usm_ndarray_zeros; +using dpnp::tensor::py_internal::usm_ndarray_zeros; /* ============== Advanced Indexing ============= */ -using dpctl::tensor::py_internal::usm_ndarray_put; -using dpctl::tensor::py_internal::usm_ndarray_take; +using dpnp::tensor::py_internal::usm_ndarray_put; +using dpnp::tensor::py_internal::usm_ndarray_take; -using dpctl::tensor::py_internal::py_extract; -using dpctl::tensor::py_internal::py_mask_positions; -using dpctl::tensor::py_internal::py_nonzero; -using dpctl::tensor::py_internal::py_place; +using dpnp::tensor::py_internal::py_extract; +using dpnp::tensor::py_internal::py_mask_positions; +using dpnp::tensor::py_internal::py_nonzero; +using dpnp::tensor::py_internal::py_place; /* ================= Repeat ====================*/ -using dpctl::tensor::py_internal::py_cumsum_1d; -using dpctl::tensor::py_internal::py_repeat_by_scalar; -using dpctl::tensor::py_internal::py_repeat_by_sequence; +using dpnp::tensor::py_internal::py_cumsum_1d; +using dpnp::tensor::py_internal::py_repeat_by_scalar; +using dpnp::tensor::py_internal::py_repeat_by_sequence; /* ================ Eye ================== */ -using dpctl::tensor::py_internal::usm_ndarray_eye; +using dpnp::tensor::py_internal::usm_ndarray_eye; /* =========================== Tril and triu ============================== */ -using dpctl::tensor::py_internal::usm_ndarray_triul; +using dpnp::tensor::py_internal::usm_ndarray_triul; /* =========================== Where ============================== */ -using dpctl::tensor::py_internal::py_where; +using dpnp::tensor::py_internal::py_where; /* =========================== Clip ============================== */ -using dpctl::tensor::py_internal::py_clip; +using dpnp::tensor::py_internal::py_clip; // populate dispatch tables void init_dispatch_tables(void) { - using namespace dpctl::tensor::py_internal; + using namespace dpnp::tensor::py_internal; init_copy_and_cast_usm_to_usm_dispatch_tables(); init_copy_numpy_ndarray_into_usm_ndarray_dispatch_tables(); @@ -149,7 +149,7 @@ void init_dispatch_tables(void) // populate dispatch vectors void init_dispatch_vectors(void) { - using namespace dpctl::tensor::py_internal; + using namespace dpnp::tensor::py_internal; init_copy_as_contig_dispatch_vectors(); init_copy_for_reshape_dispatch_vectors(); @@ -180,7 +180,7 @@ PYBIND11_MODULE(_tensor_impl, m) init_dispatch_tables(); init_dispatch_vectors(); - using dpctl::tensor::strides::contract_iter; + using dpnp::tensor::strides::contract_iter; m.def( "_contract_iter", &contract_iter, "Simplifies iteration of array of given shape & stride. Returns " @@ -210,7 +210,7 @@ PYBIND11_MODULE(_tensor_impl, m) py::arg("src"), py::arg("dst"), py::arg("sycl_queue"), py::arg("depends") = py::list()); - using dpctl::tensor::strides::contract_iter2; + using dpnp::tensor::strides::contract_iter2; m.def( "_contract_iter2", &contract_iter2, "Simplifies iteration over elements of pair of arrays of given shape " @@ -220,7 +220,7 @@ PYBIND11_MODULE(_tensor_impl, m) "as the original " "iterator, possibly in a different order."); - using dpctl::tensor::strides::contract_iter3; + using dpnp::tensor::strides::contract_iter3; m.def( "_contract_iter3", &contract_iter3, "Simplifies iteration over elements of 3-tuple of arrays of given " @@ -231,7 +231,7 @@ PYBIND11_MODULE(_tensor_impl, m) "as the original " "iterator, possibly in a different order."); - using dpctl::tensor::strides::contract_iter4; + using dpnp::tensor::strides::contract_iter4; m.def( "_contract_iter4", &contract_iter4, "Simplifies iteration over elements of 4-tuple of arrays of given " @@ -248,12 +248,12 @@ PYBIND11_MODULE(_tensor_impl, m) [](const std::vector &mi, const std::vector &shape, char order = 'C') { if (order == orderC) { - return dpctl::tensor::py_internal::_ravel_multi_index_c(mi, - shape); + return dpnp::tensor::py_internal::_ravel_multi_index_c(mi, + shape); } else { - return dpctl::tensor::py_internal::_ravel_multi_index_f(mi, - shape); + return dpnp::tensor::py_internal::_ravel_multi_index_f(mi, + shape); } }, ""); @@ -263,12 +263,12 @@ PYBIND11_MODULE(_tensor_impl, m) [](py::ssize_t flat_index, const std::vector &shape, char order = 'C') { if (order == orderC) { - return dpctl::tensor::py_internal::_unravel_index_c(flat_index, - shape); + return dpnp::tensor::py_internal::_unravel_index_c(flat_index, + shape); } else { - return dpctl::tensor::py_internal::_unravel_index_f(flat_index, - shape); + return dpnp::tensor::py_internal::_unravel_index_f(flat_index, + shape); } }, ""); @@ -358,35 +358,35 @@ PYBIND11_MODULE(_tensor_impl, m) py::arg("depends") = py::list()); m.def("default_device_fp_type", - dpctl::tensor::py_internal::default_device_fp_type, + dpnp::tensor::py_internal::default_device_fp_type, "Gives default floating point type supported by device.", py::arg("dev")); m.def("default_device_int_type", - dpctl::tensor::py_internal::default_device_int_type, + dpnp::tensor::py_internal::default_device_int_type, "Gives default signed integer type supported by device.", py::arg("dev")); m.def("default_device_uint_type", - dpctl::tensor::py_internal::default_device_uint_type, + dpnp::tensor::py_internal::default_device_uint_type, "Gives default unsigned integer type supported by device.", py::arg("dev")); m.def("default_device_bool_type", - dpctl::tensor::py_internal::default_device_bool_type, + dpnp::tensor::py_internal::default_device_bool_type, "Gives default boolean type supported by device.", py::arg("dev")); m.def("default_device_complex_type", - dpctl::tensor::py_internal::default_device_complex_type, + dpnp::tensor::py_internal::default_device_complex_type, "Gives default complex floating point type supported by device.", py::arg("dev")); m.def("default_device_index_type", - dpctl::tensor::py_internal::default_device_index_type, + dpnp::tensor::py_internal::default_device_index_type, "Gives default index type supported by device.", py::arg("dev")); - auto tril_fn = [](const dpctl::tensor::usm_ndarray &src, - const dpctl::tensor::usm_ndarray &dst, py::ssize_t k, + auto tril_fn = [](const dpnp::tensor::usm_ndarray &src, + const dpnp::tensor::usm_ndarray &dst, py::ssize_t k, sycl::queue &exec_q, const std::vector depends) -> std::pair { @@ -396,8 +396,8 @@ PYBIND11_MODULE(_tensor_impl, m) py::arg("dst"), py::arg("k") = 0, py::arg("sycl_queue"), py::arg("depends") = py::list()); - auto triu_fn = [](const dpctl::tensor::usm_ndarray &src, - const dpctl::tensor::usm_ndarray &dst, py::ssize_t k, + auto triu_fn = [](const dpnp::tensor::usm_ndarray &src, + const dpnp::tensor::usm_ndarray &dst, py::ssize_t k, sycl::queue &exec_q, const std::vector depends) -> std::pair { @@ -418,8 +418,8 @@ PYBIND11_MODULE(_tensor_impl, m) py::arg("axis_start"), py::arg("axis_end"), py::arg("dst"), py::arg("sycl_queue"), py::arg("depends") = py::list()); - auto overlap = [](const dpctl::tensor::usm_ndarray &x1, - const dpctl::tensor::usm_ndarray &x2) -> bool { + auto overlap = [](const dpnp::tensor::usm_ndarray &x1, + const dpnp::tensor::usm_ndarray &x2) -> bool { auto const &overlap = MemoryOverlap(); return overlap(x1, x2); }; @@ -428,8 +428,8 @@ PYBIND11_MODULE(_tensor_impl, m) py::arg("array1"), py::arg("array2")); auto same_logical_tensors = - [](const dpctl::tensor::usm_ndarray &x1, - const dpctl::tensor::usm_ndarray &x2) -> bool { + [](const dpnp::tensor::usm_ndarray &x1, + const dpnp::tensor::usm_ndarray &x2) -> bool { auto const &same_logical_tensors = SameLogicalTensors(); return same_logical_tensors(x1, x2); }; @@ -449,10 +449,10 @@ PYBIND11_MODULE(_tensor_impl, m) py::arg("x2"), py::arg("dst"), py::arg("sycl_queue"), py::arg("depends") = py::list()); - auto repeat_sequence = [](const dpctl::tensor::usm_ndarray &src, - const dpctl::tensor::usm_ndarray &dst, - const dpctl::tensor::usm_ndarray &reps, - const dpctl::tensor::usm_ndarray &cumsum, + auto repeat_sequence = [](const dpnp::tensor::usm_ndarray &src, + const dpnp::tensor::usm_ndarray &dst, + const dpnp::tensor::usm_ndarray &reps, + const dpnp::tensor::usm_ndarray &cumsum, std::optional axis, sycl::queue &exec_q, const std::vector depends) -> std::pair { @@ -469,8 +469,8 @@ PYBIND11_MODULE(_tensor_impl, m) py::arg("dst"), py::arg("reps"), py::arg("cumsum"), py::arg("axis"), py::arg("sycl_queue"), py::arg("depends") = py::list()); - auto repeat_scalar = [](const dpctl::tensor::usm_ndarray &src, - const dpctl::tensor::usm_ndarray &dst, + auto repeat_scalar = [](const dpnp::tensor::usm_ndarray &src, + const dpnp::tensor::usm_ndarray &dst, const py::ssize_t reps, std::optional axis, sycl::queue &exec_q, const std::vector depends) diff --git a/dpnp/tensor/libtensor/source/tensor_elementwise.cpp b/dpnp/tensor/libtensor/source/tensor_elementwise.cpp index 76b9916ca9d3..f56b1ce2181c 100644 --- a/dpnp/tensor/libtensor/source/tensor_elementwise.cpp +++ b/dpnp/tensor/libtensor/source/tensor_elementwise.cpp @@ -29,7 +29,7 @@ //===---------------------------------------------------------------------===// /// /// \file -/// This file defines functions of dpctl.tensor._tensor_elementwise_impl +/// This file defines functions of dpnp.tensor._tensor_elementwise_impl /// extension. //===---------------------------------------------------------------------===// @@ -41,5 +41,5 @@ namespace py = pybind11; PYBIND11_MODULE(_tensor_elementwise_impl, m) { - dpctl::tensor::py_internal::init_elementwise_functions(m); + dpnp::tensor::py_internal::init_elementwise_functions(m); } diff --git a/dpnp/tensor/libtensor/source/tensor_linalg.cpp b/dpnp/tensor/libtensor/source/tensor_linalg.cpp index 4a1b5fb79b9e..f46517e5adcc 100644 --- a/dpnp/tensor/libtensor/source/tensor_linalg.cpp +++ b/dpnp/tensor/libtensor/source/tensor_linalg.cpp @@ -29,7 +29,7 @@ //===---------------------------------------------------------------------===// /// /// \file -/// This file defines functions of dpctl.tensor._tensor_impl extensions +/// This file defines functions of dpnp.tensor._tensor_impl extensions //===----------------------------------------------------------------------===// #include "linalg_functions/dot.hpp" @@ -37,5 +37,5 @@ PYBIND11_MODULE(_tensor_linalg_impl, m) { - dpctl::tensor::py_internal::init_dot(m); + dpnp::tensor::py_internal::init_dot(m); } diff --git a/dpnp/tensor/libtensor/source/tensor_reductions.cpp b/dpnp/tensor/libtensor/source/tensor_reductions.cpp index 6e6a24f7b934..f54a48c7faf0 100644 --- a/dpnp/tensor/libtensor/source/tensor_reductions.cpp +++ b/dpnp/tensor/libtensor/source/tensor_reductions.cpp @@ -29,7 +29,7 @@ //===---------------------------------------------------------------------===// /// /// \file -/// This file defines functions of dpctl.tensor._tensor_reductions_impl +/// This file defines functions of dpnp.tensor._tensor_reductions_impl /// extension. //===---------------------------------------------------------------------===// @@ -39,5 +39,5 @@ PYBIND11_MODULE(_tensor_reductions_impl, m) { - dpctl::tensor::py_internal::init_reduction_functions(m); + dpnp::tensor::py_internal::init_reduction_functions(m); } diff --git a/dpnp/tensor/libtensor/source/tensor_sorting.cpp b/dpnp/tensor/libtensor/source/tensor_sorting.cpp index 318c3559d77c..6c660e606e12 100644 --- a/dpnp/tensor/libtensor/source/tensor_sorting.cpp +++ b/dpnp/tensor/libtensor/source/tensor_sorting.cpp @@ -29,7 +29,7 @@ //===----------------------------------------------------------------------===// /// /// \file -/// This file defines functions of dpctl.tensor._tensor_sorting_impl +/// This file defines functions of dpnp.tensor._tensor_sorting_impl /// extension. //===----------------------------------------------------------------------===// @@ -45,11 +45,11 @@ PYBIND11_MODULE(_tensor_sorting_impl, m) { - dpctl::tensor::py_internal::init_isin_functions(m); - dpctl::tensor::py_internal::init_merge_sort_functions(m); - dpctl::tensor::py_internal::init_merge_argsort_functions(m); - dpctl::tensor::py_internal::init_searchsorted_functions(m); - dpctl::tensor::py_internal::init_radix_sort_functions(m); - dpctl::tensor::py_internal::init_radix_argsort_functions(m); - dpctl::tensor::py_internal::init_topk_functions(m); + dpnp::tensor::py_internal::init_isin_functions(m); + dpnp::tensor::py_internal::init_merge_sort_functions(m); + dpnp::tensor::py_internal::init_merge_argsort_functions(m); + dpnp::tensor::py_internal::init_searchsorted_functions(m); + dpnp::tensor::py_internal::init_radix_sort_functions(m); + dpnp::tensor::py_internal::init_radix_argsort_functions(m); + dpnp::tensor::py_internal::init_topk_functions(m); } diff --git a/dpnp/tensor/libtensor/source/triul_ctor.cpp b/dpnp/tensor/libtensor/source/triul_ctor.cpp index 13e909196460..90127e509b75 100644 --- a/dpnp/tensor/libtensor/source/triul_ctor.cpp +++ b/dpnp/tensor/libtensor/source/triul_ctor.cpp @@ -29,7 +29,7 @@ //===--------------------------------------------------------------------===// /// /// \file -/// This file defines functions of dpctl.tensor._tensor_impl extensions +/// This file defines functions of dpnp.tensor._tensor_impl extensions //===--------------------------------------------------------------------===// #include // for std::copy @@ -52,22 +52,22 @@ #include "utils/type_dispatch.hpp" namespace py = pybind11; -namespace td_ns = dpctl::tensor::type_dispatch; +namespace td_ns = dpnp::tensor::type_dispatch; -namespace dpctl::tensor::py_internal +namespace dpnp::tensor::py_internal { -using dpctl::utils::keep_args_alive; +using dpnp::utils::keep_args_alive; -using dpctl::tensor::kernels::constructors::tri_fn_ptr_t; +using dpnp::tensor::kernels::constructors::tri_fn_ptr_t; static tri_fn_ptr_t tril_generic_dispatch_vector[td_ns::num_types]; static tri_fn_ptr_t triu_generic_dispatch_vector[td_ns::num_types]; std::pair usm_ndarray_triul(sycl::queue &exec_q, - const dpctl::tensor::usm_ndarray &src, - const dpctl::tensor::usm_ndarray &dst, + const dpnp::tensor::usm_ndarray &src, + const dpnp::tensor::usm_ndarray &dst, char part, py::ssize_t k = 0, const std::vector &depends = {}) @@ -107,7 +107,7 @@ std::pair char *dst_data = dst.get_data(); // check that arrays do not overlap, and concurrent copying is safe. - auto const &overlap = dpctl::tensor::overlap::MemoryOverlap(); + auto const &overlap = dpnp::tensor::overlap::MemoryOverlap(); if (overlap(src, dst)) { // TODO: could use a temporary, but this is done by the caller throw py::value_error("Arrays index overlapping segments of memory"); @@ -125,12 +125,12 @@ std::pair } // check same queues - if (!dpctl::utils::queues_are_compatible(exec_q, {src, dst})) { + if (!dpnp::utils::queues_are_compatible(exec_q, {src, dst})) { throw py::value_error( "Execution queue context is not the same as allocation contexts"); } - dpctl::tensor::validation::CheckWritable::throw_if_not_writable(dst); + dpnp::tensor::validation::CheckWritable::throw_if_not_writable(dst); auto src_strides = src.get_strides_vector(); auto dst_strides = dst.get_strides_vector(); @@ -162,7 +162,7 @@ std::pair nd += 2; using usm_host_allocatorT = - dpctl::tensor::alloc_utils::usm_host_allocator; + dpnp::tensor::alloc_utils::usm_host_allocator; using usmshT = std::vector; usm_host_allocatorT allocator(exec_q); @@ -185,8 +185,8 @@ std::pair (*shp_host_shape_and_strides)[3 * nd - 1] = dst_strides[src_nd - 1]; auto dev_shape_and_strides_owner = - dpctl::tensor::alloc_utils::smart_malloc_device(3 * nd, - exec_q); + dpnp::tensor::alloc_utils::smart_malloc_device(3 * nd, + exec_q); py::ssize_t *dev_shape_and_strides = dev_shape_and_strides_owner.get(); const sycl::event ©_shape_and_strides = exec_q.copy( @@ -212,7 +212,7 @@ std::pair const auto &temporaries_cleanup_ev = exec_q.submit([&](sycl::handler &cgh) { cgh.depends_on(tri_ev); const auto &ctx = exec_q.get_context(); - using dpctl::tensor::alloc_utils::sycl_free_noexcept; + using dpnp::tensor::alloc_utils::sycl_free_noexcept; cgh.host_task( [shp_host_shape_and_strides = std::move(shp_host_shape_and_strides), dev_shape_and_strides, ctx]() { @@ -233,8 +233,8 @@ void init_triul_ctor_dispatch_vectors(void) { using namespace td_ns; - using dpctl::tensor::kernels::constructors::TrilGenericFactory; - using dpctl::tensor::kernels::constructors::TriuGenericFactory; + using dpnp::tensor::kernels::constructors::TrilGenericFactory; + using dpnp::tensor::kernels::constructors::TriuGenericFactory; DispatchVectorBuilder dvb1; dvb1.populate_dispatch_vector(tril_generic_dispatch_vector); @@ -243,4 +243,4 @@ void init_triul_ctor_dispatch_vectors(void) dvb2.populate_dispatch_vector(triu_generic_dispatch_vector); } -} // namespace dpctl::tensor::py_internal +} // namespace dpnp::tensor::py_internal diff --git a/dpnp/tensor/libtensor/source/triul_ctor.hpp b/dpnp/tensor/libtensor/source/triul_ctor.hpp index 47cc4ce8892d..00525725b67f 100644 --- a/dpnp/tensor/libtensor/source/triul_ctor.hpp +++ b/dpnp/tensor/libtensor/source/triul_ctor.hpp @@ -29,7 +29,7 @@ //===--------------------------------------------------------------------===// /// /// \file -/// This file defines functions of dpctl.tensor._tensor_impl extensions +/// This file defines functions of dpnp.tensor._tensor_impl extensions //===--------------------------------------------------------------------===// #pragma once @@ -42,17 +42,17 @@ namespace py = pybind11; -namespace dpctl::tensor::py_internal +namespace dpnp::tensor::py_internal { extern std::pair usm_ndarray_triul(sycl::queue &exec_q, - const dpctl::tensor::usm_ndarray &src, - const dpctl::tensor::usm_ndarray &dst, + const dpnp::tensor::usm_ndarray &src, + const dpnp::tensor::usm_ndarray &dst, char part, py::ssize_t k = 0, const std::vector &depends = {}); extern void init_triul_ctor_dispatch_vectors(void); -} // namespace dpctl::tensor::py_internal +} // namespace dpnp::tensor::py_internal diff --git a/dpnp/tensor/libtensor/source/where.cpp b/dpnp/tensor/libtensor/source/where.cpp index 1d535a712917..f140e07d1cc9 100644 --- a/dpnp/tensor/libtensor/source/where.cpp +++ b/dpnp/tensor/libtensor/source/where.cpp @@ -30,7 +30,7 @@ /// /// \file /// This file defines Python API for implementation functions of -/// dpctl.tensor.where +/// dpnp.tensor.where //===---------------------------------------------------------------------===// #include @@ -54,38 +54,37 @@ #include "simplify_iteration_space.hpp" #include "where.hpp" -namespace dpctl::tensor::py_internal +namespace dpnp::tensor::py_internal { namespace py = pybind11; -namespace td_ns = dpctl::tensor::type_dispatch; +namespace td_ns = dpnp::tensor::type_dispatch; -using dpctl::tensor::kernels::search::where_contig_impl_fn_ptr_t; -using dpctl::tensor::kernels::search::where_strided_impl_fn_ptr_t; +using dpnp::tensor::kernels::search::where_contig_impl_fn_ptr_t; +using dpnp::tensor::kernels::search::where_strided_impl_fn_ptr_t; static where_contig_impl_fn_ptr_t where_contig_dispatch_table[td_ns::num_types] [td_ns::num_types]; static where_strided_impl_fn_ptr_t where_strided_dispatch_table[td_ns::num_types][td_ns::num_types]; -using dpctl::utils::keep_args_alive; +using dpnp::utils::keep_args_alive; std::pair - py_where(const dpctl::tensor::usm_ndarray &condition, - const dpctl::tensor::usm_ndarray &x1, - const dpctl::tensor::usm_ndarray &x2, - const dpctl::tensor::usm_ndarray &dst, + py_where(const dpnp::tensor::usm_ndarray &condition, + const dpnp::tensor::usm_ndarray &x1, + const dpnp::tensor::usm_ndarray &x2, + const dpnp::tensor::usm_ndarray &dst, sycl::queue &exec_q, const std::vector &depends) { - if (!dpctl::utils::queues_are_compatible(exec_q, - {x1, x2, condition, dst})) { + if (!dpnp::utils::queues_are_compatible(exec_q, {x1, x2, condition, dst})) { throw py::value_error( "Execution queue is not compatible with allocation queues"); } - dpctl::tensor::validation::CheckWritable::throw_if_not_writable(dst); + dpnp::tensor::validation::CheckWritable::throw_if_not_writable(dst); int nd = condition.get_ndim(); int x1_nd = x1.get_ndim(); @@ -124,9 +123,9 @@ std::pair return std::make_pair(sycl::event{}, sycl::event{}); } - auto const &overlap = dpctl::tensor::overlap::MemoryOverlap(); + auto const &overlap = dpnp::tensor::overlap::MemoryOverlap(); auto const &same_logical_tensors = - dpctl::tensor::overlap::SameLogicalTensors(); + dpnp::tensor::overlap::SameLogicalTensors(); if ((overlap(dst, condition) && !same_logical_tensors(dst, condition)) || (overlap(dst, x1) && !same_logical_tensors(dst, x1)) || (overlap(dst, x2) && !same_logical_tensors(dst, x2))) { @@ -148,7 +147,7 @@ std::pair throw py::value_error("Value arrays must have the same data type"); } - dpctl::tensor::validation::AmpleMemory::throw_if_not_ample(dst, nelems); + dpnp::tensor::validation::AmpleMemory::throw_if_not_ample(dst, nelems); char *cond_data = condition.get_data(); char *x1_data = x1.get_data(); @@ -211,7 +210,7 @@ std::pair std::vector host_task_events; host_task_events.reserve(2); - using dpctl::tensor::offset_utils::device_allocate_and_pack; + using dpnp::tensor::offset_utils::device_allocate_and_pack; auto ptr_size_event_tuple = device_allocate_and_pack( exec_q, host_task_events, // common shape and strides @@ -235,8 +234,8 @@ std::pair // free packed temporaries sycl::event temporaries_cleanup_ev = - dpctl::tensor::alloc_utils::async_smart_free( - exec_q, {where_ev}, packed_shape_strides_owner); + dpnp::tensor::alloc_utils::async_smart_free(exec_q, {where_ev}, + packed_shape_strides_owner); host_task_events.push_back(temporaries_cleanup_ev); sycl::event arg_cleanup_ev = @@ -248,17 +247,17 @@ std::pair void init_where_dispatch_tables(void) { using namespace td_ns; - using dpctl::tensor::kernels::search::WhereContigFactory; + using dpnp::tensor::kernels::search::WhereContigFactory; DispatchTableBuilder dtb1; dtb1.populate_dispatch_table(where_contig_dispatch_table); - using dpctl::tensor::kernels::search::WhereStridedFactory; + using dpnp::tensor::kernels::search::WhereStridedFactory; DispatchTableBuilder dtb2; dtb2.populate_dispatch_table(where_strided_dispatch_table); } -} // namespace dpctl::tensor::py_internal +} // namespace dpnp::tensor::py_internal diff --git a/dpnp/tensor/libtensor/source/where.hpp b/dpnp/tensor/libtensor/source/where.hpp index ba81d8b11642..9e3bb5cf5e3e 100644 --- a/dpnp/tensor/libtensor/source/where.hpp +++ b/dpnp/tensor/libtensor/source/where.hpp @@ -30,7 +30,7 @@ /// /// \file /// This file declares Python API for implementation functions of -/// dpctl.tensor.where +/// dpnp.tensor.where //===---------------------------------------------------------------------===// #pragma once @@ -41,17 +41,17 @@ #include "dpnp4pybind11.hpp" -namespace dpctl::tensor::py_internal +namespace dpnp::tensor::py_internal { extern std::pair - py_where(const dpctl::tensor::usm_ndarray &, - const dpctl::tensor::usm_ndarray &, - const dpctl::tensor::usm_ndarray &, - const dpctl::tensor::usm_ndarray &, + py_where(const dpnp::tensor::usm_ndarray &, + const dpnp::tensor::usm_ndarray &, + const dpnp::tensor::usm_ndarray &, + const dpnp::tensor::usm_ndarray &, sycl::queue &, const std::vector &); extern void init_where_dispatch_tables(void); -} // namespace dpctl::tensor::py_internal +} // namespace dpnp::tensor::py_internal diff --git a/dpnp/tensor/libtensor/source/zeros_ctor.cpp b/dpnp/tensor/libtensor/source/zeros_ctor.cpp index b9a2e01bea4a..3d6f99c4907e 100644 --- a/dpnp/tensor/libtensor/source/zeros_ctor.cpp +++ b/dpnp/tensor/libtensor/source/zeros_ctor.cpp @@ -29,7 +29,7 @@ //===--------------------------------------------------------------------===// /// /// \file -/// This file defines functions of dpctl.tensor._tensor_impl extensions +/// This file defines functions of dpnp.tensor._tensor_impl extensions //===--------------------------------------------------------------------===// #include @@ -48,12 +48,12 @@ #include "zeros_ctor.hpp" namespace py = pybind11; -namespace td_ns = dpctl::tensor::type_dispatch; +namespace td_ns = dpnp::tensor::type_dispatch; -namespace dpctl::tensor::py_internal +namespace dpnp::tensor::py_internal { -using dpctl::utils::keep_args_alive; +using dpnp::utils::keep_args_alive; typedef sycl::event (*zeros_contig_fn_ptr_t)(sycl::queue &, std::size_t, @@ -105,7 +105,7 @@ struct ZerosContigFactory static zeros_contig_fn_ptr_t zeros_contig_dispatch_vector[td_ns::num_types]; std::pair - usm_ndarray_zeros(const dpctl::tensor::usm_ndarray &dst, + usm_ndarray_zeros(const dpnp::tensor::usm_ndarray &dst, sycl::queue &exec_q, const std::vector &depends) { @@ -116,12 +116,12 @@ std::pair return std::make_pair(sycl::event(), sycl::event()); } - if (!dpctl::utils::queues_are_compatible(exec_q, {dst})) { + if (!dpnp::utils::queues_are_compatible(exec_q, {dst})) { throw py::value_error( "Execution queue is not compatible with the allocation queue"); } - dpctl::tensor::validation::CheckWritable::throw_if_not_writable(dst); + dpnp::tensor::validation::CheckWritable::throw_if_not_writable(dst); auto array_types = td_ns::usm_ndarray_types(); int dst_typenum = dst.get_typenum(); @@ -156,4 +156,4 @@ void init_zeros_ctor_dispatch_vectors(void) return; } -} // namespace dpctl::tensor::py_internal +} // namespace dpnp::tensor::py_internal diff --git a/dpnp/tensor/libtensor/source/zeros_ctor.hpp b/dpnp/tensor/libtensor/source/zeros_ctor.hpp index d104e37f5533..67f421e124e7 100644 --- a/dpnp/tensor/libtensor/source/zeros_ctor.hpp +++ b/dpnp/tensor/libtensor/source/zeros_ctor.hpp @@ -29,7 +29,7 @@ //===--------------------------------------------------------------------===// /// /// \file -/// This file defines functions of dpctl.tensor._tensor_impl extensions +/// This file defines functions of dpnp.tensor._tensor_impl extensions //===--------------------------------------------------------------------===// #pragma once @@ -40,14 +40,14 @@ #include "dpnp4pybind11.hpp" -namespace dpctl::tensor::py_internal +namespace dpnp::tensor::py_internal { extern std::pair - usm_ndarray_zeros(const dpctl::tensor::usm_ndarray &dst, + usm_ndarray_zeros(const dpnp::tensor::usm_ndarray &dst, sycl::queue &exec_q, const std::vector &depends = {}); extern void init_zeros_ctor_dispatch_vectors(void); -} // namespace dpctl::tensor::py_internal +} // namespace dpnp::tensor::py_internal