1
0
mirror of https://github.com/opencv/opencv.git synced 2026-07-29 07:13:02 +04:00

ocl: fix compilation warnings, update openCLExecuteKernelInterop

This commit is contained in:
Alexander Alekhin
2013-10-09 16:57:52 +04:00
parent e3b42ed137
commit d26f62569d
6 changed files with 133 additions and 84 deletions
+2 -8
View File
@@ -67,7 +67,6 @@
namespace cv { namespace ocl {
#define MAX_PROG_CACHE_SIZE 1024
/*
* The binary caching system to eliminate redundant program source compilation.
* Strictly, this is not a cache because we do not implement evictions right now.
@@ -291,7 +290,7 @@ struct ProgramFileCache
bool writeConfigurationToFile(const string& options, std::vector<char>& buf)
{
if (hash_ == NULL)
return true; // don't save dynamic kernels
return true; // don't save programs without hash
if (!f.is_open())
{
@@ -469,7 +468,7 @@ cl_program ProgramCache::getProgram(const Context *ctx, const cv::ocl::ProgramEn
{
stringstream src_sign;
src_sign << (int64)(source->programStr);
src_sign << source->name;
src_sign << getClContext(ctx);
if (NULL != build_options)
{
@@ -514,15 +513,10 @@ cl_program ProgramCache::getProgram(const Context *ctx, const cv::ocl::ProgramEn
cl_program program = programFileCache.getOrBuildProgram(ctx, source, all_build_options);
//Cache the binary for future use if build_options is null
if( (this->cacheSize += 1) < MAX_PROG_CACHE_SIZE)
{
cv::AutoLock lockCache(mutexCache);
this->addProgram(src_sign.str(), program);
}
else
{
cout << "Warning: code cache has been full.\n";
}
return program;
}