mirror of
https://github.com/intel/compute-runtime.git
synced 2026-01-12 00:59:38 +08:00
Fix pNext usage for ZE_STRUCTURE_TYPE_DEVICE_MEMORY_EXT_PROPERTIES
Signed-off-by: Joshua Santosh Ranjan <joshua.santosh.ranjan@intel.com>
This commit is contained in:
committed by
Compute-Runtime-Automation
parent
e151bc6e2d
commit
42e58fd301
@@ -488,10 +488,11 @@ ze_result_t DeviceImp::getMemoryProperties(uint32_t *pCount, ze_device_memory_pr
|
||||
|
||||
pMemProperties->flags = 0;
|
||||
|
||||
void *pNext = pMemProperties->pNext;
|
||||
ze_base_properties_t *pNext = static_cast<ze_base_properties_t *>(pMemProperties->pNext);
|
||||
while (pNext) {
|
||||
auto extendedProperties = reinterpret_cast<ze_device_memory_ext_properties_t *>(pMemProperties->pNext);
|
||||
if (extendedProperties->stype == ZE_STRUCTURE_TYPE_DEVICE_MEMORY_EXT_PROPERTIES) {
|
||||
|
||||
if (pNext->stype == ZE_STRUCTURE_TYPE_DEVICE_MEMORY_EXT_PROPERTIES) {
|
||||
auto extendedProperties = reinterpret_cast<ze_device_memory_ext_properties_t *>(pNext);
|
||||
|
||||
// GT_MEMORY_TYPES map to ze_device_memory_ext_type_t
|
||||
const std::array<ze_device_memory_ext_type_t, 5> sysInfoMemType = {
|
||||
@@ -516,7 +517,7 @@ ze_result_t DeviceImp::getMemoryProperties(uint32_t *pCount, ze_device_memory_pr
|
||||
extendedProperties->writeBandwidth = extendedProperties->readBandwidth;
|
||||
extendedProperties->bandwidthUnit = ZE_BANDWIDTH_UNIT_BYTES_PER_NANOSEC;
|
||||
}
|
||||
pNext = const_cast<void *>(extendedProperties->pNext);
|
||||
pNext = static_cast<ze_base_properties_t *>(pNext->pNext);
|
||||
}
|
||||
|
||||
return ZE_RESULT_SUCCESS;
|
||||
|
||||
Reference in New Issue
Block a user