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
cccf45a3
Kaydet (Commit)
cccf45a3
authored
Ara 16, 2014
tarafından
Kohei Yoshida
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Split the wait-for-result part and push-result-to-doc part.
Change-Id: I496fa9274922603f4c7efdcab90e66a23df741fa
üst
1dd1dfc1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
25 additions
and
10 deletions
+25
-10
formulagroupcl.cxx
sc/source/core/opencl/formulagroupcl.cxx
+25
-10
No files found.
sc/source/core/opencl/formulagroupcl.cxx
Dosyayı görüntüle @
cccf45a3
...
...
@@ -3659,28 +3659,31 @@ class CLInterpreterResult
SCROW
mnGroupLength
;
cl_mem
mpCLResBuf
;
double
*
mpResBuf
;
public
:
CLInterpreterResult
()
:
mpKernel
(
NULL
),
mnGroupLength
(
0
)
{}
CLInterpreterResult
()
:
mpKernel
(
NULL
),
mnGroupLength
(
0
)
,
mpCLResBuf
(
NULL
),
mpResBuf
(
NULL
)
{}
CLInterpreterResult
(
DynamicKernel
*
pKernel
,
SCROW
nGroupLength
)
:
mpKernel
(
pKernel
),
mnGroupLength
(
nGroupLength
)
{}
mpKernel
(
pKernel
),
mnGroupLength
(
nGroupLength
)
,
mpCLResBuf
(
NULL
),
mpResBuf
(
NULL
)
{}
bool
isValid
()
const
{
return
mpKernel
!=
NULL
;
}
bool
pushResultToDocument
(
ScDocument
&
rDoc
,
const
ScAddress
&
rTopPos
)
void
waitForResult
(
)
{
if
(
!
isValid
())
return
false
;
return
;
// Map results back
cl_mem
res
=
mpKernel
->
GetResultBuffer
();
mpCLResBuf
=
mpKernel
->
GetResultBuffer
();
// Obtain cl context
::
opencl
::
KernelEnv
kEnv
;
::
opencl
::
setKernelEnv
(
&
kEnv
);
cl_int
err
;
double
*
resb
uf
=
(
double
*
)
clEnqueueMapBuffer
(
kEnv
.
mpkCmdQueue
,
res
,
mpResB
uf
=
(
double
*
)
clEnqueueMapBuffer
(
kEnv
.
mpkCmdQueue
,
mpCLResBuf
,
CL_TRUE
,
CL_MAP_READ
,
0
,
mnGroupLength
*
sizeof
(
double
),
0
,
NULL
,
NULL
,
&
err
);
...
...
@@ -3688,12 +3691,22 @@ public:
if
(
err
!=
CL_SUCCESS
)
{
SAL_WARN
(
"sc.opencl"
,
"Dynamic formula compiler: OpenCL error: "
<<
err
);
return
false
;
mpResBuf
=
NULL
;
}
}
bool
pushResultToDocument
(
ScDocument
&
rDoc
,
const
ScAddress
&
rTopPos
)
{
if
(
!
mpResBuf
)
return
false
;
rDoc
.
SetFormulaResults
(
rTopPos
,
resb
uf
,
mnGroupLength
);
rDoc
.
SetFormulaResults
(
rTopPos
,
mpResB
uf
,
mnGroupLength
);
err
=
clEnqueueUnmapMemObject
(
kEnv
.
mpkCmdQueue
,
res
,
resbuf
,
0
,
NULL
,
NULL
);
// Obtain cl context
::
opencl
::
KernelEnv
kEnv
;
::
opencl
::
setKernelEnv
(
&
kEnv
);
cl_int
err
=
clEnqueueUnmapMemObject
(
kEnv
.
mpkCmdQueue
,
mpCLResBuf
,
mpResBuf
,
0
,
NULL
,
NULL
);
if
(
err
!=
CL_SUCCESS
)
{
SAL_WARN
(
"sc.opencl"
,
"Dynamic formula compiler: OpenCL error: "
<<
err
);
...
...
@@ -3826,6 +3839,8 @@ bool FormulaGroupInterpreterOpenCL::interpret( ScDocument& rDoc,
if
(
!
aRes
.
isValid
())
return
false
;
aRes
.
waitForResult
();
return
aRes
.
pushResultToDocument
(
rDoc
,
rTopPos
);
}
...
...
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