Skip to content
Merged
Show file tree
Hide file tree
Changes from 6 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
1 change: 1 addition & 0 deletions sycl/include/CL/sycl.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@
#include <sycl/ext/oneapi/backend/level_zero.hpp>
#endif
#include <sycl/ext/oneapi/device_global/properties.hpp>
#include <sycl/ext/oneapi/experimental/builtins.hpp>
#include <sycl/ext/oneapi/experimental/cuda/barrier.hpp>
#include <sycl/ext/oneapi/filter_selector.hpp>
#include <sycl/ext/oneapi/group_algorithm.hpp>
Expand Down
18 changes: 12 additions & 6 deletions sycl/include/sycl/ext/oneapi/experimental/builtins.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,10 @@
#endif

__SYCL_INLINE_NAMESPACE(cl) {
namespace sycl::ext::oneapi::experimental {
namespace sycl {
namespace ext {
namespace oneapi {
namespace experimental {
namespace detail {
template <size_t N>
uint32_t to_uint32_t(sycl::marray<bfloat16, N> x, size_t start) {
Expand Down Expand Up @@ -144,7 +147,7 @@ sycl::marray<bfloat16, N> fabs(sycl::marray<bfloat16, N> x) {
std::memcpy(&res[i * 2], &partial_res, sizeof(uint32_t));
}

if constexpr (N % 2) {
if (N % 2) {
res[N - 1] = bfloat16::from_bits(__clc_fabs(x[N - 1].raw()));
}
return res;
Expand Down Expand Up @@ -179,7 +182,7 @@ sycl::marray<bfloat16, N> fmin(sycl::marray<bfloat16, N> x,
std::memcpy(&res[i * 2], &partial_res, sizeof(uint32_t));
}

if constexpr (N % 2) {
if (N % 2) {
res[N - 1] =
bfloat16::from_bits(__clc_fmin(x[N - 1].raw(), y[N - 1].raw()));
}
Expand Down Expand Up @@ -217,7 +220,7 @@ sycl::marray<bfloat16, N> fmax(sycl::marray<bfloat16, N> x,
std::memcpy(&res[i * 2], &partial_res, sizeof(uint32_t));
}

if constexpr (N % 2) {
if (N % 2) {
res[N - 1] =
bfloat16::from_bits(__clc_fmax(x[N - 1].raw(), y[N - 1].raw()));
}
Expand Down Expand Up @@ -257,7 +260,7 @@ sycl::marray<bfloat16, N> fma(sycl::marray<bfloat16, N> x,
std::memcpy(&res[i * 2], &partial_res, sizeof(uint32_t));
}

if constexpr (N % 2) {
if (N % 2) {
res[N - 1] = bfloat16::from_bits(
__clc_fma(x[N - 1].raw(), y[N - 1].raw(), z[N - 1].raw()));
}
Expand All @@ -271,7 +274,10 @@ sycl::marray<bfloat16, N> fma(sycl::marray<bfloat16, N> x,
#endif // defined(__SYCL_DEVICE_ONLY__) && defined(__NVPTX__)
}

} // namespace sycl::ext::oneapi::experimental
} // namespace experimental
} // namespace oneapi
} // namespace ext
} // namespace sycl
} // __SYCL_INLINE_NAMESPACE(cl)

#undef __SYCL_CONSTANT_AS
Loading