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
4e736a8b
Kaydet (Commit)
4e736a8b
authored
Kas 23, 2013
tarafından
Markus Mohrhard
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
add API to retrieve all available OpenCL platforms and devices
Change-Id: I2475961ae315ee7193ca2cedd5943b663bfee7a0
üst
6c711025
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
117 additions
and
2 deletions
+117
-2
UnoApi_offapi.mk
offapi/UnoApi_offapi.mk
+2
-0
OpenCLDevice.idl
offapi/com/sun/star/sheet/opencl/OpenCLDevice.idl
+37
-0
OpenCLPlatform.idl
offapi/com/sun/star/sheet/opencl/OpenCLPlatform.idl
+33
-0
XOpenCLSelection.idl
offapi/com/sun/star/sheet/opencl/XOpenCLSelection.idl
+7
-0
docuno.hxx
sc/inc/docuno.hxx
+5
-0
openclwrapper.cxx
sc/source/core/opencl/openclwrapper.cxx
+4
-0
formulagroup.cxx
sc/source/core/tool/formulagroup.cxx
+1
-1
docuno.cxx
sc/source/ui/unoobj/docuno.cxx
+28
-1
No files found.
offapi/UnoApi_offapi.mk
Dosyayı görüntüle @
4e736a8b
...
...
@@ -3327,6 +3327,8 @@ $(eval $(call gb_UnoApi_add_idlfiles,offapi,com/sun/star/security,\
))
$(eval $(call gb_UnoApi_add_idlfiles,offapi,com/sun/star/sheet/opencl,\
OpenCLDevice \
OpenCLPlatform \
XOpenCLSelection \
))
...
...
offapi/com/sun/star/sheet/opencl/OpenCLDevice.idl
0 → 100644
Dosyayı görüntüle @
4e736a8b
/*
-*-
Mode
:
C
++
; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*
*
This
file
is
part
of
the
LibreOffice
project
.
*
*
This
Source
Code
Form
is
subject
to
the
terms
of
the
Mozilla
Public
*
License
,
v
.
2.0
.
If
a
copy
of
the
MPL
was
not
distributed
with
this
*
file
,
You
can
obtain
one
at
http
:
//
mozilla
.
org/MPL/2.0/.
*/
#
ifndef
__com_sun_star_sheet_opencl_OpenCLDevice_idl__
#
define
__com_sun_star_sheet_opencl_OpenCLDevice_idl__
module
com
{
module
sun
{
module
star
{
module
sheet
{
module
opencl
{
struct
OpenCLDevice
{
/**
*
The
name
of
the
device
as
returned
by
OpenCL
*/
string
Name
;
/**
*
The
vendor
of
the
device
as
returned
by
OpenCL
*/
string
Vendor
;
/**
*
The
driver
version
as
returned
by
OpenCL
*/
string
Driver
;
}
;
}
; }; }; }; };
#
endif
/*
vim
:
set
shiftwidth
=
4
softtabstop
=
4
expandtab
:
*/
offapi/com/sun/star/sheet/opencl/OpenCLPlatform.idl
0 → 100644
Dosyayı görüntüle @
4e736a8b
/*
-*-
Mode
:
C
++
; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*
*
This
file
is
part
of
the
LibreOffice
project
.
*
*
This
Source
Code
Form
is
subject
to
the
terms
of
the
Mozilla
Public
*
License
,
v
.
2.0
.
If
a
copy
of
the
MPL
was
not
distributed
with
this
*
file
,
You
can
obtain
one
at
http
:
//
mozilla
.
org/MPL/2.0/.
*/
#
ifndef
__com_sun_star_sheet_opencl_OpenCLPlatform_idl__
#
define
__com_sun_star_sheet_opencl_OpenCLPlatform_idl__
#
include
<
com
/
sun
/
star
/
sheet
/
opencl
/
OpenCLDevice
.
idl>
module
com
{
module
sun
{
module
star
{
module
sheet
{
module
opencl
{
struct
OpenCLPlatform
{
/**
*
The
name
of
the
platform
as
returned
by
OpenCL
*/
string
Name
;
string
Vendor
;
sequence
<
OpenCLDevice
>
Devices
;
}
;
}
; }; }; }; };
#
endif
/*
vim
:
set
shiftwidth
=
4
softtabstop
=
4
expandtab
:
*/
offapi/com/sun/star/sheet/opencl/XOpenCLSelection.idl
Dosyayı görüntüle @
4e736a8b
...
...
@@ -7,6 +7,8 @@
*
file
,
You
can
obtain
one
at
http
:
//
mozilla
.
org/MPL/2.0/.
*/
#
include
<
com
/
sun
/
star
/
sheet
/
opencl
/
OpenCLPlatform
.
idl>
module
com
{
module
sun
{
module
star
{
module
sheet
{
module
opencl
{
interface
XOpenCLSelection
:
com
::
sun
::
star
::
uno
::
XInterface
...
...
@@ -38,6 +40,11 @@ interface XOpenCLSelection : com::sun::star::uno::XInterface
*/
long
getDeviceID
()
;
/**
*
lists
all
OpenCL
devices
and
platforms
*/
sequence
<
OpenCLPlatform
>
getOpenCLPlatforms
()
;
}
;
}
; }; }; }; };
...
...
sc/inc/docuno.hxx
Dosyayı görüntüle @
4e736a8b
...
...
@@ -46,6 +46,7 @@
#include <com/sun/star/beans/XPropertySet.hpp>
#include <com/sun/star/sheet/XCellRangesAccess.hpp>
#include <com/sun/star/sheet/opencl/XOpenCLSelection.hpp>
#include <com/sun/star/sheet/opencl/OpenCLPlatform.hpp>
#include <com/sun/star/util/XChangesNotifier.hpp>
#include <cppuhelper/implbase2.hxx>
#include <cppuhelper/implbase3.hxx>
...
...
@@ -333,6 +334,10 @@ public:
virtual
sal_Int32
SAL_CALL
getDeviceID
()
throw
(
::
com
::
sun
::
star
::
uno
::
RuntimeException
);
virtual
com
::
sun
::
star
::
uno
::
Sequence
<
com
::
sun
::
star
::
sheet
::
opencl
::
OpenCLPlatform
>
SAL_CALL
getOpenCLPlatforms
()
throw
(
::
com
::
sun
::
star
::
uno
::
RuntimeException
);
};
...
...
sc/source/core/opencl/openclwrapper.cxx
Dosyayı görüntüle @
4e736a8b
...
...
@@ -997,6 +997,10 @@ bool switchOpenclDevice(const OUString* pDevice, bool bAutoSelect)
void
getOpenCLDeviceInfo
(
size_t
&
rDeviceId
,
size_t
&
rPlatformId
)
{
int
status
=
clewInit
(
OPENCL_DLL_NAME
);
if
(
status
<
0
)
return
;
cl_device_id
id
=
OpenclDevice
::
gpuEnv
.
mpDevID
;
findDeviceInfoFromDeviceId
(
id
,
rDeviceId
,
rPlatformId
);
}
...
...
sc/source/core/tool/formulagroup.cxx
Dosyayı görüntüle @
4e736a8b
...
...
@@ -660,7 +660,7 @@ void FormulaGroupInterpreter::getOpenCLDeviceInfo(sal_Int32& rDeviceId, sal_Int3
rDeviceId
=
-
1
;
rPlatformId
=
-
1
;
bool
bOpenCLEnabled
=
ScInterpreter
::
GetGlobalConfig
().
mbOpenCLEnabled
;
if
(
bOpenCLEnabled
)
if
(
!
bOpenCLEnabled
)
return
;
#if HAVE_FEATURE_OPENCL
...
...
sc/source/ui/unoobj/docuno.cxx
Dosyayı görüntüle @
4e736a8b
...
...
@@ -477,6 +477,7 @@ uno::Any SAL_CALL ScModelObj::queryInterface( const uno::Type& rType )
SC_QUERYINTERFACE
(
lang
::
XMultiServiceFactory
)
SC_QUERYINTERFACE
(
lang
::
XServiceInfo
)
SC_QUERYINTERFACE
(
util
::
XChangesNotifier
)
SC_QUERYINTERFACE
(
sheet
::
opencl
::
XOpenCLSelection
)
uno
::
Any
aRet
(
SfxBaseModel
::
queryInterface
(
rType
));
if
(
!
aRet
.
hasValue
()
...
...
@@ -529,7 +530,7 @@ uno::Sequence<uno::Type> SAL_CALL ScModelObj::getTypes() throw(uno::RuntimeExcep
long
nAggLen
=
aAggTypes
.
getLength
();
const
uno
::
Type
*
pAggPtr
=
aAggTypes
.
getConstArray
();
const
long
nThisLen
=
1
5
;
const
long
nThisLen
=
1
6
;
aTypes
.
realloc
(
nParentLen
+
nAggLen
+
nThisLen
);
uno
::
Type
*
pPtr
=
aTypes
.
getArray
();
pPtr
[
nParentLen
+
0
]
=
getCppuType
((
const
uno
::
Reference
<
sheet
::
XSpreadsheetDocument
>*
)
0
);
...
...
@@ -547,6 +548,7 @@ uno::Sequence<uno::Type> SAL_CALL ScModelObj::getTypes() throw(uno::RuntimeExcep
pPtr
[
nParentLen
+
12
]
=
getCppuType
((
const
uno
::
Reference
<
lang
::
XMultiServiceFactory
>*
)
0
);
pPtr
[
nParentLen
+
13
]
=
getCppuType
((
const
uno
::
Reference
<
lang
::
XServiceInfo
>*
)
0
);
pPtr
[
nParentLen
+
14
]
=
getCppuType
((
const
uno
::
Reference
<
util
::
XChangesNotifier
>*
)
0
);
pPtr
[
nParentLen
+
15
]
=
getCppuType
((
const
uno
::
Reference
<
sheet
::
opencl
::
XOpenCLSelection
>*
)
0
);
long
i
;
for
(
i
=
0
;
i
<
nParentLen
;
i
++
)
...
...
@@ -2341,6 +2343,31 @@ sal_Int32 ScModelObj::getDeviceID()
return
nDeviceId
;
}
uno
::
Sequence
<
sheet
::
opencl
::
OpenCLPlatform
>
ScModelObj
::
getOpenCLPlatforms
()
throw
(
uno
::
RuntimeException
)
{
std
::
vector
<
sc
::
OpenclPlatformInfo
>
aPlatformInfo
;
sc
::
FormulaGroupInterpreter
::
fillOpenCLInfo
(
aPlatformInfo
);
uno
::
Sequence
<
sheet
::
opencl
::
OpenCLPlatform
>
aRet
(
aPlatformInfo
.
size
());
for
(
size_t
i
=
0
;
i
<
aPlatformInfo
.
size
();
++
i
)
{
aRet
[
i
].
Name
=
aPlatformInfo
[
i
].
maName
;
aRet
[
i
].
Vendor
=
aPlatformInfo
[
i
].
maVendor
;
aRet
[
i
].
Devices
.
realloc
(
aPlatformInfo
[
i
].
maDevices
.
size
());
for
(
size_t
j
=
0
;
j
<
aPlatformInfo
[
i
].
maDevices
.
size
();
++
j
)
{
const
sc
::
OpenclDeviceInfo
&
rDevice
=
aPlatformInfo
[
i
].
maDevices
[
j
];
aRet
[
i
].
Devices
[
j
].
Name
=
rDevice
.
maName
;
aRet
[
i
].
Devices
[
j
].
Vendor
=
rDevice
.
maVendor
;
aRet
[
i
].
Devices
[
j
].
Driver
=
rDevice
.
maDriver
;
}
}
return
aRet
;
}
//------------------------------------------------------------------------
...
...
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