[libclc] 263/291: geometric: Limit fast_{distance, length} functions to single precision

Andreas Beckmann anbe at moszumanska.debian.org
Tue Sep 8 10:53:58 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 b25cbb32d726217f60c9ac24ba6cdeeff2c80b8c
Author: Jan Vesely <jan.vesely at rutgers.edu>
Date:   Sat May 9 22:31:01 2015 +0000

    geometric: Limit fast_{distance,length} functions to single precision
    
    Signed-off-by: Jan Vesely <jan.vesely at rutgers.edu>
    Reviewed-by: Tom Stellard <thomas.stellard at amd.com>
    
    git-svn-id: https://llvm.org/svn/llvm-project/libclc/trunk@236940 91177308-0d34-0410-b5e6-96231b3b80d8
---
 generic/include/clc/geometric/fast_distance.h |  2 ++
 generic/include/clc/geometric/fast_length.h   |  2 ++
 generic/lib/geometric/fast_distance.cl        |  6 ++----
 generic/lib/geometric/fast_length.cl          | 21 ---------------------
 4 files changed, 6 insertions(+), 25 deletions(-)

diff --git a/generic/include/clc/geometric/fast_distance.h b/generic/include/clc/geometric/fast_distance.h
index 91b3fe5..a84f70b 100644
--- a/generic/include/clc/geometric/fast_distance.h
+++ b/generic/include/clc/geometric/fast_distance.h
@@ -21,4 +21,6 @@
  */
 
 #define __CLC_BODY <clc/geometric/fast_distance.inc>
+#define __FLOAT_ONLY
 #include <clc/geometric/floatn.inc>
+#undef __FLOAT_ONLY
diff --git a/generic/include/clc/geometric/fast_length.h b/generic/include/clc/geometric/fast_length.h
index 2c7b80a..1d894b6 100644
--- a/generic/include/clc/geometric/fast_length.h
+++ b/generic/include/clc/geometric/fast_length.h
@@ -21,4 +21,6 @@
  */
 
 #define __CLC_BODY <clc/geometric/fast_length.inc>
+#define __FLOAT_ONLY
 #include <clc/geometric/floatn.inc>
+#undef __FLOAT_ONLY
diff --git a/generic/lib/geometric/fast_distance.cl b/generic/lib/geometric/fast_distance.cl
index 47c9d7a..0a4f82c 100644
--- a/generic/lib/geometric/fast_distance.cl
+++ b/generic/lib/geometric/fast_distance.cl
@@ -22,9 +22,7 @@
 
 #include <clc/clc.h>
 
-#ifdef cl_khr_fp64
-#pragma OPENCL EXTENSION cl_khr_fp64 : enable
-#endif
-
 #define __CLC_BODY <fast_distance.inc>
+#define __FLOAT_ONLY
 #include <clc/geometric/floatn.inc>
+#undef __FLOAT_ONLY
diff --git a/generic/lib/geometric/fast_length.cl b/generic/lib/geometric/fast_length.cl
index 425dcf7..8f6ffc6 100644
--- a/generic/lib/geometric/fast_length.cl
+++ b/generic/lib/geometric/fast_length.cl
@@ -37,24 +37,3 @@ _CLC_OVERLOAD _CLC_DEF float fast_length(float3 p) {
 _CLC_OVERLOAD _CLC_DEF float fast_length(float4 p) {
   return half_sqrt(dot(p, p));
 }
-
-#ifdef cl_khr_fp64
-#pragma OPENCL EXTENSION cl_khr_fp64 : enable
-
-_CLC_OVERLOAD _CLC_DEF double fast_length(double p) {
-  return fabs(p);
-}
-
-_CLC_OVERLOAD _CLC_DEF double fast_length(double2 p) {
-  return half_sqrt(dot(p, p));
-}
-
-_CLC_OVERLOAD _CLC_DEF double fast_length(double3 p) {
-  return half_sqrt(dot(p, p));
-}
-
-_CLC_OVERLOAD _CLC_DEF double fast_length(double4 p) {
-  return half_sqrt(dot(p, p));
-}
-
-#endif

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