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
08f16d5a
Kaydet (Commit)
08f16d5a
authored
Eyl 13, 2013
tarafından
Kohei Yoshida
Kaydeden (comit)
Markus Mohrhard
Eyl 19, 2013
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Avoid having build-time dependency on scopencl.
Change-Id: I32918599dca0556a61b85d868dffbb5e72541e69
üst
3be59e38
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
92 additions
and
23 deletions
+92
-23
Library_sc.mk
sc/Library_sc.mk
+1
-0
Library_scopencl.mk
sc/Library_scopencl.mk
+0
-1
Library_scui.mk
sc/Library_scui.mk
+0
-1
formulagroup.hxx
sc/inc/formulagroup.hxx
+3
-0
platforminfo.hxx
sc/inc/platforminfo.hxx
+4
-2
formulagroupcl.cxx
sc/source/core/opencl/formulagroupcl.cxx
+14
-0
openclwrapper.cxx
sc/source/core/opencl/openclwrapper.cxx
+15
-0
openclwrapper.hxx
sc/source/core/opencl/openclwrapper.hxx
+1
-0
formulagroup.cxx
sc/source/core/tool/formulagroup.cxx
+45
-11
platforminfo.cxx
sc/source/core/tool/platforminfo.cxx
+4
-7
calcoptionsdlg.cxx
sc/source/ui/optdlg/calcoptionsdlg.cxx
+5
-1
No files found.
sc/Library_sc.mk
Dosyayı görüntüle @
08f16d5a
...
...
@@ -227,6 +227,7 @@ $(eval $(call gb_Library_add_exception_objects,sc,\
sc/source/core/tool/optutil \
sc/source/core/tool/orcusxml \
sc/source/core/tool/parclass \
sc/source/core/tool/platforminfo \
sc/source/core/tool/printopt \
sc/source/core/tool/prnsave \
sc/source/core/tool/progress \
...
...
sc/Library_scopencl.mk
Dosyayı görüntüle @
08f16d5a
...
...
@@ -35,7 +35,6 @@ $(eval $(call gb_Library_use_libraries,scopencl,\
$(eval $(call gb_Library_add_exception_objects,scopencl,\
sc/source/core/opencl/formulagroupcl \
sc/source/core/opencl/platforminfo \
sc/source/core/opencl/openclwrapper \
sc/source/core/opencl/clcc/clew \
))
...
...
sc/Library_scui.mk
Dosyayı görüntüle @
08f16d5a
...
...
@@ -35,7 +35,6 @@ $(eval $(call gb_Library_use_libraries,scui,\
i18nlangtag \
sal \
sc \
scopencl \
sfx \
sot \
svl \
...
...
sc/inc/formulagroup.hxx
Dosyayı görüntüle @
08f16d5a
...
...
@@ -12,7 +12,9 @@
#include "address.hxx"
#include "types.hxx"
#include "platforminfo.hxx"
#include <vector>
#include <boost/noncopyable.hpp>
#include <boost/ptr_container/ptr_vector.hpp>
#include <boost/unordered_set.hpp>
...
...
@@ -52,6 +54,7 @@ class SC_DLLPUBLIC FormulaGroupInterpreter
public
:
static
FormulaGroupInterpreter
*
getStatic
();
static
void
fillOpenCLInfo
(
std
::
vector
<
OpenclPlatformInfo
>&
rPlatforms
);
virtual
ScMatrixRef
inverseMatrix
(
const
ScMatrix
&
rMat
)
=
0
;
virtual
bool
interpret
(
ScDocument
&
rDoc
,
const
ScAddress
&
rTopPos
,
const
ScFormulaCellGroupRef
&
xGroup
,
ScTokenArray
&
rCode
)
=
0
;
...
...
sc/inc/platforminfo.hxx
Dosyayı görüntüle @
08f16d5a
...
...
@@ -26,6 +26,8 @@ struct SC_DLLPUBLIC OpenclDeviceInfo
size_t
mnMemory
;
size_t
mnComputeUnits
;
size_t
mnFrequency
;
OpenclDeviceInfo
();
};
struct
SC_DLLPUBLIC
OpenclPlatformInfo
...
...
@@ -34,9 +36,9 @@ struct SC_DLLPUBLIC OpenclPlatformInfo
OUString
maVendor
;
OUString
maName
;
std
::
vector
<
OpenclDeviceInfo
>
maDevices
;
};
SC_DLLPUBLIC
std
::
vector
<
OpenclPlatformInfo
>
listAllOpenclPlatforms
();
OpenclPlatformInfo
();
};
}
...
...
sc/source/core/opencl/formulagroupcl.cxx
Dosyayı görüntüle @
08f16d5a
...
...
@@ -1080,6 +1080,20 @@ SAL_DLLPUBLIC_EXPORT sc::FormulaGroupInterpreter* SAL_CALL createFormulaGroupOpe
return
new
sc
::
opencl
::
FormulaGroupInterpreterOpenCL
();
}
SAL_DLLPUBLIC_EXPORT
size_t
getOpenCLPlatformCount
()
{
return
sc
::
opencl
::
getOpenCLPlatformCount
();
}
SAL_DLLPUBLIC_EXPORT
void
SAL_CALL
fillOpenCLInfo
(
sc
::
OpenclPlatformInfo
*
pInfos
,
size_t
nInfoSize
)
{
std
::
vector
<
sc
::
OpenclPlatformInfo
>
aPlatforms
;
sc
::
opencl
::
fillOpenCLInfo
(
aPlatforms
);
size_t
n
=
std
::
min
(
aPlatforms
.
size
(),
nInfoSize
);
for
(
size_t
i
=
0
;
i
<
n
;
++
i
)
pInfos
[
i
]
=
aPlatforms
[
i
];
}
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
sc/source/core/opencl/openclwrapper.cxx
Dosyayı görüntüle @
08f16d5a
...
...
@@ -2718,6 +2718,21 @@ bool createPlatformInfo(cl_platform_id nPlatformId, OpenclPlatformInfo& rPlatfor
}
size_t
getOpenCLPlatformCount
()
{
int
status
=
clewInit
(
OPENCL_DLL_NAME
);
if
(
status
<
0
)
return
0
;
cl_uint
nPlatforms
;
cl_int
nState
=
clGetPlatformIDs
(
0
,
NULL
,
&
nPlatforms
);
if
(
nState
!=
CL_SUCCESS
)
return
0
;
return
nPlatforms
;
}
void
fillOpenCLInfo
(
std
::
vector
<
OpenclPlatformInfo
>&
rPlatforms
)
{
int
status
=
clewInit
(
OPENCL_DLL_NAME
);
...
...
sc/source/core/opencl/openclwrapper.hxx
Dosyayı görüntüle @
08f16d5a
...
...
@@ -280,6 +280,7 @@ public:
friend
class
agency
;
};
size_t
getOpenCLPlatformCount
();
void
fillOpenCLInfo
(
std
::
vector
<
OpenclPlatformInfo
>&
rPlatforms
);
}}
...
...
sc/source/core/tool/formulagroup.cxx
Dosyayı görüntüle @
08f16d5a
...
...
@@ -334,12 +334,29 @@ public:
static
void
SAL_CALL
thisModule
()
{}
typedef
FormulaGroupInterpreter
*
(
*
LoaderFn
)(
void
);
typedef
FormulaGroupInterpreter
*
(
*
__createFormulaGroupOpenCLInterpreter
)(
void
);
typedef
size_t
(
*
__getOpenCLPlatformCount
)(
void
);
typedef
void
(
*
__fillOpenCLInfo
)(
OpenclPlatformInfo
*
,
size_t
);
#endif
FormulaGroupInterpreter
*
FormulaGroupInterpreter
::
msInstance
=
NULL
;
osl
::
Module
*
getOpenCLModule
()
{
static
osl
::
Module
aModule
;
if
(
aModule
.
is
())
// Already loaded.
return
&
aModule
;
OUString
aLibName
(
SVLIBRARY
(
"scopencl"
));
bool
bLoaded
=
aModule
.
loadRelative
(
&
thisModule
,
aLibName
);
if
(
!
bLoaded
)
bLoaded
=
aModule
.
load
(
aLibName
);
return
bLoaded
?
&
aModule
:
NULL
;
}
/// load and/or configure the correct formula group interpreter
FormulaGroupInterpreter
*
FormulaGroupInterpreter
::
getStatic
()
{
...
...
@@ -376,18 +393,12 @@ FormulaGroupInterpreter *FormulaGroupInterpreter::getStatic()
msInstance
=
createFormulaGroupOpenCLInterpreter
();
#else
// Dynamically load scopencl shared object, and instantiate the opencl interpreter.
OUString
aLibName
(
SVLIBRARY
(
"scopencl"
));
static
osl
::
Module
aModule
;
bool
bLoaded
=
aModule
.
loadRelative
(
&
thisModule
,
aLibName
);
if
(
!
bLoaded
)
bLoaded
=
aModule
.
load
(
aLibName
);
if
(
bLoaded
)
osl
::
Module
*
pModule
=
getOpenCLModule
();
if
(
pModule
)
{
oslGenericFunction
fn
=
aModule
.
getFunctionSymbol
(
"createFormulaGroupOpenCLInterpreter"
);
oslGenericFunction
fn
=
pModule
->
getFunctionSymbol
(
"createFormulaGroupOpenCLInterpreter"
);
if
(
fn
)
msInstance
=
reinterpret_cast
<
LoaderFn
>
(
fn
)();
msInstance
=
reinterpret_cast
<
__createFormulaGroupOpenCLInterpreter
>
(
fn
)();
}
if
(
!
msInstance
)
...
...
@@ -405,6 +416,29 @@ FormulaGroupInterpreter *FormulaGroupInterpreter::getStatic()
return
msInstance
;
}
void
FormulaGroupInterpreter
::
fillOpenCLInfo
(
std
::
vector
<
OpenclPlatformInfo
>&
rPlatforms
)
{
osl
::
Module
*
pModule
=
getOpenCLModule
();
if
(
!
pModule
)
return
;
oslGenericFunction
fn
=
pModule
->
getFunctionSymbol
(
"getOpenCLPlatformCount"
);
if
(
!
fn
)
return
;
size_t
nPlatforms
=
reinterpret_cast
<
__getOpenCLPlatformCount
>
(
fn
)();
if
(
!
nPlatforms
)
return
;
fn
=
pModule
->
getFunctionSymbol
(
"fillOpenCLInfo"
);
if
(
!
fn
)
return
;
std
::
vector
<
OpenclPlatformInfo
>
aPlatforms
(
nPlatforms
);
reinterpret_cast
<
__fillOpenCLInfo
>
(
fn
)(
&
aPlatforms
[
0
],
aPlatforms
.
size
());
rPlatforms
.
swap
(
aPlatforms
);
}
void
FormulaGroupInterpreter
::
generateRPNCode
(
ScDocument
&
rDoc
,
const
ScAddress
&
rPos
,
ScTokenArray
&
rCode
)
{
// First, generate an RPN (reverse polish notation) token array.
...
...
sc/source/core/
openc
l/platforminfo.cxx
→
sc/source/core/
too
l/platforminfo.cxx
Dosyayı görüntüle @
08f16d5a
...
...
@@ -8,16 +8,13 @@
*/
#include "platforminfo.hxx"
#include "
openclwrapper
.hxx"
#include "
formulagroup
.hxx"
namespace
sc
{
std
::
vector
<
OpenclPlatformInfo
>
listAllOpenclPlatforms
()
{
std
::
vector
<
OpenclPlatformInfo
>
aPlatforms
;
opencl
::
fillOpenCLInfo
(
aPlatforms
);
return
aPlatforms
;
}
OpenclDeviceInfo
::
OpenclDeviceInfo
()
{}
OpenclPlatformInfo
::
OpenclPlatformInfo
()
{}
}
...
...
sc/source/ui/optdlg/calcoptionsdlg.cxx
Dosyayı görüntüle @
08f16d5a
...
...
@@ -14,6 +14,10 @@
#include "svtools/svlbitm.hxx"
#include "svtools/treelistentry.hxx"
#if HAVE_FEATURE_OPENCL
#include "formulagroup.hxx"
#endif
namespace
{
typedef
enum
{
...
...
@@ -195,7 +199,7 @@ void ScCalcOptionsDialog::fillOpenclList()
{
mpOpenclInfoList
->
SetUpdateMode
(
false
);
mpOpenclInfoList
->
Clear
();
maPlatformInfo
=
sc
::
listAllOpenclPlatforms
(
);
sc
::
FormulaGroupInterpreter
::
fillOpenCLInfo
(
maPlatformInfo
);
for
(
std
::
vector
<
sc
::
OpenclPlatformInfo
>::
iterator
it
=
maPlatformInfo
.
begin
(),
itEnd
=
maPlatformInfo
.
end
();
it
!=
itEnd
;
++
it
)
{
...
...
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