Make template type explicit for std::min calls

Fixes build on macOS, which complained about the mismatched argument
types.
This commit is contained in:
James Price
2018-11-09 11:04:50 +00:00
committed by Kévin Petit
parent bb92fae53e
commit 3b577bb13a
2 changed files with 2 additions and 2 deletions

View File

@@ -249,7 +249,7 @@ int test(cl_device_id device, cl_context context, cl_command_queue queue, test_o
error = clGetDeviceInfo(device, CL_DEVICE_LOCAL_MEM_SIZE, sizeof(device_local_mem_size), &device_local_mem_size, NULL); error = clGetDeviceInfo(device, CL_DEVICE_LOCAL_MEM_SIZE, sizeof(device_local_mem_size), &device_local_mem_size, NULL);
RETURN_ON_CL_ERROR(error, "clGetDeviceInfo") RETURN_ON_CL_ERROR(error, "clGetDeviceInfo")
max_work_group_size = (std::min)(max_work_group_size, (device_local_mem_size - kernel_local_mem_size) / sizeof(cl_long)); max_work_group_size = (std::min<cl_ulong>)(max_work_group_size, (device_local_mem_size - kernel_local_mem_size) / sizeof(cl_long));
} }
std::random_device rd; std::random_device rd;

View File

@@ -237,7 +237,7 @@ int test(cl_device_id device, cl_context context, cl_command_queue queue, test_o
error = clGetDeviceInfo(device, CL_DEVICE_LOCAL_MEM_SIZE, sizeof(device_local_mem_size), &device_local_mem_size, NULL); error = clGetDeviceInfo(device, CL_DEVICE_LOCAL_MEM_SIZE, sizeof(device_local_mem_size), &device_local_mem_size, NULL);
RETURN_ON_CL_ERROR(error, "clGetDeviceInfo") RETURN_ON_CL_ERROR(error, "clGetDeviceInfo")
max_work_group_size = (std::min)(max_work_group_size, (device_local_mem_size - kernel_local_mem_size) / sizeof(cl_long)); max_work_group_size = (std::min<cl_ulong>)(max_work_group_size, (device_local_mem_size - kernel_local_mem_size) / sizeof(cl_long));
} }
std::random_device rd; std::random_device rd;