18 namespace d = s::detail;
24 return -
static_cast<T
>(
x ==
y);
27 template <
typename T>
inline T __sFOrdEqual(T x, T y) {
return x ==
y; }
29 template <
typename T>
inline T __vFUnordNotEqual(T x, T y) {
30 return -
static_cast<T
>(
x !=
y);
33 template <
typename T>
inline T __sFUnordNotEqual(T x, T y) {
return x !=
y; }
35 template <
typename T>
inline T __vFOrdGreaterThan(T x, T y) {
36 return -
static_cast<T
>(
x >
y);
39 template <
typename T>
inline T __sFOrdGreaterThan(T x, T y) {
return x >
y; }
41 template <
typename T>
inline T __vFOrdGreaterThanEqual(T x, T y) {
42 return -
static_cast<T
>(
x >=
y);
45 template <
typename T>
inline T __sFOrdGreaterThanEqual(T x, T y) {
49 template <
typename T>
inline T __vFOrdLessThanEqual(T x, T y) {
50 return -
static_cast<T
>(
x <=
y);
53 template <
typename T>
inline T __sFOrdLessThanEqual(T x, T y) {
return x <=
y; }
55 template <
typename T>
inline T __vFOrdNotEqual(T x, T y) {
56 return -
static_cast<T
>((
x <
y) || (x > y));
59 template <
typename T>
inline T __sFOrdNotEqual(T x, T y) {
60 return ((x < y) || (x > y));
63 template <
typename T>
inline T __vLessOrGreater(T x, T y) {
64 return -
static_cast<T
>((
x <
y) || (x > y));
67 template <
typename T>
inline T __sLessOrGreater(T x, T y) {
68 return ((x < y) || (x > y));
74 template <
typename T>
inline T __vOrdered(T x, T y) {
75 return -
static_cast<T
>(
79 template <
typename T>
inline T __sOrdered(T x, T y) {
83 template <
typename T>
inline T __vUnordered(T x, T y) {
84 return -(
static_cast<T
>(
88 template <
typename T>
inline T __sUnordered(T x, T y) {
93 inline typename sycl::detail::enable_if_t<d::is_sgeninteger<T>::value, T>
94 __sycl_host_bitselect(T a, T b, T c) {
95 return (a & ~c) | (
b & c);
98 template <
typename T>
union databitset;
100 template <>
union databitset<
s::
cl_float> {
102 "size of cl_float is not equal to 32 bits(cl_int).");
110 "size of cl_double is not equal to 64 bits(cl_long).");
116 template <>
union databitset<
s::
cl_half> {
118 "size of cl_half is not equal to 16 bits(cl_short).");
123 template <
typename T>
124 typename sycl::detail::enable_if_t<d::is_sgenfloat<T>::value,
125 T>
inline __sycl_host_bitselect(T a, T b,
135 br.i = ((ba.i & ~bc.i) | (bb.i & bc.i));
139 template <
typename T,
typename T2>
140 inline T2 __sycl_host_select(T2 a, T2 b, T c) {
144 template <
typename T,
typename T2>
inline T2 __vselect(T2 a, T2 b, T c) {
153 return __sFOrdEqual(x, y);
157 return __sFOrdEqual(x, y);
161 return __sFOrdEqual(x, y);
173 return __sFUnordNotEqual(x, y);
177 return __sFUnordNotEqual(x, y);
181 return __sFUnordNotEqual(x, y);
193 return __sFOrdGreaterThan(x, y);
197 return __sFOrdGreaterThan(x, y);
201 return __sFOrdGreaterThan(x, y);
213 return __sFOrdGreaterThanEqual(x, y);
217 return __sFOrdGreaterThanEqual(x, y);
221 return __sFOrdGreaterThanEqual(x, y);
223 MAKE_1V_2V_FUNC(sycl_host_FOrdGreaterThanEqual, __vFOrdGreaterThanEqual,
225 MAKE_1V_2V_FUNC(sycl_host_FOrdGreaterThanEqual, __vFOrdGreaterThanEqual,
227 MAKE_1V_2V_FUNC(sycl_host_FOrdGreaterThanEqual, __vFOrdGreaterThanEqual,
263 return __sFOrdLessThanEqual(x, y);
267 return __sFOrdLessThanEqual(x, y);
271 return __sFOrdLessThanEqual(x, y);
283 return __sFOrdNotEqual(x, y);
287 return __sFOrdNotEqual(x, y);
291 return __sFOrdNotEqual(x, y);
303 return __sLessOrGreater(x, y);
307 return __sLessOrGreater(x, y);
311 return __sLessOrGreater(x, y);
322 return std::isfinite(x);
325 return std::isfinite(x);
328 return -
static_cast<s::cl_int>(std::isfinite(x));
331 return -
static_cast<s::cl_long>(std::isfinite(x));
345 return std::isinf(x);
348 return std::isinf(x);
351 return -
static_cast<s::cl_int>(std::isinf(x));
354 return -
static_cast<s::cl_long>(std::isinf(x));
392 return std::isnormal(x);
395 return std::isnormal(x);
398 return -
static_cast<s::cl_int>(std::isnormal(x));
401 return -
static_cast<s::cl_long>(std::isnormal(x));
416 return __sOrdered(x, y);
420 return __sOrdered(x, y);
423 return __sOrdered(x, y);
435 return __sUnordered(x, y);
439 return __sUnordered(x, y);
443 return __sUnordered(x, y);
454 return std::signbit(x);
457 return std::signbit(x);
460 return -
static_cast<s::cl_int>(std::signbit(x));
463 return -
static_cast<s::cl_long>(std::signbit(x));