43 static_assert(std::is_same_v<argT, argT2>,
44 "Input types are expected to be the same");
45 static_assert(std::is_integral_v<argT> || std::is_floating_point_v<argT> ||
46 std::is_same_v<argT, sycl::half>,
47 "Input types are expected to be integral or floating");
49 using supports_vec =
typename std::false_type;
50 using supports_sg_loadstore =
typename std::true_type;
52 divT operator()(
const argT &in1,
const argT &in2, modT &mod)
const
54 if constexpr (std::is_integral_v<argT>) {
60 if constexpr (std::is_signed_v<argT>) {
61 if ((in1 == std::numeric_limits<argT>::min()) &&
64 return std::numeric_limits<argT>::min();
71 if constexpr (std::is_signed_v<argT>) {
72 if (l_xor(in1 > 0, in2 > 0) && (mod != 0)) {
80 mod = sycl::fmod(in1, in2);
87 auto div = (in1 - mod) / in2;
91 if (l_xor(in2 < 0, mod < 0)) {
98 mod = sycl::copysign(modT(0), in2);
103 auto floordiv = sycl::floor(div);
104 if (div - floordiv > divT(0.5)) {
105 floordiv += divT(1.0);
111 div = sycl::copysign(divT(0), in1 / in2);
118 bool l_xor(
bool b1,
bool b2)
const