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
1e8b72f8
Commit
1e8b72f8
authored
Oct 22, 2013
by
Andrey Pavlenko
Committed by
OpenCV Buildbot
Oct 22, 2013
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1658 from alalek:ocl_fixes
parents
a54d36bd
e7fd0534
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
25 additions
and
20 deletions
+25
-20
cl_programcache.cpp
modules/ocl/src/cl_programcache.cpp
+23
-18
cl_programcache.hpp
modules/ocl/src/cl_programcache.hpp
+0
-1
fft.cpp
modules/ocl/src/fft.cpp
+2
-1
No files found.
modules/ocl/src/cl_programcache.cpp
View file @
1e8b72f8
...
...
@@ -61,12 +61,16 @@ namespace cv { namespace ocl {
cv
::
Mutex
ProgramCache
::
mutexFiles
;
cv
::
Mutex
ProgramCache
::
mutexCache
;
std
::
auto_ptr
<
ProgramCache
>
_programCache
;
ProgramCache
*
_programCache
=
NULL
;
ProgramCache
*
ProgramCache
::
getProgramCache
()
{
if
(
NULL
==
_programCache
.
get
())
_programCache
.
reset
(
new
ProgramCache
());
return
_programCache
.
get
();
if
(
NULL
==
_programCache
)
{
cv
::
AutoLock
lock
(
getInitializationMutex
());
if
(
NULL
==
_programCache
)
_programCache
=
new
ProgramCache
();
}
return
_programCache
;
}
ProgramCache
::
ProgramCache
()
...
...
@@ -78,6 +82,12 @@ ProgramCache::ProgramCache()
ProgramCache
::~
ProgramCache
()
{
releaseProgram
();
if
(
this
==
_programCache
)
{
cv
::
AutoLock
lock
(
getInitializationMutex
());
if
(
this
==
_programCache
)
_programCache
=
NULL
;
}
}
cl_program
ProgramCache
::
progLookup
(
const
string
&
srcsign
)
...
...
@@ -420,22 +430,17 @@ struct ProgramFileCache
{
if
(
status
==
CL_BUILD_PROGRAM_FAILURE
)
{
cl_int
logStatus
;
char
*
buildLog
=
NULL
;
size_t
buildLogSize
=
0
;
logStatus
=
clGetProgramBuildInfo
(
program
,
getClDeviceID
(
ctx
),
CL_PROGRAM_BUILD_LOG
,
buildLogSize
,
buildLog
,
&
buildLogSize
);
if
(
logStatus
!=
CL_SUCCESS
)
std
::
cout
<<
"Failed to build the program and get the build info."
<<
endl
;
buildLog
=
new
char
[
buildLogSize
];
CV_DbgAssert
(
!!
buildLog
);
memset
(
buildLog
,
0
,
buildLogSize
);
openCLSafeCall
(
clGetProgramBuildInfo
(
program
,
getClDeviceID
(
ctx
),
CL_PROGRAM_BUILD_LOG
,
buildLogSize
,
buildLog
,
NULL
));
std
::
cout
<<
"
\n
BUILD LOG: "
<<
options
<<
"
\n
"
;
std
::
cout
<<
buildLog
<<
endl
;
delete
[]
buildLog
;
CL_PROGRAM_BUILD_LOG
,
0
,
NULL
,
&
buildLogSize
));
std
::
vector
<
char
>
buildLog
;
buildLog
.
resize
(
buildLogSize
);
memset
(
&
buildLog
[
0
],
0
,
buildLogSize
);
openCLSafeCall
(
clGetProgramBuildInfo
(
program
,
getClDeviceID
(
ctx
),
CL_PROGRAM_BUILD_LOG
,
buildLogSize
,
&
buildLog
[
0
],
NULL
));
std
::
cout
<<
std
::
endl
<<
"BUILD LOG: "
<<
(
source
->
name
?
source
->
name
:
"dynamic program"
)
<<
": "
<<
options
<<
"
\n
"
;
std
::
cout
<<
&
buildLog
[
0
]
<<
endl
;
}
openCLVerifyCall
(
status
);
}
...
...
modules/ocl/src/cl_programcache.hpp
View file @
1e8b72f8
...
...
@@ -52,7 +52,6 @@ class ProgramCache
protected
:
ProgramCache
();
~
ProgramCache
();
friend
class
std
::
auto_ptr
<
ProgramCache
>
;
public
:
static
ProgramCache
*
getProgramCache
();
...
...
modules/ocl/src/fft.cpp
View file @
1e8b72f8
...
...
@@ -126,7 +126,8 @@ void cv::ocl::fft_setup()
{
return
;
}
pCache
.
setupData
=
new
clAmdFftSetupData
;
if
(
pCache
.
setupData
==
NULL
)
pCache
.
setupData
=
new
clAmdFftSetupData
;
openCLSafeCall
(
clAmdFftInitSetupData
(
pCache
.
setupData
));
pCache
.
started
=
true
;
}
...
...
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