Files
compute-runtime/runtime/os_interface/linux/drm_allocation.h
Mateusz Jablonski aee69779fa Minor renaming in a scope of multi os context allocations:
shareable -> multiOsContextCapable
resetTaskCount -> releaseUsageInOsContext
resetResidencyTaskCount -> releaseResidencyInOsContext
isUsedByContext -> isUsedByOsContext

Change-Id: If824246a0e393b962bd12f8c63d429a0fcfcda25
Signed-off-by: Mateusz Jablonski <mateusz.jablonski@intel.com>
2019-01-07 11:42:43 +01:00

41 lines
1.4 KiB
C++

/*
* Copyright (C) 2017-2019 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
*/
#pragma once
#include "runtime/memory_manager/graphics_allocation.h"
namespace OCLRT {
class BufferObject;
struct OsHandle {
BufferObject *bo = nullptr;
};
class DrmAllocation : public GraphicsAllocation {
public:
DrmAllocation(BufferObject *bo, void *ptrIn, size_t sizeIn, MemoryPool::Type pool, uint32_t osContextsCount, bool multiOsContextCapable) : GraphicsAllocation(ptrIn, castToUint64(ptrIn), 0llu, sizeIn, osContextsCount, multiOsContextCapable), bo(bo) {
this->memoryPool = pool;
}
DrmAllocation(BufferObject *bo, void *ptrIn, size_t sizeIn, osHandle sharedHandle, MemoryPool::Type pool, uint32_t osContextsCount, bool multiOsContextCapable) : GraphicsAllocation(ptrIn, sizeIn, sharedHandle, osContextsCount, multiOsContextCapable), bo(bo) {
this->memoryPool = pool;
}
DrmAllocation(BufferObject *bo, void *ptrIn, uint64_t gpuAddress, size_t sizeIn, MemoryPool::Type pool, uint32_t osContextsCount, bool multiOsContextCapable) : GraphicsAllocation(ptrIn, gpuAddress, 0, sizeIn, osContextsCount, multiOsContextCapable), bo(bo) {
this->memoryPool = pool;
}
BufferObject *getBO() const {
if (fragmentsStorage.fragmentCount) {
return fragmentsStorage.fragmentStorageData[0].osHandleStorage->bo;
}
return this->bo;
}
protected:
BufferObject *bo;
};
} // namespace OCLRT