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
603fa03a
Commit
603fa03a
authored
7 years ago
by
Alexander Alekhin
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #9441 from wzw-intel:delete_program
parents
8a094a5f
da3da84a
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
23 additions
and
1 deletion
+23
-1
ocl.hpp
modules/core/include/opencv2/core/ocl.hpp
+1
-0
ocl.cpp
modules/core/src/ocl.cpp
+22
-1
No files found.
modules/core/include/opencv2/core/ocl.hpp
View file @
603fa03a
...
...
@@ -248,6 +248,7 @@ public:
const
Device
&
device
(
size_t
idx
)
const
;
Program
getProg
(
const
ProgramSource
&
prog
,
const
String
&
buildopt
,
String
&
errmsg
);
void
unloadProg
(
Program
&
prog
);
static
Context
&
getDefault
(
bool
initialize
=
true
);
void
*
ptr
()
const
;
...
...
This diff is collapsed.
Click to expand it.
modules/core/src/ocl.cpp
View file @
603fa03a
...
...
@@ -1380,6 +1380,23 @@ struct Context::Impl
return
prog
;
}
void
unloadProg
(
Program
&
prog
)
{
cv
::
AutoLock
lock
(
program_cache_mutex
);
for
(
CacheList
::
iterator
i
=
cacheList
.
begin
();
i
!=
cacheList
.
end
();
++
i
)
{
phash_t
::
iterator
it
=
phash
.
find
(
*
i
);
if
(
it
!=
phash
.
end
())
{
if
(
it
->
second
.
ptr
()
==
prog
.
ptr
())
{
phash
.
erase
(
*
i
);
cacheList
.
erase
(
i
);
return
;
}
}
}
}
IMPLEMENT_REFCOUNTABLE
();
...
...
@@ -1643,7 +1660,11 @@ Program Context::getProg(const ProgramSource& prog,
return
p
?
p
->
getProg
(
prog
,
buildopts
,
errmsg
)
:
Program
();
}
void
Context
::
unloadProg
(
Program
&
prog
)
{
if
(
p
)
p
->
unloadProg
(
prog
);
}
#ifdef HAVE_OPENCL_SVM
bool
Context
::
useSVM
()
const
...
...
This diff is collapsed.
Click to expand it.
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