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
Hide 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 @@
...
@@ -31,7 +31,7 @@
/// CONFIGURATIONS
/// CONFIGURATIONS
// Comment out this to turn off FMIN and FMAX intrinsics
// Comment out this to turn off FMIN and FMAX intrinsics
#define USE_FMIN_FMAX 1
#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)
#define UNROLLING_FACTOR 16 // set to 4 for correctness testing (if no reduce)
#include "formulagroupcl_public.hxx"
#include "formulagroupcl_public.hxx"
#ifdef WIN32
#ifdef WIN32
...
@@ -1218,30 +1218,25 @@ public:
...
@@ -1218,30 +1218,25 @@ public:
ss
<<
"int nCount = 0;
\n\t
"
;
ss
<<
"int nCount = 0;
\n\t
"
;
ss
<<
"double tmpBottom;
\n\t
"
;
ss
<<
"double tmpBottom;
\n\t
"
;
unsigned
i
=
vSubArguments
.
size
();
unsigned
i
=
vSubArguments
.
size
();
size_t
nItems
=
0
;
while
(
i
--
)
while
(
i
--
)
{
{
if
(
NumericRange
*
NR
=
if
(
NumericRange
*
NR
=
dynamic_cast
<
NumericRange
*>
(
vSubArguments
[
i
].
get
()))
dynamic_cast
<
NumericRange
*>
(
vSubArguments
[
i
].
get
()))
{
{
bool
needBody
;
bool
needBody
;
NR
->
GenReductionLoopHeader
(
ss
,
needBody
);
if
(
needBody
==
false
)
continue
;
nItems
+=
NR
->
GenReductionLoopHeader
(
ss
,
needBody
);
if
(
needBody
==
false
)
continue
;
}
}
else
if
(
ParallelNumericRange
*
PNR
=
else
if
(
ParallelNumericRange
*
PNR
=
dynamic_cast
<
ParallelNumericRange
*>
(
vSubArguments
[
i
].
get
()))
dynamic_cast
<
ParallelNumericRange
*>
(
vSubArguments
[
i
].
get
()))
{
{
//did not handle yet
//did not handle yet
bool
needBody
;
bool
needBody
;
PNR
->
GenReductionLoopHeader
(
ss
,
needBody
);
if
(
needBody
==
false
)
continue
;
nItems
+=
PNR
->
GenReductionLoopHeader
(
ss
,
needBody
);
if
(
needBody
==
false
)
continue
;
}
}
else
if
(
StringRange
*
SR
=
else
if
(
StringRange
*
SR
=
dynamic_cast
<
StringRange
*>
(
vSubArguments
[
i
].
get
()))
dynamic_cast
<
StringRange
*>
(
vSubArguments
[
i
].
get
()))
{
{
//did not handle yet
//did not handle yet
bool
needBody
;
bool
needBody
;
nItems
+=
SR
->
GenReductionLoopHeader
(
ss
,
needBody
);
SR
->
GenReductionLoopHeader
(
ss
,
needBody
);
if
(
needBody
==
false
)
continue
;
if
(
needBody
==
false
)
continue
;
}
}
else
else
...
@@ -1257,7 +1252,6 @@ public:
...
@@ -1257,7 +1252,6 @@ public:
static_cast
<
const
formula
::
SingleVectorRefToken
*
>
(
pCur
);
static_cast
<
const
formula
::
SingleVectorRefToken
*
>
(
pCur
);
ss
<<
"if (gid0 < "
<<
pSVR
->
GetArrayLength
()
<<
"){
\n\t\t
"
;
ss
<<
"if (gid0 < "
<<
pSVR
->
GetArrayLength
()
<<
"){
\n\t\t
"
;
#else
#else
nItems
+=
1
;
#endif
#endif
}
}
else
if
(
pCur
->
GetType
()
==
formula
::
svDouble
)
else
if
(
pCur
->
GetType
()
==
formula
::
svDouble
)
...
@@ -1265,11 +1259,9 @@ public:
...
@@ -1265,11 +1259,9 @@ public:
#ifdef ISNAN
#ifdef ISNAN
ss
<<
"{
\n\t\t
"
;
ss
<<
"{
\n\t\t
"
;
#endif
#endif
nItems
+=
1
;
}
}
else
else
{
{
nItems
+=
1
;
}
}
}
}
#ifdef ISNAN
#ifdef ISNAN
...
@@ -1304,7 +1296,7 @@ public:
...
@@ -1304,7 +1296,7 @@ public:
ss
<<
"return tmp"
;
ss
<<
"return tmp"
;
#ifdef ISNAN
#ifdef ISNAN
if
(
isAverage
())
if
(
isAverage
())
ss
<<
"
/(double)nCount
"
;
ss
<<
"
*pow((double)nCount,-1.0)
"
;
#else
#else
if
(
isAverage
())
if
(
isAverage
())
ss
<<
"/(double)"
<<
nItems
;
ss
<<
"/(double)"
<<
nItems
;
...
@@ -2827,10 +2819,10 @@ DynamicKernelSoPArguments::DynamicKernelSoPArguments(
...
@@ -2827,10 +2819,10 @@ DynamicKernelSoPArguments::DynamicKernelSoPArguments(
mvSubArguments
.
push_back
(
SoPHelper
(
ts
,
mvSubArguments
.
push_back
(
SoPHelper
(
ts
,
ft
->
Children
[
i
],
new
OpSumIf
));
ft
->
Children
[
i
],
new
OpSumIf
));
break
;
break
;
/*
case ocNegSub:
case
ocNegSub
:
mvSubArguments
.
push_back
(
SoPHelper
(
ts
,
mvSubArguments
.
push_back
(
SoPHelper
(
ts
,
ft
->
Children
[
i
],
new
OpNegSub
));
ft
->
Children
[
i
],
new
OpNegSub
));
break;
*/
break
;
case
ocAveDev
:
case
ocAveDev
:
mvSubArguments
.
push_back
(
SoPHelper
(
ts
,
mvSubArguments
.
push_back
(
SoPHelper
(
ts
,
ft
->
Children
[
i
],
new
OpAveDev
));
ft
->
Children
[
i
],
new
OpAveDev
));
...
@@ -3071,6 +3063,12 @@ DynamicKernelSoPArguments::DynamicKernelSoPArguments(
...
@@ -3071,6 +3063,12 @@ DynamicKernelSoPArguments::DynamicKernelSoPArguments(
mvSubArguments
.
push_back
(
SoPHelper
(
ts
,
ft
->
Children
[
i
],
mvSubArguments
.
push_back
(
SoPHelper
(
ts
,
ft
->
Children
[
i
],
new
OpBesselj
));
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
else
throw
UnhandledToken
(
pChild
,
"unhandled opcode"
);
throw
UnhandledToken
(
pChild
,
"unhandled opcode"
);
break
;
break
;
...
@@ -3175,6 +3173,9 @@ public:
...
@@ -3175,6 +3173,9 @@ public:
global_work_size
,
NULL
,
0
,
NULL
,
NULL
);
global_work_size
,
NULL
,
0
,
NULL
,
NULL
);
if
(
CL_SUCCESS
!=
err
)
if
(
CL_SUCCESS
!=
err
)
throw
OpenCLError
(
err
,
__FILE__
,
__LINE__
);
throw
OpenCLError
(
err
,
__FILE__
,
__LINE__
);
err
=
clFinish
(
kEnv
.
mpkCmdQueue
);
if
(
CL_SUCCESS
!=
err
)
throw
OpenCLError
(
err
,
__FILE__
,
__LINE__
);
}
}
virtual
~
DynamicKernel
();
virtual
~
DynamicKernel
();
cl_mem
GetResultBuffer
(
void
)
const
{
return
mpResClmem
;
}
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,
...
@@ -196,6 +196,71 @@ void OpBesselj::GenSlidingWindowFunction(std::stringstream &ss,
ss
<<
" return DBL_MAX;
\n
"
;
ss
<<
" return DBL_MAX;
\n
"
;
ss
<<
"}"
;
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:
...
@@ -21,6 +21,13 @@ public:
const
std
::
string
&
sSymName
,
SubArguments
&
vSubArguments
)
SAL_OVERRIDE
;
const
std
::
string
&
sSymName
,
SubArguments
&
vSubArguments
)
SAL_OVERRIDE
;
virtual
std
::
string
BinFuncName
(
void
)
const
SAL_OVERRIDE
{
return
"Besselj"
;
}
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