feature: Add Initial Support for Get Vector Width Properties

- Added support for L0 to query Vector Width Properties which allows for
querying all the supported vector widths and their prefferred and
native vector widths per data type.
- Updated shared code to support querying the same values thru
getPreferredVectorWidth* and getNativeVectorWidth* helper functions
for OpenCL and Level Zero.
- Initial support for reporting base values for the vector
widths with future support for reporting different values per platform and
based on the SIMD/SIMT size used.

Related-To: NEO-13745

Signed-off-by: Neil R. Spruit <neil.r.spruit@intel.com>
This commit is contained in:
Neil R. Spruit
2025-06-24 22:48:43 +00:00
committed by Compute-Runtime-Automation
parent 39b28474ae
commit 532c663da6
15 changed files with 233 additions and 17 deletions

View File

@@ -76,6 +76,7 @@ struct Device : _ze_device_handle_t {
virtual ze_result_t getMemoryProperties(uint32_t *pCount, ze_device_memory_properties_t *pMemProperties) = 0;
virtual ze_result_t getMemoryAccessProperties(ze_device_memory_access_properties_t *pMemAccessProperties) = 0;
virtual ze_result_t getProperties(ze_device_properties_t *pDeviceProperties) = 0;
virtual ze_result_t getVectorWidthPropertiesExt(uint32_t *pCount, ze_device_vector_width_properties_ext_t *pVectorWidthProperties) = 0;
virtual ze_result_t getSubDevices(uint32_t *pCount, ze_device_handle_t *phSubdevices) = 0;
virtual ze_result_t getCacheProperties(uint32_t *pCount, ze_device_cache_properties_t *pCacheProperties) = 0;
virtual ze_result_t getStatus() = 0;

View File

@@ -1000,6 +1000,36 @@ ze_result_t DeviceImp::getKernelProperties(ze_device_module_properties_t *pKerne
return ZE_RESULT_SUCCESS;
}
ze_result_t DeviceImp::getVectorWidthPropertiesExt(uint32_t *pCount, ze_device_vector_width_properties_ext_t *pVectorWidthProperties) {
if (*pCount == 0) {
*pCount = 1;
return ZE_RESULT_SUCCESS;
}
if (pVectorWidthProperties == nullptr) {
return ZE_RESULT_ERROR_INVALID_ARGUMENT;
}
if (*pCount > 1) {
*pCount = 1;
}
auto &gfxCoreHelper = this->neoDevice->getGfxCoreHelper();
auto vectorWidthSize = gfxCoreHelper.getMinimalSIMDSize();
pVectorWidthProperties[0].vector_width_size = vectorWidthSize;
pVectorWidthProperties[0].preferred_vector_width_char = gfxCoreHelper.getPreferredVectorWidthChar(vectorWidthSize);
pVectorWidthProperties[0].preferred_vector_width_short = gfxCoreHelper.getPreferredVectorWidthShort(vectorWidthSize);
pVectorWidthProperties[0].preferred_vector_width_int = gfxCoreHelper.getPreferredVectorWidthInt(vectorWidthSize);
pVectorWidthProperties[0].preferred_vector_width_long = gfxCoreHelper.getPreferredVectorWidthLong(vectorWidthSize);
pVectorWidthProperties[0].preferred_vector_width_float = gfxCoreHelper.getPreferredVectorWidthFloat(vectorWidthSize);
pVectorWidthProperties[0].preferred_vector_width_half = gfxCoreHelper.getPreferredVectorWidthHalf(vectorWidthSize);
pVectorWidthProperties[0].native_vector_width_char = gfxCoreHelper.getNativeVectorWidthChar(vectorWidthSize);
pVectorWidthProperties[0].native_vector_width_short = gfxCoreHelper.getNativeVectorWidthShort(vectorWidthSize);
pVectorWidthProperties[0].native_vector_width_int = gfxCoreHelper.getNativeVectorWidthInt(vectorWidthSize);
pVectorWidthProperties[0].native_vector_width_long = gfxCoreHelper.getNativeVectorWidthLong(vectorWidthSize);
pVectorWidthProperties[0].native_vector_width_float = gfxCoreHelper.getNativeVectorWidthFloat(vectorWidthSize);
pVectorWidthProperties[0].native_vector_width_half = gfxCoreHelper.getNativeVectorWidthHalf(vectorWidthSize);
return ZE_RESULT_SUCCESS;
}
ze_result_t DeviceImp::getProperties(ze_device_properties_t *pDeviceProperties) {
const auto &deviceInfo = this->neoDevice->getDeviceInfo();
const auto &hardwareInfo = this->neoDevice->getHardwareInfo();

View File

@@ -59,6 +59,7 @@ struct DeviceImp : public Device, NEO::NonCopyableAndNonMovableClass {
ze_result_t getMemoryProperties(uint32_t *pCount, ze_device_memory_properties_t *pMemProperties) override;
ze_result_t getMemoryAccessProperties(ze_device_memory_access_properties_t *pMemAccessProperties) override;
ze_result_t getProperties(ze_device_properties_t *pDeviceProperties) override;
ze_result_t getVectorWidthPropertiesExt(uint32_t *pCount, ze_device_vector_width_properties_ext_t *pVectorWidthProperties) override;
ze_result_t getSubDevices(uint32_t *pCount, ze_device_handle_t *phSubdevices) override;
ze_result_t getCacheProperties(uint32_t *pCount, ze_device_cache_properties_t *pCacheProperties) override;
ze_result_t reserveCache(size_t cacheLevel, size_t cacheReservationSize) override;

View File

@@ -39,6 +39,7 @@ const std::vector<std::pair<std::string, uint32_t>> DriverHandleImp::extensionsS
{ZE_GET_KERNEL_BINARY_EXP_NAME, ZE_KERNEL_GET_BINARY_EXP_VERSION_1_0},
{ZE_EXTERNAL_SEMAPHORES_EXTENSION_NAME, ZE_EXTERNAL_SEMAPHORE_EXT_VERSION_1_0},
{ZE_CACHELINE_SIZE_EXT_NAME, ZE_DEVICE_CACHE_LINE_SIZE_EXT_VERSION_1_0},
{ZE_DEVICE_VECTOR_SIZES_EXT_NAME, ZE_DEVICE_VECTOR_SIZES_EXT_VERSION_1_0},
// Driver experimental extensions
{ZE_INTEL_DEVICE_MODULE_DP_PROPERTIES_EXP_NAME, ZE_INTEL_DEVICE_MODULE_DP_PROPERTIES_EXP_VERSION_CURRENT},