Files
compute-runtime/unit_tests/mocks/mock_gfx_partition.h
Jobczyk, Lukasz a79b682fc2 Move a GfxPartition to the core dir
Related-To: NEO-3677

Change-Id: Ia89ba93eefbb2921ef7d64bde7ed4114a0c78e0d
Signed-off-by: Jobczyk, Lukasz <lukasz.jobczyk@intel.com>
2019-09-04 15:42:25 +02:00

36 lines
799 B
C++

/*
* Copyright (C) 2019 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
*/
#include "core/memory_manager/gfx_partition.h"
#include "gmock/gmock.h"
using namespace NEO;
class MockGfxPartition : public GfxPartition {
public:
uint64_t getHeapSize(HeapIndex heapIndex) {
return getHeap(heapIndex).getSize();
}
bool heapInitialized(HeapIndex heapIndex) {
return getHeapSize(heapIndex) > 0;
}
void *getReservedCpuAddressRange() {
return reservedCpuAddressRange;
}
size_t getReservedCpuAddressRangeSize() {
return reservedCpuAddressRangeSize;
}
MOCK_METHOD2(freeGpuAddressRange, void(uint64_t gpuAddress, size_t size));
static std::array<HeapIndex, static_cast<uint32_t>(HeapIndex::TOTAL_HEAPS)> allHeapNames;
};