mirror of
https://github.com/intel/compute-runtime.git
synced 2025-09-15 13:01:45 +08:00

Change-Id: I5c9b6778c93c7422bb84ee367dbf298df5e06cab Related-To: NEO-3020 Signed-off-by: Dunajski, Bartosz <bartosz.dunajski@intel.com>
37 lines
1.2 KiB
C++
37 lines
1.2 KiB
C++
/*
|
|
* Copyright (C) 2018-2019 Intel Corporation
|
|
*
|
|
* SPDX-License-Identifier: MIT
|
|
*
|
|
*/
|
|
|
|
#pragma once
|
|
#include "runtime/command_stream/command_stream_receiver.h"
|
|
#include "runtime/memory_manager/internal_allocation_storage.h"
|
|
|
|
namespace NEO {
|
|
class MockInternalAllocationStorage : public InternalAllocationStorage {
|
|
public:
|
|
using InternalAllocationStorage::InternalAllocationStorage;
|
|
void cleanAllocationList(uint32_t waitTaskCount, uint32_t allocationUsage) override {
|
|
cleanAllocationsCalled++;
|
|
lastCleanAllocationsTaskCount = waitTaskCount;
|
|
lastCleanAllocationUsage = allocationUsage;
|
|
InternalAllocationStorage::cleanAllocationList(waitTaskCount, allocationUsage);
|
|
if (doUpdateCompletion) {
|
|
*commandStreamReceiver.getTagAddress() = valueToUpdateCompletion;
|
|
doUpdateCompletion = false;
|
|
}
|
|
}
|
|
void updateCompletionAfterCleaningList(uint32_t newValue) {
|
|
doUpdateCompletion = true;
|
|
valueToUpdateCompletion = newValue;
|
|
}
|
|
bool doUpdateCompletion = false;
|
|
uint32_t valueToUpdateCompletion;
|
|
uint32_t lastCleanAllocationUsage = 0;
|
|
uint32_t lastCleanAllocationsTaskCount = 0;
|
|
uint32_t cleanAllocationsCalled = 0;
|
|
};
|
|
} // namespace NEO
|