Changeset View
Changeset View
Standalone View
Standalone View
intern/cycles/util/util_debug.h
| Show All 13 Lines | |||||
| * limitations under the License. | * limitations under the License. | ||||
| */ | */ | ||||
| #ifndef __UTIL_DEBUG_H__ | #ifndef __UTIL_DEBUG_H__ | ||||
| #define __UTIL_DEBUG_H__ | #define __UTIL_DEBUG_H__ | ||||
| #include <assert.h> | #include <assert.h> | ||||
| #endif /* __UTIL_DEBUG_H__ */ | CCL_NAMESPACE_BEGIN | ||||
| class DebugFlags { | |||||
| public: | |||||
| struct CPU { | |||||
| CPU(); | |||||
| void reset(); | |||||
| bool avx2; | |||||
| bool avx; | |||||
| bool sse41; | |||||
| bool sse3; | |||||
| bool sse2; | |||||
| }; | |||||
| struct OpenCL { | |||||
| OpenCL(); | |||||
| void reset(); | |||||
| enum DeviceType { | |||||
| DEVICE_NONE, | |||||
| DEVICE_ALL, | |||||
| DEVICE_DEFAULT, | |||||
| DEVICE_CPU, | |||||
| DEVICE_GPU, | |||||
| DEVICE_ACCELERATOR, | |||||
| }; | |||||
| enum KernelType { | |||||
| KERNEL_DEFAULT, | |||||
| KERNEL_MEGA, | |||||
| KERNEL_SPLIT, | |||||
| }; | |||||
| DeviceType device_type; | |||||
| KernelType kernel_type; | |||||
| bool debug; | |||||
| }; | |||||
| static DebugFlags& get() | |||||
| { | |||||
| static DebugFlags instance; | |||||
| return instance; | |||||
| } | |||||
| void reset(); | |||||
| CPU cpu; | |||||
| OpenCL opencl; | |||||
| private: | |||||
| DebugFlags(); | |||||
| #if (__cplusplus > 199711L) | |||||
| public: | |||||
| DebugFlags(DebugFlags const& /*other*/) = delete; | |||||
| void operator=(DebugFlags const& /*other*/) = delete; | |||||
| #else | |||||
| private: | |||||
| DebugFlags(DebugFlags const& /*other*/); | |||||
| void operator=(DebugFlags const& /*other*/); | |||||
| #endif | |||||
| }; | |||||
| typedef DebugFlags& DebugFlagsRef; | |||||
| inline DebugFlags& DebugFlags() { | |||||
| return DebugFlags::get(); | |||||
| } | |||||
| CCL_NAMESPACE_END | |||||
| #endif /* __UTIL_DEBUG_H__ */ | |||||