ocl: cache program build failures
authorAlexander Alekhin <alexander.alekhin@intel.com>
Mon, 23 Oct 2017 10:46:56 +0000 (13:46 +0300)
committerAlexander Alekhin <alexander.alekhin@intel.com>
Mon, 23 Oct 2017 10:46:56 +0000 (13:46 +0300)
To prevent unnecessary compiler invocations

modules/core/src/ocl.cpp

index 984307e..6da86b7 100644 (file)
@@ -1387,7 +1387,7 @@ struct Context::Impl
             }
         }
         Program prog(src, buildflags, errmsg);
-        if(prog.ptr())
+        // Cache result of build failures too (to prevent unnecessary compiler invocations)
         {
             cv::AutoLock lock(program_cache_mutex);
             phash.insert(std::pair<std::string, Program>(key, prog));