18 #if defined(__SPIR__) || defined(__SPIRV__)
33 #include <type_traits>
65 inline namespace _V1 {
66 namespace ext::intel::math {
69 "sycl::half is not compatible with _iml_half_internal.");
71 template <
typename Tp>
72 std::enable_if_t<std::is_same_v<Tp, float>,
float>
saturate(Tp x) {
76 template <
typename Tp>
77 std::enable_if_t<std::is_same_v<Tp, float>,
float>
copysign(Tp x, Tp y) {
81 template <
typename Tp>
82 std::enable_if_t<std::is_same_v<Tp, double>,
double>
copysign(Tp x, Tp y) {
86 template <
typename Tp>
94 template <
typename Tp>
95 std::enable_if_t<std::is_same_v<Tp, float>,
float>
ceil(Tp x) {
99 template <
typename Tp>
100 std::enable_if_t<std::is_same_v<Tp, double>,
double>
ceil(Tp x) {
104 template <
typename Tp>
110 template <
typename Tp>
111 std::enable_if_t<std::is_same_v<Tp, sycl::half2>, sycl::half2>
ceil(Tp x) {
112 return sycl::half2{
ceil(
x.s0()),
ceil(
x.s1())};
115 template <
typename Tp>
116 std::enable_if_t<std::is_same_v<Tp, float>,
float>
floor(Tp x) {
120 template <
typename Tp>
121 std::enable_if_t<std::is_same_v<Tp, double>,
double>
floor(Tp x) {
125 template <
typename Tp>
131 template <
typename Tp>
132 std::enable_if_t<std::is_same_v<Tp, sycl::half2>, sycl::half2>
floor(Tp x) {
136 template <
typename Tp>
137 std::enable_if_t<std::is_same_v<Tp, float>,
float>
inv(Tp x) {
141 template <
typename Tp>
142 std::enable_if_t<std::is_same_v<Tp, double>,
double>
inv(Tp x) {
146 template <
typename Tp>
152 template <
typename Tp>
153 std::enable_if_t<std::is_same_v<Tp, sycl::half2>, sycl::half2>
inv(Tp x) {
154 return sycl::half2{
inv(
x.s0()),
inv(
x.s1())};
157 template <
typename Tp>
158 std::enable_if_t<std::is_same_v<Tp, float>,
float>
rint(Tp x) {
162 template <
typename Tp>
163 std::enable_if_t<std::is_same_v<Tp, double>,
double>
rint(Tp x) {
167 template <
typename Tp>
173 template <
typename Tp>
174 std::enable_if_t<std::is_same_v<Tp, sycl::half2>, sycl::half2>
rint(Tp x) {
175 return sycl::half2{
rint(
x.s0()),
rint(
x.s1())};
178 template <
typename Tp>
179 std::enable_if_t<std::is_same_v<Tp, float>,
float>
sqrt(Tp x) {
183 template <
typename Tp>
184 std::enable_if_t<std::is_same_v<Tp, double>,
double>
sqrt(Tp x) {
188 template <
typename Tp>
194 template <
typename Tp>
195 std::enable_if_t<std::is_same_v<Tp, sycl::half2>, sycl::half2>
sqrt(Tp x) {
196 return sycl::half2{
sqrt(
x.s0()),
sqrt(
x.s1())};
199 template <
typename Tp>
200 std::enable_if_t<std::is_same_v<Tp, float>,
float>
rsqrt(Tp x) {
204 template <
typename Tp>
205 std::enable_if_t<std::is_same_v<Tp, double>,
double>
rsqrt(Tp x) {
209 template <
typename Tp>
215 template <
typename Tp>
216 std::enable_if_t<std::is_same_v<Tp, sycl::half2>, sycl::half2>
rsqrt(Tp x) {
220 template <
typename Tp>
221 std::enable_if_t<std::is_same_v<Tp, float>,
float>
trunc(Tp x) {
225 template <
typename Tp>
226 std::enable_if_t<std::is_same_v<Tp, double>,
double>
trunc(Tp x) {
230 template <
typename Tp>
236 template <
typename Tp>
237 std::enable_if_t<std::is_same_v<Tp, sycl::half2>, sycl::half2>
trunc(Tp x) {
241 template <
typename Tp>
242 std::enable_if_t<std::is_same_v<Tp, double>,
double>
rcp64h(Tp x) {
uint16_t _iml_half_internal
float __imf_truncf(float)
float __imf_saturatef(float)
float __imf_rsqrtf(float)
double __imf_rint(double)
double __imf_ceil(double)
_iml_half_internal __imf_invf16(_iml_half_internal)
double __imf_sqrt(double)
double __imf_trunc(double)
_iml_half_internal __imf_rintf16(_iml_half_internal)
double __imf_rsqrt(double)
float __imf_copysignf(float, float)
_iml_half_internal __imf_floorf16(_iml_half_internal)
double __imf_floor(double)
_iml_half_internal __imf_sqrtf16(_iml_half_internal)
_iml_half_internal __imf_truncf16(_iml_half_internal)
double __imf_rcp64h(double)
float __imf_floorf(float)
double __imf_copysign(double, double)
_iml_half_internal __imf_copysignf16(_iml_half_internal, _iml_half_internal)
_iml_half_internal __imf_rsqrtf16(_iml_half_internal)
_iml_half_internal __imf_ceilf16(_iml_half_internal)
std::enable_if_t< std::is_same_v< Tp, float >, float > sqrt(Tp x)
std::enable_if_t< std::is_same_v< Tp, float >, float > ceil(Tp x)
std::enable_if_t< std::is_same_v< Tp, float >, float > trunc(Tp x)
std::enable_if_t< std::is_same_v< Tp, float >, float > copysign(Tp x, Tp y)
std::enable_if_t< std::is_same_v< Tp, float >, float > rint(Tp x)
std::enable_if_t< std::is_same_v< Tp, float >, float > floor(Tp x)
std::enable_if_t< std::is_same_v< Tp, float >, float > saturate(Tp x)
std::enable_if_t< std::is_same_v< Tp, float >, float > inv(Tp x)
std::enable_if_t< std::is_same_v< Tp, double >, double > rcp64h(Tp x)
std::enable_if_t< std::is_same_v< Tp, float >, float > rsqrt(Tp x)