Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2017-11-02 16:31:47 +0300
committerCampbell Barton <ideasman42@gmail.com>2017-11-02 16:31:47 +0300
commit7eb4ef6cacbb4cf0fbc2ff01d2e1a5fa133072cf (patch)
tree39df21ec691f7c00fcc357303bdd6dbb72a15eb7 /intern/cycles/device
parent90788adb665ae0b011a0cbc668c3fcfd0cb5f24b (diff)
parent6355d98267963984160b7cae212d0353b6846a7d (diff)
Merge branch 'master' into blender2.8
Diffstat (limited to 'intern/cycles/device')
-rw-r--r--intern/cycles/device/opencl/opencl_split.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/intern/cycles/device/opencl/opencl_split.cpp b/intern/cycles/device/opencl/opencl_split.cpp
index ae623d22f07..2125f3d126f 100644
--- a/intern/cycles/device/opencl/opencl_split.cpp
+++ b/intern/cycles/device/opencl/opencl_split.cpp
@@ -430,7 +430,10 @@ public:
<< string_human_readable_number(max_buffer_size) << " bytes. ("
<< string_human_readable_size(max_buffer_size) << ").";
- size_t num_elements = max_elements_for_max_buffer_size(kg, data, max_buffer_size / 2);
+ /* Limit to 2gb, as we shouldn't need more than that and some devices may support much more. */
+ max_buffer_size = min(max_buffer_size / 2, (cl_ulong)2l*1024*1024*1024);
+
+ size_t num_elements = max_elements_for_max_buffer_size(kg, data, max_buffer_size);
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;