Skip to content

Commit

Permalink
gcc_source/kernel.hpp: add support for legacy clang
Browse files Browse the repository at this point in the history
  • Loading branch information
WolframRhodium committed Oct 9, 2022
1 parent acdc582 commit d819e59
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions gcc_source/kernel.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ static inline Vec16f sqrt(Vec16f x) {
for (int i = 0; i < 16; i++) {
ret[i] = std::sqrt(x[i]);
}

return ret;
}

Expand All @@ -45,22 +45,22 @@ static inline Vec16f pow(Vec16f base, Vec16f exp) {
for (int i = 0; i < 16; i++) {
ret[i] = std::pow(base[i], exp[i]);
}

return ret;
}

static inline Vec16f max(Vec16f x, Vec16f y) {
#if __clang__
#if __clang__ && __clang_major__ >= 14
return __builtin_elementwise_max(x, y);
#else // __clang__
#else // __clang__ && __clang_major__ >= 14
Vec16f ret;

for (int i = 0; i < 16; i++) {
ret[i] = std::fmax(x[i], y[i]);
}

return ret;
#endif // __clang__
#endif // __clang__ && __clang_major__ >= 14
}

template <int n>
Expand Down

0 comments on commit d819e59

Please sign in to comment.