Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,12 @@ struct FloorDivideFunctor

resT operator()(const argT1 &in1, const argT2 &in2)
{
if constexpr (std::is_integral_v<argT1> || std::is_integral_v<argT2>) {
if constexpr (std::is_same_v<argT1, bool> &&
std::is_same_v<argT2, bool>) {
return (in2) ? static_cast<resT>(in1) : resT(0);
}
else if constexpr (std::is_integral_v<argT1> ||
std::is_integral_v<argT2>) {
if (in2 == argT2(0)) {
return resT(0);
}
Expand All @@ -81,7 +86,16 @@ struct FloorDivideFunctor
sycl::vec<resT, vec_sz> operator()(const sycl::vec<argT1, vec_sz> &in1,
const sycl::vec<argT2, vec_sz> &in2)
{
if constexpr (std::is_integral_v<resT>) {
if constexpr (std::is_same_v<argT1, bool> &&
std::is_same_v<argT2, bool>) {
sycl::vec<resT, vec_sz> res;
#pragma unroll
for (int i = 0; i < vec_sz; ++i) {
res[i] = (in2[i]) ? static_cast<resT>(in1[i]) : resT(0);
}
return res;
}
else if constexpr (std::is_integral_v<resT>) {
sycl::vec<resT, vec_sz> res;
#pragma unroll
for (int i = 0; i < vec_sz; ++i) {
Expand Down