summaryrefslogtreecommitdiff
path: root/generic/lib
diff options
context:
space:
mode:
authorPeter Collingbourne <peter@pcc.me.uk>2012-05-29 13:35:45 +0000
committerPeter Collingbourne <peter@pcc.me.uk>2012-05-29 13:35:45 +0000
commitf69df75b298de2fb5b63e59ee4911d14cc6e462b (patch)
treee2969100849f05f9466f3826b0ad629d970e953f /generic/lib
parent54397b81aa3d5f5b871423368cca162a27a6e98f (diff)
Add missing dot.h include.
git-svn-id: https://llvm.org/svn/llvm-project/libclc/trunk@157615 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'generic/lib')
-rw-r--r--generic/lib/geometric/dot.cl22
1 files changed, 22 insertions, 0 deletions
diff --git a/generic/lib/geometric/dot.cl b/generic/lib/geometric/dot.cl
index 76cc1d2..0d6fe6c 100644
--- a/generic/lib/geometric/dot.cl
+++ b/generic/lib/geometric/dot.cl
@@ -15,3 +15,25 @@ _CLC_OVERLOAD _CLC_DEF float dot(float3 p0, float3 p1) {
_CLC_OVERLOAD _CLC_DEF float dot(float4 p0, float4 p1) {
return p0.x*p1.x + p0.y*p1.y + p0.z*p1.z + p0.w*p1.w;
}
+
+#ifdef cl_khr_fp64
+
+#pragma OPENCL EXTENSION cl_khr_fp64 : enable
+
+_CLC_OVERLOAD _CLC_DEF double dot(double p0, double p1) {
+ return p0*p1;
+}
+
+_CLC_OVERLOAD _CLC_DEF double dot(double2 p0, double2 p1) {
+ return p0.x*p1.x + p0.y*p1.y;
+}
+
+_CLC_OVERLOAD _CLC_DEF double dot(double3 p0, double3 p1) {
+ return p0.x*p1.x + p0.y*p1.y + p0.z*p1.z;
+}
+
+_CLC_OVERLOAD _CLC_DEF double dot(double4 p0, double4 p1) {
+ return p0.x*p1.x + p0.y*p1.y + p0.z*p1.z + p0.w*p1.w;
+}
+
+#endif