]> Gitweb @ Texas Instruments - Open Source Git Repositories - git.TI.com/gitweb - opencv/tiopencv.git/commitdiff
ocl: Check OpenCL CMEM related preconditions
authorDjordje Senicic <x0157990@ti.com>
Thu, 14 Sep 2017 20:11:12 +0000 (16:11 -0400)
committerDjordje Senicic <x0157990@ti.com>
Thu, 14 Sep 2017 20:11:12 +0000 (16:11 -0400)
Signed-off-by: Djordje Senicic <x0157990@ti.com>
modules/core/src/ocl.cpp

index 1cb2a6d91595cdbdf0476bd1b6c6e6f3086e1ffe..80bb3f5eb585f7cf4fd8cc4c0f3221d2e8b56f7d 100644 (file)
@@ -1571,6 +1571,22 @@ bool haveOpenCL()
 
     if (!g_isOpenCLInitialized)
     {
+#ifdef CV_TIOPENCL
+        if (0 == access("/dev/cmem", 0))
+        { 
+          if(0 == system("pidof -x ti-mctd > /dev/null"))
+          {
+            //A process having name PROCESS is running.
+          } else {
+            g_isOpenCLInitialized = true;
+            return false;
+          }
+        } 
+        else { 
+          g_isOpenCLInitialized = true;
+          return false;
+        }     
+#endif
         try
         {
             cl_uint n = 0;