Skip to content

Commit

Permalink
[SYCL][ESIMD] Remove use of double literal in fmod (#7277)
Browse files Browse the repository at this point in the history
The float variant of ESIMD fmod unintentionally uses a double literal
which creates a requirement for aspect::fp64 when using the operation.
This commit changes this literal to a 32-bit floating point literal.

Signed-off-by: Larsen, Steffen <steffen.larsen@intel.com>
  • Loading branch information
steffenlarsen authored Nov 4, 2022
1 parent 9da2563 commit cc18904
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion sycl/include/sycl/ext/intel/experimental/esimd/math.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -1399,7 +1399,7 @@ ESIMD_INLINE __ESIMD_NS::simd<float, N> fmod(__ESIMD_NS::simd<float, N> y,
__ESIMD_NS::simd<float, N> reminder =
abs_y - abs_x * __ESIMD_NS::trunc<float>(abs_y / abs_x);

abs_x.merge(0.0, reminder >= 0);
abs_x.merge(0.0f, reminder >= 0);
__ESIMD_NS::simd<float, N> fmod = reminder + abs_x;
__ESIMD_NS::simd<float, N> fmod_abs = __ESIMD_NS::abs(fmod);

Expand Down

0 comments on commit cc18904

Please sign in to comment.