Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
core
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
LibreOffice
core
Commits
25fb3d74
Kaydet (Commit)
25fb3d74
authored
Kas 13, 2013
tarafından
Tor Lillqvist
Kaydeden (comit)
Michael Meeks
Kas 20, 2013
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
WIP: Background ahead-of-time OpenCL compilation
Change-Id: I6e9906fb68a22eb0adab753726ec0d62dd05fe9b
üst
3e8df9eb
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
39 additions
and
7 deletions
+39
-7
formulacell.hxx
sc/inc/formulacell.hxx
+10
-5
types.hxx
sc/inc/types.hxx
+1
-0
formulacell.cxx
sc/source/core/data/formulacell.cxx
+3
-0
formulagroupcl.cxx
sc/source/core/opencl/formulagroupcl.cxx
+16
-2
clkernelthread.cxx
sc/source/core/tool/clkernelthread.cxx
+9
-0
No files found.
sc/inc/formulacell.hxx
Dosyayı görüntüle @
25fb3d74
...
...
@@ -20,15 +20,19 @@
#ifndef SC_FORMULACELL_HXX
#define SC_FORMULACELL_HXX
#include "formularesult.hxx"
#include <set>
#include <boost/noncopyable.hpp>
#include "formula/tokenarray.hxx"
#include <formula/tokenarray.hxx>
#include <osl/conditn.hxx>
#include <osl/mutex.hxx>
#include <rtl/ref.hxx>
#include "svl/listener.hxx"
#include <svl/listener.hxx>
#include "types.hxx"
#include <set>
#include <boost/noncopyable.hpp>
#include "formularesult.hxx"
namespace
sc
{
...
...
@@ -54,6 +58,7 @@ struct SC_DLLPUBLIC ScFormulaCellGroup : boost::noncopyable
ScTokenArray
*
mpCode
;
osl
::
Mutex
maMutex
;
osl
::
Condition
maCompilationDone
;
sc
::
CompiledFormula
*
mpCompiledFormula
;
ScFormulaCell
*
mpTopCell
;
SCROW
mnLength
;
// How many of these do we have ?
...
...
sc/inc/types.hxx
Dosyayı görüntüle @
25fb3d74
...
...
@@ -59,6 +59,7 @@ const sal_uInt16 MatrixEdgeOpen = 32;
enum
GroupCalcState
{
GroupCalcEnabled
,
GroupCalcOpenCLKernelCompilationScheduled
,
GroupCalcOpenCLKernelBinaryCreated
,
GroupCalcRunning
,
GroupCalcDisabled
...
...
sc/source/core/data/formulacell.cxx
Dosyayı görüntüle @
25fb3d74
...
...
@@ -445,9 +445,12 @@ ScFormulaCellGroup::~ScFormulaCellGroup()
void
ScFormulaCellGroup
::
scheduleCompilation
()
{
osl
::
ResettableMutexGuard
aGuard
(
maMutex
);
meCalcState
=
sc
::
GroupCalcOpenCLKernelCompilationScheduled
;
sc
::
CLBuildKernelWorkItem
aWorkItem
;
aWorkItem
.
meWhatToDo
=
sc
::
CLBuildKernelWorkItem
::
COMPILE
;
aWorkItem
.
mxGroup
=
this
;
aGuard
.
clear
();
mxCLKernelThread
->
push
(
aWorkItem
);
}
...
...
sc/source/core/opencl/formulagroupcl.cxx
Dosyayı görüntüle @
25fb3d74
...
...
@@ -2659,8 +2659,22 @@ bool FormulaGroupInterpreterOpenCL::interpret( ScDocument& rDoc,
const
ScAddress
&
rTopPos
,
const
ScFormulaCellGroupRef
&
xGroup
,
ScTokenArray
&
rCode
)
{
// printf("Vector width = %d\n", xGroup->mnLength);
DynamicKernel
*
pKernel
=
DynamicKernel
::
create
(
rDoc
,
rTopPos
,
rCode
);
DynamicKernel
*
pKernel
;
osl
::
ResettableMutexGuard
aGuard
(
xGroup
->
maMutex
);
if
(
xGroup
->
meCalcState
==
sc
::
GroupCalcOpenCLKernelCompilationScheduled
)
{
aGuard
.
clear
();
xGroup
->
maCompilationDone
.
wait
();
xGroup
->
maCompilationDone
.
reset
();
pKernel
=
static_cast
<
DynamicKernel
*>
(
xGroup
->
mpCompiledFormula
);
}
else
{
aGuard
.
clear
();
pKernel
=
DynamicKernel
::
create
(
rDoc
,
rTopPos
,
rCode
);
}
if
(
!
pKernel
)
return
false
;
...
...
sc/source/core/tool/clkernelthread.cxx
Dosyayı görüntüle @
25fb3d74
...
...
@@ -9,6 +9,8 @@
#include <sal/log.hxx>
#include "formulagroupinterpreter.hxx"
#include "clkernelthread.hxx"
using
namespace
std
;
...
...
@@ -46,6 +48,13 @@ void CLBuildKernelThread::execute()
{
case
CLBuildKernelWorkItem
:
:
COMPILE
:
SAL_INFO
(
"sc.opencl.thread"
,
"told to compile group "
<<
aWorkItem
.
mxGroup
<<
" to binary"
);
assert
(
aWorkItem
.
mxGroup
->
meCalcState
==
sc
::
GroupCalcOpenCLKernelCompilationScheduled
);
aWorkItem
.
mxGroup
->
mpCompiledFormula
=
sc
::
FormulaGroupInterpreter
::
getStatic
()
->
createCompiledFormula
(
*
aWorkItem
.
mxGroup
->
mpTopCell
->
GetDocument
(),
aWorkItem
.
mxGroup
->
mpTopCell
->
aPos
,
*
aWorkItem
.
mxGroup
->
mpCode
);
aWorkItem
.
mxGroup
->
meCalcState
=
sc
::
GroupCalcOpenCLKernelBinaryCreated
;
aWorkItem
.
mxGroup
->
maCompilationDone
.
set
();
break
;
case
CLBuildKernelWorkItem
:
:
FINISH
:
SAL_INFO
(
"sc.opencl.thread"
,
"told to finish"
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment