diff options
author | Thomas Dinges <blender@dingto.org> | 2016-05-06 23:34:15 +0300 |
---|---|---|
committer | Thomas Dinges <blender@dingto.org> | 2016-05-07 00:13:33 +0300 |
commit | 734d1aec3f93b8757533284330afc2ac651442bd (patch) | |
tree | 98bbf8ea18392b09355c8b041b7727f9af88b2c4 /intern/cycles/util | |
parent | bd335f13fe3d25e8e6bb472acb9c727d1629e582 (diff) |
Cycles: Make CUDA adaptive feature compile a Debug flag.
If the CUDA Toolkit is installed and the user is on Linux,
adaptive, feature based CUDA runtime compile is now possible to enable via:
* Environment flag CYCLES_CUDA_ADAPTIVE_COMPILE or
* Debug menu (Debug value 256) in the Cycles UI.
Diffstat (limited to 'intern/cycles/util')
-rw-r--r-- | intern/cycles/util/util_debug.cpp | 15 | ||||
-rw-r--r-- | intern/cycles/util/util_debug.h | 15 |
2 files changed, 30 insertions, 0 deletions
diff --git a/intern/cycles/util/util_debug.cpp b/intern/cycles/util/util_debug.cpp index 448c6223765..80d177d2cae 100644 --- a/intern/cycles/util/util_debug.cpp +++ b/intern/cycles/util/util_debug.cpp @@ -57,6 +57,18 @@ void DebugFlags::CPU::reset() qbvh = true; } +DebugFlags::CUDA::CUDA() + : adaptive_compile(false) +{ + reset(); +} + +void DebugFlags::CUDA::reset() +{ + if(getenv("CYCLES_CUDA_ADAPTIVE_COMPILE") != NULL) + adaptive_compile = true; +} + DebugFlags::OpenCL::OpenCL() : device_type(DebugFlags::OpenCL::DEVICE_ALL), kernel_type(DebugFlags::OpenCL::KERNEL_DEFAULT), @@ -123,6 +135,9 @@ std::ostream& operator <<(std::ostream &os, << " SSE3 : " << string_from_bool(debug_flags.cpu.sse3) << "\n" << " SSE2 : " << string_from_bool(debug_flags.cpu.sse2) << "\n"; + os << "CUDA flags:\n" + << " Adaptive Compile: " << string_from_bool(debug_flags.cuda.adaptive_compile) << "\n"; + const char *opencl_device_type, *opencl_kernel_type; switch(debug_flags.opencl.device_type) { diff --git a/intern/cycles/util/util_debug.h b/intern/cycles/util/util_debug.h index 6ec5188049d..641abcc0668 100644 --- a/intern/cycles/util/util_debug.h +++ b/intern/cycles/util/util_debug.h @@ -46,6 +46,18 @@ public: bool qbvh; }; + /* Descriptor of CUDA feature-set to be used. */ + struct CUDA { + CUDA(); + + /* Reset flags to their defaults. */ + void reset(); + + /* Whether adaptive feature based runtime compile is enabled or not. + * Requires the CUDA Toolkit and only works on Linux atm. */ + bool adaptive_compile; + }; + /* Descriptor of OpenCL feature-set to be used. */ struct OpenCL { OpenCL(); @@ -107,6 +119,9 @@ public: /* Requested CPU flags. */ CPU cpu; + /* Requested CUDA flags. */ + CUDA cuda; + /* Requested OpenCL flags. */ OpenCL opencl; |