[libclc] 09/291: Add fabs builtin.

Andreas Beckmann anbe at moszumanska.debian.org
Tue Sep 8 10:53:27 UTC 2015


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

anbe pushed a commit to branch master
in repository libclc.

commit 117180439615bd06e7a536e61270af9ea6b1406e
Author: Peter Collingbourne <peter at pcc.me.uk>
Date:   Mon May 28 22:22:13 2012 +0000

    Add fabs builtin.
    
    git-svn-id: https://llvm.org/svn/llvm-project/libclc/trunk@157595 91177308-0d34-0410-b5e6-96231b3b80d8
---
 generic/include/clc/clc.h       | 1 +
 generic/include/clc/math/fabs.h | 6 ++++++
 test/fabs.cl                    | 3 +++
 3 files changed, 10 insertions(+)

diff --git a/generic/include/clc/clc.h b/generic/include/clc/clc.h
index f2536bc..72e2f23 100644
--- a/generic/include/clc/clc.h
+++ b/generic/include/clc/clc.h
@@ -33,6 +33,7 @@
 
 /* 6.11.2 Math Functions */
 #include <clc/math/cos.h>
+#include <clc/math/fabs.h>
 #include <clc/math/sin.h>
 #include <clc/math/sqrt.h>
 #include <clc/math/native_cos.h>
diff --git a/generic/include/clc/math/fabs.h b/generic/include/clc/math/fabs.h
new file mode 100644
index 0000000..4da013c
--- /dev/null
+++ b/generic/include/clc/math/fabs.h
@@ -0,0 +1,6 @@
+#undef fabs
+#define fabs __clc_fabs
+
+#define FUNCTION __clc_fabs
+#define INTRINSIC "llvm.fabs"
+#include <clc/math/unary_intrin.inc>
diff --git a/test/fabs.cl b/test/fabs.cl
new file mode 100644
index 0000000..91d42c4
--- /dev/null
+++ b/test/fabs.cl
@@ -0,0 +1,3 @@
+__kernel void foo(float *f) {
+  *f = fabs(*f);
+}

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