summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
authorKohei Yoshida <kohei.yoshida@collabora.com>2013-09-10 21:09:24 -0400
committerMarkus Mohrhard <markus.mohrhard@googlemail.com>2013-09-19 17:03:15 +0200
commit4ecf503924516979970254eb3783f68037647ac3 (patch)
treede67bcdd61ce10b77aca4964a349e9f0de83897d /sc
parentf22e509c2b31ee2ed024412af5b55bf8944e76b4 (diff)
First step toward splitting the opencl code into own shared library.
Change-Id: I44fa3ded8d48b2972af17b78ab6c0af03e024f36
Diffstat (limited to 'sc')
-rw-r--r--sc/Library_sc.mk9
-rw-r--r--sc/Library_scopencl.mk37
-rw-r--r--sc/Module_sc.mk6
-rw-r--r--sc/inc/document.hxx2
-rw-r--r--sc/source/core/opencl/openclwrapper.cxx1
-rw-r--r--sc/source/core/tool/formulagroup.cxx16
6 files changed, 60 insertions, 11 deletions
diff --git a/sc/Library_sc.mk b/sc/Library_sc.mk
index bd1a9a3b2805..d1987371f327 100644
--- a/sc/Library_sc.mk
+++ b/sc/Library_sc.mk
@@ -54,15 +54,6 @@ $(eval $(call gb_Library_add_exception_objects,sc,\
))
endif
-ifeq ($(ENABLE_OPENCL),TRUE)
-$(eval $(call gb_Library_use_externals,sc,opencl))
-
-$(eval $(call gb_Library_add_exception_objects,sc,\
- sc/source/core/opencl/formulagroupcl \
- sc/source/core/opencl/openclwrapper \
-))
-endif
-
$(eval $(call gb_Library_use_libraries,sc,\
avmedia \
basegfx \
diff --git a/sc/Library_scopencl.mk b/sc/Library_scopencl.mk
new file mode 100644
index 000000000000..f30f9c4a89ea
--- /dev/null
+++ b/sc/Library_scopencl.mk
@@ -0,0 +1,37 @@
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_Library_Library,scopencl))
+
+$(eval $(call gb_Library_set_include,scopencl,\
+ -I$(SRCDIR)/sc/source/core/inc \
+ -I$(SRCDIR)/sc/inc \
+ $$(INCLUDE) \
+))
+
+$(eval $(call gb_Library_set_precompiled_header,scopencl,$(SRCDIR)/sc/inc/pch/precompiled_scopencl))
+
+$(eval $(call gb_Library_use_sdk_api,scopencl))
+
+$(eval $(call gb_Library_use_libraries,scopencl,\
+ for \
+ forui \
+ sal \
+ sc \
+ $(gb_UWINAPI) \
+))
+
+$(eval $(call gb_Library_use_externals,scopencl,opencl))
+
+$(eval $(call gb_Library_add_exception_objects,scopencl,\
+ sc/source/core/opencl/formulagroupcl \
+ sc/source/core/opencl/openclwrapper \
+))
+
+# vim: set noet sw=4 ts=4:
diff --git a/sc/Module_sc.mk b/sc/Module_sc.mk
index 35f1fc1e6ca8..6522862f7389 100644
--- a/sc/Module_sc.mk
+++ b/sc/Module_sc.mk
@@ -19,6 +19,12 @@ $(eval $(call gb_Module_add_targets,sc,\
UIConfig_scalc \
))
+ifeq ($(ENABLE_OPENCL),TRUE)
+$(eval $(call gb_Module_add_targets,sc,\
+ Library_scopencl \
+))
+endif
+
ifneq (,$(filter DESKTOP,$(BUILD_TYPE)))
$(eval $(call gb_Module_add_targets,sc,\
Library_scqahelper \
diff --git a/sc/inc/document.hxx b/sc/inc/document.hxx
index 6993abb0f8c7..1e720a87779d 100644
--- a/sc/inc/document.hxx
+++ b/sc/inc/document.hxx
@@ -1745,7 +1745,7 @@ public:
* @param pResults array of numeric results.
* @param nLen length of numeric results.
*/
- void SetFormulaResults( const ScAddress& rTopPos, const double* pResults, size_t nLen );
+ void SC_DLLPUBLIC SetFormulaResults( const ScAddress& rTopPos, const double* pResults, size_t nLen );
private:
ScDocument(const ScDocument& r); // disabled with no definition
diff --git a/sc/source/core/opencl/openclwrapper.cxx b/sc/source/core/opencl/openclwrapper.cxx
index 75e991bbdd33..c46bdceaeb6b 100644
--- a/sc/source/core/opencl/openclwrapper.cxx
+++ b/sc/source/core/opencl/openclwrapper.cxx
@@ -10,7 +10,6 @@
#include "openclwrapper.hxx"
#include "sal/config.h"
-#include "random.hxx"
#include "oclkernels.hxx"
#include <stdio.h>
diff --git a/sc/source/core/tool/formulagroup.cxx b/sc/source/core/tool/formulagroup.cxx
index 04bec4fb854a..98ef4a94ce4e 100644
--- a/sc/source/core/tool/formulagroup.cxx
+++ b/sc/source/core/tool/formulagroup.cxx
@@ -128,6 +128,15 @@ void fillMatrix( ScMatrix& rMat, size_t nCol, rtl_uString** pStrs, size_t nLen )
}
+class FormulaGroupInterpreterOpenCLMissing : public FormulaGroupInterpreter
+{
+public:
+ FormulaGroupInterpreterOpenCLMissing() : FormulaGroupInterpreter() {}
+ virtual ~FormulaGroupInterpreterOpenCLMissing() {}
+ virtual ScMatrixRef inverseMatrix(const ScMatrix&) { return ScMatrixRef(); }
+ virtual bool interpret(ScDocument&, const ScAddress&, const ScFormulaCellGroupRef&, ScTokenArray&) { return false; }
+};
+
ScMatrixRef FormulaGroupInterpreterSoftware::inverseMatrix(const ScMatrix& /*rMat*/)
{
return ScMatrixRef();
@@ -340,7 +349,14 @@ FormulaGroupInterpreter *FormulaGroupInterpreter::getStatic()
{
#if HAVE_FEATURE_OPENCL
if ( ScInterpreter::GetGlobalConfig().mbOpenCLEnabled )
+ {
+#ifdef DISABLE_DYNLOADING
msInstance = sc::opencl::createFormulaGroupInterpreter();
+#else
+ // TODO : Dynamically load scopencl shared object, and instantiate the opencl interpreter.
+ msInstance = new sc::FormulaGroupInterpreterOpenCLMissing();
+#endif
+ }
#endif
if ( !msInstance ) // software fallback
{