From 4833a71621c3948e5ef24f5d0b2b6596b07b38e5 Mon Sep 17 00:00:00 2001 From: Mai Lavelle Date: Thu, 16 Mar 2017 02:57:45 -0400 Subject: Cycles: Adjust global size for OpenCL CPU devices to make them faster --- intern/cycles/device/opencl/opencl_split.cpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'intern/cycles/device') 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) << ")."; -- cgit v1.2.3