Skip to content

Commit 323104f

Browse files
[ABI-Break][SYCL] Remove preview guards around bfloat16 (#13233)
Also reverts `isnan` check to non-preview implementation to avoid unnecessary dependecy of a data type on builtins.
1 parent 5b16b09 commit 323104f

File tree

2 files changed

+3
-25
lines changed

2 files changed

+3
-25
lines changed

sycl/include/sycl/detail/generic_type_lists.hpp

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -97,16 +97,8 @@ using scalar_vector_double_list =
9797
using double_list =
9898
tl_append<scalar_double_list, vector_double_list, marray_double_list>;
9999

100-
#ifdef __INTEL_PREVIEW_BREAKING_CHANGES
101100
using scalar_floating_list = tl_append<scalar_float_list, scalar_double_list,
102101
scalar_half_list, scalar_bfloat16_list>;
103-
#else
104-
// Presently, this is used only by builtins_legacy_scalar.hpp for defining math
105-
// funcs. bfloat16 provides its own scalar math definitions so we skip its
106-
// inclusion.
107-
using scalar_floating_list =
108-
tl_append<scalar_float_list, scalar_double_list, scalar_half_list>;
109-
#endif
110102

111103
using vector_floating_list = tl_append<vector_float_list, vector_double_list,
112104
vector_half_list, vector_bfloat16_list>;

sycl/include/sycl/ext/oneapi/bfloat16.hpp

Lines changed: 3 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,6 @@ __devicelib_ConvertBF16ToFINTEL(const uint16_t &) noexcept;
2121

2222
namespace sycl {
2323
inline namespace _V1 {
24-
25-
#ifdef __INTEL_PREVIEW_BREAKING_CHANGES
26-
// forward declaration of sycl::isnan built-in.
27-
// extern __DPCPP_SYCL_EXTERNAL bool isnan(float a);
28-
bool isnan(float a);
29-
#endif
30-
3124
namespace ext::oneapi {
3225

3326
class bfloat16;
@@ -53,10 +46,6 @@ using Vec8StorageT = std::array<Bfloat16StorageT, 8>;
5346
using Vec16StorageT = std::array<Bfloat16StorageT, 16>;
5447
#endif
5548
} // namespace bf16
56-
57-
#ifndef __INTEL_PREVIEW_BREAKING_CHANGES
58-
inline bool float_is_nan(float x) { return x != x; }
59-
#endif
6049
} // namespace detail
6150

6251
class bfloat16 {
@@ -77,13 +66,10 @@ class bfloat16 {
7766

7867
private:
7968
static detail::Bfloat16StorageT from_float_fallback(const float &a) {
80-
#ifdef __INTEL_PREVIEW_BREAKING_CHANGES
81-
if (sycl::isnan(a))
82-
return 0xffc1;
83-
#else
84-
if (detail::float_is_nan(a))
69+
// We don't call sycl::isnan because we don't want a data type to depend on
70+
// builtins.
71+
if (a != a)
8572
return 0xffc1;
86-
#endif
8773

8874
union {
8975
uint32_t intStorage;

0 commit comments

Comments
 (0)