Files
compute-runtime/unit_tests/mocks/mock_graphics_allocation.h
Jobczyk, Lukasz b44c60ddc0 Use GPU addresses when setting up scheduler kernel's SVM args
Change-Id: Ia2d67d031ffce2413dd8c73d87c9d3d8f3d71ede
Signed-off-by: Jobczyk, Lukasz <lukasz.jobczyk@intel.com>
2019-02-14 07:21:31 +01:00

35 lines
1.1 KiB
C++

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