[libclc] 49/79: amdgpu/half_rsqrt: Switch implementation to native_rsqrt

Andreas Boll aboll-guest at moszumanska.debian.org
Mon Mar 19 16:50:59 UTC 2018


This is an automated email from the git hooks/post-receive script.

aboll-guest pushed a commit to branch master
in repository libclc.

commit 7c4255efce75f3b2694d2a5f2f8f9e3b536d985b
Author: Jan Vesely <jan.vesely at rutgers.edu>
Date:   Tue Feb 13 22:09:31 2018 +0000

    amdgpu/half_rsqrt: Switch implementation to native_rsqrt
    
    Reviewer: Tom Stellard <tstellar at redhat.com>
    Signed-off-by: Jan Vesely <jan.vesely at rutgers.edu>
    
    git-svn-id: https://llvm.org/svn/llvm-project/libclc/trunk@325053 91177308-0d34-0410-b5e6-96231b3b80d8
---
 amdgpu/lib/SOURCES                    |  1 +
 amdgpu/lib/math/half_native_unary.inc | 11 +++++++++++
 amdgpu/lib/math/half_rsqrt.cl         |  6 ++++++
 3 files changed, 18 insertions(+)

diff --git a/amdgpu/lib/SOURCES b/amdgpu/lib/SOURCES
index 20322ec..461c773 100644
--- a/amdgpu/lib/SOURCES
+++ b/amdgpu/lib/SOURCES
@@ -1,5 +1,6 @@
 math/native_exp.cl
 math/native_log.cl
 math/native_log10.cl
+math/half_rsqrt.cl
 math/nextafter.cl
 math/sqrt.cl
diff --git a/amdgpu/lib/math/half_native_unary.inc b/amdgpu/lib/math/half_native_unary.inc
new file mode 100644
index 0000000..0f99ba5
--- /dev/null
+++ b/amdgpu/lib/math/half_native_unary.inc
@@ -0,0 +1,11 @@
+#include <utils.h>
+
+#define __CLC_HALF_FUNC(x) __CLC_CONCAT(half_, x)
+#define __CLC_NATIVE_FUNC(x) __CLC_CONCAT(native_, x)
+
+_CLC_OVERLOAD _CLC_DEF __CLC_GENTYPE __CLC_HALF_FUNC(__CLC_FUNC)(__CLC_GENTYPE val) {
+	return __CLC_NATIVE_FUNC(__CLC_FUNC)(val);
+}
+
+#undef __CLC_NATIVE_FUNC
+#undef __CLC_HALF_FUNC
diff --git a/amdgpu/lib/math/half_rsqrt.cl b/amdgpu/lib/math/half_rsqrt.cl
new file mode 100644
index 0000000..9056690
--- /dev/null
+++ b/amdgpu/lib/math/half_rsqrt.cl
@@ -0,0 +1,6 @@
+#include <clc/clc.h>
+ 
+#define __CLC_FUNC rsqrt
+#define __FLOAT_ONLY
+#define __CLC_BODY <half_native_unary.inc>
+#include <clc/math/gentype.inc>

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-opencl/libclc.git



More information about the Pkg-opencl-commits mailing list