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
e0d936ef
Kaydet (Commit)
e0d936ef
authored
Mar 20, 2014
tarafından
Kohei Yoshida
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
More code that's specific to OpenCL kernel pre-compilation.
Change-Id: I82474c48924aca36d9fde468081fb2457a153ac6
üst
1c2781df
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
17 additions
and
2 deletions
+17
-2
formulacell.hxx
sc/inc/formulacell.hxx
+4
-0
formulacell.cxx
sc/source/core/data/formulacell.cxx
+8
-2
formulagroupcl.cxx
sc/source/core/opencl/formulagroupcl.cxx
+5
-0
No files found.
sc/inc/formulacell.hxx
Dosyayı görüntüle @
e0d936ef
...
@@ -34,6 +34,8 @@
...
@@ -34,6 +34,8 @@
#include "formularesult.hxx"
#include "formularesult.hxx"
#define ENABLE_THREADED_OPENCL_KERNEL_COMPILATION 0
namespace
sc
{
namespace
sc
{
class
CLBuildKernelThread
;
class
CLBuildKernelThread
;
...
@@ -78,8 +80,10 @@ struct SC_DLLPUBLIC ScFormulaCellGroup : boost::noncopyable
...
@@ -78,8 +80,10 @@ struct SC_DLLPUBLIC ScFormulaCellGroup : boost::noncopyable
ScDocument
&
rDoc
,
const
ScAddress
&
rPos
,
formula
::
FormulaGrammar
::
Grammar
eGram
);
ScDocument
&
rDoc
,
const
ScAddress
&
rPos
,
formula
::
FormulaGrammar
::
Grammar
eGram
);
void
compileOpenCLKernel
();
void
compileOpenCLKernel
();
#if ENABLE_THREADED_OPENCL_KERNEL_COMPILATION
static
int
snCount
;
static
int
snCount
;
static
rtl
::
Reference
<
sc
::
CLBuildKernelThread
>
sxCompilationThread
;
static
rtl
::
Reference
<
sc
::
CLBuildKernelThread
>
sxCompilationThread
;
#endif
};
};
inline
void
intrusive_ptr_add_ref
(
const
ScFormulaCellGroup
*
p
)
inline
void
intrusive_ptr_add_ref
(
const
ScFormulaCellGroup
*
p
)
...
...
sc/source/core/data/formulacell.cxx
Dosyayı görüntüle @
e0d936ef
...
@@ -59,8 +59,6 @@
...
@@ -59,8 +59,6 @@
#include <boost/scoped_ptr.hpp>
#include <boost/scoped_ptr.hpp>
#define ENABLE_THREADED_OPENCL_KERNEL_COMPILATION 0
using
namespace
formula
;
using
namespace
formula
;
#ifdef USE_MEMPOOL
#ifdef USE_MEMPOOL
...
@@ -392,6 +390,7 @@ void adjustDBRange(ScToken* pToken, ScDocument& rNewDoc, const ScDocument* pOldD
...
@@ -392,6 +390,7 @@ void adjustDBRange(ScToken* pToken, ScDocument& rNewDoc, const ScDocument* pOldD
}
}
#if ENABLE_THREADED_OPENCL_KERNEL_COMPILATION
// The mutex to synchronize access to the OpenCL compilation thread.
// The mutex to synchronize access to the OpenCL compilation thread.
static
osl
::
Mutex
&
getOpenCLCompilationThreadMutex
()
static
osl
::
Mutex
&
getOpenCLCompilationThreadMutex
()
{
{
...
@@ -411,6 +410,7 @@ static osl::Mutex& getOpenCLCompilationThreadMutex()
...
@@ -411,6 +410,7 @@ static osl::Mutex& getOpenCLCompilationThreadMutex()
int
ScFormulaCellGroup
::
snCount
=
0
;
int
ScFormulaCellGroup
::
snCount
=
0
;
rtl
::
Reference
<
sc
::
CLBuildKernelThread
>
ScFormulaCellGroup
::
sxCompilationThread
;
rtl
::
Reference
<
sc
::
CLBuildKernelThread
>
ScFormulaCellGroup
::
sxCompilationThread
;
#endif
ScFormulaCellGroup
::
ScFormulaCellGroup
()
:
ScFormulaCellGroup
::
ScFormulaCellGroup
()
:
mnRefCount
(
0
),
mnRefCount
(
0
),
...
@@ -424,6 +424,7 @@ ScFormulaCellGroup::ScFormulaCellGroup() :
...
@@ -424,6 +424,7 @@ ScFormulaCellGroup::ScFormulaCellGroup() :
meCalcState
(
sc
::
GroupCalcEnabled
),
meCalcState
(
sc
::
GroupCalcEnabled
),
meKernelState
(
sc
::
OpenCLKernelNone
)
meKernelState
(
sc
::
OpenCLKernelNone
)
{
{
#if ENABLE_THREADED_OPENCL_KERNEL_COMPILATION
if
(
ScInterpreter
::
GetGlobalConfig
().
mbOpenCLEnabled
)
if
(
ScInterpreter
::
GetGlobalConfig
().
mbOpenCLEnabled
)
{
{
osl
::
MutexGuard
aGuard
(
getOpenCLCompilationThreadMutex
());
osl
::
MutexGuard
aGuard
(
getOpenCLCompilationThreadMutex
());
...
@@ -434,10 +435,12 @@ ScFormulaCellGroup::ScFormulaCellGroup() :
...
@@ -434,10 +435,12 @@ ScFormulaCellGroup::ScFormulaCellGroup() :
sxCompilationThread
->
launch
();
sxCompilationThread
->
launch
();
}
}
}
}
#endif
}
}
ScFormulaCellGroup
::~
ScFormulaCellGroup
()
ScFormulaCellGroup
::~
ScFormulaCellGroup
()
{
{
#if ENABLE_THREADED_OPENCL_KERNEL_COMPILATION
if
(
ScInterpreter
::
GetGlobalConfig
().
mbOpenCLEnabled
)
if
(
ScInterpreter
::
GetGlobalConfig
().
mbOpenCLEnabled
)
{
{
osl
::
MutexGuard
aGuard
(
getOpenCLCompilationThreadMutex
());
osl
::
MutexGuard
aGuard
(
getOpenCLCompilationThreadMutex
());
...
@@ -450,17 +453,20 @@ ScFormulaCellGroup::~ScFormulaCellGroup()
...
@@ -450,17 +453,20 @@ ScFormulaCellGroup::~ScFormulaCellGroup()
sxCompilationThread
.
clear
();
sxCompilationThread
.
clear
();
}
}
}
}
#endif
delete
mpCode
;
delete
mpCode
;
delete
mpCompiledFormula
;
delete
mpCompiledFormula
;
}
}
void
ScFormulaCellGroup
::
scheduleCompilation
()
void
ScFormulaCellGroup
::
scheduleCompilation
()
{
{
#if ENABLE_THREADED_OPENCL_KERNEL_COMPILATION
meKernelState
=
sc
::
OpenCLKernelCompilationScheduled
;
meKernelState
=
sc
::
OpenCLKernelCompilationScheduled
;
sc
::
CLBuildKernelWorkItem
aWorkItem
;
sc
::
CLBuildKernelWorkItem
aWorkItem
;
aWorkItem
.
meWhatToDo
=
sc
::
CLBuildKernelWorkItem
::
COMPILE
;
aWorkItem
.
meWhatToDo
=
sc
::
CLBuildKernelWorkItem
::
COMPILE
;
aWorkItem
.
mxGroup
=
this
;
aWorkItem
.
mxGroup
=
this
;
sxCompilationThread
->
push
(
aWorkItem
);
sxCompilationThread
->
push
(
aWorkItem
);
#endif
}
}
void
ScFormulaCellGroup
::
setCode
(
const
ScTokenArray
&
rCode
)
void
ScFormulaCellGroup
::
setCode
(
const
ScTokenArray
&
rCode
)
...
...
sc/source/core/opencl/formulagroupcl.cxx
Dosyayı görüntüle @
e0d936ef
...
@@ -3450,6 +3450,7 @@ bool FormulaGroupInterpreterOpenCL::interpret( ScDocument& rDoc,
...
@@ -3450,6 +3450,7 @@ bool FormulaGroupInterpreterOpenCL::interpret( ScDocument& rDoc,
DynamicKernel
*
pKernel
=
NULL
;
DynamicKernel
*
pKernel
=
NULL
;
boost
::
scoped_ptr
<
DynamicKernel
>
pLocalKernel
;
boost
::
scoped_ptr
<
DynamicKernel
>
pLocalKernel
;
#if ENABLE_THREADED_OPENCL_KERNEL_COMPILATION
if
(
xGroup
->
meKernelState
==
sc
::
OpenCLKernelCompilationScheduled
||
if
(
xGroup
->
meKernelState
==
sc
::
OpenCLKernelCompilationScheduled
||
xGroup
->
meKernelState
==
sc
::
OpenCLKernelBinaryCreated
)
xGroup
->
meKernelState
==
sc
::
OpenCLKernelBinaryCreated
)
{
{
...
@@ -3467,6 +3468,10 @@ bool FormulaGroupInterpreterOpenCL::interpret( ScDocument& rDoc,
...
@@ -3467,6 +3468,10 @@ bool FormulaGroupInterpreterOpenCL::interpret( ScDocument& rDoc,
pKernel
=
static_cast
<
DynamicKernel
*>
(
createCompiledFormula
(
rDoc
,
rTopPos
,
*
xGroup
,
rCode
));
pKernel
=
static_cast
<
DynamicKernel
*>
(
createCompiledFormula
(
rDoc
,
rTopPos
,
*
xGroup
,
rCode
));
pLocalKernel
.
reset
(
pKernel
);
// to be deleted when done.
pLocalKernel
.
reset
(
pKernel
);
// to be deleted when done.
}
}
#else
pKernel
=
static_cast
<
DynamicKernel
*>
(
createCompiledFormula
(
rDoc
,
rTopPos
,
*
xGroup
,
rCode
));
pLocalKernel
.
reset
(
pKernel
);
// to be deleted when done.
#endif
if
(
!
pKernel
)
if
(
!
pKernel
)
return
false
;
return
false
;
...
...
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