DPC++ Runtime
Runtime libraries for oneAPI DPC++
builtins.hpp File Reference
Include dependency graph for builtins.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Namespaces

 sycl
 ---— Error handling, matching OpenCL plugin semantics.
 
 sycl::_V1
 
 sycl::_V1::detail
 

Macros

#define __NOEXC   /*noexcept*/
 
#define __FAST_MATH_GENFLOAT(T)   (detail::is_svgenfloat<T>::value)
 
#define __FAST_MATH_SGENFLOAT(T)   (detail::is_sgenfloat<T>::value)
 
#define __SYCL_MATH_FUNCTION_OVERLOAD_IMPL(NAME)
 
#define __SYCL_MATH_FUNCTION_OVERLOAD(NAME)
 
#define __SYCL_MATH_FUNCTION_OVERLOAD_FM(NAME)
 
#define __SYCL_MATH_FUNCTION_2_OVERLOAD_IMPL(NAME)
 
#define __SYCL_MATH_FUNCTION_2_OVERLOAD(NAME)
 
#define __SYCL_MATH_FUNCTION_3_OVERLOAD(NAME)
 
#define __SYCL_NATIVE_MATH_FUNCTION_OVERLOAD(NAME)
 
#define __SYCL_NATIVE_MATH_FUNCTION_2_OVERLOAD(NAME)
 
#define __SYCL_HALF_PRECISION_MATH_FUNCTION_OVERLOAD(NAME)
 
#define __SYCL_HALF_PRECISION_MATH_FUNCTION_2_OVERLOAD(NAME)
 

Functions

template<class T , size_t N>
vec< T, 2 > sycl::_V1::detail::to_vec2 (marray< T, N > x, size_t start)
 
template<typename T , size_t N>
__SYCL_ALWAYS_INLINE std::enable_if_t< __FAST_MATH_SGENFLOAT(T), marray< T, N > > sycl::_V1::powr (marray< T, N > x, marray< T, N > y) __NOEXC
 

Macro Definition Documentation

◆ __FAST_MATH_GENFLOAT

#define __FAST_MATH_GENFLOAT (   T)    (detail::is_svgenfloat<T>::value)

Definition at line 42 of file builtins.hpp.

◆ __FAST_MATH_SGENFLOAT

#define __FAST_MATH_SGENFLOAT (   T)    (detail::is_sgenfloat<T>::value)

Definition at line 43 of file builtins.hpp.

◆ __NOEXC

#define __NOEXC   /*noexcept*/

Definition at line 18 of file builtins.hpp.

◆ __SYCL_HALF_PRECISION_MATH_FUNCTION_2_OVERLOAD

#define __SYCL_HALF_PRECISION_MATH_FUNCTION_2_OVERLOAD (   NAME)
Value:
template <size_t N> \
inline __SYCL_ALWAYS_INLINE marray<float, N> NAME( \
marray<float, N> x, marray<float, N> y) __NOEXC { \
marray<float, N> res; \
for (size_t i = 0; i < N / 2; i++) { \
auto partial_res = __sycl_std::__invoke_half_##NAME<vec<float, 2>>( \
detail::to_vec2(x, i * 2), detail::to_vec2(y, i * 2)); \
std::memcpy(&res[i * 2], &partial_res, sizeof(vec<float, 2>)); \
} \
if (N % 2) { \
res[N - 1] = \
__sycl_std::__invoke_half_##NAME<float>(x[N - 1], y[N - 1]); \
} \
return res; \
}
#define __NOEXC
Definition: builtins.hpp:18
#define __SYCL_ALWAYS_INLINE
vec< T, 2 > to_vec2(marray< T, N > x, size_t start)
Definition: builtins.hpp:25
void memcpy(void *Dst, const void *Src, std::size_t Size)

◆ __SYCL_HALF_PRECISION_MATH_FUNCTION_OVERLOAD

#define __SYCL_HALF_PRECISION_MATH_FUNCTION_OVERLOAD (   NAME)
Value:
template <size_t N> \
inline __SYCL_ALWAYS_INLINE marray<float, N> NAME(marray<float, N> x) \
__NOEXC { \
marray<float, N> res; \
for (size_t i = 0; i < N / 2; i++) { \
auto partial_res = __sycl_std::__invoke_half_##NAME<vec<float, 2>>( \
detail::to_vec2(x, i * 2)); \
std::memcpy(&res[i * 2], &partial_res, sizeof(vec<float, 2>)); \
} \
if (N % 2) { \
res[N - 1] = __sycl_std::__invoke_half_##NAME<float>(x[N - 1]); \
} \
return res; \
}

◆ __SYCL_MATH_FUNCTION_2_OVERLOAD

#define __SYCL_MATH_FUNCTION_2_OVERLOAD (   NAME)
Value:
template <typename T, size_t N> \
inline __SYCL_ALWAYS_INLINE \
std::enable_if_t<detail::is_sgenfloat<T>::value, marray<T, N>> \
NAME(marray<T, N> x, marray<T, N> y) __NOEXC { \
__SYCL_MATH_FUNCTION_2_OVERLOAD_IMPL(NAME) \
}

Definition at line 141 of file builtins.hpp.

◆ __SYCL_MATH_FUNCTION_2_OVERLOAD_IMPL

#define __SYCL_MATH_FUNCTION_2_OVERLOAD_IMPL (   NAME)
Value:
marray<T, N> res; \
for (size_t i = 0; i < N / 2; i++) { \
auto partial_res = __sycl_std::__invoke_##NAME<vec<T, 2>>( \
detail::to_vec2(x, i * 2), detail::to_vec2(y, i * 2)); \
std::memcpy(&res[i * 2], &partial_res, sizeof(vec<T, 2>)); \
} \
if (N % 2) { \
res[N - 1] = __sycl_std::__invoke_##NAME<T>(x[N - 1], y[N - 1]); \
} \
return res;

Definition at line 129 of file builtins.hpp.

◆ __SYCL_MATH_FUNCTION_3_OVERLOAD

#define __SYCL_MATH_FUNCTION_3_OVERLOAD (   NAME)
Value:
template <typename T, size_t N> \
inline __SYCL_ALWAYS_INLINE \
std::enable_if_t<detail::is_sgenfloat<T>::value, marray<T, N>> \
NAME(marray<T, N> x, marray<T, N> y, marray<T, N> z) __NOEXC { \
marray<T, N> res; \
for (size_t i = 0; i < N / 2; i++) { \
auto partial_res = __sycl_std::__invoke_##NAME<vec<T, 2>>( \
detail::to_vec2(x, i * 2), detail::to_vec2(y, i * 2), \
detail::to_vec2(z, i * 2)); \
std::memcpy(&res[i * 2], &partial_res, sizeof(vec<T, 2>)); \
} \
if (N % 2) { \
res[N - 1] = \
__sycl_std::__invoke_##NAME<T>(x[N - 1], y[N - 1], z[N - 1]); \
} \
return res; \
}

Definition at line 173 of file builtins.hpp.

◆ __SYCL_MATH_FUNCTION_OVERLOAD

#define __SYCL_MATH_FUNCTION_OVERLOAD (   NAME)
Value:
template <typename T, size_t N> \
inline __SYCL_ALWAYS_INLINE \
std::enable_if_t<detail::is_sgenfloat<T>::value, marray<T, N>> \
NAME(marray<T, N> x) __NOEXC { \
__SYCL_MATH_FUNCTION_OVERLOAD_IMPL(NAME) \
}

Definition at line 65 of file builtins.hpp.

◆ __SYCL_MATH_FUNCTION_OVERLOAD_FM

#define __SYCL_MATH_FUNCTION_OVERLOAD_FM (   NAME)
Value:
template <typename T, size_t N> \
inline __SYCL_ALWAYS_INLINE \
std::enable_if_t<__FAST_MATH_SGENFLOAT(T), marray<T, N>> \
NAME(marray<T, N> x) __NOEXC { \
__SYCL_MATH_FUNCTION_OVERLOAD_IMPL(NAME) \
}
#define __FAST_MATH_SGENFLOAT(T)
Definition: builtins.hpp:43

Definition at line 106 of file builtins.hpp.

◆ __SYCL_MATH_FUNCTION_OVERLOAD_IMPL

#define __SYCL_MATH_FUNCTION_OVERLOAD_IMPL (   NAME)
Value:
marray<T, N> res; \
for (size_t i = 0; i < N / 2; i++) { \
vec<T, 2> partial_res = \
__sycl_std::__invoke_##NAME<vec<T, 2>>(detail::to_vec2(x, i * 2)); \
std::memcpy(&res[i * 2], &partial_res, sizeof(vec<T, 2>)); \
} \
if (N % 2) { \
res[N - 1] = __sycl_std::__invoke_##NAME<T>(x[N - 1]); \
} \
return res;

Definition at line 53 of file builtins.hpp.

◆ __SYCL_NATIVE_MATH_FUNCTION_2_OVERLOAD

#define __SYCL_NATIVE_MATH_FUNCTION_2_OVERLOAD (   NAME)
Value:
template <size_t N> \
inline __SYCL_ALWAYS_INLINE marray<float, N> NAME( \
marray<float, N> x, marray<float, N> y) __NOEXC { \
marray<float, N> res; \
for (size_t i = 0; i < N / 2; i++) { \
auto partial_res = __sycl_std::__invoke_native_##NAME<vec<float, 2>>( \
detail::to_vec2(x, i * 2), detail::to_vec2(y, i * 2)); \
std::memcpy(&res[i * 2], &partial_res, sizeof(vec<float, 2>)); \
} \
if (N % 2) { \
res[N - 1] = \
__sycl_std::__invoke_native_##NAME<float>(x[N - 1], y[N - 1]); \
} \
return res; \
}

◆ __SYCL_NATIVE_MATH_FUNCTION_OVERLOAD

#define __SYCL_NATIVE_MATH_FUNCTION_OVERLOAD (   NAME)
Value:
template <size_t N> \
inline __SYCL_ALWAYS_INLINE marray<float, N> NAME(marray<float, N> x) \
__NOEXC { \
marray<float, N> res; \
for (size_t i = 0; i < N / 2; i++) { \
auto partial_res = __sycl_std::__invoke_native_##NAME<vec<float, 2>>( \
detail::to_vec2(x, i * 2)); \
std::memcpy(&res[i * 2], &partial_res, sizeof(vec<float, 2>)); \
} \
if (N % 2) { \
res[N - 1] = __sycl_std::__invoke_native_##NAME<float>(x[N - 1]); \
} \
return res; \
}