Revert "Traverse pNext chain for all memory allocations extensions"

This reverts commit bd8b85c354.

Signed-off-by: Compute-Runtime-Validation <compute-runtime-validation@intel.com>
This commit is contained in:
Compute-Runtime-Validation
2023-02-19 05:04:40 +01:00
committed by Compute-Runtime-Automation
parent 15f08a92c0
commit 29cbdc2430
2 changed files with 5 additions and 68 deletions

View File

@@ -271,19 +271,18 @@ ze_result_t ContextImp::allocSharedMem(ze_device_handle_t hDevice,
bool relaxedSizeAllowed = NEO::DebugManager.flags.AllowUnrestrictedSize.get();
bool rayTracingAllocation = false;
const ze_base_desc_t *pNext = static_cast<const ze_base_desc_t *>(deviceDesc->pNext);
while (pNext) {
if (pNext->stype == ZE_STRUCTURE_TYPE_RELAXED_ALLOCATION_LIMITS_EXP_DESC) {
if (deviceDesc->pNext) {
const ze_base_desc_t *extendedDesc = reinterpret_cast<const ze_base_desc_t *>(deviceDesc->pNext);
if (extendedDesc->stype == ZE_STRUCTURE_TYPE_RELAXED_ALLOCATION_LIMITS_EXP_DESC) {
const ze_relaxed_allocation_limits_exp_desc_t *relaxedLimitsDesc =
reinterpret_cast<const ze_relaxed_allocation_limits_exp_desc_t *>(pNext);
reinterpret_cast<const ze_relaxed_allocation_limits_exp_desc_t *>(extendedDesc);
if (!(relaxedLimitsDesc->flags & ZE_RELAXED_ALLOCATION_LIMITS_EXP_FLAG_MAX_SIZE)) {
return ZE_RESULT_ERROR_INVALID_ARGUMENT;
}
relaxedSizeAllowed = true;
} else if (pNext->stype == ZE_STRUCTURE_TYPE_RAYTRACING_MEM_ALLOC_EXT_DESC) {
} else if (extendedDesc->stype == ZE_STRUCTURE_TYPE_RAYTRACING_MEM_ALLOC_EXT_DESC) {
rayTracingAllocation = true;
}
pNext = static_cast<const ze_base_desc_t *>(pNext->pNext);
}
if (relaxedSizeAllowed == false &&