Changeset View
Changeset View
Standalone View
Standalone View
src/device/opencl/opencl_util.cpp
| Context not available. | |||||
| # include "device/device_intern.h" | # include "device/device_intern.h" | ||||
| # include "device/opencl/device_opencl.h" | # include "device/opencl/device_opencl.h" | ||||
| # include "device/device_debug.h" | |||||
| # include "util/util_debug.h" | |||||
| # include "util/util_logging.h" | # include "util/util_logging.h" | ||||
| # include "util/util_md5.h" | # include "util/util_md5.h" | ||||
| # include "util/util_path.h" | # include "util/util_path.h" | ||||
| Context not available. | |||||
| debug_src = &clsrc; | debug_src = &clsrc; | ||||
| } | } | ||||
| if (DebugFlags().running_inside_blender && compile_separate(clbin)) { | if (DeviceDebugFlags().running_inside_blender && compile_separate(clbin)) { | ||||
| add_log(string("Built and loaded program from ") + clbin + ".", true); | add_log(string("Built and loaded program from ") + clbin + ".", true); | ||||
| loaded = true; | loaded = true; | ||||
| } | } | ||||
| else { | else { | ||||
| if (DebugFlags().running_inside_blender) { | if (DeviceDebugFlags().running_inside_blender) { | ||||
| add_log(string("Separate-process building of ") + clbin + | add_log(string("Separate-process building of ") + clbin + | ||||
| " failed, will fall back to regular building.", | " failed, will fall back to regular building.", | ||||
| true); | true); | ||||
| Context not available. | |||||
| cl_device_type OpenCLInfo::device_type() | cl_device_type OpenCLInfo::device_type() | ||||
| { | { | ||||
| switch (DebugFlags().opencl.device_type) { | switch (DeviceDebugFlags().opencl.device_type) { | ||||
| case DebugFlags::OpenCL::DEVICE_NONE: | case DeviceDebugFlags::OpenCL::DEVICE_NONE: | ||||
| return 0; | return 0; | ||||
| case DebugFlags::OpenCL::DEVICE_ALL: | case DeviceDebugFlags::OpenCL::DEVICE_ALL: | ||||
| return CL_DEVICE_TYPE_ALL; | return CL_DEVICE_TYPE_ALL; | ||||
| case DebugFlags::OpenCL::DEVICE_DEFAULT: | case DeviceDebugFlags::OpenCL::DEVICE_DEFAULT: | ||||
| return CL_DEVICE_TYPE_DEFAULT; | return CL_DEVICE_TYPE_DEFAULT; | ||||
| case DebugFlags::OpenCL::DEVICE_CPU: | case DeviceDebugFlags::OpenCL::DEVICE_CPU: | ||||
| return CL_DEVICE_TYPE_CPU; | return CL_DEVICE_TYPE_CPU; | ||||
| case DebugFlags::OpenCL::DEVICE_GPU: | case DeviceDebugFlags::OpenCL::DEVICE_GPU: | ||||
| return CL_DEVICE_TYPE_GPU; | return CL_DEVICE_TYPE_GPU; | ||||
| case DebugFlags::OpenCL::DEVICE_ACCELERATOR: | case DeviceDebugFlags::OpenCL::DEVICE_ACCELERATOR: | ||||
| return CL_DEVICE_TYPE_ACCELERATOR; | return CL_DEVICE_TYPE_ACCELERATOR; | ||||
| default: | default: | ||||
| return CL_DEVICE_TYPE_ALL; | return CL_DEVICE_TYPE_ALL; | ||||
| Context not available. | |||||
| bool OpenCLInfo::use_debug() | bool OpenCLInfo::use_debug() | ||||
| { | { | ||||
| return DebugFlags().opencl.debug; | return DeviceDebugFlags().opencl.debug; | ||||
| } | } | ||||
| bool OpenCLInfo::device_supported(const string &platform_name, const cl_device_id device_id) | bool OpenCLInfo::device_supported(const string &platform_name, const cl_device_id device_id) | ||||
| Context not available. | |||||