Device Vector Sizes Query Extension

Device Vector Sizes Query Extension#

API#

Summary:#

This extension provides a mechanism to query all the supported vector sizes for the given device. Users can use this query to allow them to choose the best vector size for each data type for their kernels. The call to zeDeviceGetVectorWidthPropertiesExt returns list(s) of preferred/native vector sizes matched with the vector width supported on the device. The first index in the array for the vector sizes will be for the largest vector width supported by the device. Example: a device with SIMD support of 16, 8, will report the preferred vector sizes for 16 first and then 8.

Example usecase:#

zeDeviceGetVectorWidthPropertiesExt(hDevice, &pCount, nullptr);
std::vector<ze_device_vector_width_properties_ext_t> vectorWidthProps(pCount);
for (auto& vectorWidthProp : vectorWidthProps) {
    vectorWidthProp.stype = ZE_STRUCTURE_TYPE_DEVICE_VECTOR_WIDTH_PROPERTIES_EXT;
    vectorWidthProp.pNext = nullptr;
}
zeDeviceGetVectorWidthPropertiesExt(hDevice, &pCount, vectorWidthProps.data());