[libclc] 33/79: half_recip: Implement using 1/x

Andreas Boll aboll-guest at moszumanska.debian.org
Mon Mar 19 16:50:58 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 2b093d60b85f09c9dd98329ad6ee420ac64e5cf3
Author: Jan Vesely <jan.vesely at rutgers.edu>
Date:   Thu Jan 18 21:11:58 2018 +0000

    half_recip: Implement using 1/x
    
    Passes CTS on carrizo
    v2: Use full precision implementation
    
    Reviewer: Jeroen Ketema <j.ketema at xs4all.nl>
    Signed-off-by: Jan Vesely <jan.vesely at rutgers.edu>
    
    git-svn-id: https://llvm.org/svn/llvm-project/libclc/trunk@322896 91177308-0d34-0410-b5e6-96231b3b80d8
---
 generic/include/clc/clc.h             |  1 +
 generic/include/clc/math/half_recip.h |  9 +++++++++
 generic/lib/SOURCES                   |  1 +
 generic/lib/math/half_recip.cl        | 10 ++++++++++
 4 files changed, 21 insertions(+)

diff --git a/generic/include/clc/clc.h b/generic/include/clc/clc.h
index a52ed5d..8be8b38 100644
--- a/generic/include/clc/clc.h
+++ b/generic/include/clc/clc.h
@@ -77,6 +77,7 @@
 #include <clc/math/half_log.h>
 #include <clc/math/half_log10.h>
 #include <clc/math/half_log2.h>
+#include <clc/math/half_recip.h>
 #include <clc/math/half_rsqrt.h>
 #include <clc/math/half_sqrt.h>
 #include <clc/math/hypot.h>
diff --git a/generic/include/clc/math/half_recip.h b/generic/include/clc/math/half_recip.h
new file mode 100644
index 0000000..17f4ba8
--- /dev/null
+++ b/generic/include/clc/math/half_recip.h
@@ -0,0 +1,9 @@
+#define __CLC_BODY <clc/math/unary_decl.inc>
+#define __CLC_FUNCTION half_recip
+#define __FLOAT_ONLY
+
+#include <clc/math/gentype.inc>
+
+#undef __FLOAT_ONLY
+#undef __CLC_BODY
+#undef __CLC_FUNCTION
diff --git a/generic/lib/SOURCES b/generic/lib/SOURCES
index 11a4ca8..ee28690 100644
--- a/generic/lib/SOURCES
+++ b/generic/lib/SOURCES
@@ -111,6 +111,7 @@ math/half_exp2.cl
 math/half_log.cl
 math/half_log10.cl
 math/half_log2.cl
+math/half_recip.cl
 math/half_rsqrt.cl
 math/half_sqrt.cl
 math/hypot.cl
diff --git a/generic/lib/math/half_recip.cl b/generic/lib/math/half_recip.cl
new file mode 100644
index 0000000..c0b5c00
--- /dev/null
+++ b/generic/lib/math/half_recip.cl
@@ -0,0 +1,10 @@
+#include <clc/clc.h>
+
+#define recip(x) (1.0f/x)
+
+#define __CLC_FUNC recip
+#define __CLC_BODY <half_unary.inc>
+#define __FLOAT_ONLY
+#include <clc/math/gentype.inc>
+
+#undef recip

-- 
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