Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Dinges <blender@dingto.org>2016-05-19 17:32:57 +0300
committerThomas Dinges <blender@dingto.org>2016-05-19 17:32:57 +0300
commitdedc9950188dc71a3a89d62f3f15d98d0adfc511 (patch)
tree4147c60eee21dfa7bbd909a41dec37ababe7f263 /intern/cycles
parentc5893db5cc70be12e65632ab673320f8765161f1 (diff)
Cycles / CUDA: Don't use bundled kernel if Adaptive is enforced by the user.
Diffstat (limited to 'intern/cycles')
-rw-r--r--intern/cycles/device/device_cuda.cpp29
1 files changed, 16 insertions, 13 deletions
diff --git a/intern/cycles/device/device_cuda.cpp b/intern/cycles/device/device_cuda.cpp
index 39bb4426826..7fc62136512 100644
--- a/intern/cycles/device/device_cuda.cpp
+++ b/intern/cycles/device/device_cuda.cpp
@@ -251,23 +251,26 @@ public:
string compile_kernel(const DeviceRequestedFeatures& requested_features)
{
- /* compute cubin name */
+ /* Compute cubin name. */
int major, minor;
cuDeviceComputeCapability(&major, &minor, cuDevId);
string cubin;
- /* adaptive compile */
+ /* Adaptive Compile.
+ * If enabled, always use that */
bool use_adaptive_compile = use_adaptive_compilation();
- /* attempt to use kernel provided with blender */
- cubin = path_get(string_printf("lib/kernel_sm_%d%d.cubin", major, minor));
- VLOG(1) << "Testing for pre-compiled kernel " << cubin;
- if(path_exists(cubin)) {
- VLOG(1) << "Using precompiled kernel";
- return cubin;
+ /* Attempt to use kernel provided with Blender. */
+ if(!use_adaptive_compile) {
+ cubin = path_get(string_printf("lib/kernel_sm_%d%d.cubin", major, minor));
+ VLOG(1) << "Testing for pre-compiled kernel " << cubin;
+ if(path_exists(cubin)) {
+ VLOG(1) << "Using precompiled kernel";
+ return cubin;
+ }
}
- /* not found, try to use locally compiled kernel */
+ /* Try to use locally compiled kernel. */
string kernel_path = path_get("kernel");
string md5 = path_files_md5_hash(kernel_path);
@@ -286,7 +289,7 @@ public:
cubin = path_user_get(path_join("cache", cubin));
VLOG(1) << "Testing for locally compiled kernel " << cubin;
- /* if exists already, use it */
+ /* If exists already, use it. */
if(path_exists(cubin)) {
VLOG(1) << "Using locally compiled kernel";
return cubin;
@@ -302,7 +305,7 @@ public:
}
#endif
- /* if not, find CUDA compiler */
+ /* If not, find CUDA compiler. */
const char *nvcc = cuewCompilerPath();
if(nvcc == NULL) {
@@ -324,7 +327,7 @@ public:
else if(cuda_version != 75)
printf("CUDA version %d.%d detected, build may succeed but only CUDA 7.5 is officially supported.\n", cuda_version/10, cuda_version%10);
- /* compile */
+ /* Compile. */
string kernel = path_join(kernel_path, path_join("kernels", path_join("cuda", "kernel.cu")));
string include = kernel_path;
const int machine = system_cpu_bits();
@@ -358,7 +361,7 @@ public:
return "";
}
- /* verify if compilation succeeded */
+ /* Verify if compilation succeeded */
if(!path_exists(cubin)) {
cuda_error_message("CUDA kernel compilation failed, see console for details.");
return "";