feature(sysman): VF telemetry APIs for memory utilization

Related-To: NEO-11337

Signed-off-by: Pratik Bari <pratik.bari@intel.com>
This commit is contained in:
Pratik Bari
2024-11-14 08:16:28 +00:00
committed by Compute-Runtime-Automation
parent 917a4134fd
commit 31ca28d5bf
50 changed files with 2301 additions and 5 deletions

View File

@@ -378,6 +378,7 @@ ZE_DLLEXPORT ze_result_t ZE_APICALL zesGetDeviceExpProcAddrTable(
fillDdiEntry(pDdiTable->pfnGetSubDevicePropertiesExp, L0::zesDeviceGetSubDevicePropertiesExp, version, ZE_API_VERSION_1_9);
fillDdiEntry(pDdiTable->pfnEnumActiveVFExp, L0::zesDeviceEnumActiveVFExp, version, ZE_API_VERSION_1_9);
fillDdiEntry(pDdiTable->pfnEnumEnabledVFExp, L0::zesDeviceEnumEnabledVFExp, version, ZE_API_VERSION_1_11);
return result;
}
@@ -398,6 +399,9 @@ zesGetVFManagementExpProcAddrTable(
fillDdiEntry(pDdiTable->pfnGetVFEngineUtilizationExp, L0::zesVFManagementGetVFEngineUtilizationExp, version, ZE_API_VERSION_1_9);
fillDdiEntry(pDdiTable->pfnSetVFTelemetryModeExp, L0::zesVFManagementSetVFTelemetryModeExp, version, ZE_API_VERSION_1_9);
fillDdiEntry(pDdiTable->pfnSetVFTelemetrySamplingIntervalExp, L0::zesVFManagementSetVFTelemetrySamplingIntervalExp, version, ZE_API_VERSION_1_9);
fillDdiEntry(pDdiTable->pfnGetVFCapabilitiesExp, L0::zesVFManagementGetVFCapabilitiesExp, version, ZE_API_VERSION_1_11);
fillDdiEntry(pDdiTable->pfnGetVFMemoryUtilizationExp2, L0::zesVFManagementGetVFMemoryUtilizationExp2, version, ZE_API_VERSION_1_11);
fillDdiEntry(pDdiTable->pfnGetVFEngineUtilizationExp2, L0::zesVFManagementGetVFEngineUtilizationExp2, version, ZE_API_VERSION_1_11);
return result;
}

View File

@@ -1,5 +1,5 @@
/*
* Copyright (C) 2023 Intel Corporation
* Copyright (C) 2023-2024 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
@@ -57,4 +57,8 @@ struct _zes_perf_handle_t {
struct _zes_fan_handle_t {
virtual ~_zes_fan_handle_t() = default;
};
struct _zes_vf_handle_t {
virtual ~_zes_vf_handle_t() = default;
};

View File

@@ -892,6 +892,57 @@ ze_result_t zesVFManagementSetVFTelemetrySamplingIntervalExp(
}
}
ze_result_t zesDeviceEnumEnabledVFExp(
zes_device_handle_t hDevice,
uint32_t *pCount,
zes_vf_handle_t *phVFhandle) {
if (L0::sysmanInitFromCore) {
return L0::SysmanDevice::deviceEnumEnabledVF(hDevice, pCount, phVFhandle);
} else if (L0::Sysman::sysmanOnlyInit) {
return L0::Sysman::SysmanDevice::deviceEnumEnabledVF(hDevice, pCount, phVFhandle);
} else {
return ZE_RESULT_ERROR_UNINITIALIZED;
}
}
ze_result_t zesVFManagementGetVFCapabilitiesExp(
zes_vf_handle_t hVFhandle,
zes_vf_exp_capabilities_t *pCapability) {
if (L0::sysmanInitFromCore) {
return L0::VfManagement::fromHandle(hVFhandle)->vfGetCapabilities(pCapability);
} else if (L0::Sysman::sysmanOnlyInit) {
return L0::Sysman::VfManagement::fromHandle(hVFhandle)->vfGetCapabilities(pCapability);
} else {
return ZE_RESULT_ERROR_UNINITIALIZED;
}
}
ze_result_t zesVFManagementGetVFMemoryUtilizationExp2(
zes_vf_handle_t hVFhandle,
uint32_t *pCount,
zes_vf_util_mem_exp2_t *pMemUtil) {
if (L0::sysmanInitFromCore) {
return L0::VfManagement::fromHandle(hVFhandle)->vfGetMemoryUtilization(pCount, pMemUtil);
} else if (L0::Sysman::sysmanOnlyInit) {
return L0::Sysman::VfManagement::fromHandle(hVFhandle)->vfGetMemoryUtilization(pCount, pMemUtil);
} else {
return ZE_RESULT_ERROR_UNINITIALIZED;
}
}
ze_result_t zesVFManagementGetVFEngineUtilizationExp2(
zes_vf_handle_t hVFhandle,
uint32_t *pCount,
zes_vf_util_engine_exp2_t *pEngineUtil) {
if (L0::sysmanInitFromCore) {
return L0::VfManagement::fromHandle(hVFhandle)->vfGetEngineUtilization(pCount, pEngineUtil);
} else if (L0::Sysman::sysmanOnlyInit) {
return L0::Sysman::VfManagement::fromHandle(hVFhandle)->vfGetEngineUtilization(pCount, pEngineUtil);
} else {
return ZE_RESULT_ERROR_UNINITIALIZED;
}
}
ze_result_t zesDeviceEnumMemoryModules(
zes_device_handle_t hDevice,
uint32_t *pCount,
@@ -2051,6 +2102,33 @@ ZE_APIEXPORT ze_result_t ZE_APICALL zesVFManagementGetVFEngineUtilizationExp(
return L0::zesVFManagementGetVFEngineUtilizationExp(hVFhandle, pCount, pEngineUtil);
}
ZE_APIEXPORT ze_result_t ZE_APICALL zesDeviceEnumEnabledVFExp(
zes_device_handle_t hDevice,
uint32_t *pCount,
zes_vf_handle_t *phVFhandle) {
return L0::zesDeviceEnumEnabledVFExp(hDevice, pCount, phVFhandle);
}
ZE_APIEXPORT ze_result_t ZE_APICALL zesVFManagementGetVFCapabilitiesExp(
zes_vf_handle_t hVFhandle,
zes_vf_exp_capabilities_t *pCapability) {
return L0::zesVFManagementGetVFCapabilitiesExp(hVFhandle, pCapability);
}
ZE_APIEXPORT ze_result_t ZE_APICALL zesVFManagementGetVFMemoryUtilizationExp2(
zes_vf_handle_t hVFhandle,
uint32_t *pCount,
zes_vf_util_mem_exp2_t *pMemUtil) {
return L0::zesVFManagementGetVFMemoryUtilizationExp2(hVFhandle, pCount, pMemUtil);
}
ZE_APIEXPORT ze_result_t ZE_APICALL zesVFManagementGetVFEngineUtilizationExp2(
zes_vf_handle_t hVFhandle,
uint32_t *pCount,
zes_vf_util_engine_exp2_t *pEngineUtil) {
return L0::zesVFManagementGetVFEngineUtilizationExp2(hVFhandle, pCount, pEngineUtil);
}
ZE_APIEXPORT ze_result_t ZE_APICALL zesVFManagementSetVFTelemetryModeExp(
zes_vf_handle_t hVFhandle,
zes_vf_info_util_exp_flags_t flags,