summaryrefslogtreecommitdiff
path: root/sc/source/core/opencl/openclwrapper.hxx
diff options
context:
space:
mode:
authorTor Lillqvist <tml@iki.fi>2013-07-13 22:54:17 +0300
committerTor Lillqvist <tml@iki.fi>2013-07-14 09:27:55 +0300
commit46894ec48eb33dc99dab807c9fcaf0caa7c6cd84 (patch)
tree1373cf49bcd8d7e173ed87e3853bbc575a7e117b /sc/source/core/opencl/openclwrapper.hxx
parent542b45af44cae091735d9c2e11756a928e230261 (diff)
Use CL_MAP_WRITE_INVALIDATE_REGION only if defined (in OpenCL 1.2)
Can again turn on OpenCL by default for OS X then, hopefully. Change-Id: Id84b2c17c8431080261be45923d8c153f3822e8b
Diffstat (limited to 'sc/source/core/opencl/openclwrapper.hxx')
-rw-r--r--sc/source/core/opencl/openclwrapper.hxx14
1 files changed, 14 insertions, 0 deletions
diff --git a/sc/source/core/opencl/openclwrapper.hxx b/sc/source/core/opencl/openclwrapper.hxx
index d83b7c8f535c..1c798f172964 100644
--- a/sc/source/core/opencl/openclwrapper.hxx
+++ b/sc/source/core/opencl/openclwrapper.hxx
@@ -20,6 +20,20 @@
#include <CL/cl.h>
#endif
+// CL_MAP_WRITE_INVALIDATE_REGION is new in OpenCL 1.2.
+
+// When compiling against an older OpenCL, use CL_MAP_WRITE.
+
+// FIXME: But what if this code has been compiled against OpenCL 1.2
+// headers but then runs against an OpenCL 1.1 implementation?
+// Probably the code should check at run-time the version of the
+// OpenCL implementation and choose which flag to use based on that.
+#ifdef CL_MAP_WRITE_INVALIDATE_REGION
+#define OPENCLWRAPPER_CL_MAP_WRITE_FLAG CL_MAP_WRITE_INVALIDATE_REGION
+#else
+#define OPENCLWRAPPER_CL_MAP_WRITE_FLAG CL_MAP_WRITE
+#endif
+
#if defined(_MSC_VER)
#ifndef strcasecmp
#define strcasecmp strcmp