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
d0c9cb0c
Kaydet (Commit)
d0c9cb0c
authored
Mar 28, 2015
tarafından
Stephan Bergmann
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Clean up C-style casts from pointers to void
Change-Id: I7e6315bf2a2e3d6e089ef8f5eacc69d2b413374a
üst
3a32d02b
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
22 additions
and
22 deletions
+22
-22
opencl_device_selection.h
opencl/inc/opencl_device_selection.h
+7
-7
opencl_device.cxx
opencl/source/opencl_device.cxx
+14
-14
openclwrapper.cxx
opencl/source/openclwrapper.cxx
+1
-1
No files found.
opencl/inc/opencl_device_selection.h
Dosyayı görüntüle @
d0c9cb0c
...
...
@@ -101,7 +101,7 @@ inline ds_status initDSProfile(ds_profile** p, const char* version)
if
(
p
==
NULL
)
return
DS_INVALID_PROFILE
;
profile
=
(
ds_profile
*
)
malloc
(
sizeof
(
ds_profile
));
profile
=
static_cast
<
ds_profile
*>
(
malloc
(
sizeof
(
ds_profile
)
));
if
(
profile
==
NULL
)
return
DS_MEMORY_ERROR
;
memset
(
profile
,
0
,
sizeof
(
ds_profile
));
...
...
@@ -109,7 +109,7 @@ inline ds_status initDSProfile(ds_profile** p, const char* version)
clGetPlatformIDs
(
0
,
NULL
,
&
numPlatforms
);
if
(
numPlatforms
!=
0
)
{
platforms
=
(
cl_platform_id
*
)
malloc
(
numPlatforms
*
sizeof
(
cl_platform_id
));
platforms
=
static_cast
<
cl_platform_id
*>
(
malloc
(
numPlatforms
*
sizeof
(
cl_platform_id
)
));
if
(
platforms
==
NULL
)
{
status
=
DS_MEMORY_ERROR
;
...
...
@@ -136,7 +136,7 @@ inline ds_status initDSProfile(ds_profile** p, const char* version)
}
if
(
numDevices
!=
0
)
{
devices
=
(
cl_device_id
*
)
malloc
(
numDevices
*
sizeof
(
cl_device_id
));
devices
=
static_cast
<
cl_device_id
*>
(
malloc
(
numDevices
*
sizeof
(
cl_device_id
)
));
if
(
devices
==
NULL
)
{
status
=
DS_MEMORY_ERROR
;
...
...
@@ -145,7 +145,7 @@ inline ds_status initDSProfile(ds_profile** p, const char* version)
}
profile
->
numDevices
=
numDevices
+
1
;
// +1 to numDevices to include the native CPU
profile
->
devices
=
(
ds_device
*
)
malloc
(
profile
->
numDevices
*
sizeof
(
ds_device
));
profile
->
devices
=
static_cast
<
ds_device
*>
(
malloc
(
profile
->
numDevices
*
sizeof
(
ds_device
)
));
if
(
profile
->
devices
==
NULL
)
{
profile
->
numDevices
=
0
;
...
...
@@ -185,13 +185,13 @@ inline ds_status initDSProfile(ds_profile** p, const char* version)
clGetDeviceInfo
(
profile
->
devices
[
next
].
oclDeviceID
,
CL_DEVICE_NAME
,
DS_DEVICE_NAME_LENGTH
,
&
buffer
,
NULL
);
length
=
strlen
(
buffer
);
profile
->
devices
[
next
].
oclDeviceName
=
(
char
*
)
malloc
(
length
+
1
);
profile
->
devices
[
next
].
oclDeviceName
=
static_cast
<
char
*>
(
malloc
(
length
+
1
)
);
memcpy
(
profile
->
devices
[
next
].
oclDeviceName
,
buffer
,
length
+
1
);
clGetDeviceInfo
(
profile
->
devices
[
next
].
oclDeviceID
,
CL_DRIVER_VERSION
,
DS_DEVICE_NAME_LENGTH
,
&
buffer
,
NULL
);
length
=
strlen
(
buffer
);
profile
->
devices
[
next
].
oclDriverVersion
=
(
char
*
)
malloc
(
length
+
1
);
profile
->
devices
[
next
].
oclDriverVersion
=
static_cast
<
char
*>
(
malloc
(
length
+
1
)
);
memcpy
(
profile
->
devices
[
next
].
oclDriverVersion
,
buffer
,
length
+
1
);
}
}
...
...
@@ -390,7 +390,7 @@ inline ds_status readProFile(const char* fileName, char** content, size_t* conte
size
=
pos
;
rewind
(
input
);
binary
=
(
char
*
)
malloc
(
size
);
binary
=
static_cast
<
char
*>
(
malloc
(
size
)
);
if
(
binary
==
NULL
)
{
fclose
(
input
);
...
...
opencl/source/opencl_device.cxx
Dosyayı görüntüle @
d0c9cb0c
...
...
@@ -219,7 +219,7 @@ ds_status releaseScore(void* score)
{
if
(
NULL
!=
score
)
{
delete
(
LibreOfficeDeviceScore
*
)
score
;
delete
static_cast
<
LibreOfficeDeviceScore
*>
(
score
)
;
}
return
DS_SUCCESS
;
}
...
...
@@ -270,8 +270,8 @@ ds_status evaluateScoreForDevice(ds_device* device, void* evalData)
{
/* No 64-bit float support */
device
->
score
=
(
void
*
)
new
LibreOfficeDeviceScore
;
((
LibreOfficeDeviceScore
*
)
device
->
score
)
->
fTime
=
DBL_MAX
;
((
LibreOfficeDeviceScore
*
)
device
->
score
)
->
bNoCLErrors
=
true
;
static_cast
<
LibreOfficeDeviceScore
*>
(
device
->
score
)
->
fTime
=
DBL_MAX
;
static_cast
<
LibreOfficeDeviceScore
*>
(
device
->
score
)
->
bNoCLErrors
=
true
;
SAL_INFO
(
"opencl.device"
,
"... no fp64 support"
);
}
else
...
...
@@ -295,14 +295,14 @@ ds_status evaluateScoreForDevice(ds_device* device, void* evalData)
size_t
length
;
char
*
buildLog
;
clStatus
=
clGetProgramBuildInfo
(
clProgram
,
device
->
oclDeviceID
,
CL_PROGRAM_BUILD_LOG
,
0
,
NULL
,
&
length
);
buildLog
=
(
char
*
)
malloc
(
length
);
buildLog
=
static_cast
<
char
*>
(
malloc
(
length
)
);
clGetProgramBuildInfo
(
clProgram
,
device
->
oclDeviceID
,
CL_PROGRAM_BUILD_LOG
,
length
,
buildLog
,
&
length
);
SAL_INFO
(
"opencl.device"
,
"Build Errors:
\n
"
<<
buildLog
);
free
(
buildLog
);
device
->
score
=
(
void
*
)
new
LibreOfficeDeviceScore
;
((
LibreOfficeDeviceScore
*
)
device
->
score
)
->
fTime
=
DBL_MAX
;
((
LibreOfficeDeviceScore
*
)
device
->
score
)
->
bNoCLErrors
=
false
;
static_cast
<
LibreOfficeDeviceScore
*>
(
device
->
score
)
->
fTime
=
DBL_MAX
;
static_cast
<
LibreOfficeDeviceScore
*>
(
device
->
score
)
->
bNoCLErrors
=
false
;
}
else
{
...
...
@@ -311,7 +311,7 @@ ds_status evaluateScoreForDevice(ds_device* device, void* evalData)
timerStart
(
&
kernelTime
);
/* Run kernel */
LibreOfficeDeviceEvaluationIO
*
testData
=
(
LibreOfficeDeviceEvaluationIO
*
)
evalData
;
LibreOfficeDeviceEvaluationIO
*
testData
=
static_cast
<
LibreOfficeDeviceEvaluationIO
*>
(
evalData
)
;
cl_kernel
clKernel
=
clCreateKernel
(
clProgram
,
"DynamicKernel"
,
&
clStatus
);
DS_CHECK_STATUS
(
clStatus
,
"evaluateScoreForDevice::clCreateKernel"
);
cl_mem
clResult
=
clCreateBuffer
(
clContext
,
CL_MEM_WRITE_ONLY
|
CL_MEM_USE_HOST_PTR
,
sizeof
(
cl_double
)
*
testData
->
outputSize
,
&
testData
->
output
[
0
],
&
clStatus
);
...
...
@@ -347,8 +347,8 @@ ds_status evaluateScoreForDevice(ds_device* device, void* evalData)
clReleaseKernel
(
clKernel
);
device
->
score
=
(
void
*
)
new
LibreOfficeDeviceScore
;
((
LibreOfficeDeviceScore
*
)
device
->
score
)
->
fTime
=
timerCurrent
(
&
kernelTime
);
((
LibreOfficeDeviceScore
*
)
device
->
score
)
->
bNoCLErrors
=
true
;
static_cast
<
LibreOfficeDeviceScore
*>
(
device
->
score
)
->
fTime
=
timerCurrent
(
&
kernelTime
);
static_cast
<
LibreOfficeDeviceScore
*>
(
device
->
score
)
->
bNoCLErrors
=
true
;
}
clReleaseProgram
(
clProgram
);
...
...
@@ -363,7 +363,7 @@ ds_status evaluateScoreForDevice(ds_device* device, void* evalData)
timer
kernelTime
;
timerStart
(
&
kernelTime
);
LibreOfficeDeviceEvaluationIO
*
testData
=
(
LibreOfficeDeviceEvaluationIO
*
)
evalData
;
LibreOfficeDeviceEvaluationIO
*
testData
=
static_cast
<
LibreOfficeDeviceEvaluationIO
*>
(
evalData
)
;
for
(
unsigned
long
j
=
0
;
j
<
testData
->
outputSize
;
j
++
)
{
double
fAverage
=
0.0
f
;
...
...
@@ -386,10 +386,10 @@ ds_status evaluateScoreForDevice(ds_device* device, void* evalData)
float
fInterpretTailFactor
=
10.0
;
device
->
score
=
(
void
*
)
new
LibreOfficeDeviceScore
;
((
LibreOfficeDeviceScore
*
)
device
->
score
)
->
fTime
=
timerCurrent
(
&
kernelTime
);
((
LibreOfficeDeviceScore
*
)
device
->
score
)
->
bNoCLErrors
=
true
;
static_cast
<
LibreOfficeDeviceScore
*>
(
device
->
score
)
->
fTime
=
timerCurrent
(
&
kernelTime
);
static_cast
<
LibreOfficeDeviceScore
*>
(
device
->
score
)
->
bNoCLErrors
=
true
;
((
LibreOfficeDeviceScore
*
)
device
->
score
)
->
fTime
*=
fInterpretTailFactor
;
static_cast
<
LibreOfficeDeviceScore
*>
(
device
->
score
)
->
fTime
*=
fInterpretTailFactor
;
}
return
DS_SUCCESS
;
}
...
...
@@ -403,7 +403,7 @@ ds_status pickBestDevice(ds_profile* profile, int* bestDeviceIdx)
for
(
unsigned
int
d
=
0
;
d
<
profile
->
numDevices
;
d
++
)
{
ds_device
device
=
profile
->
devices
[
d
];
LibreOfficeDeviceScore
*
pScore
=
(
LibreOfficeDeviceScore
*
)
device
.
score
;
LibreOfficeDeviceScore
*
pScore
=
static_cast
<
LibreOfficeDeviceScore
*>
(
device
.
score
)
;
// Check blacklist and whitelist for actual devices
if
(
device
.
type
==
DS_DEVICE_OPENCL_DEVICE
)
...
...
opencl/source/openclwrapper.cxx
Dosyayı görüntüle @
d0c9cb0c
...
...
@@ -830,7 +830,7 @@ bool switchOpenCLDevice(const OUString* pDevice, bool bAutoSelect, bool bForceEv
// initialisation below.) Because otherwise the code crashes in
// initOpenCLRunEnv(). Confused? You should be.
gpuEnv
.
mpArryDevsID
=
(
cl_device_id
*
)
malloc
(
sizeof
(
cl_device_id
)
);
gpuEnv
.
mpArryDevsID
=
static_cast
<
cl_device_id
*>
(
malloc
(
sizeof
(
cl_device_id
)
)
);
gpuEnv
.
mpArryDevsID
[
0
]
=
pDeviceId
;
return
!
initOpenCLRunEnv
(
0
);
...
...
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