int OclHost::getThreadPerMulti() { if (isGPU()) { #ifdef __APPLE__ int id = 20; #else cl_uint revision = getDeviceInfoInt( CL_DEVICE_COMPUTE_CAPABILITY_MAJOR_NV); int id = 10 * revision + getDeviceInfoLong(CL_DEVICE_COMPUTE_CAPABILITY_MINOR_NV); #endif switch (id) { case 10: return 768; case 11: return 768; case 12: return 1024; case 13: return 1024; case 20: return 1536; case 21: return 1536; default: return 1536; } } else { return 256; } }
void DeviceInfo::populate(cl_platform_id platformId, cl_device_id deviceId) { // this->platformId = platformId; platformVendor = getPlatformInfoString(platformId, CL_PLATFORM_VENDOR); platformName = getPlatformInfoString(platformId, CL_PLATFORM_NAME); // this->deviceId = deviceId; deviceType = getDeviceInfoInt(deviceId, CL_DEVICE_TYPE); globalMemSize = getDeviceInfoInt64(deviceId, CL_DEVICE_GLOBAL_MEM_SIZE); localMemSize = getDeviceInfoInt(deviceId, CL_DEVICE_LOCAL_MEM_SIZE); globalMemCachelineSize = getDeviceInfoInt(deviceId, CL_DEVICE_GLOBAL_MEM_CACHELINE_SIZE); maxMemAllocSize = getDeviceInfoInt64(deviceId, CL_DEVICE_MAX_MEM_ALLOC_SIZE); maxComputeUnits = getDeviceInfoInt(deviceId, CL_DEVICE_MAX_COMPUTE_UNITS); maxWorkGroupSize = getDeviceInfoInt(deviceId, CL_DEVICE_MAX_WORK_GROUP_SIZE); maxWorkItemDimensions = getDeviceInfoInt(deviceId, CL_DEVICE_MAX_WORK_ITEM_DIMENSIONS); // maxWorkItemSizes = getDeviceInfoInt(deviceId, CL_MAX_WORK_ITEM_SIZES); deviceName = getDeviceInfoString(deviceId, CL_DEVICE_NAME); openClCVersion = getDeviceInfoString(deviceId, CL_DEVICE_OPENCL_C_VERSION); deviceVersion = getDeviceInfoString(deviceId, CL_DEVICE_VERSION); maxClockFrequency = getDeviceInfoInt(deviceId, CL_DEVICE_MAX_CLOCK_FREQUENCY); }