Files
compute-runtime/unit_tests/mocks/mock_internal_allocation_storage.h
Mateusz Hoppe b5e2f322f6 Move files from runtime/memory_manager to core
- remove TbxMemoryManager

Change-Id: I554feff51f08e108b2e9ee22ecaa2cb75a1eead7
Signed-off-by: Mateusz Hoppe <mateusz.hoppe@intel.com>
2020-01-21 15:28:47 +01:00

37 lines
1.2 KiB
C++

/*
* Copyright (C) 2018-2020 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
*/
#pragma once
#include "core/memory_manager/internal_allocation_storage.h"
#include "runtime/command_stream/command_stream_receiver.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