DPC++ Runtime
Runtime libraries for oneAPI DPC++
|
|
Go to the documentation of this file.
16 #define _USE_MATH_DEFINES
23 namespace d = s::detail;
26 namespace __host_std {
29 template <
typename T>
inline T __fclamp(
T x,
T minval,
T maxval) {
30 return std::fmin(std::fmax(x, minval), maxval);
33 template <
typename T>
inline T __degrees(
T radians) {
37 template <
typename T>
inline T __mix(
T x,
T y,
T a) {
return x + (y - x) * a; }
39 template <
typename T>
inline T __radians(
T degrees) {
43 template <
typename T>
inline T __step(
T edge,
T x) {
44 return (x < edge) ? 0.0 : 1.0;
47 template <
typename T>
inline T __smoothstep(
T edge0,
T edge1,
T x) {
49 T v = (x - edge0) / (edge1 - edge0);
50 t = __fclamp(v,
T(0),
T(1));
51 return t * t * (3 - 2 * t);
54 template <
typename T>
inline T __sign(
T x) {
71 return __fclamp(x, minval, maxval);
75 return __fclamp(x, minval, maxval);
79 return __fclamp(x, minval, maxval);
101 return std::fmin(x, y);
104 return std::fmin(x, y);
107 return std::fmin(x, y);
115 return std::fmax(x, y);
118 return std::fmax(x, y);
121 return std::fmax(x, y);
130 return __mix(x, y, a);
134 return __mix(x, y, a);
137 return __mix(x, y, a);
159 return __step(edge, x);
162 return __step(edge, x);
165 return __step(edge, x);
174 return __smoothstep(edge0, edge1, x);
178 return __smoothstep(edge0, edge1, x);
182 return __smoothstep(edge0, edge1, x);
s::cl_half degrees(s::cl_half radians) __NOEXC
T cast_if_host_half(T val)
#define MAKE_1V_2V_3V(Fun, Ret, Arg1, Arg2, Arg3)
#define MAKE_1V_2V(Fun, Ret, Arg1, Arg2)
detail::common_rel_ret_t< T > isnan(T x) __NOEXC
s::cl_half smoothstep(s::cl_half edge0, s::cl_half edge1, s::cl_half x) __NOEXC
s::cl_half fmax_common(s::cl_half x, s::cl_half y) __NOEXC
We provide new interfaces for matrix muliply in this patch:
detail::enable_if_t< detail::is_genfloat< T >::value, T > sign(T x) __NOEXC
s::cl_half step(s::cl_half edge, s::cl_half x) __NOEXC
s::cl_half fclamp(s::cl_half x, s::cl_half minval, s::cl_half maxval) __NOEXC
s::cl_half mix(s::cl_half x, s::cl_half y, s::cl_half a) __NOEXC
#define MAKE_1V(Fun, Ret, Arg1)
s::cl_half fmin_common(s::cl_half x, s::cl_half y) __NOEXC
#define __SYCL_INLINE_NAMESPACE(X)
s::cl_half radians(s::cl_half degrees) __NOEXC