Files
compute-runtime/unit_tests/mocks/mock_graphics_allocation.h
Venevtsev, Igor 165d1e4e55 Use GfxPartition for GPU address range allocations
[2/n] - OsAgnosticMemoryManager

Related-To: NEO-2877

Change-Id: I887126362381ac960608a2150fae211631d3cd5b
Signed-off-by: Venevtsev, Igor <igor.venevtsev@intel.com>
2019-06-25 12:54:20 +02:00

43 lines
1.3 KiB
C++

/*
* Copyright (C) 2017-2019 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
*/
#pragma once
#include "runtime/memory_manager/graphics_allocation.h"
#include "runtime/memory_manager/os_agnostic_memory_manager.h"
namespace NEO {
class MockGraphicsAllocation : public MemoryAllocation {
public:
using MemoryAllocation::MemoryAllocation;
using MemoryAllocation::objectNotResident;
using MemoryAllocation::objectNotUsed;
using MemoryAllocation::usageInfos;
MockGraphicsAllocation()
: MockGraphicsAllocation(true) {}
MockGraphicsAllocation(bool multiOsContextCapable)
: MemoryAllocation(AllocationType::UNKNOWN, nullptr, 0u, 0, MemoryPool::MemoryNull, multiOsContextCapable) {}
MockGraphicsAllocation(void *buffer, size_t sizeIn)
: MemoryAllocation(AllocationType::UNKNOWN, buffer, castToUint64(buffer), 0llu, sizeIn, MemoryPool::MemoryNull, false) {}
MockGraphicsAllocation(void *buffer, uint64_t gpuAddr, size_t sizeIn)
: MemoryAllocation(AllocationType::UNKNOWN, buffer, gpuAddr, 0llu, sizeIn, MemoryPool::MemoryNull, false) {}
void resetInspectionIds() {
for (auto &usageInfo : usageInfos) {
usageInfo.inspectionId = 0u;
}
}
void overrideMemoryPool(MemoryPool::Type pool) {
this->memoryPool = pool;
}
};
} // namespace NEO