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
f3e788b8
Commit
f3e788b8
authored
Nov 06, 2019
by
Alexander Alekhin
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #15813 from i-murzov:3.4-ocl-empty-platform
parents
2112aa31
cdbfdcc3
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
4 deletions
+18
-4
ocl.cpp
modules/core/src/ocl.cpp
+18
-4
No files found.
modules/core/src/ocl.cpp
View file @
f3e788b8
...
@@ -2037,16 +2037,25 @@ struct Context::Impl
...
@@ -2037,16 +2037,25 @@ struct Context::Impl
0
0
};
};
cl_uint
i
,
nd0
=
0
,
nd
=
0
;
cl_uint
nd0
=
0
;
int
dtype
=
dtype0
&
15
;
int
dtype
=
dtype0
&
15
;
CV_OCL_DBG_CHECK
(
clGetDeviceIDs
(
pl
,
dtype
,
0
,
0
,
&
nd0
));
cl_int
status
=
clGetDeviceIDs
(
pl
,
dtype
,
0
,
NULL
,
&
nd0
);
if
(
status
!=
CL_DEVICE_NOT_FOUND
)
// Not an error if platform has no devices
{
CV_OCL_DBG_CHECK_RESULT
(
status
,
cv
::
format
(
"clGetDeviceIDs(platform=%p, device_type=%d, num_entries=0, devices=NULL, numDevices=%p)"
,
pl
,
dtype
,
&
nd0
).
c_str
());
}
if
(
nd0
==
0
)
return
;
AutoBuffer
<
void
*>
dlistbuf
(
nd0
*
2
+
1
);
AutoBuffer
<
void
*>
dlistbuf
(
nd0
*
2
+
1
);
cl_device_id
*
dlist
=
(
cl_device_id
*
)
dlistbuf
.
data
();
cl_device_id
*
dlist
=
(
cl_device_id
*
)
dlistbuf
.
data
();
cl_device_id
*
dlist_new
=
dlist
+
nd0
;
cl_device_id
*
dlist_new
=
dlist
+
nd0
;
CV_OCL_DBG_CHECK
(
clGetDeviceIDs
(
pl
,
dtype
,
nd0
,
dlist
,
&
nd0
));
CV_OCL_DBG_CHECK
(
clGetDeviceIDs
(
pl
,
dtype
,
nd0
,
dlist
,
&
nd0
));
String
name0
;
cl_uint
i
,
nd
=
0
;
String
name0
;
for
(
i
=
0
;
i
<
nd0
;
i
++
)
for
(
i
=
0
;
i
<
nd0
;
i
++
)
{
{
Device
d
(
dlist
[
i
]);
Device
d
(
dlist
[
i
]);
...
@@ -5944,7 +5953,12 @@ void convertFromImage(void* cl_mem_image, UMat& dst)
...
@@ -5944,7 +5953,12 @@ void convertFromImage(void* cl_mem_image, UMat& dst)
static
void
getDevices
(
std
::
vector
<
cl_device_id
>&
devices
,
cl_platform_id
platform
)
static
void
getDevices
(
std
::
vector
<
cl_device_id
>&
devices
,
cl_platform_id
platform
)
{
{
cl_uint
numDevices
=
0
;
cl_uint
numDevices
=
0
;
CV_OCL_DBG_CHECK
(
clGetDeviceIDs
(
platform
,
(
cl_device_type
)
Device
::
TYPE_ALL
,
0
,
NULL
,
&
numDevices
));
cl_int
status
=
clGetDeviceIDs
(
platform
,
(
cl_device_type
)
Device
::
TYPE_ALL
,
0
,
NULL
,
&
numDevices
);
if
(
status
!=
CL_DEVICE_NOT_FOUND
)
// Not an error if platform has no devices
{
CV_OCL_DBG_CHECK_RESULT
(
status
,
cv
::
format
(
"clGetDeviceIDs(platform, Device::TYPE_ALL, num_entries=0, devices=NULL, numDevices=%p)"
,
&
numDevices
).
c_str
());
}
if
(
numDevices
==
0
)
if
(
numDevices
==
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