Skip to content

[SYCL] Fixed AMD compilation for bfloat16 to use generic impl. #10009

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jun 22, 2023
Merged
Show file tree
Hide file tree
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
11 changes: 3 additions & 8 deletions sycl/include/sycl/ext/oneapi/bfloat16.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -115,16 +115,11 @@ class bfloat16 {

// Unary minus operator overloading
friend bfloat16 operator-(bfloat16 &lhs) {
#if defined(__SYCL_DEVICE_ONLY__)
#if defined(__NVPTX__)
#if (__SYCL_CUDA_ARCH__ >= 800)
#if defined(__SYCL_DEVICE_ONLY__) && defined(__NVPTX__) && \
(__SYCL_CUDA_ARCH__ >= 800)
return detail::bitsToBfloat16(__nvvm_neg_bf16(lhs.value));
#else
return -to_float(lhs.value);
#endif
#else
#elif defined(__SYCL_DEVICE_ONLY__) && defined(__SPIR__)
return bfloat16{-__devicelib_ConvertBF16ToFINTEL(lhs.value)};
#endif
#else
return -to_float(lhs.value);
#endif
Expand Down
2 changes: 0 additions & 2 deletions sycl/test-e2e/BFloat16/bfloat16_type.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@
// TODO currently the feature isn't supported on FPGA.
// UNSUPPORTED: accelerator
//
// Not currently supported on HIP.
// UNSUPPORTED: hip

//==----------- bfloat16_type.cpp - SYCL bfloat16 type test ----------------==//
//
Expand Down