diff options
-rw-r--r-- | intern/cycles/device/device_cpu.cpp | 10 | ||||
-rw-r--r-- | intern/cycles/util/util_debug.h | 9 |
2 files changed, 14 insertions, 5 deletions
diff --git a/intern/cycles/device/device_cpu.cpp b/intern/cycles/device/device_cpu.cpp index 0783230ef14..6b6b3432446 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(DebugFlags().cpu.avx2 && system_cpu_support_avx2()) { + if(DebugFlags().cpu.has_avx2() && system_cpu_support_avx2()) { architecture_name = "AVX2"; kernel = kernel_avx2; } else #endif #ifdef WITH_CYCLES_OPTIMIZED_KERNEL_AVX - if(DebugFlags().cpu.avx && system_cpu_support_avx()) { + if(DebugFlags().cpu.has_avx() && system_cpu_support_avx()) { architecture_name = "AVX"; kernel = kernel_avx; } else #endif #ifdef WITH_CYCLES_OPTIMIZED_KERNEL_SSE41 - if(DebugFlags().cpu.sse41 && system_cpu_support_sse41()) { + if(DebugFlags().cpu.has_sse41() && system_cpu_support_sse41()) { architecture_name = "SSE4.1"; kernel = kernel_sse41; } else #endif #ifdef WITH_CYCLES_OPTIMIZED_KERNEL_SSE3 - if(DebugFlags().cpu.sse3 && system_cpu_support_sse3()) { + if(DebugFlags().cpu.has_sse3() && system_cpu_support_sse3()) { architecture_name = "SSE3"; kernel = kernel_sse3; } else #endif #ifdef WITH_CYCLES_OPTIMIZED_KERNEL_SSE2 - if(DebugFlags().cpu.sse2 && system_cpu_support_sse2()) { + if(DebugFlags().cpu.has_sse2() && system_cpu_support_sse2()) { architecture_name = "SSE2"; kernel = kernel_sse2; } diff --git a/intern/cycles/util/util_debug.h b/intern/cycles/util/util_debug.h index 632c6ae35e7..ec38cd373ba 100644 --- a/intern/cycles/util/util_debug.h +++ b/intern/cycles/util/util_debug.h @@ -45,6 +45,15 @@ public: bool sse3; bool sse2; + /* Check functions to see whether instructions up to the given one + * are allowed for use. + */ + bool has_avx2() { return has_avx() && avx2; } + bool has_avx() { return has_sse41() && avx; } + bool has_sse41() { return has_sse3() && sse41; } + bool has_sse3() { return has_sse2() && sse3; } + bool has_sse2() { return sse2; } + /* Whether QBVH usage is allowed or not. */ bool qbvh; |