Skip to content

Commit c3e409f

Browse files
committed
ocl: update program cache defaults
1 parent 7a95e65 commit c3e409f

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

modules/core/src/ocl.cpp

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1267,7 +1267,7 @@ static size_t getProgramCountLimit()
12671267
static size_t count = 0;
12681268
if (!initialized)
12691269
{
1270-
count = getConfigurationParameterForSize("OPENCV_OPENCL_PROGRAM_CACHE", 64);
1270+
count = getConfigurationParameterForSize("OPENCV_OPENCL_PROGRAM_CACHE", 0);
12711271
initialized = true;
12721272
}
12731273
return count;
@@ -1412,6 +1412,14 @@ struct Context::Impl
14121412
size_t sz = phash.size();
14131413
if (limit > 0 && sz >= limit)
14141414
{
1415+
static bool warningFlag = false;
1416+
if (!warningFlag)
1417+
{
1418+
printf("\nWARNING: OpenCV-OpenCL:\n"
1419+
" In-memory cache for OpenCL programs is full, older programs will be unloaded.\n"
1420+
" You can change cache size via OPENCV_OPENCL_PROGRAM_CACHE environment variable\n\n");
1421+
warningFlag = true;
1422+
}
14151423
while (!cacheList.empty())
14161424
{
14171425
size_t c = phash.erase(cacheList.back());

0 commit comments

Comments
 (0)