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
783179c1
Kaydet (Commit)
783179c1
authored
Eyl 13, 2013
tarafından
Markus Mohrhard
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
show compute units, frequency and memory for opencl devices
Change-Id: Ib322a429a3d29ed985702dc1b5cb9d1cb0a1ac07
üst
8fa1a8b4
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
153 additions
and
9 deletions
+153
-9
platforminfo.hxx
sc/inc/platforminfo.hxx
+3
-0
openclwrapper.cxx
sc/source/core/opencl/openclwrapper.cxx
+21
-0
calcoptionsdlg.cxx
sc/source/ui/optdlg/calcoptionsdlg.cxx
+29
-9
calcoptionsdlg.hxx
sc/source/ui/optdlg/calcoptionsdlg.hxx
+12
-0
formulacalculationoptions.ui
sc/uiconfig/scalc/ui/formulacalculationoptions.ui
+88
-0
No files found.
sc/inc/platforminfo.hxx
Dosyayı görüntüle @
783179c1
...
...
@@ -23,6 +23,9 @@ struct SC_DLLPUBLIC OpenclDeviceInfo
size_t
mnId
;
OUString
maName
;
OUString
maVendor
;
size_t
mnMemory
;
size_t
mnComputeUnits
;
size_t
mnFrequency
;
};
struct
SC_DLLPUBLIC
OpenclPlatformInfo
...
...
sc/source/core/opencl/openclwrapper.cxx
Dosyayı görüntüle @
783179c1
...
...
@@ -2654,6 +2654,27 @@ void createDeviceInfo(cl_device_id aDeviceId, OpenclPlatformInfo& rPlatformInfo)
aDeviceInfo
.
maVendor
=
OUString
::
createFromAscii
(
pVendor
);
cl_ulong
nMemSize
;
nState
=
clGetDeviceInfo
(
aDeviceId
,
CL_DEVICE_GLOBAL_MEM_SIZE
,
sizeof
(
nMemSize
),
&
nMemSize
,
NULL
);
if
(
nState
!=
CL_SUCCESS
)
return
;
aDeviceInfo
.
mnMemory
=
nMemSize
;
cl_uint
nClockFrequency
;
nState
=
clGetDeviceInfo
(
aDeviceId
,
CL_DEVICE_MAX_CLOCK_FREQUENCY
,
sizeof
(
nClockFrequency
),
&
nClockFrequency
,
NULL
);
if
(
nState
!=
CL_SUCCESS
)
return
;
aDeviceInfo
.
mnFrequency
=
nClockFrequency
;
cl_uint
nComputeUnits
;
nState
=
clGetDeviceInfo
(
aDeviceId
,
CL_DEVICE_MAX_COMPUTE_UNITS
,
sizeof
(
nComputeUnits
),
&
nComputeUnits
,
NULL
);
if
(
nState
!=
CL_SUCCESS
)
return
;
aDeviceInfo
.
mnComputeUnits
=
nComputeUnits
;
rPlatformInfo
.
maDevices
.
push_back
(
aDeviceInfo
);
}
...
...
sc/source/ui/optdlg/calcoptionsdlg.cxx
Dosyayı görüntüle @
783179c1
...
...
@@ -14,10 +14,6 @@
#include "svtools/svlbitm.hxx"
#include "svtools/treelistentry.hxx"
#if HAVE_FEATURE_OPENCL
#include "platforminfo.hxx"
#endif
namespace
{
typedef
enum
{
...
...
@@ -118,11 +114,15 @@ ScCalcOptionsDialog::ScCalcOptionsDialog(Window* pParent, const ScCalcConfig& rC
get
(
mpOpenclInfoList
,
"opencl_list"
);
get
(
mpBtnAutomaticSelectionTrue
,
"automatic_select_true"
);
get
(
mpBtnAutomaticSelectionFalse
,
"automatic_select_false"
);
get
(
mpFtFrequency
,
"frequency"
);
get
(
mpFtComputeUnits
,
"compute_units"
);
get
(
mpFtMemory
,
"memory"
);
mpOpenclInfoList
->
set_height_request
(
4
*
mpOpenclInfoList
->
GetTextHeight
());
mpOpenclInfoList
->
SetStyle
(
mpOpenclInfoList
->
GetStyle
()
|
WB_CLIPCHILDREN
|
WB_FORCE_MAKEVISIBLE
);
mpOpenclInfoList
->
SetHighlightRange
();
mpOpenclInfoList
->
GetParent
()
->
Hide
();
mpOpenclInfoList
->
SetSelectHdl
(
LINK
(
this
,
ScCalcOptionsDialog
,
DeviceSelHdl
));
mpBtnAutomaticSelectionTrue
->
SetToggleHdl
(
LINK
(
this
,
ScCalcOptionsDialog
,
BtnAutomaticSelectHdl
));
...
...
@@ -195,14 +195,15 @@ void ScCalcOptionsDialog::fillOpenclList()
{
mpOpenclInfoList
->
SetUpdateMode
(
false
);
mpOpenclInfoList
->
Clear
();
std
::
vector
<
sc
::
OpenclPlatformInfo
>
aPlatformInfo
=
sc
::
listAllOpenclPlatforms
();
for
(
std
::
vector
<
sc
::
OpenclPlatformInfo
>::
const_iterator
it
=
aPlatformInfo
.
begin
(),
itEnd
=
aPlatformInfo
.
end
();
it
!=
itEnd
;
++
it
)
m
aPlatformInfo
=
sc
::
listAllOpenclPlatforms
();
for
(
std
::
vector
<
sc
::
OpenclPlatformInfo
>::
iterator
it
=
m
aPlatformInfo
.
begin
(),
itEnd
=
m
aPlatformInfo
.
end
();
it
!=
itEnd
;
++
it
)
{
for
(
std
::
vector
<
sc
::
OpenclDeviceInfo
>::
const_
iterator
for
(
std
::
vector
<
sc
::
OpenclDeviceInfo
>::
iterator
itr
=
it
->
maDevices
.
begin
(),
itrEnd
=
it
->
maDevices
.
end
();
itr
!=
itrEnd
;
++
itr
)
{
mpOpenclInfoList
->
InsertEntry
(
it
->
maVendor
+
" "
+
itr
->
maName
);
SvTreeListEntry
*
pEntry
=
mpOpenclInfoList
->
InsertEntry
(
it
->
maVendor
+
" "
+
itr
->
maName
);
pEntry
->
SetUserData
(
&
(
*
itr
));
}
}
...
...
@@ -299,6 +300,7 @@ void ScCalcOptionsDialog::SelectionChanged()
bValue
=
maConfig
.
mbOpenCLEnabled
;
mpFtAnnotation
->
SetText
(
maDescOpenCLEnabled
);
mpOpenclInfoList
->
GetParent
()
->
Show
();
setOptimalLayoutSize
();
if
(
bValue
)
mpOpenclInfoList
->
GetParent
()
->
Enable
();
else
...
...
@@ -356,6 +358,18 @@ void ScCalcOptionsDialog::OpenclAutomaticSelectionChanged()
maConfig
.
mbOpenCLAutoSelect
=
bValue
;
}
void
ScCalcOptionsDialog
::
SelectedDeviceChanged
()
{
#if HAVE_FEATURE_OPENCL
SvTreeListEntry
*
pEntry
=
mpOpenclInfoList
->
GetModel
()
->
GetView
(
0
)
->
FirstSelected
();
sc
::
OpenclDeviceInfo
*
pInfo
=
reinterpret_cast
<
sc
::
OpenclDeviceInfo
*>
(
pEntry
->
GetUserData
());
assert
(
pInfo
);
mpFtFrequency
->
SetText
(
OUString
::
number
(
pInfo
->
mnFrequency
));
mpFtComputeUnits
->
SetText
(
OUString
::
number
(
pInfo
->
mnComputeUnits
));
mpFtMemory
->
SetText
(
OUString
::
number
(
pInfo
->
mnMemory
/
1024
/
1024
));
#endif
}
void
ScCalcOptionsDialog
::
RadioValueChanged
()
{
sal_uInt16
nSelected
=
mpLbSettings
->
GetSelectEntryPos
();
...
...
@@ -424,5 +438,11 @@ IMPL_LINK_NOARG(ScCalcOptionsDialog, BtnAutomaticSelectHdl)
return
0
;
}
IMPL_LINK_NOARG
(
ScCalcOptionsDialog
,
DeviceSelHdl
)
{
SelectedDeviceChanged
();
return
0
;
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
sc/source/ui/optdlg/calcoptionsdlg.hxx
Dosyayı görüntüle @
783179c1
...
...
@@ -20,6 +20,10 @@
#include "calcconfig.hxx"
#if HAVE_FEATURE_OPENCL
#include "platforminfo.hxx"
#endif
class
ScCalcOptionsDialog
:
public
ModalDialog
{
public
:
...
...
@@ -29,6 +33,7 @@ public:
DECL_LINK
(
SettingsSelHdl
,
Control
*
);
DECL_LINK
(
BtnToggleHdl
,
void
*
);
DECL_LINK
(
BtnAutomaticSelectHdl
,
void
*
);
DECL_LINK
(
DeviceSelHdl
,
void
*
);
const
ScCalcConfig
&
GetConfig
()
const
;
...
...
@@ -38,6 +43,7 @@ private:
void
ListOptionValueChanged
();
void
RadioValueChanged
();
void
OpenclAutomaticSelectionChanged
();
void
SelectedDeviceChanged
();
#if HAVE_FEATURE_OPENCL
void
fillOpenclList
();
#endif
...
...
@@ -55,6 +61,9 @@ private:
RadioButton
*
mpBtnFalse
;
FixedText
*
mpFtAnnotation
;
FixedText
*
mpFtFrequency
;
FixedText
*
mpFtComputeUnits
;
FixedText
*
mpFtMemory
;
SvTreeListBox
*
mpOpenclInfoList
;
RadioButton
*
mpBtnAutomaticSelectionTrue
;
...
...
@@ -78,6 +87,9 @@ private:
OUString
maDescOpenCLEnabled
;
ScCalcConfig
maConfig
;
#if HAVE_FEATURE_OPENCL
std
::
vector
<
sc
::
OpenclPlatformInfo
>
maPlatformInfo
;
#endif
};
#endif
...
...
sc/uiconfig/scalc/ui/formulacalculationoptions.ui
Dosyayı görüntüle @
783179c1
...
...
@@ -4,6 +4,7 @@
<!-- interface-requires LibreOffice 1.0 -->
<object
class=
"GtkDialog"
id=
"FormulaCalculationOptions"
>
<property
name=
"can_focus"
>
False
</property>
<property
name=
"vexpand"
>
True
</property>
<property
name=
"border_width"
>
6
</property>
<property
name=
"title"
translatable=
"yes"
>
Detailed Calculation Settings
</property>
<property
name=
"type_hint"
>
dialog
</property>
...
...
@@ -368,6 +369,93 @@
<property
name=
"height"
>
1
</property>
</packing>
</child>
<child>
<object
class=
"GtkGrid"
id=
"grid5"
>
<property
name=
"visible"
>
True
</property>
<property
name=
"can_focus"
>
False
</property>
<child>
<object
class=
"GtkLabel"
id=
"frequency_label"
>
<property
name=
"visible"
>
True
</property>
<property
name=
"can_focus"
>
False
</property>
<property
name=
"label"
translatable=
"yes"
>
Frequency:
</property>
</object>
<packing>
<property
name=
"left_attach"
>
0
</property>
<property
name=
"top_attach"
>
0
</property>
<property
name=
"width"
>
1
</property>
<property
name=
"height"
>
1
</property>
</packing>
</child>
<child>
<object
class=
"GtkLabel"
id=
"compute_units_label"
>
<property
name=
"visible"
>
True
</property>
<property
name=
"can_focus"
>
False
</property>
<property
name=
"label"
translatable=
"yes"
>
Compute Units:
</property>
</object>
<packing>
<property
name=
"left_attach"
>
0
</property>
<property
name=
"top_attach"
>
1
</property>
<property
name=
"width"
>
1
</property>
<property
name=
"height"
>
1
</property>
</packing>
</child>
<child>
<object
class=
"GtkLabel"
id=
"memory_label"
>
<property
name=
"visible"
>
True
</property>
<property
name=
"can_focus"
>
False
</property>
<property
name=
"label"
translatable=
"yes"
>
Memory (in MB):
</property>
</object>
<packing>
<property
name=
"left_attach"
>
0
</property>
<property
name=
"top_attach"
>
2
</property>
<property
name=
"width"
>
1
</property>
<property
name=
"height"
>
1
</property>
</packing>
</child>
<child>
<object
class=
"GtkLabel"
id=
"frequency"
>
<property
name=
"visible"
>
True
</property>
<property
name=
"can_focus"
>
False
</property>
</object>
<packing>
<property
name=
"left_attach"
>
1
</property>
<property
name=
"top_attach"
>
0
</property>
<property
name=
"width"
>
1
</property>
<property
name=
"height"
>
1
</property>
</packing>
</child>
<child>
<object
class=
"GtkLabel"
id=
"compute_units"
>
<property
name=
"visible"
>
True
</property>
<property
name=
"can_focus"
>
False
</property>
</object>
<packing>
<property
name=
"left_attach"
>
1
</property>
<property
name=
"top_attach"
>
1
</property>
<property
name=
"width"
>
1
</property>
<property
name=
"height"
>
1
</property>
</packing>
</child>
<child>
<object
class=
"GtkLabel"
id=
"memory"
>
<property
name=
"visible"
>
True
</property>
<property
name=
"can_focus"
>
False
</property>
</object>
<packing>
<property
name=
"left_attach"
>
1
</property>
<property
name=
"top_attach"
>
2
</property>
<property
name=
"width"
>
1
</property>
<property
name=
"height"
>
1
</property>
</packing>
</child>
</object>
<packing>
<property
name=
"left_attach"
>
0
</property>
<property
name=
"top_attach"
>
2
</property>
<property
name=
"width"
>
1
</property>
<property
name=
"height"
>
1
</property>
</packing>
</child>
</object>
<packing>
<property
name=
"left_attach"
>
0
</property>
...
...
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