summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
authorTor Lillqvist <tml@collabora.com>2013-09-30 14:27:38 +0300
committerTor Lillqvist <tml@collabora.com>2013-09-30 16:57:38 +0300
commitab683542cd78e225a2e11e405e1cd8cfce99461a (patch)
tree95c3bc300a7e7819772fdc348171875a9e42bfd5 /sc
parent723afc607ec3e947afa0f2122751ea537bca62bd (diff)
Revert "Fix OpenCL use on Mac"
Nah, do use clew after all. Makes it easier to build against an old SDK. Do always link against the OpenCL framework, though, and use NULL instead of some dylib name as the parameter to clewInit() (and thus dlopen()). This reverts commit d0fdae78797979949ec7ead20ad52b901c8c7e9a. Change-Id: I2ec07ddf60941851ea70523113296627fbd80a0c
Diffstat (limited to 'sc')
-rw-r--r--sc/Library_scopencl.mk3
-rw-r--r--sc/source/core/opencl/openclwrapper.cxx8
-rw-r--r--sc/source/core/opencl/openclwrapper.hxx8
3 files changed, 4 insertions, 15 deletions
diff --git a/sc/Library_scopencl.mk b/sc/Library_scopencl.mk
index c2ca1f397189..cb702e867eda 100644
--- a/sc/Library_scopencl.mk
+++ b/sc/Library_scopencl.mk
@@ -36,8 +36,7 @@ $(eval $(call gb_Library_use_libraries,scopencl,\
$(eval $(call gb_Library_add_exception_objects,scopencl,\
sc/source/core/opencl/formulagroupcl \
sc/source/core/opencl/openclwrapper \
- $(if $(filter-out MACOSX,$(OS)), \
- sc/source/core/opencl/clcc/clew) \
+ sc/source/core/opencl/clcc/clew \
))
ifeq ($(OS),LINUX)
diff --git a/sc/source/core/opencl/openclwrapper.cxx b/sc/source/core/opencl/openclwrapper.cxx
index 50bb0d1602e1..6fa86cc7e6d6 100644
--- a/sc/source/core/opencl/openclwrapper.cxx
+++ b/sc/source/core/opencl/openclwrapper.cxx
@@ -41,7 +41,9 @@
fprintf(stderr,"[OCL_ERROR] %s\n",str);
#define OPENCL_DLL_NAME "OpenCL.dll"
-#elif !defined(MACOSX)
+#elif defined(MACOSX)
+#define OPENCL_DLL_NAME NULL
+#else
#define OPENCL_DLL_NAME "libOpenCL.so"
#endif
@@ -2609,11 +2611,9 @@ bool createPlatformInfo(cl_platform_id nPlatformId, OpenclPlatformInfo& rPlatfor
size_t getOpenCLPlatformCount()
{
-#ifndef MACOSX
int status = clewInit(OPENCL_DLL_NAME);
if (status < 0)
return 0;
-#endif
cl_uint nPlatforms;
cl_int nState = clGetPlatformIDs(0, NULL, &nPlatforms);
@@ -2630,11 +2630,9 @@ const std::vector<OpenclPlatformInfo>& fillOpenCLInfo()
if(!aPlatforms.empty())
return aPlatforms;
-#ifndef MACOSX
int status = clewInit(OPENCL_DLL_NAME);
if (status < 0)
return aPlatforms;
-#endif
cl_uint nPlatforms;
cl_int nState = clGetPlatformIDs(0, NULL, &nPlatforms);
diff --git a/sc/source/core/opencl/openclwrapper.hxx b/sc/source/core/opencl/openclwrapper.hxx
index 5fd39916211c..c81c313dd96d 100644
--- a/sc/source/core/opencl/openclwrapper.hxx
+++ b/sc/source/core/opencl/openclwrapper.hxx
@@ -21,16 +21,8 @@
#include <rtl/string.hxx>
-#ifdef MACOSX
-
-#include <OpenCL/cl.h>
-
-#else
-
#include "clcc/clew.h"
-#endif
-
// CL_MAP_WRITE_INVALIDATE_REGION is new in OpenCL 1.2.
// When compiling against an older OpenCL, use CL_MAP_WRITE.