3rd attempt to prepare patch with improved OpenCL kernels of CascadeClassifier.

This commit is contained in:
Vadim Pisarevsky
2014-02-03 15:12:27 +04:00
parent 0fef7f8b96
commit 30593ee55e
9 changed files with 1194 additions and 1018 deletions

View File

@@ -615,7 +615,7 @@ static void* initOpenCLAndLoad(const char* funcname)
initialized = true;
g_haveOpenCL = handle != 0 && dlsym(handle, oclFuncToCheck) != 0;
if( g_haveOpenCL )
fprintf(stderr, "Succesffuly loaded OpenCL v1.1+ runtime from %s\n", oclpath);
fprintf(stderr, "Successfully loaded OpenCL v1.1+ runtime from %s\n", oclpath);
else
fprintf(stderr, "Failed to load OpenCL runtime\n");
}
@@ -1335,11 +1335,13 @@ inline bool operator < (const HashKey& h1, const HashKey& h2)
return h1.a < h2.a || (h1.a == h2.a && h1.b < h2.b);
}
static bool g_isOpenCLInitialized = false;
static bool g_isOpenCLAvailable = false;
bool haveOpenCL()
{
#ifdef HAVE_OPENCL
static bool g_isOpenCLInitialized = false;
static bool g_isOpenCLAvailable = false;
if (!g_isOpenCLInitialized)
{
try
@@ -1354,6 +1356,9 @@ bool haveOpenCL()
g_isOpenCLInitialized = true;
}
return g_isOpenCLAvailable;
#else
return false;
#endif
}
bool useOpenCL()