Cycles: Dont allow global size to fall to zero
authorMai Lavelle <mai.lavelle@gmail.com>
Thu, 6 Jul 2017 00:15:47 +0000 (20:15 -0400)
committerMai Lavelle <mai.lavelle@gmail.com>
Thu, 6 Jul 2017 00:19:15 +0000 (20:19 -0400)
intern/cycles/device/opencl/opencl_split.cpp

index 73b8769d3ccb70b7b01249b825051adcd3fd1d96..50345613b6dd7214400a7e00c9b74b5f96d590c1 100644 (file)
@@ -428,7 +428,7 @@ public:
                        << string_human_readable_size(max_buffer_size) << ").";
 
                size_t num_elements = max_elements_for_max_buffer_size(kg, data, max_buffer_size / 2);
-               int2 global_size = make_int2(round_down((int)sqrt(num_elements), 64), (int)sqrt(num_elements));
+               int2 global_size = make_int2(max(round_down((int)sqrt(num_elements), 64), 64), (int)sqrt(num_elements));
                VLOG(1) << "Global size: " << global_size << ".";
                return global_size;
        }