[Bf-blender-cvs] [4833a71621] master: Cycles: Adjust global size for OpenCL CPU devices to make them faster

Mai Lavelle noreply at git.blender.org
Thu Mar 16 11:12:11 CET 2017


Commit: 4833a71621c3948e5ef24f5d0b2b6596b07b38e5
Author: Mai Lavelle
Date:   Thu Mar 16 02:57:45 2017 -0400
Branches: master
https://developer.blender.org/rB4833a71621c3948e5ef24f5d0b2b6596b07b38e5

Cycles: Adjust global size for OpenCL CPU devices to make them faster

===================================================================

M	intern/cycles/device/opencl/opencl_split.cpp

===================================================================

diff --git a/intern/cycles/device/opencl/opencl_split.cpp b/intern/cycles/device/opencl/opencl_split.cpp
index a09d93c625..3faae4039e 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) << ").";




More information about the Bf-blender-cvs mailing list