Files
compute-runtime/unit_tests/mocks/mock_graphics_allocation.h
Filip Hazubski 552a1268eb Refactor blit buffer call
Resolves: NEO-3241

Change-Id: I726135ae55d1e0fcbacd80620e827ee5c7c0c8dc
Signed-off-by: Filip Hazubski <filip.hazubski@intel.com>
2019-08-09 16:43:40 +02:00

44 lines
1.4 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::aubInfo;
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