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
87ae0f99
Commit
87ae0f99
authored
Mar 20, 2014
by
Andrey Pavlenko
Committed by
OpenCV Buildbot
Mar 20, 2014
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #2492 from KonstantinMatskevich:ocl_fix_wrongdevice
parents
a2dec6c3
f9f730c4
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
3 deletions
+4
-3
ocl.cpp
modules/core/src/ocl.cpp
+3
-2
umatrix.cpp
modules/core/src/umatrix.cpp
+1
-1
No files found.
modules/core/src/ocl.cpp
View file @
87ae0f99
...
@@ -1410,7 +1410,7 @@ bool useOpenCL()
...
@@ -1410,7 +1410,7 @@ bool useOpenCL()
{
{
CoreTLSData
*
data
=
coreTlsData
.
get
();
CoreTLSData
*
data
=
coreTlsData
.
get
();
if
(
data
->
useOpenCL
<
0
)
if
(
data
->
useOpenCL
<
0
)
data
->
useOpenCL
=
(
int
)
haveOpenCL
();
data
->
useOpenCL
=
(
int
)
haveOpenCL
()
&&
Device
::
getDefault
().
ptr
()
!=
NULL
;
return
data
->
useOpenCL
>
0
;
return
data
->
useOpenCL
>
0
;
}
}
...
@@ -1419,7 +1419,7 @@ void setUseOpenCL(bool flag)
...
@@ -1419,7 +1419,7 @@ void setUseOpenCL(bool flag)
if
(
haveOpenCL
()
)
if
(
haveOpenCL
()
)
{
{
CoreTLSData
*
data
=
coreTlsData
.
get
();
CoreTLSData
*
data
=
coreTlsData
.
get
();
data
->
useOpenCL
=
flag
?
1
:
0
;
data
->
useOpenCL
=
(
flag
&&
Device
::
getDefault
().
ptr
()
!=
NULL
)
?
1
:
0
;
}
}
}
}
...
@@ -2245,6 +2245,7 @@ not_found:
...
@@ -2245,6 +2245,7 @@ not_found:
std
::
cerr
<<
deviceTypes
[
t
]
<<
" "
;
std
::
cerr
<<
deviceTypes
[
t
]
<<
" "
;
std
::
cerr
<<
std
::
endl
<<
" Device name: "
<<
(
deviceName
.
length
()
==
0
?
"any"
:
deviceName
)
<<
std
::
endl
;
std
::
cerr
<<
std
::
endl
<<
" Device name: "
<<
(
deviceName
.
length
()
==
0
?
"any"
:
deviceName
)
<<
std
::
endl
;
CV_Error
(
CL_INVALID_DEVICE
,
"Requested OpenCL device is not found"
);
return
NULL
;
return
NULL
;
}
}
...
...
modules/core/src/umatrix.cpp
View file @
87ae0f99
...
@@ -88,7 +88,7 @@ void UMatData::unlock()
...
@@ -88,7 +88,7 @@ void UMatData::unlock()
MatAllocator
*
UMat
::
getStdAllocator
()
MatAllocator
*
UMat
::
getStdAllocator
()
{
{
if
(
ocl
::
haveOpenCL
()
)
if
(
ocl
::
haveOpenCL
()
&&
ocl
::
useOpenCL
()
)
return
ocl
::
getOpenCLAllocator
();
return
ocl
::
getOpenCLAllocator
();
return
Mat
::
getStdAllocator
();
return
Mat
::
getStdAllocator
();
}
}
...
...
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