Skip to content

Commit 7b016d9

Browse files
authored
Add implementation of dpnp.nextafter function (#1938)
* Implement dpnp.nextafter * Add MKL extension for nextafter * Applied pre-commit hook * Applied review comments
1 parent 9a29427 commit 7b016d9

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

49 files changed

+518
-168
lines changed

dpnp/backend/extensions/vm/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ set(_elementwise_sources
5252
${CMAKE_CURRENT_SOURCE_DIR}/log1p.cpp
5353
${CMAKE_CURRENT_SOURCE_DIR}/log2.cpp
5454
${CMAKE_CURRENT_SOURCE_DIR}/mul.cpp
55+
${CMAKE_CURRENT_SOURCE_DIR}/nextafter.cpp
5556
${CMAKE_CURRENT_SOURCE_DIR}/pow.cpp
5657
${CMAKE_CURRENT_SOURCE_DIR}/rint.cpp
5758
${CMAKE_CURRENT_SOURCE_DIR}/sin.cpp

dpnp/backend/extensions/vm/abs.cpp

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,16 +43,15 @@
4343

4444
namespace dpnp::extensions::vm
4545
{
46-
namespace ew_cmn_ns = dpctl::tensor::kernels::elementwise_common;
4746
namespace py = pybind11;
4847
namespace py_int = dpnp::extensions::py_internal;
4948
namespace td_ns = dpctl::tensor::type_dispatch;
50-
namespace tu_ns = dpctl::tensor::type_utils;
5149

5250
namespace impl
5351
{
54-
// OneMKL namespace with VM functions
55-
namespace mkl_vm = oneapi::mkl::vm;
52+
namespace ew_cmn_ns = dpctl::tensor::kernels::elementwise_common;
53+
namespace mkl_vm = oneapi::mkl::vm; // OneMKL namespace with VM functions
54+
namespace tu_ns = dpctl::tensor::type_utils;
5655

5756
/**
5857
* @brief A factory to define pairs of supported types for which

dpnp/backend/extensions/vm/acos.cpp

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,16 +43,15 @@
4343

4444
namespace dpnp::extensions::vm
4545
{
46-
namespace ew_cmn_ns = dpctl::tensor::kernels::elementwise_common;
4746
namespace py = pybind11;
4847
namespace py_int = dpnp::extensions::py_internal;
4948
namespace td_ns = dpctl::tensor::type_dispatch;
50-
namespace tu_ns = dpctl::tensor::type_utils;
5149

5250
namespace impl
5351
{
54-
// OneMKL namespace with VM functions
55-
namespace mkl_vm = oneapi::mkl::vm;
52+
namespace ew_cmn_ns = dpctl::tensor::kernels::elementwise_common;
53+
namespace mkl_vm = oneapi::mkl::vm; // OneMKL namespace with VM functions
54+
namespace tu_ns = dpctl::tensor::type_utils;
5655

5756
/**
5857
* @brief A factory to define pairs of supported types for which

dpnp/backend/extensions/vm/acosh.cpp

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,16 +43,15 @@
4343

4444
namespace dpnp::extensions::vm
4545
{
46-
namespace ew_cmn_ns = dpctl::tensor::kernels::elementwise_common;
4746
namespace py = pybind11;
4847
namespace py_int = dpnp::extensions::py_internal;
4948
namespace td_ns = dpctl::tensor::type_dispatch;
50-
namespace tu_ns = dpctl::tensor::type_utils;
5149

5250
namespace impl
5351
{
54-
// OneMKL namespace with VM functions
55-
namespace mkl_vm = oneapi::mkl::vm;
52+
namespace ew_cmn_ns = dpctl::tensor::kernels::elementwise_common;
53+
namespace mkl_vm = oneapi::mkl::vm; // OneMKL namespace with VM functions
54+
namespace tu_ns = dpctl::tensor::type_utils;
5655

5756
/**
5857
* @brief A factory to define pairs of supported types for which

dpnp/backend/extensions/vm/add.cpp

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,16 +43,15 @@
4343

4444
namespace dpnp::extensions::vm
4545
{
46-
namespace ew_cmn_ns = dpctl::tensor::kernels::elementwise_common;
4746
namespace py = pybind11;
4847
namespace py_int = dpnp::extensions::py_internal;
4948
namespace td_ns = dpctl::tensor::type_dispatch;
50-
namespace tu_ns = dpctl::tensor::type_utils;
5149

5250
namespace impl
5351
{
54-
// OneMKL namespace with VM functions
55-
namespace mkl_vm = oneapi::mkl::vm;
52+
namespace ew_cmn_ns = dpctl::tensor::kernels::elementwise_common;
53+
namespace mkl_vm = oneapi::mkl::vm; // OneMKL namespace with VM functions
54+
namespace tu_ns = dpctl::tensor::type_utils;
5655

5756
/**
5857
* @brief A factory to define pairs of supported types for which

dpnp/backend/extensions/vm/asin.cpp

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,16 +43,15 @@
4343

4444
namespace dpnp::extensions::vm
4545
{
46-
namespace ew_cmn_ns = dpctl::tensor::kernels::elementwise_common;
4746
namespace py = pybind11;
4847
namespace py_int = dpnp::extensions::py_internal;
4948
namespace td_ns = dpctl::tensor::type_dispatch;
50-
namespace tu_ns = dpctl::tensor::type_utils;
5149

5250
namespace impl
5351
{
54-
// OneMKL namespace with VM functions
55-
namespace mkl_vm = oneapi::mkl::vm;
52+
namespace ew_cmn_ns = dpctl::tensor::kernels::elementwise_common;
53+
namespace mkl_vm = oneapi::mkl::vm; // OneMKL namespace with VM functions
54+
namespace tu_ns = dpctl::tensor::type_utils;
5655

5756
/**
5857
* @brief A factory to define pairs of supported types for which

dpnp/backend/extensions/vm/asinh.cpp

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,16 +43,15 @@
4343

4444
namespace dpnp::extensions::vm
4545
{
46-
namespace ew_cmn_ns = dpctl::tensor::kernels::elementwise_common;
4746
namespace py = pybind11;
4847
namespace py_int = dpnp::extensions::py_internal;
4948
namespace td_ns = dpctl::tensor::type_dispatch;
50-
namespace tu_ns = dpctl::tensor::type_utils;
5149

5250
namespace impl
5351
{
54-
// OneMKL namespace with VM functions
55-
namespace mkl_vm = oneapi::mkl::vm;
52+
namespace ew_cmn_ns = dpctl::tensor::kernels::elementwise_common;
53+
namespace mkl_vm = oneapi::mkl::vm; // OneMKL namespace with VM functions
54+
namespace tu_ns = dpctl::tensor::type_utils;
5655

5756
/**
5857
* @brief A factory to define pairs of supported types for which

dpnp/backend/extensions/vm/atan.cpp

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,16 +43,15 @@
4343

4444
namespace dpnp::extensions::vm
4545
{
46-
namespace ew_cmn_ns = dpctl::tensor::kernels::elementwise_common;
4746
namespace py = pybind11;
4847
namespace py_int = dpnp::extensions::py_internal;
4948
namespace td_ns = dpctl::tensor::type_dispatch;
50-
namespace tu_ns = dpctl::tensor::type_utils;
5149

5250
namespace impl
5351
{
54-
// OneMKL namespace with VM functions
55-
namespace mkl_vm = oneapi::mkl::vm;
52+
namespace ew_cmn_ns = dpctl::tensor::kernels::elementwise_common;
53+
namespace mkl_vm = oneapi::mkl::vm; // OneMKL namespace with VM functions
54+
namespace tu_ns = dpctl::tensor::type_utils;
5655

5756
/**
5857
* @brief A factory to define pairs of supported types for which

dpnp/backend/extensions/vm/atan2.cpp

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,16 +43,15 @@
4343

4444
namespace dpnp::extensions::vm
4545
{
46-
namespace ew_cmn_ns = dpctl::tensor::kernels::elementwise_common;
4746
namespace py = pybind11;
4847
namespace py_int = dpnp::extensions::py_internal;
4948
namespace td_ns = dpctl::tensor::type_dispatch;
50-
namespace tu_ns = dpctl::tensor::type_utils;
5149

5250
namespace impl
5351
{
54-
// OneMKL namespace with VM functions
55-
namespace mkl_vm = oneapi::mkl::vm;
52+
namespace ew_cmn_ns = dpctl::tensor::kernels::elementwise_common;
53+
namespace mkl_vm = oneapi::mkl::vm; // OneMKL namespace with VM functions
54+
namespace tu_ns = dpctl::tensor::type_utils;
5655

5756
/**
5857
* @brief A factory to define pairs of supported types for which

dpnp/backend/extensions/vm/atanh.cpp

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,16 +43,15 @@
4343

4444
namespace dpnp::extensions::vm
4545
{
46-
namespace ew_cmn_ns = dpctl::tensor::kernels::elementwise_common;
4746
namespace py = pybind11;
4847
namespace py_int = dpnp::extensions::py_internal;
4948
namespace td_ns = dpctl::tensor::type_dispatch;
50-
namespace tu_ns = dpctl::tensor::type_utils;
5149

5250
namespace impl
5351
{
54-
// OneMKL namespace with VM functions
55-
namespace mkl_vm = oneapi::mkl::vm;
52+
namespace ew_cmn_ns = dpctl::tensor::kernels::elementwise_common;
53+
namespace mkl_vm = oneapi::mkl::vm; // OneMKL namespace with VM functions
54+
namespace tu_ns = dpctl::tensor::type_utils;
5655

5756
/**
5857
* @brief A factory to define pairs of supported types for which

0 commit comments

Comments
 (0)