DPC++ Runtime
Runtime libraries for oneAPI DPC++
bfloat16.hpp File Reference
#include <sycl/aliases.hpp>
#include <sycl/detail/defines_elementary.hpp>
#include <sycl/half_type.hpp>
#include <stdint.h>
Include dependency graph for bfloat16.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  sycl::_V1::ext::oneapi::bfloat16
 

Namespaces

 sycl
 
 sycl::_V1
 
 sycl::_V1::ext
 
 sycl::_V1::ext::oneapi
 
 sycl::_V1::ext::oneapi::detail
 
 sycl::_V1::ext::oneapi::detail::bf16
 

Macros

#define OP(op)
 
#define OP(op)
 
#define OP(type, op)
 

Typedefs

using sycl::_V1::ext::oneapi::detail::Bfloat16StorageT = uint16_t
 
using sycl::_V1::ext::oneapi::detail::bf16::Vec2StorageT = std::array< Bfloat16StorageT, 2 >
 
using sycl::_V1::ext::oneapi::detail::bf16::Vec3StorageT = std::array< Bfloat16StorageT, 3 >
 
using sycl::_V1::ext::oneapi::detail::bf16::Vec4StorageT = std::array< Bfloat16StorageT, 4 >
 
using sycl::_V1::ext::oneapi::detail::bf16::Vec8StorageT = std::array< Bfloat16StorageT, 8 >
 
using sycl::_V1::ext::oneapi::detail::bf16::Vec16StorageT = std::array< Bfloat16StorageT, 16 >
 

Functions

__DPCPP_SYCL_EXTERNAL uint16_t __devicelib_ConvertFToBF16INTEL (const float &) noexcept
 
__DPCPP_SYCL_EXTERNAL float __devicelib_ConvertBF16ToFINTEL (const uint16_t &) noexcept
 
Bfloat16StorageT sycl::_V1::ext::oneapi::detail::bfloat16ToBits (const bfloat16 &Value)
 
bfloat16 sycl::_V1::ext::oneapi::detail::bitsToBfloat16 (const Bfloat16StorageT Value)
 
bool sycl::_V1::ext::oneapi::detail::float_is_nan (float x)
 

Macro Definition Documentation

◆ OP [1/3]

#define OP (   op)
Value:
friend bfloat16 &operator op(bfloat16 & lhs) { \
float f = to_float(lhs.value); \
lhs.value = from_float(op f); \
return lhs; \
} \
friend bfloat16 operator op(bfloat16 &lhs, int) { \
bfloat16 old = lhs; \
operator op(lhs); \
return old; \
}

Definition at line 209 of file bfloat16.hpp.

◆ OP [2/3]

#define OP (   op)
Value:
friend bfloat16 &operator op(bfloat16 & lhs, const bfloat16 & rhs) { \
float f = static_cast<float>(lhs); \
f op static_cast<float>(rhs); \
return lhs = f; \
}

Definition at line 209 of file bfloat16.hpp.

◆ OP [3/3]

#define OP (   type,
  op 
)
Value:
friend type operator op(const bfloat16 &lhs, const bfloat16 &rhs) { \
return type{static_cast<float>(lhs) op static_cast<float>(rhs)}; \
} \
template <typename T> \
friend std::enable_if_t<std::is_convertible_v<T, float>, type> operator op( \
const bfloat16 & lhs, const T & rhs) { \
return type{static_cast<float>(lhs) op static_cast<float>(rhs)}; \
} \
template <typename T> \
friend std::enable_if_t<std::is_convertible_v<T, float>, type> operator op( \
const T & lhs, const bfloat16 & rhs) { \
return type{static_cast<float>(lhs) op static_cast<float>(rhs)}; \
}

Definition at line 209 of file bfloat16.hpp.

Function Documentation

◆ __devicelib_ConvertBF16ToFINTEL()

__DPCPP_SYCL_EXTERNAL float __devicelib_ConvertBF16ToFINTEL ( const uint16_t &  )
noexcept

References sycl::_V1::a, and sycl::_V1::isnan().

◆ __devicelib_ConvertFToBF16INTEL()

__DPCPP_SYCL_EXTERNAL uint16_t __devicelib_ConvertFToBF16INTEL ( const float &  )
noexcept