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
bb4b4105
Commit
bb4b4105
authored
Apr 25, 2013
by
peng xiao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add ocl::PlatformName to ocl::Info.
parent
416fb505
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
14 additions
and
3 deletions
+14
-3
ocl.hpp
modules/ocl/include/opencv2/ocl.hpp
+1
-0
initialization.cpp
modules/ocl/src/initialization.cpp
+12
-2
main.cpp
modules/ocl/test/main.cpp
+1
-1
No files found.
modules/ocl/include/opencv2/ocl.hpp
View file @
bb4b4105
...
...
@@ -103,6 +103,7 @@ namespace cv
void
release
();
Info
&
operator
=
(
const
Info
&
m
);
std
::
vector
<
String
>
DeviceName
;
String
PlatformName
;
};
//////////////////////////////// Initialization & Info ////////////////////////
//this function may be obsoleted
...
...
modules/ocl/src/initialization.cpp
View file @
bb4b4105
...
...
@@ -127,7 +127,7 @@ namespace cv
cl_platform_id
oclplatform
;
std
::
vector
<
cl_device_id
>
devices
;
std
::
vector
<
String
>
devName
;
String
platName
;
cl_context
oclcontext
;
cl_command_queue
clCmdQueue
;
int
devnum
;
...
...
@@ -298,10 +298,14 @@ namespace cv
std
::
vector
<
cl_platform_id
>
platforms
(
numPlatforms
);
openCLSafeCall
(
clGetPlatformIDs
(
numPlatforms
,
&
platforms
[
0
],
0
));
char
deviceName
[
256
];
int
devcienums
=
0
;
const
static
int
max_name_length
=
256
;
char
deviceName
[
max_name_length
];
char
plfmName
[
max_name_length
];
for
(
unsigned
i
=
0
;
i
<
numPlatforms
;
++
i
)
{
cl_uint
numsdev
;
cl_int
status
=
clGetDeviceIDs
(
platforms
[
i
],
devicetype
,
0
,
NULL
,
&
numsdev
);
if
(
status
!=
CL_DEVICE_NOT_FOUND
)
...
...
@@ -314,6 +318,9 @@ namespace cv
openCLSafeCall
(
clGetDeviceIDs
(
platforms
[
i
],
devicetype
,
numsdev
,
&
devices
[
0
],
0
));
Info
ocltmpinfo
;
openCLSafeCall
(
clGetPlatformInfo
(
platforms
[
i
],
CL_PLATFORM_VENDOR
,
sizeof
(
plfmName
),
plfmName
,
NULL
));
ocltmpinfo
.
PlatformName
=
String
(
plfmName
);
ocltmpinfo
.
impl
->
platName
=
String
(
plfmName
);
ocltmpinfo
.
impl
->
oclplatform
=
platforms
[
i
];
for
(
unsigned
j
=
0
;
j
<
numsdev
;
++
j
)
{
...
...
@@ -1035,6 +1042,7 @@ namespace cv
impl
->
release
();
impl
=
new
Impl
;
DeviceName
.
clear
();
PlatformName
.
clear
();
}
Info
::~
Info
()
...
...
@@ -1048,6 +1056,7 @@ namespace cv
impl
->
release
();
impl
=
m
.
impl
->
copy
();
DeviceName
=
m
.
DeviceName
;
PlatformName
=
m
.
PlatformName
;
return
*
this
;
}
...
...
@@ -1055,6 +1064,7 @@ namespace cv
{
impl
=
m
.
impl
->
copy
();
DeviceName
=
m
.
DeviceName
;
PlatformName
=
m
.
PlatformName
;
}
}
//namespace ocl
...
...
modules/ocl/test/main.cpp
View file @
bb4b4105
...
...
@@ -117,7 +117,7 @@ int main(int argc, char **argv)
}
setDevice
(
oclinfo
[
pid
],
device
);
cout
<<
"Platform name:"
<<
oclinfo
[
pid
].
PlatformName
<<
endl
;
cout
<<
"Device type:"
<<
type
<<
endl
<<
"Device name:"
<<
oclinfo
[
pid
].
DeviceName
[
device
]
<<
endl
;
return
RUN_ALL_TESTS
();
}
...
...
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