diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2018-01-19 17:02:23 +0300 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2018-01-19 17:22:32 +0300 |
commit | ccec1e76674855ab1a1c5110ea7380e92acb3b27 (patch) | |
tree | b95340dc7a46ca5319f079b5315e761f16b6563e | |
parent | 54632dc8307e30a711c5fceed79eb1b083fd40dc (diff) |
Cycles: Cleanup, stop using debug flags in system utilities
Debug flags are to be controlling render behavior, nothing to do with low level
system utilities.
it was simple to hack, but logically is wrong. Lets do things where they are
supposed to be done!
-rw-r--r-- | intern/cycles/device/device_cpu.cpp | 10 | ||||
-rw-r--r-- | intern/cycles/util/util_system.cpp | 18 |
2 files changed, 13 insertions, 15 deletions
diff --git a/intern/cycles/device/device_cpu.cpp b/intern/cycles/device/device_cpu.cpp index e476c012de1..0783230ef14 100644 --- a/intern/cycles/device/device_cpu.cpp +++ b/intern/cycles/device/device_cpu.cpp @@ -86,35 +86,35 @@ public: (void)kernel_avx; (void)kernel_avx2; #ifdef WITH_CYCLES_OPTIMIZED_KERNEL_AVX2 - if(system_cpu_support_avx2()) { + if(DebugFlags().cpu.avx2 && system_cpu_support_avx2()) { architecture_name = "AVX2"; kernel = kernel_avx2; } else #endif #ifdef WITH_CYCLES_OPTIMIZED_KERNEL_AVX - if(system_cpu_support_avx()) { + if(DebugFlags().cpu.avx && system_cpu_support_avx()) { architecture_name = "AVX"; kernel = kernel_avx; } else #endif #ifdef WITH_CYCLES_OPTIMIZED_KERNEL_SSE41 - if(system_cpu_support_sse41()) { + if(DebugFlags().cpu.sse41 && system_cpu_support_sse41()) { architecture_name = "SSE4.1"; kernel = kernel_sse41; } else #endif #ifdef WITH_CYCLES_OPTIMIZED_KERNEL_SSE3 - if(system_cpu_support_sse3()) { + if(DebugFlags().cpu.sse3 && system_cpu_support_sse3()) { architecture_name = "SSE3"; kernel = kernel_sse3; } else #endif #ifdef WITH_CYCLES_OPTIMIZED_KERNEL_SSE2 - if(system_cpu_support_sse2()) { + if(DebugFlags().cpu.sse2 && system_cpu_support_sse2()) { architecture_name = "SSE2"; kernel = kernel_sse2; } diff --git a/intern/cycles/util/util_system.cpp b/intern/cycles/util/util_system.cpp index 9b1b9a60c30..5f5211228c5 100644 --- a/intern/cycles/util/util_system.cpp +++ b/intern/cycles/util/util_system.cpp @@ -16,7 +16,6 @@ #include "util/util_system.h" -#include "util/util_debug.h" #include "util/util_logging.h" #include "util/util_types.h" #include "util/util_string.h" @@ -234,35 +233,34 @@ static CPUCapabilities& system_cpu_capabilities() bool system_cpu_support_sse2() { CPUCapabilities& caps = system_cpu_capabilities(); - return DebugFlags().cpu.sse2 && caps.sse && caps.sse2; + return caps.sse && caps.sse2; } bool system_cpu_support_sse3() { CPUCapabilities& caps = system_cpu_capabilities(); - return DebugFlags().cpu.sse3 && - caps.sse && caps.sse2 && caps.sse3 && caps.ssse3; + return caps.sse && caps.sse2 && caps.sse3 && caps.ssse3; } bool system_cpu_support_sse41() { CPUCapabilities& caps = system_cpu_capabilities(); - return DebugFlags().cpu.sse41 && - caps.sse && caps.sse2 && caps.sse3 && caps.ssse3 && caps.sse41; + return caps.sse && caps.sse2 && caps.sse3 && caps.ssse3 && caps.sse41; } bool system_cpu_support_avx() { CPUCapabilities& caps = system_cpu_capabilities(); - return DebugFlags().cpu.avx && - caps.sse && caps.sse2 && caps.sse3 && caps.ssse3 && caps.sse41 && caps.avx; + return caps.sse && caps.sse2 && caps.sse3 && caps.ssse3 && + caps.sse41 && caps.avx; } bool system_cpu_support_avx2() { CPUCapabilities& caps = system_cpu_capabilities(); - return DebugFlags().cpu.avx2 && - caps.sse && caps.sse2 && caps.sse3 && caps.ssse3 && caps.sse41 && caps.avx && caps.f16c && caps.avx2 && caps.fma3 && caps.bmi1 && caps.bmi2; + return caps.sse && caps.sse2 && caps.sse3 && caps.ssse3 && caps.sse41 && + caps.avx && caps.f16c && caps.avx2 && caps.fma3 && caps.bmi1 && + caps.bmi2; } #else |