Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
O
opencv
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
opencv
Commits
ae827a63
Commit
ae827a63
authored
Jan 24, 2014
by
Konstantin Matskevich
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixes
parent
f90e41d5
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
21 additions
and
21 deletions
+21
-21
ocl.hpp
modules/core/include/opencv2/core/ocl.hpp
+6
-6
ocl.cpp
modules/core/src/ocl.cpp
+11
-11
ocl_test.cpp
modules/ts/src/ocl_test.cpp
+4
-4
No files found.
modules/core/include/opencv2/core/ocl.hpp
View file @
ae827a63
...
...
@@ -59,7 +59,7 @@ class CV_EXPORTS Kernel;
class
CV_EXPORTS
Program
;
class
CV_EXPORTS
ProgramSource2
;
class
CV_EXPORTS
Queue
;
class
CV_EXPORTS
PlatformInfo
rm
;
class
CV_EXPORTS
PlatformInfo
2
;
class
CV_EXPORTS
Device
{
...
...
@@ -551,12 +551,12 @@ protected:
Impl
*
p
;
};
class
CV_EXPORTS
PlatformInfo
rm
class
CV_EXPORTS
PlatformInfo
2
{
public
:
PlatformInfo
rm
();
explicit
PlatformInfo
rm
(
void
*
id
);
~
PlatformInfo
rm
();
PlatformInfo
2
();
explicit
PlatformInfo
2
(
void
*
id
);
~
PlatformInfo
2
();
String
name
()
const
;
String
vendor
()
const
;
...
...
@@ -572,7 +572,7 @@ protected:
CV_EXPORTS
const
char
*
convertTypeStr
(
int
sdepth
,
int
ddepth
,
int
cn
,
char
*
buf
);
CV_EXPORTS
const
char
*
typeToStr
(
int
t
);
CV_EXPORTS
const
char
*
memopTypeToStr
(
int
t
);
CV_EXPORTS
void
getPlatfomsInfo
(
std
::
vector
<
PlatformInfo
rm
>&
platform_info
);
CV_EXPORTS
void
getPlatfomsInfo
(
std
::
vector
<
PlatformInfo
2
>&
platform_info
);
}}
...
...
modules/core/src/ocl.cpp
View file @
ae827a63
...
...
@@ -3640,7 +3640,7 @@ static void getDevices(std::vector<cl_device_id>& devices,cl_platform_id& platfo
devices
.
resize
(
numDevices
);
}
struct
PlatformInfo
rm
::
Impl
struct
PlatformInfo
2
::
Impl
{
Impl
(
void
*
id
)
{
...
...
@@ -3661,45 +3661,45 @@ struct PlatformInform::Impl
cl_platform_id
handle
;
};
PlatformInfo
rm
::
PlatformInform
()
PlatformInfo
2
::
PlatformInfo2
()
{
p
=
0
;
}
PlatformInfo
rm
::
PlatformInform
(
void
*
platform_id
)
PlatformInfo
2
::
PlatformInfo2
(
void
*
platform_id
)
{
p
=
new
Impl
(
platform_id
);
}
PlatformInfo
rm
::~
PlatformInform
()
PlatformInfo
2
::~
PlatformInfo2
()
{
if
(
p
)
p
->
release
();
}
int
PlatformInfo
rm
::
deviceNumber
()
const
int
PlatformInfo
2
::
deviceNumber
()
const
{
return
p
?
(
int
)
p
->
devices
.
size
()
:
0
;
}
void
PlatformInfo
rm
::
getDevice
(
Device
&
device
,
int
d
)
const
void
PlatformInfo
2
::
getDevice
(
Device
&
device
,
int
d
)
const
{
CV_Assert
(
d
<
(
int
)
p
->
devices
.
size
()
);
if
(
p
)
device
.
set
(
p
->
devices
[
d
]);
}
String
PlatformInfo
rm
::
name
()
const
String
PlatformInfo
2
::
name
()
const
{
return
p
?
p
->
getStrProp
(
CL_PLATFORM_NAME
)
:
String
();
}
String
PlatformInfo
rm
::
vendor
()
const
String
PlatformInfo
2
::
vendor
()
const
{
return
p
?
p
->
getStrProp
(
CL_PLATFORM_VENDOR
)
:
String
();
}
String
PlatformInfo
rm
::
version
()
const
String
PlatformInfo
2
::
version
()
const
{
return
p
?
p
->
getStrProp
(
CL_PLATFORM_VERSION
)
:
String
();
}
...
...
@@ -3718,13 +3718,13 @@ static void getPlatforms(std::vector<cl_platform_id>& platforms)
platforms
.
resize
(
numPlatforms
);
}
void
getPlatfomsInfo
(
std
::
vector
<
PlatformInfo
rm
>&
platformsInfo
)
void
getPlatfomsInfo
(
std
::
vector
<
PlatformInfo
2
>&
platformsInfo
)
{
std
::
vector
<
cl_platform_id
>
platforms
;
getPlatforms
(
platforms
);
for
(
size_t
i
=
0
;
i
<
platforms
.
size
();
i
++
)
{
platformsInfo
.
push_back
(
PlatformInfo
rm
((
void
*
)
&
platforms
[
i
])
);
platformsInfo
.
push_back
(
PlatformInfo
2
((
void
*
)
&
platforms
[
i
])
);
}
}
...
...
modules/ts/src/ocl_test.cpp
View file @
ae827a63
...
...
@@ -98,21 +98,21 @@ void dumpOpenCLDevice()
using
namespace
cv
::
ocl
;
try
{
std
::
vector
<
PlatformInfo
rm
>
platforms
;
std
::
vector
<
PlatformInfo
2
>
platforms
;
cv
::
ocl
::
getPlatfomsInfo
(
platforms
);
if
(
platforms
.
size
()
>
0
)
{
DUMP_MESSAGE_STDOUT
(
"OpenCL Platforms: "
);
for
(
size_t
i
=
0
;
i
<
platforms
.
size
();
i
++
)
{
const
PlatformInfo
rm
*
platform
=
&
platforms
[
i
];
const
PlatformInfo
2
*
platform
=
&
platforms
[
i
];
DUMP_MESSAGE_STDOUT
(
" "
<<
platform
->
name
().
c_str
());
Device
current_device
;
for
(
int
j
=
0
;
j
<
platform
->
deviceNumber
();
j
++
)
{
platform
->
getDevice
(
current_device
,
j
);
const
char
*
deviceTypeStr
=
current_device
.
type
()
==
Device
::
TYPE_CPU
?
(
"CPU"
)
:
(
current_device
.
type
()
==
Device
::
TYPE_GPU
?
"
GPU"
:
"unknown"
);
?
(
"CPU"
)
:
(
current_device
.
type
()
==
Device
::
TYPE_GPU
?
current_device
.
hostUnifiedMemory
()
?
"iGPU"
:
"d
GPU"
:
"unknown"
);
DUMP_MESSAGE_STDOUT
(
" "
<<
deviceTypeStr
<<
": "
<<
current_device
.
name
().
c_str
()
<<
" ("
<<
current_device
.
version
().
c_str
()
<<
")"
);
DUMP_PROPERTY_XML
(
cv
::
format
(
"cv_ocl_platform_%d_device_%d"
,
(
int
)
i
,
(
int
)
j
),
cv
::
format
(
"(Platform=%sType=%sName=%sVersion=%s"
,
...
...
@@ -136,7 +136,7 @@ void dumpOpenCLDevice()
#endif
const
char
*
deviceTypeStr
=
device
.
type
()
==
Device
::
TYPE_CPU
?
"CPU"
:
(
device
.
type
()
==
Device
::
TYPE_GPU
?
"
GPU"
:
"unknown"
);
?
(
"CPU"
)
:
(
device
.
type
()
==
Device
::
TYPE_GPU
?
device
.
hostUnifiedMemory
()
?
"iGPU"
:
"d
GPU"
:
"unknown"
);
DUMP_MESSAGE_STDOUT
(
" Type = "
<<
deviceTypeStr
);
DUMP_PROPERTY_XML
(
"cv_ocl_current_deviceType"
,
deviceTypeStr
);
...
...
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