Skip to content

Commit

Permalink
Update maths functions to run on Iris Xe (#1502)
Browse files Browse the repository at this point in the history
* Update dpnp.arctan2

* Update dpnp.copysign

* Update dpnp.fmod

* --amend

* Update dpnp.hypot

* Update dpnp.maximum

* Update dpnp.minimum

* Update dpnp.cross

* Update test_mathematical

* Add a new template function get_res_type

* Skip test_remainder on Iris Xe

* Fix TestAdd

* Fix TestMultiply

* Use dispatch_fmod_op in vector implementation

* Remove fmap for dpnp_floor_divide_ext

* Use dispatch_fmod_vec for vector impl

* Rename and update get_res_type func

* Fix remarks

* Use a common check in dispatch_fmod_op

* Update dispatch_fmod_op

---------

Co-authored-by: Anton <100830759+antonwolfy@users.noreply.github.com>
  • Loading branch information
vlad-perevezentsev and antonwolfy authored Aug 5, 2023
1 parent b15aafc commit 297810e
Show file tree
Hide file tree
Showing 5 changed files with 229 additions and 286 deletions.
31 changes: 16 additions & 15 deletions dpnp/backend/include/dpnp_gen_2arg_3type_tbl.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -114,16 +114,16 @@ MACRO_2ARG_3TYPES_OP(dpnp_add_c,
std::complex<double>))

MACRO_2ARG_3TYPES_OP(dpnp_arctan2_c,
sycl::atan2((double)input1_elem, (double)input2_elem),
nullptr,
std::false_type,
sycl::atan2(input1_elem, input2_elem),
sycl::atan2(x1, x2),
MACRO_UNPACK_TYPES(float, double),
oneapi::mkl::vm::atan2,
MACRO_UNPACK_TYPES(float, double))

MACRO_2ARG_3TYPES_OP(dpnp_copysign_c,
sycl::copysign((double)input1_elem, (double)input2_elem),
nullptr,
std::false_type,
sycl::copysign(input1_elem, input2_elem),
sycl::copysign(x1, x2),
MACRO_UNPACK_TYPES(float, double),
oneapi::mkl::vm::copysign,
MACRO_UNPACK_TYPES(float, double))

Expand All @@ -137,17 +137,18 @@ MACRO_2ARG_3TYPES_OP(dpnp_divide_c,
std::complex<float>,
std::complex<double>))

MACRO_2ARG_3TYPES_OP(dpnp_fmod_c,
sycl::fmod((double)input1_elem, (double)input2_elem),
nullptr,
std::false_type,
oneapi::mkl::vm::fmod,
MACRO_UNPACK_TYPES(float, double))
MACRO_2ARG_3TYPES_OP(
dpnp_fmod_c,
dispatch_fmod_op(input1_elem, input2_elem),
dispatch_fmod_op(x1, x2),
MACRO_UNPACK_TYPES(std::int32_t, std::int64_t, float, double),
oneapi::mkl::vm::fmod,
MACRO_UNPACK_TYPES(float, double))

MACRO_2ARG_3TYPES_OP(dpnp_hypot_c,
sycl::hypot((double)input1_elem, (double)input2_elem),
nullptr,
std::false_type,
sycl::hypot(input1_elem, input2_elem),
sycl::hypot(x1, x2),
MACRO_UNPACK_TYPES(float, double),
oneapi::mkl::vm::hypot,
MACRO_UNPACK_TYPES(float, double))

Expand Down
Loading

0 comments on commit 297810e

Please sign in to comment.