Cycles: Change work pool and global size of split CPU for easier debugging
authorMai Lavelle <mai.lavelle@gmail.com>
Thu, 6 Apr 2017 09:08:35 +0000 (05:08 -0400)
committerMai Lavelle <mai.lavelle@gmail.com>
Fri, 7 Apr 2017 10:06:08 +0000 (06:06 -0400)
intern/cycles/device/device_cpu.cpp
intern/cycles/device/device_split_kernel.cpp
intern/cycles/kernel/kernel_types.h

index 2761d9488cac67685e0ffc67b254bfb1a06a0fcb..3c481bb2b39db11b401b1cd225f7a92cedc8e023 100644 (file)
@@ -856,7 +856,7 @@ int2 CPUSplitKernel::split_kernel_local_size()
 }
 
 int2 CPUSplitKernel::split_kernel_global_size(device_memory& /*kg*/, device_memory& /*data*/, DeviceTask * /*task*/) {
-       return make_int2(64, 1);
+       return make_int2(1, 1);
 }
 
 uint64_t CPUSplitKernel::state_buffer_size(device_memory& kernel_globals, device_memory& /*data*/, size_t num_threads) {
index 30e7a58281c87030a26cee6a753a6910ae132449..fa641161c0508b29eb1e9c88b5476b3921b1239f 100644 (file)
@@ -151,7 +151,8 @@ bool DeviceSplitKernel::path_trace(DeviceTask *task,
                /* Calculate max groups */
 
                /* Denotes the maximum work groups possible w.r.t. current requested tile size. */
-               unsigned int max_work_groups = num_global_elements / WORK_POOL_SIZE + 1;
+               unsigned int work_pool_size = (device->info.type == DEVICE_CPU) ? WORK_POOL_SIZE_CPU : WORK_POOL_SIZE_GPU;
+               unsigned int max_work_groups = num_global_elements / work_pool_size + 1;
 
                /* Allocate work_pool_wgs memory. */
                work_pool_wgs.resize(max_work_groups * sizeof(unsigned int));
index 19c91248922af6d7f8b81abc866657356b667964..623f3728c69819749580eeb02264c6da123d881a 100644 (file)
@@ -56,7 +56,13 @@ CCL_NAMESPACE_BEGIN
 
 #define VOLUME_STACK_SIZE              16
 
-#define WORK_POOL_SIZE 64
+#define WORK_POOL_SIZE_GPU 64
+#define WORK_POOL_SIZE_CPU 1
+#ifdef __KERNEL_GPU__
+#  define WORK_POOL_SIZE WORK_POOL_SIZE_GPU
+#else
+#  define WORK_POOL_SIZE WORK_POOL_SIZE_CPU
+#endif
 
 /* device capabilities */
 #ifdef __KERNEL_CPU__