Files
compute-runtime/shared/source/memory_manager/multi_graphics_allocation.h
Krzysztof Gibala 3d9a180c12 Implement local memory path for all devices in buffer
Related-To: NEO-4589
Signed-off-by: Krzysztof Gibala <krzysztof.gibala@intel.com>
2020-11-05 15:01:58 +01:00

49 lines
1.2 KiB
C++

/*
* Copyright (C) 2020 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
*/
#pragma once
#include "shared/source/memory_manager/graphics_allocation.h"
#include <mutex>
namespace NEO {
class MultiGraphicsAllocation {
public:
MultiGraphicsAllocation(uint32_t maxRootDeviceIndex);
MultiGraphicsAllocation(const MultiGraphicsAllocation &obj);
GraphicsAllocation *getDefaultGraphicsAllocation() const;
void addAllocation(GraphicsAllocation *graphicsAllocation);
void removeAllocation(uint32_t rootDeviceIndex);
GraphicsAllocation *getGraphicsAllocation(uint32_t rootDeviceIndex) const;
GraphicsAllocation::AllocationType getAllocationType() const;
bool isCoherent() const;
StackVec<GraphicsAllocation *, 1> const &getGraphicsAllocations() const;
void ensureMemoryOnDevice(MemoryManager &memoryManager, uint32_t requiredRootDeviceIndex);
uint32_t getLastUsedRootDeviceIndex() const { return lastUsedRootDeviceIndex; }
protected:
StackVec<GraphicsAllocation *, 1> graphicsAllocations;
uint32_t lastUsedRootDeviceIndex = std::numeric_limits<uint32_t>::max();
uint32_t requiredRootDeviceIndex = std::numeric_limits<uint32_t>::max();
std::mutex transferMutex;
};
} // namespace NEO