From a77d7686f74796f004ea8260f8874df518db7279 Mon Sep 17 00:00:00 2001 From: Alexander Batashev Date: Wed, 22 Apr 2020 12:13:44 +0300 Subject: [PATCH 1/2] [SYCL] Fix conflicting visibility attributes Signed-off-by: Alexander Batashev --- sycl/source/detail/builtins_common.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/sycl/source/detail/builtins_common.cpp b/sycl/source/detail/builtins_common.cpp index 130eb1ad1d9ed..076236723624a 100644 --- a/sycl/source/detail/builtins_common.cpp +++ b/sycl/source/detail/builtins_common.cpp @@ -26,35 +26,35 @@ __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) { +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) { +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) From b7bc183c6ab619b2291f159a492a6fb168b62ca7 Mon Sep 17 00:00:00 2001 From: Alexander Batashev Date: Wed, 22 Apr 2020 15:10:33 +0300 Subject: [PATCH 2/2] Clang-format Signed-off-by: Alexander Batashev --- sycl/source/detail/builtins_common.cpp | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/sycl/source/detail/builtins_common.cpp b/sycl/source/detail/builtins_common.cpp index 076236723624a..7e813d3273a91 100644 --- a/sycl/source/detail/builtins_common.cpp +++ b/sycl/source/detail/builtins_common.cpp @@ -34,9 +34,7 @@ template inline T __degrees(T radians) { return (180 / M_PI) * radians; } -template 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 inline T __radians(T degrees) { return (M_PI / 180) * degrees; @@ -46,8 +44,7 @@ template inline T __step(T edge, T x) { return (x < edge) ? 0.0 : 1.0; } -template -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));