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
3ad748ac
Kaydet (Commit)
3ad748ac
authored
Haz 13, 2014
tarafından
haochen
Kaydeden (comit)
Markus Mohrhard
Haz 17, 2014
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
GPU Calc:Support nested formulae expansion for simple nested
Change-Id: If1ae42a5481cf76942ff1ac5e0ee31a94159badd
üst
8e19f8eb
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
115 additions
and
48 deletions
+115
-48
formulagroupcl.cxx
sc/source/core/opencl/formulagroupcl.cxx
+57
-41
op_logical.cxx
sc/source/core/opencl/op_logical.cxx
+27
-1
opbase.cxx
sc/source/core/opencl/opbase.cxx
+27
-5
opbase.hxx
sc/source/core/opencl/opbase.hxx
+4
-1
No files found.
sc/source/core/opencl/formulagroupcl.cxx
Dosyayı görüntüle @
3ad748ac
...
...
@@ -1256,12 +1256,12 @@ public:
ss
<<
", "
;
vSubArguments
[
i
]
->
GenSlidingWindowDecl
(
ss
);
}
ss
<<
") {
\n
\t
"
;
ss
<<
"double tmp = "
<<
GetBottom
()
<<
";
\n
\t
"
;
ss
<<
"int gid0 = get_global_id(0);
\n
\t
"
;
ss
<<
") {
\n
"
;
ss
<<
"double tmp = "
<<
GetBottom
()
<<
";
\n
"
;
ss
<<
"int gid0 = get_global_id(0);
\n
"
;
if
(
isAverage
())
ss
<<
"int nCount = 0;
\n
\t
"
;
ss
<<
"double tmpBottom;
\n
\t
"
;
ss
<<
"int nCount = 0;
\n
"
;
ss
<<
"double tmpBottom;
\n
"
;
unsigned
i
=
vSubArguments
.
size
();
while
(
i
--
)
{
...
...
@@ -1292,60 +1292,52 @@ public:
if
(
pCur
->
GetType
()
==
formula
::
svSingleVectorRef
)
{
#ifdef ISNAN
const
formula
::
SingleVectorRefToken
*
pSVR
=
static_cast
<
const
formula
::
SingleVectorRefToken
*
>
(
pCur
);
ss
<<
"if (gid0 < "
<<
pSVR
->
GetArrayLength
()
<<
"){
\n\t\t
"
;
#else
#endif
ss
<<
"if (gid0 < "
<<
pSVR
->
GetArrayLength
()
<<
"){
\n
"
;
}
else
if
(
pCur
->
GetType
()
==
formula
::
svDouble
)
{
#ifdef ISNAN
ss
<<
"{
\n\t\t
"
;
#endif
}
else
{
ss
<<
"{
\n
"
;
}
}
#ifdef ISNAN
if
(
ocPush
==
vSubArguments
[
i
]
->
GetFormulaToken
()
->
GetOpCode
())
{
ss
<<
"tmpBottom = "
<<
GetBottom
()
<<
";
\n
\t\t
"
;
ss
<<
"tmpBottom = "
<<
GetBottom
()
<<
";
\n
"
;
ss
<<
"if (isNan("
;
ss
<<
vSubArguments
[
i
]
->
GenSlidingWindowDeclRef
();
ss
<<
"))
\n\t\t\t
"
;
ss
<<
"tmp = "
;
ss
<<
Gen2
(
"tmpBottom"
,
"tmp"
)
<<
";
\n\t\t
"
;
ss
<<
"else{
\n\t\t\t
"
;
ss
<<
"tmp = "
;
ss
<<
"))
\n
"
;
if
(
ZeroReturnZero
()
)
ss
<<
" return 0;
\n
"
;
else
{
ss
<<
" tmp = "
;
ss
<<
Gen2
(
"tmpBottom"
,
"tmp"
)
<<
";
\n
"
;
}
ss
<<
"else{
\n
"
;
ss
<<
" tmp = "
;
ss
<<
Gen2
(
vSubArguments
[
i
]
->
GenSlidingWindowDeclRef
(),
"tmp"
);
ss
<<
";
\n\t\t\t
"
;
ss
<<
"}
\n\t
"
;
ss
<<
"}
\n\t
"
;
ss
<<
";
\n
"
;
ss
<<
" }
\n
"
;
ss
<<
"}
\n
"
;
if
(
vSubArguments
[
i
]
->
GetFormulaToken
()
->
GetType
()
==
formula
::
svSingleVectorRef
&&
ZeroReturnZero
()
)
{
ss
<<
"else{
\n
"
;
ss
<<
" return 0;
\n
"
;
ss
<<
" }
\n
"
;
}
}
else
{
ss
<<
"tmp = "
;
ss
<<
Gen2
(
vSubArguments
[
i
]
->
GenSlidingWindowDeclRef
(),
"tmp"
);
ss
<<
";
\n
\t
"
;
ss
<<
";
\n
"
;
}
#else
ss
<<
"tmp = "
;
// Generate the operation in binary form
ss
<<
Gen2
(
vSubArguments
[
i
]
->
GenSlidingWindowDeclRef
(),
"tmp"
);
ss
<<
";
\n\t
"
;
#endif
}
ss
<<
"return tmp"
;
#ifdef ISNAN
if
(
isAverage
())
ss
<<
"*pow((double)nCount,-1.0)"
;
#else
if
(
isAverage
())
ss
<<
"/(double)"
<<
nItems
;
#endif
ss
<<
";
\n
}"
;
}
virtual
bool
isAverage
()
const
{
return
false
;
}
...
...
@@ -1535,6 +1527,11 @@ public:
static_cast
<
const
formula
::
SingleVectorRefToken
*>
(
vSubArguments
[
i
]
->
GetFormulaToken
());
temp3
<<
pSVR
->
GetArrayLength
();
temp3
<<
")||isNan("
<<
vSubArguments
[
i
]
->
GenSlidingWindowDeclRef
();
temp3
<<
")?0:"
;
temp3
<<
vSubArguments
[
i
]
->
GenSlidingWindowDeclRef
();
temp3
<<
")"
;
}
else
if
(
vSubArguments
[
i
]
->
GetFormulaToken
()
->
GetType
()
==
formula
::
svDoubleVectorRef
){
...
...
@@ -1542,13 +1539,14 @@ public:
static_cast
<
const
formula
::
DoubleVectorRefToken
*>
(
vSubArguments
[
i
]
->
GetFormulaToken
());
temp3
<<
pSVR
->
GetArrayLength
();
}
temp3
<<
")||isNan("
<<
vSubArguments
[
i
]
->
GenSlidingWindowDeclRef
(
true
);
temp3
<<
")?0:"
;
temp3
<<
vSubArguments
[
i
]
->
GenSlidingWindowDeclRef
(
true
);
temp3
<<
")"
;
}
}
else
temp3
<<
vSubArguments
[
i
]
->
GenSlidingWindowDeclRef
(
true
);
}
...
...
@@ -1604,6 +1602,11 @@ public:
static_cast
<
const
formula
::
SingleVectorRefToken
*>
(
vSubArguments
[
i
]
->
GetFormulaToken
());
temp4
<<
pSVR
->
GetArrayLength
();
temp4
<<
")||isNan("
<<
vSubArguments
[
i
]
->
GenSlidingWindowDeclRef
();
temp4
<<
")?0:"
;
temp4
<<
vSubArguments
[
i
]
->
GenSlidingWindowDeclRef
();
temp4
<<
")"
;
}
else
if
(
vSubArguments
[
i
]
->
GetFormulaToken
()
->
GetType
()
==
formula
::
svDoubleVectorRef
)
...
...
@@ -1612,13 +1615,14 @@ public:
static_cast
<
const
formula
::
DoubleVectorRefToken
*>
(
vSubArguments
[
i
]
->
GetFormulaToken
());
temp4
<<
pSVR
->
GetArrayLength
();
}
temp4
<<
")||isNan("
<<
vSubArguments
[
i
]
->
GenSlidingWindowDeclRef
(
true
);
temp4
<<
")?0:"
;
temp4
<<
vSubArguments
[
i
]
->
GenSlidingWindowDeclRef
(
true
);
temp4
<<
")"
;
}
}
else
{
temp4
<<
vSubArguments
[
i
]
...
...
@@ -1752,6 +1756,7 @@ public:
return
lhs
+
"*"
+
rhs
;
}
virtual
std
::
string
BinFuncName
(
void
)
const
SAL_OVERRIDE
{
return
"fmul"
;
}
virtual
bool
ZeroReturnZero
()
{
return
true
;};
};
/// Technically not a reduction, but fits the framework.
...
...
@@ -2021,8 +2026,19 @@ public:
}
else
{
if
(
mvSubArguments
.
size
()
!=
2
)
throw
Unhandled
();
ss
<<
"("
<<
mpCodeGen
->
Gen2
(
mvSubArguments
[
0
]
->
GenSlidingWindowDeclRef
(
true
),
mvSubArguments
[
1
]
->
GenSlidingWindowDeclRef
(
true
))
<<
")"
;
bool
bArgument1_NeedNested
=
(
mvSubArguments
[
0
]
->
GetFormulaToken
()
->
GetType
()
==
formula
::
svSingleVectorRef
)
?
false
:
true
;
bool
bArgument2_NeedNested
=
(
mvSubArguments
[
1
]
->
GetFormulaToken
()
->
GetType
()
==
formula
::
svSingleVectorRef
)
?
false
:
true
;
ss
<<
"("
;
ss
<<
mpCodeGen
->
Gen2
(
mvSubArguments
[
0
]
->
GenSlidingWindowDeclRef
(
bArgument1_NeedNested
),
mvSubArguments
[
1
]
->
GenSlidingWindowDeclRef
(
bArgument2_NeedNested
));
ss
<<
")"
;
}
return
ss
.
str
();
}
...
...
sc/source/core/opencl/op_logical.cxx
Dosyayı görüntüle @
3ad748ac
...
...
@@ -319,7 +319,6 @@ void OpIf::GenSlidingWindowFunction(std::stringstream &ss,
{
ss
<<
"
\n
double "
<<
sSymName
;
ss
<<
"_"
<<
BinFuncName
()
<<
"("
;
if
(
vSubArguments
.
size
()
!=
3
)
throw
Unhandled
(
"unknown operand for ocPush"
);
for
(
unsigned
i
=
0
;
i
<
vSubArguments
.
size
();
i
++
)
{
if
(
i
)
...
...
@@ -335,6 +334,8 @@ void OpIf::GenSlidingWindowFunction(std::stringstream &ss,
throw
UnhandledToken
(
tmpCur0
,
"unknown operand for ocPush"
);
}
else
{
if
(
vSubArguments
.
size
()
==
3
)
{
ss
<<
" if(isNan("
;
ss
<<
vSubArguments
[
0
]
->
GenSlidingWindowDeclRef
();
...
...
@@ -349,6 +350,31 @@ void OpIf::GenSlidingWindowFunction(std::stringstream &ss,
ss
<<
vSubArguments
[
1
]
->
GenSlidingWindowDeclRef
();
ss
<<
";
\n
"
;
}
if
(
vSubArguments
.
size
()
==
2
)
{
ss
<<
" if(isNan("
;
ss
<<
vSubArguments
[
0
]
->
GenSlidingWindowDeclRef
();
ss
<<
")|| "
;
ss
<<
vSubArguments
[
0
]
->
GenSlidingWindowDeclRef
();
ss
<<
" == 0)
\n
"
;
ss
<<
" return 0;
\n
"
;
ss
<<
" else"
;
ss
<<
" return "
;
ss
<<
vSubArguments
[
1
]
->
GenSlidingWindowDeclRef
();
ss
<<
";
\n
"
;
}
if
(
vSubArguments
.
size
()
==
1
)
{
ss
<<
" if(isNan("
;
ss
<<
vSubArguments
[
0
]
->
GenSlidingWindowDeclRef
();
ss
<<
")|| "
;
ss
<<
vSubArguments
[
0
]
->
GenSlidingWindowDeclRef
();
ss
<<
" == 0)
\n
"
;
ss
<<
" return 0;
\n
"
;
ss
<<
" else"
;
ss
<<
" return 1;
\n
"
;
}
}
ss
<<
"}
\n
"
;
}
...
...
sc/source/core/opencl/opbase.cxx
Dosyayı görüntüle @
3ad748ac
...
...
@@ -130,7 +130,6 @@ void CheckVariables::CheckSubArgumentIsNan( std::stringstream & ss,
SubArguments
&
vSubArguments
,
int
argumentNum
)
{
int
i
=
argumentNum
;
#ifdef ISNAN
if
(
vSubArguments
[
i
]
->
GetFormulaToken
()
->
GetType
()
==
formula
::
svSingleVectorRef
)
{
...
...
@@ -139,6 +138,17 @@ void CheckVariables::CheckSubArgumentIsNan( std::stringstream & ss,
ss
<<
" if(singleIndex>="
;
ss
<<
pTmpDVR1
->
GetArrayLength
();
ss
<<
" ||"
;
ss
<<
"isNan("
;
ss
<<
vSubArguments
[
i
]
->
GenSlidingWindowDeclRef
(
true
);
ss
<<
"))
\n
"
;
ss
<<
" tmp"
;
ss
<<
i
;
ss
<<
"=0;
\n
else
\n
"
;
ss
<<
" tmp"
;
ss
<<
i
;
ss
<<
"="
;
ss
<<
vSubArguments
[
i
]
->
GenSlidingWindowDeclRef
(
true
);
ss
<<
";
\n
"
;
}
if
(
vSubArguments
[
i
]
->
GetFormulaToken
()
->
GetType
()
==
formula
::
svDoubleVectorRef
)
...
...
@@ -148,24 +158,36 @@ void CheckVariables::CheckSubArgumentIsNan( std::stringstream & ss,
ss
<<
" if(doubleIndex>="
;
ss
<<
pTmpDVR2
->
GetArrayLength
();
ss
<<
" ||"
;
ss
<<
"isNan("
;
ss
<<
vSubArguments
[
i
]
->
GenSlidingWindowDeclRef
(
false
);
ss
<<
"))
\n
"
;
ss
<<
" tmp"
;
ss
<<
i
;
ss
<<
"=0;
\n
else
\n
"
;
ss
<<
" tmp"
;
ss
<<
i
;
ss
<<
"="
;
ss
<<
vSubArguments
[
i
]
->
GenSlidingWindowDeclRef
(
false
);
ss
<<
";
\n
"
;
}
if
(
vSubArguments
[
i
]
->
GetFormulaToken
()
->
GetType
()
==
formula
::
svDouble
||
vSubArguments
[
i
]
->
GetFormulaToken
()
->
GetOpCode
()
!=
ocPush
)
{
ss
<<
" if("
;
}
ss
<<
"isNan("
;
ss
<<
vSubArguments
[
i
]
->
GenSlidingWindowDeclRef
(
true
);
ss
<<
vSubArguments
[
i
]
->
GenSlidingWindowDeclRef
(
);
ss
<<
"))
\n
"
;
ss
<<
" tmp"
;
ss
<<
i
;
ss
<<
"=0;
\n
else
\n
"
;
#endif
ss
<<
" tmp"
;
ss
<<
i
;
ss
<<
"="
;
ss
<<
vSubArguments
[
i
]
->
GenSlidingWindowDeclRef
(
true
);
ss
<<
vSubArguments
[
i
]
->
GenSlidingWindowDeclRef
(
);
ss
<<
";
\n
"
;
}
}
void
CheckVariables
::
CheckSubArgumentIsNan2
(
std
::
stringstream
&
ss
,
...
...
sc/source/core/opencl/opbase.hxx
Dosyayı görüntüle @
3ad748ac
...
...
@@ -211,7 +211,7 @@ public:
virtual
void
GenSlidingWindowDecl
(
std
::
stringstream
&
ss
)
const
SAL_OVERRIDE
;
/// When referenced in a sliding window function
virtual
std
::
string
GenSlidingWindowDeclRef
(
bool
=
tru
e
)
const
SAL_OVERRIDE
;
virtual
std
::
string
GenSlidingWindowDeclRef
(
bool
=
fals
e
)
const
SAL_OVERRIDE
;
/// Create buffer and pass the buffer to a given kernel
virtual
size_t
Marshal
(
cl_kernel
,
int
,
int
,
cl_program
)
SAL_OVERRIDE
;
...
...
@@ -250,6 +250,9 @@ public:
std
::
set
<
std
::
string
>&
)
{}
virtual
bool
takeString
()
const
=
0
;
virtual
bool
takeNumeric
()
const
=
0
;
//Continue process 'Zero' or Not(like OpMul, not continue process when meet
// 'Zero'
virtual
bool
ZeroReturnZero
()
{
return
false
;}
virtual
~
OpBase
()
{}
};
...
...
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