18 namespace d = s::detail;
21 namespace __host_std {
24 template <
typename T>
inline T __vFOrdEqual(
T x,
T y) {
25 return -
static_cast<T>(x == y);
28 template <
typename T>
inline T __sFOrdEqual(
T x,
T y) {
return x == y; }
31 return -
static_cast<T>(x != y);
34 template <
typename T>
inline T __sFUnordNotEqual(
T x,
T y) {
return x != y; }
36 template <
typename T>
inline T __vFOrdGreaterThan(
T x,
T y) {
37 return -
static_cast<T>(x > y);
40 template <
typename T>
inline T __sFOrdGreaterThan(
T x,
T y) {
return x > y; }
42 template <
typename T>
inline T __vFOrdGreaterThanEqual(
T x,
T y) {
43 return -
static_cast<T>(x >= y);
46 template <
typename T>
inline T __sFOrdGreaterThanEqual(
T x,
T y) {
50 template <
typename T>
inline T __vFOrdLessThanEqual(
T x,
T y) {
51 return -
static_cast<T>(x <= y);
54 template <
typename T>
inline T __sFOrdLessThanEqual(
T x,
T y) {
return x <= y; }
56 template <
typename T>
inline T __vFOrdNotEqual(
T x,
T y) {
57 return -
static_cast<T>((x < y) || (x > y));
60 template <
typename T>
inline T __sFOrdNotEqual(
T x,
T y) {
61 return ((x < y) || (x > y));
64 template <
typename T>
inline T __vLessOrGreater(
T x,
T y) {
65 return -
static_cast<T>((x < y) || (x > y));
68 template <
typename T>
inline T __sLessOrGreater(
T x,
T y) {
69 return ((x < y) || (x > y));
75 template <
typename T>
inline T __vOrdered(
T x,
T y) {
76 return -
static_cast<T>(
80 template <
typename T>
inline T __sOrdered(
T x,
T y) {
84 template <
typename T>
inline T __vUnordered(
T x,
T y) {
85 return -(
static_cast<T>(
89 template <
typename T>
inline T __sUnordered(
T x,
T y) {
94 inline typename sycl::detail::enable_if_t<d::is_sgeninteger<T>::value,
T>
95 __bitselect(
T a,
T b,
T c) {
96 return (a & ~c) | (
b & c);
99 template <
typename T>
union databitset;
101 template <>
union databitset<
s::
cl_float> {
103 "size of cl_float is not equal to 32 bits(cl_int).");
111 "size of cl_double is not equal to 64 bits(cl_long).");
117 template <>
union databitset<
s::
cl_half> {
119 "size of cl_half is not equal to 16 bits(cl_short).");
124 template <
typename T>
125 typename sycl::detail::enable_if_t<d::is_sgenfloat<T>::value,
126 T>
inline __bitselect(
T a,
T b,
T c) {
135 br.i = ((ba.i & ~bc.i) | (bb.i & bc.i));
139 template <
typename T,
typename T2>
inline T2 __select(T2 a, T2 b,
T c) {
143 template <
typename T,
typename T2>
inline T2 __vselect(T2 a, T2 b,
T c) {
151 return __sFOrdEqual(x, y);
154 return __sFOrdEqual(x, y);
157 return __sFOrdEqual(x, y);
165 return __sFUnordNotEqual(x, y);
168 return __sFUnordNotEqual(x, y);
171 return __sFUnordNotEqual(x, y);
182 return __sFOrdGreaterThan(x, y);
186 return __sFOrdGreaterThan(x, y);
189 return __sFOrdGreaterThan(x, y);
201 return __sFOrdGreaterThanEqual(x, y);
205 return __sFOrdGreaterThanEqual(x, y);
209 return __sFOrdGreaterThanEqual(x, y);
248 return __sFOrdLessThanEqual(x, y);
252 return __sFOrdLessThanEqual(x, y);
255 return __sFOrdLessThanEqual(x, y);
266 return __sFOrdNotEqual(x, y);
269 return __sFOrdNotEqual(x, y);
272 return __sFOrdNotEqual(x, y);
283 return __sLessOrGreater(x, y);
286 return __sLessOrGreater(x, y);
289 return __sLessOrGreater(x, y);
385 return __sOrdered(x, y);
388 return __sOrdered(x, y);
391 return __sOrdered(x, y);
399 return __sUnordered(x, y);
402 return __sUnordered(x, y);
405 return __sUnordered(x, y);