mirror of
https://github.com/intel/compute-runtime.git
synced 2025-12-21 01:04:57 +08:00
Cleaned up files: shared/source/command_stream/experimental_command_buffer.h shared/source/helpers/get_info.h shared/source/helpers/local_id_gen.h shared/source/memory_manager/gfx_partition.h shared/source/memory_manager/host_ptr_manager.h shared/source/memory_manager/prefetch_manager.h shared/test/common/mocks/mock_memory_manager.h Related-To: NEO-5548 Signed-off-by: Warchulski, Jaroslaw <jaroslaw.warchulski@intel.com>
74 lines
1.5 KiB
C++
74 lines
1.5 KiB
C++
/*
|
|
* Copyright (C) 2018-2023 Intel Corporation
|
|
*
|
|
* SPDX-License-Identifier: MIT
|
|
*
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
#include <cinttypes>
|
|
#include <cstddef>
|
|
#include <limits>
|
|
|
|
namespace NEO {
|
|
|
|
struct OsHandle {
|
|
virtual ~OsHandle() = default;
|
|
|
|
protected:
|
|
OsHandle() = default;
|
|
};
|
|
struct ResidencyData;
|
|
|
|
constexpr int maxFragmentsCount = 3;
|
|
|
|
enum class FragmentPosition {
|
|
NONE = 0,
|
|
LEADING,
|
|
MIDDLE,
|
|
TRAILING
|
|
};
|
|
|
|
enum class RequirementsStatus {
|
|
SUCCESS = 0,
|
|
FATAL
|
|
};
|
|
|
|
struct PartialAllocation {
|
|
FragmentPosition fragmentPosition = FragmentPosition::NONE;
|
|
const void *allocationPtr = nullptr;
|
|
size_t allocationSize = 0u;
|
|
};
|
|
|
|
struct AllocationRequirements {
|
|
PartialAllocation allocationFragments[maxFragmentsCount];
|
|
uint64_t totalRequiredSize = 0u;
|
|
uint32_t requiredFragmentsCount = 0u;
|
|
uint32_t rootDeviceIndex = std::numeric_limits<uint32_t>::max();
|
|
};
|
|
|
|
struct FragmentStorage {
|
|
const void *fragmentCpuPointer = nullptr;
|
|
size_t fragmentSize = 0;
|
|
int refCount = 0;
|
|
OsHandle *osInternalStorage = nullptr;
|
|
ResidencyData *residency = nullptr;
|
|
bool driverAllocation = false;
|
|
};
|
|
|
|
struct AllocationStorageData {
|
|
OsHandle *osHandleStorage = nullptr;
|
|
size_t fragmentSize = 0;
|
|
const void *cpuPtr = nullptr;
|
|
bool freeTheFragment = false;
|
|
ResidencyData *residency = nullptr;
|
|
};
|
|
|
|
struct OsHandleStorage {
|
|
AllocationStorageData fragmentStorageData[maxFragmentsCount];
|
|
uint32_t fragmentCount = 0;
|
|
};
|
|
|
|
} // namespace NEO
|