Fix l0 kernel set arg buffer caching

Fix for incorrect cache hit if alloc id was uninitialized
and allocations counter was the same.

Signed-off-by: Dominik Dabek <dominik.dabek@intel.com>
This commit is contained in:
Dominik Dabek
2022-10-27 10:40:20 +00:00
committed by Compute-Runtime-Automation
parent 6cf8b4daca
commit 526ba1bde5
3 changed files with 41 additions and 5 deletions

View File

@@ -536,7 +536,9 @@ ze_result_t KernelImp::setArgBuffer(uint32_t argIndex, size_t argSize, const voi
NEO::SvmAllocationData *allocData = nullptr;
if (argVal != nullptr) {
const auto requestedAddress = *reinterpret_cast<void *const *>(argVal);
if (argInfo.allocId > 0 && requestedAddress == argInfo.value) {
if (argInfo.allocId > 0 &&
argInfo.allocId < NEO::SvmAllocationData::uninitializedAllocId &&
requestedAddress == argInfo.value) {
bool reuseFromCache = false;
if (allocationsCounter > 0) {
if (allocationsCounter == argInfo.allocIdMemoryManagerCounter) {