diff options
author | Mai Lavelle <mai.lavelle@gmail.com> | 2017-03-16 09:57:45 +0300 |
---|---|---|
committer | Mai Lavelle <mai.lavelle@gmail.com> | 2017-03-16 13:11:42 +0300 |
commit | 4833a71621c3948e5ef24f5d0b2b6596b07b38e5 (patch) | |
tree | fea1e11a4f2290524725b5366e7ce74962a966ef /intern | |
parent | d68a84d1d2e11d88185cc5d55a6fda6d1dd99969 (diff) |
Cycles: Adjust global size for OpenCL CPU devices to make them faster
Diffstat (limited to 'intern')
-rw-r--r-- | intern/cycles/device/opencl/opencl_split.cpp | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/intern/cycles/device/opencl/opencl_split.cpp b/intern/cycles/device/opencl/opencl_split.cpp index a09d93c625e..3faae4039e3 100644 --- a/intern/cycles/device/opencl/opencl_split.cpp +++ b/intern/cycles/device/opencl/opencl_split.cpp @@ -346,9 +346,18 @@ public: virtual int2 split_kernel_global_size(device_memory& kg, device_memory& data, DeviceTask */*task*/) { + cl_device_type type; + clGetDeviceInfo(device->cdDevice, CL_DEVICE_TYPE, sizeof(cl_device_type), &type, NULL); + + /* Use small global size on CPU devices as it seems to be much faster. */ + if(type == CL_DEVICE_TYPE_CPU) { + VLOG(1) << "Global size: (64, 64)."; + return make_int2(64, 64); + } + cl_ulong max_buffer_size; clGetDeviceInfo(device->cdDevice, CL_DEVICE_MAX_MEM_ALLOC_SIZE, sizeof(cl_ulong), &max_buffer_size, NULL); - VLOG(1) << "Maximum device allocation side: " + VLOG(1) << "Maximum device allocation size: " << string_human_readable_number(max_buffer_size) << " bytes. (" << string_human_readable_size(max_buffer_size) << ")."; |