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
fbbf5c08
Kaydet (Commit)
fbbf5c08
authored
May 13, 2014
tarafından
haochen
Kaydeden (comit)
Markus Mohrhard
May 19, 2014
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
GPU Calc: Fixed style&error problem in formulagroupcl and op_addin
Change-Id: Id7c6e341eb88f6c8ffdaa7f83b787bb19649afec
üst
dd0f8447
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
88 additions
and
15 deletions
+88
-15
formulagroupcl.cxx
sc/source/core/opencl/formulagroupcl.cxx
+16
-15
op_addin.cxx
sc/source/core/opencl/op_addin.cxx
+65
-0
op_addin.hxx
sc/source/core/opencl/op_addin.hxx
+7
-0
No files found.
sc/source/core/opencl/formulagroupcl.cxx
Dosyayı görüntüle @
fbbf5c08
...
...
@@ -31,7 +31,7 @@
/// CONFIGURATIONS
// Comment out this to turn off FMIN and FMAX intrinsics
#define USE_FMIN_FMAX 1
#define REDUCE_THRESHOLD
4
// set to 4 for correctness testing. priority 1
#define REDUCE_THRESHOLD
201
// set to 4 for correctness testing. priority 1
#define UNROLLING_FACTOR 16 // set to 4 for correctness testing (if no reduce)
#include "formulagroupcl_public.hxx"
#ifdef WIN32
...
...
@@ -1218,30 +1218,25 @@ public:
ss
<<
"int nCount = 0;
\n\t
"
;
ss
<<
"double tmpBottom;
\n\t
"
;
unsigned
i
=
vSubArguments
.
size
();
size_t
nItems
=
0
;
while
(
i
--
)
{
if
(
NumericRange
*
NR
=
dynamic_cast
<
NumericRange
*>
(
vSubArguments
[
i
].
get
()))
{
bool
needBody
;
nItems
+=
NR
->
GenReductionLoopHeader
(
ss
,
needBody
);
if
(
needBody
==
false
)
continue
;
bool
needBody
;
NR
->
GenReductionLoopHeader
(
ss
,
needBody
);
if
(
needBody
==
false
)
continue
;
}
else
if
(
ParallelNumericRange
*
PNR
=
dynamic_cast
<
ParallelNumericRange
*>
(
vSubArguments
[
i
].
get
()))
{
//did not handle yet
bool
needBody
;
nItems
+=
PNR
->
GenReductionLoopHeader
(
ss
,
needBody
);
if
(
needBody
==
false
)
continue
;
bool
needBody
;
PNR
->
GenReductionLoopHeader
(
ss
,
needBody
);
if
(
needBody
==
false
)
continue
;
}
else
if
(
StringRange
*
SR
=
dynamic_cast
<
StringRange
*>
(
vSubArguments
[
i
].
get
()))
{
//did not handle yet
bool
needBody
;
nItems
+=
SR
->
GenReductionLoopHeader
(
ss
,
needBody
);
SR
->
GenReductionLoopHeader
(
ss
,
needBody
);
if
(
needBody
==
false
)
continue
;
}
else
...
...
@@ -1257,7 +1252,6 @@ public:
static_cast
<
const
formula
::
SingleVectorRefToken
*
>
(
pCur
);
ss
<<
"if (gid0 < "
<<
pSVR
->
GetArrayLength
()
<<
"){
\n\t\t
"
;
#else
nItems
+=
1
;
#endif
}
else
if
(
pCur
->
GetType
()
==
formula
::
svDouble
)
...
...
@@ -1265,11 +1259,9 @@ public:
#ifdef ISNAN
ss
<<
"{
\n\t\t
"
;
#endif
nItems
+=
1
;
}
else
{
nItems
+=
1
;
}
}
#ifdef ISNAN
...
...
@@ -1304,7 +1296,7 @@ public:
ss
<<
"return tmp"
;
#ifdef ISNAN
if
(
isAverage
())
ss
<<
"
/(double)nCount
"
;
ss
<<
"
*pow((double)nCount,-1.0)
"
;
#else
if
(
isAverage
())
ss
<<
"/(double)"
<<
nItems
;
...
...
@@ -2827,10 +2819,10 @@ DynamicKernelSoPArguments::DynamicKernelSoPArguments(
mvSubArguments
.
push_back
(
SoPHelper
(
ts
,
ft
->
Children
[
i
],
new
OpSumIf
));
break
;
/*
case ocNegSub:
case
ocNegSub
:
mvSubArguments
.
push_back
(
SoPHelper
(
ts
,
ft
->
Children
[
i
],
new
OpNegSub
));
break;
*/
break
;
case
ocAveDev
:
mvSubArguments
.
push_back
(
SoPHelper
(
ts
,
ft
->
Children
[
i
],
new
OpAveDev
));
...
...
@@ -3071,6 +3063,12 @@ DynamicKernelSoPArguments::DynamicKernelSoPArguments(
mvSubArguments
.
push_back
(
SoPHelper
(
ts
,
ft
->
Children
[
i
],
new
OpBesselj
));
}
else
if
(
!
(
pChild
->
GetExternal
().
compareTo
(
OUString
(
"com.sun.star.sheet.addin.Analysis.getGestep"
))))
{
mvSubArguments
.
push_back
(
SoPHelper
(
ts
,
ft
->
Children
[
i
],
new
OpGestep
));
}
else
throw
UnhandledToken
(
pChild
,
"unhandled opcode"
);
break
;
...
...
@@ -3175,6 +3173,9 @@ public:
global_work_size
,
NULL
,
0
,
NULL
,
NULL
);
if
(
CL_SUCCESS
!=
err
)
throw
OpenCLError
(
err
,
__FILE__
,
__LINE__
);
err
=
clFinish
(
kEnv
.
mpkCmdQueue
);
if
(
CL_SUCCESS
!=
err
)
throw
OpenCLError
(
err
,
__FILE__
,
__LINE__
);
}
virtual
~
DynamicKernel
();
cl_mem
GetResultBuffer
(
void
)
const
{
return
mpResClmem
;
}
...
...
sc/source/core/opencl/op_addin.cxx
Dosyayı görüntüle @
fbbf5c08
...
...
@@ -196,6 +196,71 @@ void OpBesselj::GenSlidingWindowFunction(std::stringstream &ss,
ss
<<
" return DBL_MAX;
\n
"
;
ss
<<
"}"
;
}
void
OpGestep
::
GenSlidingWindowFunction
(
std
::
stringstream
&
ss
,
const
std
::
string
&
sSymName
,
SubArguments
&
vSubArguments
)
{
ss
<<
"
\n
double "
<<
sSymName
;
ss
<<
"_"
<<
BinFuncName
()
<<
"("
;
for
(
unsigned
i
=
0
;
i
<
vSubArguments
.
size
();
i
++
)
{
if
(
i
)
ss
<<
","
;
vSubArguments
[
i
]
->
GenSlidingWindowDecl
(
ss
);
}
ss
<<
")
\n
"
;
ss
<<
"{
\n
"
;
ss
<<
" double tmp=0,tmp0 =0,tmp1 = 0;
\n
"
;
ss
<<
" int gid0=get_global_id(0);
\n
"
;
size_t
i
=
vSubArguments
.
size
();
ss
<<
"
\n
"
;
for
(
i
=
0
;
i
<
vSubArguments
.
size
();
i
++
)
{
FormulaToken
*
pCur
=
vSubArguments
[
i
]
->
GetFormulaToken
();
assert
(
pCur
);
if
(
pCur
->
GetType
()
==
formula
::
svSingleVectorRef
)
{
#ifdef ISNAN
const
formula
::
SingleVectorRefToken
*
pSVR
=
dynamic_cast
<
const
formula
::
SingleVectorRefToken
*
>
(
pCur
);
ss
<<
" if (gid0 < "
<<
pSVR
->
GetArrayLength
()
<<
")
\n
"
;
ss
<<
" {
\n
"
;
#endif
}
else
if
(
pCur
->
GetType
()
==
formula
::
svDouble
)
{
#ifdef ISNAN
ss
<<
" {
\n
"
;
#endif
}
else
{
#ifdef ISNAN
#endif
}
#ifdef ISNAN
if
(
ocPush
==
vSubArguments
[
i
]
->
GetFormulaToken
()
->
GetOpCode
())
{
ss
<<
" if (isNan("
;
ss
<<
vSubArguments
[
i
]
->
GenSlidingWindowDeclRef
();
ss
<<
"))
\n
"
;
ss
<<
" tmp"
<<
i
<<
" = 0;
\n
"
;
ss
<<
" else
\n
"
;
ss
<<
" tmp"
<<
i
<<
" = "
;
ss
<<
vSubArguments
[
i
]
->
GenSlidingWindowDeclRef
();
ss
<<
";
\n
}
\n
"
;
}
else
{
ss
<<
"tmp"
<<
i
<<
" ="
<<
vSubArguments
[
i
]
->
GenSlidingWindowDeclRef
();
ss
<<
";
\n
"
;
}
#endif
}
ss
<<
" tmp =tmp0 >= tmp1 ? 1 : 0;
\n
"
;
ss
<<
" return tmp;
\n
"
;
ss
<<
"}
\n
"
;
}
}}
...
...
sc/source/core/opencl/op_addin.hxx
Dosyayı görüntüle @
fbbf5c08
...
...
@@ -21,6 +21,13 @@ public:
const
std
::
string
&
sSymName
,
SubArguments
&
vSubArguments
)
SAL_OVERRIDE
;
virtual
std
::
string
BinFuncName
(
void
)
const
SAL_OVERRIDE
{
return
"Besselj"
;
}
};
class
OpGestep
:
public
Normal
{
public
:
virtual
void
GenSlidingWindowFunction
(
std
::
stringstream
&
ss
,
const
std
::
string
&
sSymName
,
SubArguments
&
vSubArguments
)
SAL_OVERRIDE
;;
virtual
std
::
string
BinFuncName
(
void
)
const
SAL_OVERRIDE
{
return
"Gestep"
;
}
};
}}
...
...
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