40 static_assert(std::is_same_v<argT, argT2>,
41 "Input types are expected to be the same");
42 static_assert(std::is_integral_v<argT> || std::is_floating_point_v<argT> ||
43 std::is_same_v<argT, sycl::half>,
44 "Input types are expected to be integral or floating");
46 using supports_vec =
typename std::false_type;
47 using supports_sg_loadstore =
typename std::true_type;
49 divT operator()(
const argT &in1,
const argT &in2, modT &mod)
const
51 if constexpr (std::is_integral_v<argT>) {
57 if constexpr (std::is_signed_v<argT>) {
58 if ((in1 == std::numeric_limits<argT>::min()) &&
61 return std::numeric_limits<argT>::min();
68 if constexpr (std::is_signed_v<argT>) {
69 if (l_xor(in1 > 0, in2 > 0) && (mod != 0)) {
77 mod = sycl::fmod(in1, in2);
84 auto div = (in1 - mod) / in2;
88 if (l_xor(in2 < 0, mod < 0)) {
95 mod = sycl::copysign(modT(0), in2);
100 auto floordiv = sycl::floor(div);
101 if (div - floordiv > divT(0.5)) {
102 floordiv += divT(1.0);
108 div = sycl::copysign(divT(0), in1 / in2);
115 bool l_xor(
bool b1,
bool b2)
const