diff --git a/sycl/source/detail/builtins_common.cpp b/sycl/source/detail/builtins_common.cpp index 130eb1ad1d9ed..7e813d3273a91 100644 --- a/sycl/source/detail/builtins_common.cpp +++ b/sycl/source/detail/builtins_common.cpp @@ -26,35 +26,32 @@ __SYCL_INLINE_NAMESPACE(cl) { namespace __host_std { namespace { -template __SYCL_EXPORT inline T __fclamp(T x, T minval, T maxval) { +template inline T __fclamp(T x, T minval, T maxval) { return std::fmin(std::fmax(x, minval), maxval); } -template __SYCL_EXPORT inline T __degrees(T radians) { +template inline T __degrees(T radians) { return (180 / M_PI) * radians; } -template __SYCL_EXPORT inline T __mix(T x, T y, T a) { - return x + (y - x) * a; -} +template inline T __mix(T x, T y, T a) { return x + (y - x) * a; } -template __SYCL_EXPORT inline T __radians(T degrees) { +template inline T __radians(T degrees) { return (M_PI / 180) * degrees; } -template __SYCL_EXPORT inline T __step(T edge, T x) { +template inline T __step(T edge, T x) { return (x < edge) ? 0.0 : 1.0; } -template -__SYCL_EXPORT inline T __smoothstep(T edge0, T edge1, T x) { +template inline T __smoothstep(T edge0, T edge1, T x) { T t; T v = (x - edge0) / (edge1 - edge0); t = __fclamp(v, T(0), T(1)); return t * t * (3 - 2 * t); } -template __SYCL_EXPORT inline T __sign(T x) { +template inline T __sign(T x) { if (std::isnan(d::cast_if_host_half(x))) return T(0.0); if (x > 0)