summaryrefslogtreecommitdiff
path: root/sc/source
diff options
context:
space:
mode:
authorTor Lillqvist <tml@collabora.com>2015-09-08 14:35:37 +0300
committerTor Lillqvist <tml@collabora.com>2015-09-17 06:04:27 +0000
commitf2b93f2e314215d6342e0bd5727e6740cc15e29c (patch)
tree3a539267a45b5bfedc9587a180033eea71d80ede /sc/source
parent9008c5365581733f3d54ee30ade5e418cd6e694b (diff)
ENABLE_THREADED_OPENCL_KERNEL_COMPILATION has been zero for a long time
And I doubt we will try to turn it on again, so remove dead code. Change-Id: Iaa8908fdb5a197ef0d1da5eaf08ae08df2a86ee7 Reviewed-on: https://gerrit.libreoffice.org/18404 Reviewed-by: Tor Lillqvist <tml@collabora.com> Tested-by: Tor Lillqvist <tml@collabora.com>
Diffstat (limited to 'sc/source')
-rw-r--r--sc/source/core/data/formulacell.cxx64
-rw-r--r--sc/source/core/opencl/formulagroupcl.cxx28
-rw-r--r--sc/source/core/tool/clkernelthread.cxx69
3 files changed, 0 insertions, 161 deletions
diff --git a/sc/source/core/data/formulacell.cxx b/sc/source/core/data/formulacell.cxx
index 14d3d44ba89d..07d19a394387 100644
--- a/sc/source/core/data/formulacell.cxx
+++ b/sc/source/core/data/formulacell.cxx
@@ -44,7 +44,6 @@
#include "editutil.hxx"
#include "chgtrack.hxx"
#include "tokenarray.hxx"
-#include "clkernelthread.hxx"
#include <formula/errorcodes.hxx>
#include <formula/vectortoken.hxx>
@@ -535,28 +534,6 @@ typedef boost::ptr_map<AreaListenerKey, sc::FormulaGroupAreaListener> AreaListen
}
-#if ENABLE_THREADED_OPENCL_KERNEL_COMPILATION
-// The mutex to synchronize access to the OpenCL compilation thread.
-static osl::Mutex& getOpenCLCompilationThreadMutex()
-{
- static osl::Mutex* pMutex = NULL;
- if( !pMutex )
- {
- osl::Guard< osl::Mutex > aGuard( osl::Mutex::getGlobalMutex() );
- if( !pMutex )
- {
- static osl::Mutex aMutex;
- pMutex = &aMutex;
- }
- }
-
- return *pMutex;
-}
-
-int ScFormulaCellGroup::snCount = 0;
-rtl::Reference<sc::CLBuildKernelThread> ScFormulaCellGroup::sxCompilationThread;
-#endif
-
struct ScFormulaCellGroup::Impl
{
AreaListenersType maAreaListeners;
@@ -576,53 +553,16 @@ ScFormulaCellGroup::ScFormulaCellGroup() :
meKernelState(sc::OpenCLKernelNone)
{
SAL_INFO( "sc.core.formulacell", "ScFormulaCellGroup ctor this " << this);
-#if ENABLE_THREADED_OPENCL_KERNEL_COMPILATION
- if (officecfg::Office::Common::Misc::UseOpenCL::get())
- {
- osl::MutexGuard aGuard(getOpenCLCompilationThreadMutex());
- if (snCount++ == 0)
- {
- assert(!sxCompilationThread.is());
- sxCompilationThread.set(new sc::CLBuildKernelThread);
- sxCompilationThread->launch();
- }
- }
-#endif
}
ScFormulaCellGroup::~ScFormulaCellGroup()
{
SAL_INFO( "sc.core.formulacell", "ScFormulaCellGroup dtor this " << this);
-#if ENABLE_THREADED_OPENCL_KERNEL_COMPILATION
- if (officecfg::Office::Common::Misc::UseOpenCL::get())
- {
- osl::MutexGuard aGuard(getOpenCLCompilationThreadMutex());
- if (--snCount == 0 && sxCompilationThread.is())
- {
- assert(sxCompilationThread.is());
- sxCompilationThread->finish();
- sxCompilationThread->join();
- SAL_INFO("sc.opencl", "OpenCL kernel compilation thread has finished");
- sxCompilationThread.clear();
- }
- }
-#endif
delete mpCode;
delete mpCompiledFormula;
delete mpImpl;
}
-#if ENABLE_THREADED_OPENCL_KERNEL_COMPILATION
-void ScFormulaCellGroup::scheduleCompilation()
-{
- meKernelState = sc::OpenCLKernelCompilationScheduled;
- sc::CLBuildKernelWorkItem aWorkItem;
- aWorkItem.meWhatToDo = sc::CLBuildKernelWorkItem::COMPILE;
- aWorkItem.mxGroup = this;
- sxCompilationThread->push(aWorkItem);
-}
-#endif
-
void ScFormulaCellGroup::setCode( const ScTokenArray& rCode )
{
delete mpCode;
@@ -3755,10 +3695,6 @@ ScFormulaCellGroupRef ScFormulaCell::CreateCellGroup( SCROW nLen, bool bInvarian
mxGroup->mbInvariant = bInvariant;
mxGroup->mnLength = nLen;
mxGroup->mpCode = pCode; // Move this to the shared location.
-#if ENABLE_THREADED_OPENCL_KERNEL_COMPILATION
- if (mxGroup->sxCompilationThread.is())
- mxGroup->scheduleCompilation();
-#endif
return mxGroup;
}
diff --git a/sc/source/core/opencl/formulagroupcl.cxx b/sc/source/core/opencl/formulagroupcl.cxx
index 340f3915a649..b72c3177d0ec 100644
--- a/sc/source/core/opencl/formulagroupcl.cxx
+++ b/sc/source/core/opencl/formulagroupcl.cxx
@@ -9,7 +9,6 @@
#include "formulagroup.hxx"
#include "formulagroupcl.hxx"
-#include "clkernelthread.hxx"
#include "grouptokenconverter.hxx"
#include "document.hxx"
#include "formulacell.hxx"
@@ -4181,13 +4180,6 @@ public:
mpKernel = pKernel;
}
-#if ENABLE_THREADED_OPENCL_KERNEL_COMPILATION
- void setUnmanagedKernel( DynamicKernel* pKernel )
- {
- mpKernel = pKernel;
- }
-#endif
-
CLInterpreterResult launchKernel()
{
if (!isValid())
@@ -4229,27 +4221,7 @@ CLInterpreterContext createCLInterpreterContext( const ScCalcConfig& rConfig,
{
CLInterpreterContext aCxt(xGroup->mnLength);
-#if ENABLE_THREADED_OPENCL_KERNEL_COMPILATION
- if (rGroup.meKernelState == sc::OpenCLKernelCompilationScheduled ||
- rGroup.meKernelState == sc::OpenCLKernelBinaryCreated)
- {
- if (rGroup.meKernelState == sc::OpenCLKernelCompilationScheduled)
- {
- ScFormulaCellGroup::sxCompilationThread->maCompilationDoneCondition.wait();
- ScFormulaCellGroup::sxCompilationThread->maCompilationDoneCondition.reset();
- }
-
- // Kernel instance is managed by the formula group.
- aCxt.setUnmanagedKernel(static_cast<DynamicKernel*>(xGroup->mpCompiledFormula));
- }
- else
- {
- assert(xGroup->meCalcState == sc::GroupCalcRunning);
- aCxt.setManagedKernel(static_cast<DynamicKernel*>(DynamicKernel::create(rConfig, rCode, xGroup->mnLength)));
- }
-#else
aCxt.setManagedKernel(static_cast<DynamicKernel*>(DynamicKernel::create(rConfig, rCode, xGroup->mnLength)));
-#endif
return aCxt;
}
diff --git a/sc/source/core/tool/clkernelthread.cxx b/sc/source/core/tool/clkernelthread.cxx
deleted file mode 100644
index 52a483051a4c..000000000000
--- a/sc/source/core/tool/clkernelthread.cxx
+++ /dev/null
@@ -1,69 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*
- * 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/.
- */
-
-#include <sal/log.hxx>
-
-#include "formulagroup.hxx"
-#include "grouptokenconverter.hxx"
-
-#include "clkernelthread.hxx"
-
-using namespace std;
-
-namespace sc {
-
-CLBuildKernelThread::CLBuildKernelThread() :
- salhelper::Thread("opencl-build-kernel-thread")
-{
-}
-
-CLBuildKernelThread::~CLBuildKernelThread()
-{
-}
-
-void CLBuildKernelThread::execute()
-{
- SAL_INFO("sc.opencl.thread", "running");
-
- bool done = false;
- while (!done)
- {
- SAL_INFO("sc.opencl.thread", "waiting for condition");
- maQueueCondition.wait();
- SAL_INFO("sc.opencl.thread", "got condition");
- osl::ResettableMutexGuard aGuard(maQueueMutex);
- maQueueCondition.reset();
- while (!maQueue.empty())
- {
- CLBuildKernelWorkItem aWorkItem = maQueue.front();
- maQueue.pop();
- aGuard.clear();
-
- switch (aWorkItem.meWhatToDo)
- {
- case CLBuildKernelWorkItem::COMPILE:
- SAL_INFO("sc.opencl.thread", "told to compile group " << aWorkItem.mxGroup << " (state " << aWorkItem.mxGroup->meCalcState << ") to binary");
- aWorkItem.mxGroup->compileOpenCLKernel();
- SAL_INFO("sc.opencl.thread", "group " << aWorkItem.mxGroup << " compilation done");
- maCompilationDoneCondition.set();
- break;
- case CLBuildKernelWorkItem::FINISH:
- SAL_INFO("sc.opencl.thread", "told to finish");
- done = true;
- break;
- }
-
- aGuard.reset();
- }
- }
-}
-
-}
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */