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:
authorSergey Sharybin <sergey.vfx@gmail.com>2015-11-21 19:49:00 +0300
committerSergey Sharybin <sergey.vfx@gmail.com>2015-11-21 19:49:00 +0300
commit52d7bc624a750b633ee9691615f267af0fc88d03 (patch)
treec25176abe1c62ca448afadef943673dc51627297 /intern/cycles/device/device_cuda.cpp
parenta106da7f1dd92b7fc8559d7f83509e7f21758615 (diff)
Cycles: Make CUDA device internally operate with requested features
This just replaces internal argument `experimental` with `requested_features` making it possible to access particular requested settings when building kernels.
Diffstat (limited to 'intern/cycles/device/device_cuda.cpp')
-rw-r--r--intern/cycles/device/device_cuda.cpp22
1 files changed, 11 insertions, 11 deletions
diff --git a/intern/cycles/device/device_cuda.cpp b/intern/cycles/device/device_cuda.cpp
index a47d4edeb56..7f21cc5e036 100644
--- a/intern/cycles/device/device_cuda.cpp
+++ b/intern/cycles/device/device_cuda.cpp
@@ -185,21 +185,21 @@ public:
cuda_assert(cuCtxDestroy(cuContext));
}
- bool support_device(bool /*experimental*/)
+ bool support_device(const DeviceRequestedFeatures& /*requested_features*/)
{
int major, minor;
cuDeviceComputeCapability(&major, &minor, cuDevId);
-
+
/* We only support sm_20 and above */
if(major < 2) {
cuda_error_message(string_printf("CUDA device supported only with compute capability 2.0 or up, found %d.%d.", major, minor));
return false;
}
-
+
return true;
}
- string compile_kernel(bool experimental)
+ string compile_kernel(const DeviceRequestedFeatures& requested_features)
{
/* compute cubin name */
int major, minor;
@@ -207,7 +207,7 @@ public:
string cubin;
/* attempt to use kernel provided with blender */
- if(experimental)
+ if(requested_features.experimental)
cubin = path_get(string_printf("lib/kernel_experimental_sm_%d%d.cubin", major, minor));
else
cubin = path_get(string_printf("lib/kernel_sm_%d%d.cubin", major, minor));
@@ -221,7 +221,7 @@ public:
string kernel_path = path_get("kernel");
string md5 = path_files_md5_hash(kernel_path);
- if(experimental)
+ if(requested_features.experimental)
cubin = string_printf("cycles_kernel_experimental_sm%d%d_%s.cubin", major, minor, md5.c_str());
else
cubin = string_printf("cycles_kernel_sm%d%d_%s.cubin", major, minor, md5.c_str());
@@ -279,8 +279,8 @@ public:
"-o \"%s\" --ptxas-options=\"-v\" --use_fast_math -I\"%s\" "
"-DNVCC -D__KERNEL_CUDA_VERSION__=%d",
nvcc, major, minor, machine, kernel.c_str(), cubin.c_str(), include.c_str(), cuda_version);
-
- if(experimental)
+
+ if(requested_features.experimental)
command += " -D__KERNEL_EXPERIMENTAL__";
if(getenv("CYCLES_CUDA_EXTRA_CFLAGS")) {
@@ -314,13 +314,13 @@ public:
/* check if cuda init succeeded */
if(cuContext == 0)
return false;
-
+
/* check if GPU is supported */
- if(!support_device(requested_features.experimental))
+ if(!support_device(requested_features))
return false;
/* get kernel */
- string cubin = compile_kernel(requested_features.experimental);
+ string cubin = compile_kernel(requested_features);
if(cubin == "")
return false;