Remove usage WITH_CYCLES_CUDA_BINARIES in code, use check for
[blender.git] / intern / cycles / util / util_cuda.cpp
index 12cb0d3e254a3548339536b4cbd8cc5b0786142e..ddd8b0014655895a299e3dce8735bbcaca2bcacd 100644 (file)
@@ -376,21 +376,23 @@ bool cuLibraryInit()
        /* cuda 4.0 */
        CUDA_LIBRARY_FIND(cuCtxSetCurrent);
 
-#ifndef WITH_CUDA_BINARIES
+       if(cuHavePrecompiledKernels())
+               result = true;
 #ifdef _WIN32
-       return false; /* runtime build doesn't work at the moment */
-#else
-       if(cuCompilerPath() == "")
-               return false;
+       else if(cuCompilerPath() != "")
+               result = true;
 #endif
-#endif
-
-       /* success */
-       result = true;
 
        return result;
 }
 
+bool cuHavePrecompiledKernels()
+{
+       string cubins_path = path_get("lib");
+
+       return path_exists(cubins_path);
+}
+
 string cuCompilerPath()
 {
 #ifdef _WIN32