2017-12-21 07:45:38 +08:00
|
|
|
/*
|
2020-02-22 16:28:27 +08:00
|
|
|
* Copyright (C) 2017-2020 Intel Corporation
|
2017-12-21 07:45:38 +08:00
|
|
|
*
|
2018-09-18 15:11:08 +08:00
|
|
|
* SPDX-License-Identifier: MIT
|
2017-12-21 07:45:38 +08:00
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
#pragma once
|
2020-02-24 05:44:01 +08:00
|
|
|
#include "shared/source/memory_manager/graphics_allocation.h"
|
2020-02-24 17:22:30 +08:00
|
|
|
|
2020-02-23 05:50:57 +08:00
|
|
|
#include "opencl/source/memory_manager/os_agnostic_memory_manager.h"
|
2017-12-21 07:45:38 +08:00
|
|
|
|
2019-03-26 18:59:46 +08:00
|
|
|
namespace NEO {
|
2020-06-03 18:31:33 +08:00
|
|
|
|
|
|
|
constexpr uint32_t mockRootDeviceIndex = 0u;
|
|
|
|
constexpr DeviceBitfield mockDeviceBitfield(0b1);
|
|
|
|
|
2019-04-18 21:30:47 +08:00
|
|
|
class MockGraphicsAllocation : public MemoryAllocation {
|
2018-11-07 16:33:55 +08:00
|
|
|
public:
|
2019-08-07 00:01:26 +08:00
|
|
|
using MemoryAllocation::aubInfo;
|
2019-04-18 21:30:47 +08:00
|
|
|
using MemoryAllocation::MemoryAllocation;
|
|
|
|
using MemoryAllocation::objectNotResident;
|
|
|
|
using MemoryAllocation::objectNotUsed;
|
|
|
|
using MemoryAllocation::usageInfos;
|
2018-05-14 17:25:18 +08:00
|
|
|
|
2019-02-26 18:37:51 +08:00
|
|
|
MockGraphicsAllocation()
|
2019-11-04 23:03:30 +08:00
|
|
|
: MemoryAllocation(0, AllocationType::UNKNOWN, nullptr, 0u, 0, MemoryPool::MemoryNull) {}
|
2019-02-26 18:37:51 +08:00
|
|
|
|
|
|
|
MockGraphicsAllocation(void *buffer, size_t sizeIn)
|
2019-11-04 23:03:30 +08:00
|
|
|
: MemoryAllocation(0, AllocationType::UNKNOWN, buffer, castToUint64(buffer), 0llu, sizeIn, MemoryPool::MemoryNull) {}
|
2019-02-26 18:37:51 +08:00
|
|
|
|
|
|
|
MockGraphicsAllocation(void *buffer, uint64_t gpuAddr, size_t sizeIn)
|
2019-11-04 23:03:30 +08:00
|
|
|
: MemoryAllocation(0, AllocationType::UNKNOWN, buffer, gpuAddr, 0llu, sizeIn, MemoryPool::MemoryNull) {}
|
2018-12-04 22:11:29 +08:00
|
|
|
|
|
|
|
void resetInspectionIds() {
|
|
|
|
for (auto &usageInfo : usageInfos) {
|
|
|
|
usageInfo.inspectionId = 0u;
|
|
|
|
}
|
2018-05-14 17:25:18 +08:00
|
|
|
}
|
2018-12-04 22:11:29 +08:00
|
|
|
|
2018-07-23 17:03:05 +08:00
|
|
|
void overrideMemoryPool(MemoryPool::Type pool) {
|
|
|
|
this->memoryPool = pool;
|
|
|
|
}
|
2017-12-21 07:45:38 +08:00
|
|
|
};
|
2019-03-26 18:59:46 +08:00
|
|
|
} // namespace NEO
|