[libclc] 36/79: half_divide: Implement using x/y
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 fdd3ddeac3b203c30321f4d4756de7ffbf8606d0
Author: Jan Vesely <jan.vesely at rutgers.edu>
Date: Thu Jan 18 21:12:06 2018 +0000
half_divide: Implement using x/y
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@322899 91177308-0d34-0410-b5e6-96231b3b80d8
---
generic/include/clc/clc.h | 1 +
generic/include/clc/math/half_divide.h | 7 +++++++
generic/lib/SOURCES | 1 +
generic/lib/math/half_binary.inc | 9 +++++++++
generic/lib/math/half_divide.cl | 9 +++++++++
5 files changed, 27 insertions(+)
diff --git a/generic/include/clc/clc.h b/generic/include/clc/clc.h
index 9e4b185..930bbfc 100644
--- a/generic/include/clc/clc.h
+++ b/generic/include/clc/clc.h
@@ -71,6 +71,7 @@
#include <clc/math/fract.h>
#include <clc/math/frexp.h>
#include <clc/math/half_cos.h>
+#include <clc/math/half_divide.h>
#include <clc/math/half_exp.h>
#include <clc/math/half_exp10.h>
#include <clc/math/half_exp2.h>
diff --git a/generic/include/clc/math/half_divide.h b/generic/include/clc/math/half_divide.h
new file mode 100644
index 0000000..84096b9
--- /dev/null
+++ b/generic/include/clc/math/half_divide.h
@@ -0,0 +1,7 @@
+#define __CLC_BODY <clc/math/binary_decl_tt.inc>
+#define __CLC_FUNCTION half_divide
+
+#include <clc/math/gentype.inc>
+
+#undef __CLC_BODY
+#undef __CLC_FUNCTION
diff --git a/generic/lib/SOURCES b/generic/lib/SOURCES
index c0d1238..9dbd35e 100644
--- a/generic/lib/SOURCES
+++ b/generic/lib/SOURCES
@@ -105,6 +105,7 @@ math/fmod.cl
math/fract.cl
math/frexp.cl
math/half_cos.cl
+math/half_divide.cl
math/half_exp.cl
math/half_exp10.cl
math/half_exp2.cl
diff --git a/generic/lib/math/half_binary.inc b/generic/lib/math/half_binary.inc
new file mode 100644
index 0000000..f831b53
--- /dev/null
+++ b/generic/lib/math/half_binary.inc
@@ -0,0 +1,9 @@
+#include <utils.h>
+
+#define __CLC_HALF_FUNC(x) __CLC_CONCAT(half_, x)
+
+_CLC_OVERLOAD _CLC_DEF __CLC_GENTYPE __CLC_HALF_FUNC(__CLC_FUNC)(__CLC_GENTYPE x, __CLC_GENTYPE y) {
+ return __CLC_FUNC(x, y);
+}
+
+#undef __CLC_HALF_FUNC
diff --git a/generic/lib/math/half_divide.cl b/generic/lib/math/half_divide.cl
new file mode 100644
index 0000000..ee9c895
--- /dev/null
+++ b/generic/lib/math/half_divide.cl
@@ -0,0 +1,9 @@
+#include <clc/clc.h>
+
+#define divide(x,y) (x/y)
+
+#define __CLC_FUNC divide
+#define __CLC_BODY <half_binary.inc>
+#define __FLOAT_ONLY
+#include <clc/math/gentype.inc>
+#undef divide
--
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