diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2015-07-07 15:17:41 +0300 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2015-07-07 15:18:45 +0300 |
commit | 37539962fe0da09bb66af43aeb642cb03561c717 (patch) | |
tree | 7ff7666b723d8c604f4362f35c3c351906ef8e27 /intern/cycles/device/device_opencl.cpp | |
parent | 0c14a897dd92cba317f2466f39ef5782b823b31c (diff) |
Cycles: Add an option to force disable all OpenCL devices
This way it's possible to disable OpenCL devices for AMD devices
which are considered whitelisted.
Diffstat (limited to 'intern/cycles/device/device_opencl.cpp')
-rw-r--r-- | intern/cycles/device/device_opencl.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/intern/cycles/device/device_opencl.cpp b/intern/cycles/device/device_opencl.cpp index 39aa8c1e677..476bda34a17 100644 --- a/intern/cycles/device/device_opencl.cpp +++ b/intern/cycles/device/device_opencl.cpp @@ -77,6 +77,8 @@ cl_device_type opencl_device_type() char *device = getenv("CYCLES_OPENCL_TEST"); if(device) { + if(strcmp(device, "NONE") == 0) + return 0; if(strcmp(device, "ALL") == 0) return CL_DEVICE_TYPE_ALL; else if(strcmp(device, "DEFAULT") == 0) @@ -211,6 +213,10 @@ void opencl_get_usable_devices(vector<OpenCLPlatformDevice> *usable_devices) (getenv("CYCLES_OPENCL_SPLIT_KERNEL_TEST")) != NULL; const cl_device_type device_type = opencl_device_type(); + if(device_type == 0) { + return; + } + vector<cl_device_id> device_ids; cl_uint num_devices = 0; vector<cl_platform_id> platform_ids; @@ -3480,6 +3486,9 @@ void device_opencl_info(vector<DeviceInfo>& devices) string device_opencl_capabilities(void) { + if(opencl_device_type() == 0) { + return "All OpenCL devices are forced to be OFF"; + } string result = ""; string error_msg = ""; /* Only used by opencl_assert(), but in the future * it could also be nicely reported to the console. |