Commit c3e409f9 authored by Alexander Alekhin's avatar Alexander Alekhin

ocl: update program cache defaults

parent 7a95e654
...@@ -1267,7 +1267,7 @@ static size_t getProgramCountLimit() ...@@ -1267,7 +1267,7 @@ static size_t getProgramCountLimit()
static size_t count = 0; static size_t count = 0;
if (!initialized) if (!initialized)
{ {
count = getConfigurationParameterForSize("OPENCV_OPENCL_PROGRAM_CACHE", 64); count = getConfigurationParameterForSize("OPENCV_OPENCL_PROGRAM_CACHE", 0);
initialized = true; initialized = true;
} }
return count; return count;
...@@ -1412,6 +1412,14 @@ struct Context::Impl ...@@ -1412,6 +1412,14 @@ struct Context::Impl
size_t sz = phash.size(); size_t sz = phash.size();
if (limit > 0 && sz >= limit) if (limit > 0 && sz >= limit)
{ {
static bool warningFlag = false;
if (!warningFlag)
{
printf("\nWARNING: OpenCV-OpenCL:\n"
" In-memory cache for OpenCL programs is full, older programs will be unloaded.\n"
" You can change cache size via OPENCV_OPENCL_PROGRAM_CACHE environment variable\n\n");
warningFlag = true;
}
while (!cacheList.empty()) while (!cacheList.empty())
{ {
size_t c = phash.erase(cacheList.back()); size_t c = phash.erase(cacheList.back());
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment