Skip to content

Commit 217057d

Browse files
committed
remove mkl::remainder implementation
1 parent 3ccba21 commit 217057d

File tree

5 files changed

+5
-154
lines changed

5 files changed

+5
-154
lines changed

dpnp/backend/extensions/vm/remainder.hpp

-83
This file was deleted.

dpnp/backend/extensions/vm/types_matrix.hpp

-15
Original file line numberDiff line numberDiff line change
@@ -68,21 +68,6 @@ struct DivOutputType
6868
dpctl_td_ns::DefaultResultEntry<void>>::result_type;
6969
};
7070

71-
/**
72-
* @brief A factory to define pairs of supported types for which
73-
* MKL VM library provides support in oneapi::mkl::vm::remainder<T> function.
74-
*
75-
* @tparam T Type of input vectors `a` and `b` and of result vector `y`.
76-
*/
77-
template <typename T>
78-
struct RemainderOutputType
79-
{
80-
using value_type = typename std::disjunction<
81-
dpctl_td_ns::BinaryTypeMapResultEntry<T, double, T, double, double>,
82-
dpctl_td_ns::BinaryTypeMapResultEntry<T, float, T, float, float>,
83-
dpctl_td_ns::DefaultResultEntry<void>>::result_type;
84-
};
85-
8671
/**
8772
* @brief A factory to define pairs of supported types for which
8873
* MKL VM library provides support in oneapi::mkl::vm::cos<T> function.

dpnp/backend/extensions/vm/vm_py.cpp

-33
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@
3434
#include "cos.hpp"
3535
#include "div.hpp"
3636
#include "ln.hpp"
37-
#include "remainder.hpp"
3837
#include "sin.hpp"
3938
#include "sqr.hpp"
4039
#include "sqrt.hpp"
@@ -47,7 +46,6 @@ using vm_ext::binary_impl_fn_ptr_t;
4746
using vm_ext::unary_impl_fn_ptr_t;
4847

4948
static binary_impl_fn_ptr_t div_dispatch_vector[dpctl_td_ns::num_types];
50-
static binary_impl_fn_ptr_t remainder_dispatch_vector[dpctl_td_ns::num_types];
5149

5250
static unary_impl_fn_ptr_t cos_dispatch_vector[dpctl_td_ns::num_types];
5351
static unary_impl_fn_ptr_t ln_dispatch_vector[dpctl_td_ns::num_types];
@@ -90,37 +88,6 @@ PYBIND11_MODULE(_vm_impl, m)
9088
py::arg("dst"));
9189
}
9290

93-
// BinaryUfunc: ==== REMAINDER(x1, x2) ====
94-
{
95-
vm_ext::init_ufunc_dispatch_vector<binary_impl_fn_ptr_t,
96-
vm_ext::RemainderContigFactory>(
97-
remainder_dispatch_vector);
98-
99-
auto remainder_pyapi = [&](sycl::queue exec_q, arrayT src1, arrayT src2,
100-
arrayT dst, const event_vecT &depends = {}) {
101-
return vm_ext::binary_ufunc(exec_q, src1, src2, dst, depends,
102-
remainder_dispatch_vector);
103-
};
104-
m.def("_remainder", remainder_pyapi,
105-
"Call `remainder` function from OneMKL VM library to performs "
106-
"element "
107-
"by element remainder of vector `src1` by vector `src2` "
108-
"to resulting vector `dst`",
109-
py::arg("sycl_queue"), py::arg("src1"), py::arg("src2"),
110-
py::arg("dst"), py::arg("depends") = py::list());
111-
112-
auto remainder_need_to_call_pyapi = [&](sycl::queue exec_q, arrayT src1,
113-
arrayT src2, arrayT dst) {
114-
return vm_ext::need_to_call_binary_ufunc(exec_q, src1, src2, dst,
115-
remainder_dispatch_vector);
116-
};
117-
m.def("_mkl_remainder_to_call", remainder_need_to_call_pyapi,
118-
"Check input arguments to answer if `remainder` function from "
119-
"OneMKL VM library can be used",
120-
py::arg("sycl_queue"), py::arg("src1"), py::arg("src2"),
121-
py::arg("dst"));
122-
}
123-
12491
// UnaryUfunc: ==== Cos(x) ====
12592
{
12693
vm_ext::init_ufunc_dispatch_vector<unary_impl_fn_ptr_t,

dpnp/dpnp_algo/dpnp_elementwise_common.py

+1-19
Original file line numberDiff line numberDiff line change
@@ -980,24 +980,6 @@ def dpnp_not_equal(x1, x2, out=None, order="K"):
980980

981981

982982
def dpnp_remainder(x1, x2, out=None, order="K"):
983-
"""
984-
Invokes remainder() function from pybind11 extension of OneMKL VM if possible.
985-
986-
Otherwise fully relies on dpctl.tensor implementation for remainder() function.
987-
988-
"""
989-
990-
def _call_remainder(src1, src2, dst, sycl_queue, depends=None):
991-
"""A callback to register in BinaryElementwiseFunc class of dpctl.tensor"""
992-
993-
if depends is None:
994-
depends = []
995-
996-
if vmi._mkl_remainder_to_call(sycl_queue, src1, src2, dst):
997-
# call pybind11 extension for remainder() function from OneMKL VM
998-
return vmi._remainder(sycl_queue, src1, src2, dst, depends)
999-
return ti._remainder(src1, src2, dst, sycl_queue, depends)
1000-
1001983
# dpctl.tensor only works with usm_ndarray or scalar
1002984
x1_usm_or_scalar = dpnp.get_usm_ndarray_or_scalar(x1)
1003985
x2_usm_or_scalar = dpnp.get_usm_ndarray_or_scalar(x2)
@@ -1006,7 +988,7 @@ def _call_remainder(src1, src2, dst, sycl_queue, depends=None):
1006988
func = BinaryElementwiseFunc(
1007989
"remainder",
1008990
ti._remainder_result_type,
1009-
_call_remainder,
991+
ti._remainder,
1010992
_remainder_docstring_,
1011993
)
1012994
res_usm = func(x1_usm_or_scalar, x2_usm_or_scalar, out=out_usm, order=order)

dpnp/dpnp_iface_mathematical.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -1602,12 +1602,12 @@ def remainder(
16021602
16031603
Limitations
16041604
-----------
1605-
Parameters ``x1`` and ``x2`` are supported as either :obj:`dpnp.ndarray` or scalar.
1606-
Parameters ``dtype``, ``out`` and ``where`` are supported with their default values.
1607-
Keyword arguments ``kwargs`` are currently unsupported.
1605+
Parameters ``x1`` and ``x2`` are supported as either :obj:`dpnp.ndarray`,
1606+
:class:`dpctl.tensor.usm_ndarray` or scalar.
1607+
Parameters `where`, `dtype` and `subok` are supported with their default values.
1608+
Keyword arguments `kwargs` are currently unsupported.
16081609
Otherwise the functions will be executed sequentially on CPU.
16091610
Input array data types are limited by supported DPNP :ref:`Data types`.
1610-
Parameters ``x1`` and ``x2`` are supported with equal sizes and shapes.
16111611
16121612
See Also
16131613
--------

0 commit comments

Comments
 (0)