Files
compute-runtime/runtime/memory_manager/internal_allocation_storage.h
Mateusz Jablonski 7bd92190d9 Create class to operate on command stream receiver's allocation lists
Change-Id: I4262f46aa31948ed70d1152d172619b5619a2333
Signed-off-by: Mateusz Jablonski <mateusz.jablonski@intel.com>
2018-10-23 09:42:31 +02:00

32 lines
1020 B
C++

/*
* Copyright (C) 2018 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
*/
#pragma once
#include <cstdint>
#include <memory>
#include <mutex>
namespace OCLRT {
class AllocationsList;
class CommandStreamReceiver;
class GraphicsAllocation;
class InternalAllocationStorage {
public:
InternalAllocationStorage(CommandStreamReceiver &commandStreamReceiver);
void cleanAllocationsList(uint32_t waitTaskCount, uint32_t allocationUsage);
void freeAllocationsList(uint32_t waitTaskCount, AllocationsList &allocationsList);
void storeAllocation(std::unique_ptr<GraphicsAllocation> gfxAllocation, uint32_t allocationUsage);
void storeAllocationWithTaskCount(std::unique_ptr<GraphicsAllocation> gfxAllocation, uint32_t allocationUsage, uint32_t taskCount);
std::unique_ptr<GraphicsAllocation> obtainReusableAllocation(size_t requiredSize, bool isInternalAllocationRequired);
private:
std::recursive_mutex mutex;
CommandStreamReceiver &commandStreamReceiver;
};
} // namespace OCLRT