DPC++ Runtime
Runtime libraries for oneAPI DPC++
bfloat16_math.hpp File Reference
#include <sycl/builtins.hpp>
#include <sycl/detail/memcpy.hpp>
#include <sycl/ext/oneapi/bfloat16.hpp>
#include <sycl/marray.hpp>
#include <cstring>
#include <stdint.h>
#include <type_traits>
Include dependency graph for bfloat16_math.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Namespaces

 sycl
 
 sycl::_V1
 
 sycl::_V1::ext
 
 sycl::_V1::ext::oneapi
 
 sycl::_V1::ext::oneapi::experimental
 
 sycl::_V1::ext::oneapi::experimental::detail
 

Macros

#define BFLOAT16_MATH_FP32_WRAPPERS(op)
 
#define BFLOAT16_MATH_FP32_WRAPPERS_MARRAY(op)
 

Functions

template<size_t N>
uint32_t sycl::_V1::ext::oneapi::experimental::detail::to_uint32_t (sycl::marray< bfloat16, N > x, size_t start)
 
template<typename T >
std::enable_if_t< std::is_same_v< T, bfloat16 >, bool > sycl::_V1::ext::oneapi::experimental::isnan (T x)
 
template<size_t N>
sycl::marray< bool, N > sycl::_V1::ext::oneapi::experimental::isnan (sycl::marray< bfloat16, N > x)
 
template<typename T >
std::enable_if_t< std::is_same_v< T, bfloat16 >, T > sycl::_V1::ext::oneapi::experimental::fabs (T x)
 
template<size_t N>
sycl::marray< bfloat16, N > sycl::_V1::ext::oneapi::experimental::fabs (sycl::marray< bfloat16, N > x)
 
template<typename T >
std::enable_if_t< std::is_same_v< T, bfloat16 >, T > sycl::_V1::ext::oneapi::experimental::fmin (T x, T y)
 
template<size_t N>
sycl::marray< bfloat16, N > sycl::_V1::ext::oneapi::experimental::fmin (sycl::marray< bfloat16, N > x, sycl::marray< bfloat16, N > y)
 
template<typename T >
std::enable_if_t< std::is_same_v< T, bfloat16 >, T > sycl::_V1::ext::oneapi::experimental::fmax (T x, T y)
 
template<size_t N>
sycl::marray< bfloat16, N > sycl::_V1::ext::oneapi::experimental::fmax (sycl::marray< bfloat16, N > x, sycl::marray< bfloat16, N > y)
 
template<typename T >
std::enable_if_t< std::is_same_v< T, bfloat16 >, T > sycl::_V1::ext::oneapi::experimental::fma (T x, T y, T z)
 
template<size_t N>
sycl::marray< bfloat16, N > sycl::_V1::ext::oneapi::experimental::fma (sycl::marray< bfloat16, N > x, sycl::marray< bfloat16, N > y, sycl::marray< bfloat16, N > z)
 

Macro Definition Documentation

◆ BFLOAT16_MATH_FP32_WRAPPERS

#define BFLOAT16_MATH_FP32_WRAPPERS (   op)
Value:
template <typename T> \
std::enable_if_t<std::is_same<T, bfloat16>::value, T> op(T x) { \
return sycl::ext::oneapi::bfloat16{sycl::op(float{x})}; \
}
autodecltype(x) x

Definition at line 251 of file bfloat16_math.hpp.

◆ BFLOAT16_MATH_FP32_WRAPPERS_MARRAY

#define BFLOAT16_MATH_FP32_WRAPPERS_MARRAY (   op)
Value:
template <size_t N> \
sycl::marray<bfloat16, N> op(sycl::marray<bfloat16, N> x) { \
sycl::marray<bfloat16, N> res; \
for (size_t i = 0; i < N; i++) { \
res[i] = op(x[i]); \
} \
return res; \
}
Provides a cross-platform math array class template that works on SYCL devices as well as in host C++...
Definition: marray.hpp:48

Definition at line 257 of file bfloat16_math.hpp.