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
b725cbf7
Commit
b725cbf7
authored
Jun 13, 2013
by
Roman Donchenko
Committed by
OpenCV Buildbot
Jun 13, 2013
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #986 from pengx17:2.4_initiated_context
parents
5bb6d366
5fd724b5
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
1 deletion
+12
-1
ocl.hpp
modules/ocl/include/opencv2/ocl/ocl.hpp
+4
-1
initialization.cpp
modules/ocl/src/initialization.cpp
+8
-0
No files found.
modules/ocl/include/opencv2/ocl/ocl.hpp
View file @
b725cbf7
...
...
@@ -134,6 +134,9 @@ namespace cv
//getDevice also need to be called before this function
CV_EXPORTS
void
setDeviceEx
(
Info
&
oclinfo
,
void
*
ctx
,
void
*
qu
,
int
devnum
=
0
);
//returns true when global OpenCL context is initialized
CV_EXPORTS
bool
initialized
();
//////////////////////////////// Error handling ////////////////////////
CV_EXPORTS
void
error
(
const
char
*
error_string
,
const
char
*
file
,
const
int
line
,
const
char
*
func
);
...
...
@@ -144,7 +147,7 @@ namespace cv
protected
:
Context
();
friend
class
auto_ptr
<
Context
>
;
friend
bool
initialized
();
private
:
static
auto_ptr
<
Context
>
clCxt
;
static
int
val
;
...
...
modules/ocl/src/initialization.cpp
View file @
b725cbf7
...
...
@@ -917,6 +917,14 @@ namespace cv
int
Context
::
val
=
0
;
static
Mutex
cs
;
static
volatile
int
context_tear_down
=
0
;
bool
initialized
()
{
return
*
((
volatile
int
*
)
&
Context
::
val
)
!=
0
&&
Context
::
clCxt
->
impl
->
clCmdQueue
!=
NULL
&&
Context
::
clCxt
->
impl
->
oclcontext
!=
NULL
;
}
Context
*
Context
::
getContext
()
{
if
(
*
((
volatile
int
*
)
&
val
)
!=
1
)
...
...
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