diff --git a/src/occa/internal/modes/opencl/utils.cpp b/src/occa/internal/modes/opencl/utils.cpp index 00d312710..c7af1d9b6 100644 --- a/src/occa/internal/modes/opencl/utils.cpp +++ b/src/occa/internal/modes/opencl/utils.cpp @@ -125,10 +125,10 @@ namespace occa { } int getDeviceCountInPlatform(cl_platform_id platform_id, cl_device_type device_type) { - cl_uint deviceCount = 0; - + cl_uint deviceCount; + cl_int err = clGetDeviceIDs(platform_id, device_type, 0, NULL, &deviceCount); - if (CL_DEVICE_NOT_FOUND != err) OCCA_OPENCL_ERROR("OpenCL: getDeviceCountIntPlatform", err); + if (CL_DEVICE_NOT_FOUND != err) OCCA_OPENCL_ERROR("OpenCL: getDeviceCountInPlatform", err); return deviceCount; }