Cycles: Fix ambiguity in call of min() function
authorSergey Sharybin <sergey.vfx@gmail.com>
Fri, 7 Jul 2017 08:40:19 +0000 (10:40 +0200)
committerSergey Sharybin <sergey.vfx@gmail.com>
Fri, 7 Jul 2017 08:40:19 +0000 (10:40 +0200)
intern/cycles/device/opencl/opencl_base.cpp
intern/cycles/device/opencl/opencl_split.cpp

index 49d7a228524d826f133e3f946e627d016eb92402..509da7a0a8433809a35d26b9457dddd7cdc0cddb 100644 (file)
@@ -282,7 +282,8 @@ void OpenCLDeviceBase::mem_alloc(const char *name, device_memory& mem, MemoryTyp
        clGetDeviceInfo(cdDevice, CL_DEVICE_MAX_MEM_ALLOC_SIZE, sizeof(cl_ulong), &max_alloc_size, NULL);
 
        if(DebugFlags().opencl.mem_limit) {
-               max_alloc_size = min(max_alloc_size, DebugFlags().opencl.mem_limit - stats.mem_used);
+               max_alloc_size = min(max_alloc_size,
+                                    cl_ulong(DebugFlags().opencl.mem_limit - stats.mem_used));
        }
 
        if(size > max_alloc_size) {
index fdaca2252d97fc76a6d91e34374fd682b77185a0..76d9983e9a225421df4ceb41ef000e5ba9abdddc 100644 (file)
@@ -426,7 +426,8 @@ public:
                clGetDeviceInfo(device->cdDevice, CL_DEVICE_MAX_MEM_ALLOC_SIZE, sizeof(cl_ulong), &max_buffer_size, NULL);
 
                if(DebugFlags().opencl.mem_limit) {
-                       max_buffer_size = min(max_buffer_size, DebugFlags().opencl.mem_limit - device->stats.mem_used);
+                       max_buffer_size = min(max_buffer_size,
+                                             cl_ulong(DebugFlags().opencl.mem_limit - device->stats.mem_used));
                }
 
                VLOG(1) << "Maximum device allocation size: "