Remove usage WITH_CYCLES_CUDA_BINARIES in code, use check for
[blender.git] / intern / cycles / device / device_cuda.cpp
index 040f3044457c5a6be14300edeb5356598472d68f..ae540710b50baa07a0618ec66385c6a1508a4aed 100644 (file)
@@ -238,13 +238,16 @@ public:
                if(path_exists(cubin))
                        return cubin;
 
-#if defined(WITH_CUDA_BINARIES) && defined(_WIN32)
-               if(major <= 1 && minor <= 2)
-                       cuda_error(string_printf("CUDA device supported only compute capability 1.3 or up, found %d.%d.", major, minor));
-               else
-                       cuda_error(string_printf("CUDA binary kernel for this graphics card compute capability (%d.%d) not found.", major, minor));
-               return "";
-#else
+#ifdef _WIN32
+               if(cuHavePrecompiledKernels()) {
+                       if(major <= 1 && minor <= 2)
+                               cuda_error(string_printf("CUDA device supported only compute capability 1.3 or up, found %d.%d.", major, minor));
+                       else
+                               cuda_error(string_printf("CUDA binary kernel for this graphics card compute capability (%d.%d) not found.", major, minor));
+                       return "";
+               }
+#endif
+
                /* if not, find CUDA compiler */
                string nvcc = cuCompilerPath();
 
@@ -282,7 +285,6 @@ public:
                printf("Kernel compilation finished in %.2lfs.\n", time_dt() - starttime);
 
                return cubin;
-#endif
        }
 
        bool load_kernels(bool experimental)