[libclc] r236940 - geometric: Limit fast_{distance, length} functions to single precision
Jan Vesely
jan.vesely at rutgers.edu
Sat May 9 15:31:02 PDT 2015
Author: jvesely
Date: Sat May 9 17:31:01 2015
New Revision: 236940
URL: http://llvm.org/viewvc/llvm-project?rev=236940&view=rev
Log:
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>
Modified:
libclc/trunk/generic/include/clc/geometric/fast_distance.h
libclc/trunk/generic/include/clc/geometric/fast_length.h
libclc/trunk/generic/lib/geometric/fast_distance.cl
libclc/trunk/generic/lib/geometric/fast_length.cl
Modified: libclc/trunk/generic/include/clc/geometric/fast_distance.h
URL: http://llvm.org/viewvc/llvm-project/libclc/trunk/generic/include/clc/geometric/fast_distance.h?rev=236940&r1=236939&r2=236940&view=diff
==============================================================================
--- libclc/trunk/generic/include/clc/geometric/fast_distance.h (original)
+++ libclc/trunk/generic/include/clc/geometric/fast_distance.h Sat May 9 17:31:01 2015
@@ -21,4 +21,6 @@
*/
#define __CLC_BODY <clc/geometric/fast_distance.inc>
+#define __FLOAT_ONLY
#include <clc/geometric/floatn.inc>
+#undef __FLOAT_ONLY
Modified: libclc/trunk/generic/include/clc/geometric/fast_length.h
URL: http://llvm.org/viewvc/llvm-project/libclc/trunk/generic/include/clc/geometric/fast_length.h?rev=236940&r1=236939&r2=236940&view=diff
==============================================================================
--- libclc/trunk/generic/include/clc/geometric/fast_length.h (original)
+++ libclc/trunk/generic/include/clc/geometric/fast_length.h Sat May 9 17:31:01 2015
@@ -21,4 +21,6 @@
*/
#define __CLC_BODY <clc/geometric/fast_length.inc>
+#define __FLOAT_ONLY
#include <clc/geometric/floatn.inc>
+#undef __FLOAT_ONLY
Modified: libclc/trunk/generic/lib/geometric/fast_distance.cl
URL: http://llvm.org/viewvc/llvm-project/libclc/trunk/generic/lib/geometric/fast_distance.cl?rev=236940&r1=236939&r2=236940&view=diff
==============================================================================
--- libclc/trunk/generic/lib/geometric/fast_distance.cl (original)
+++ libclc/trunk/generic/lib/geometric/fast_distance.cl Sat May 9 17:31:01 2015
@@ -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
Modified: libclc/trunk/generic/lib/geometric/fast_length.cl
URL: http://llvm.org/viewvc/llvm-project/libclc/trunk/generic/lib/geometric/fast_length.cl?rev=236940&r1=236939&r2=236940&view=diff
==============================================================================
--- libclc/trunk/generic/lib/geometric/fast_length.cl (original)
+++ libclc/trunk/generic/lib/geometric/fast_length.cl Sat May 9 17:31:01 2015
@@ -37,24 +37,3 @@ _CLC_OVERLOAD _CLC_DEF float fast_length
_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
More information about the cfe-commits
mailing list