2020-05-26 18:25:27 +08:00
|
|
|
/*
|
2021-03-26 23:54:43 +08:00
|
|
|
* Copyright (C) 2020-2021 Intel Corporation
|
2020-05-26 18:25:27 +08:00
|
|
|
*
|
|
|
|
* SPDX-License-Identifier: MIT
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
#include "shared/source/memory_manager/graphics_allocation.h"
|
|
|
|
|
2021-07-02 00:00:22 +08:00
|
|
|
#include <functional>
|
|
|
|
|
2020-05-26 18:25:27 +08:00
|
|
|
namespace NEO {
|
|
|
|
|
2021-07-02 00:00:22 +08:00
|
|
|
class MigrationSyncData;
|
|
|
|
|
2020-07-10 17:21:53 +08:00
|
|
|
class MultiGraphicsAllocation {
|
2020-05-26 18:25:27 +08:00
|
|
|
public:
|
|
|
|
MultiGraphicsAllocation(uint32_t maxRootDeviceIndex);
|
2021-07-02 00:00:22 +08:00
|
|
|
MultiGraphicsAllocation(const MultiGraphicsAllocation &multiGraphicsAllocation);
|
|
|
|
MultiGraphicsAllocation(MultiGraphicsAllocation &&);
|
|
|
|
~MultiGraphicsAllocation();
|
2020-05-26 18:25:27 +08:00
|
|
|
|
|
|
|
GraphicsAllocation *getDefaultGraphicsAllocation() const;
|
|
|
|
|
|
|
|
void addAllocation(GraphicsAllocation *graphicsAllocation);
|
|
|
|
|
2020-06-02 19:38:13 +08:00
|
|
|
void removeAllocation(uint32_t rootDeviceIndex);
|
|
|
|
|
2020-05-26 18:25:27 +08:00
|
|
|
GraphicsAllocation *getGraphicsAllocation(uint32_t rootDeviceIndex) const;
|
|
|
|
|
|
|
|
GraphicsAllocation::AllocationType getAllocationType() const;
|
|
|
|
|
|
|
|
bool isCoherent() const;
|
|
|
|
|
2020-08-04 17:53:49 +08:00
|
|
|
StackVec<GraphicsAllocation *, 1> const &getGraphicsAllocations() const;
|
2020-06-29 18:47:13 +08:00
|
|
|
|
2021-07-02 00:00:22 +08:00
|
|
|
bool requiresMigrations() const;
|
|
|
|
MigrationSyncData *getMigrationSyncData() const { return migrationSyncData; }
|
|
|
|
void setMultiStorage(bool value);
|
|
|
|
|
|
|
|
static std::function<MigrationSyncData *(size_t size)> createMigrationSyncDataFunc;
|
|
|
|
|
2020-05-26 18:25:27 +08:00
|
|
|
protected:
|
2021-07-02 00:00:22 +08:00
|
|
|
bool isMultiStorage = false;
|
|
|
|
MigrationSyncData *migrationSyncData = nullptr;
|
2020-08-04 17:53:49 +08:00
|
|
|
StackVec<GraphicsAllocation *, 1> graphicsAllocations;
|
2020-05-26 18:25:27 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
} // namespace NEO
|