mirror of
https://github.com/intel/compute-runtime.git
synced 2025-12-25 05:24:02 +08:00
Related-To: NEO-2941 Change-Id: Iedd16d0dcb4158b5e7832043289e2e6aba1549d5 Signed-off-by: Igor Venevtsev <igor.venevtsev@intel.com>
41 lines
1.2 KiB
C++
41 lines
1.2 KiB
C++
/*
|
|
* Copyright (C) 2017-2019 Intel Corporation
|
|
*
|
|
* SPDX-License-Identifier: MIT
|
|
*
|
|
*/
|
|
|
|
#pragma once
|
|
#include "core/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()
|
|
: MemoryAllocation(0, AllocationType::UNKNOWN, nullptr, 0u, 0, MemoryPool::MemoryNull) {}
|
|
|
|
MockGraphicsAllocation(void *buffer, size_t sizeIn)
|
|
: MemoryAllocation(0, AllocationType::UNKNOWN, buffer, castToUint64(buffer), 0llu, sizeIn, MemoryPool::MemoryNull) {}
|
|
|
|
MockGraphicsAllocation(void *buffer, uint64_t gpuAddr, size_t sizeIn)
|
|
: MemoryAllocation(0, AllocationType::UNKNOWN, buffer, gpuAddr, 0llu, sizeIn, MemoryPool::MemoryNull) {}
|
|
|
|
void resetInspectionIds() {
|
|
for (auto &usageInfo : usageInfos) {
|
|
usageInfo.inspectionId = 0u;
|
|
}
|
|
}
|
|
|
|
void overrideMemoryPool(MemoryPool::Type pool) {
|
|
this->memoryPool = pool;
|
|
}
|
|
};
|
|
} // namespace NEO
|