31#ifndef DW_FRAMEWORK_BUFFER_HPP_
32#define DW_FRAMEWORK_BUFFER_HPP_
36#include <dwshared/dwfoundation/dw/core/language/Optional.hpp>
37#include <dwshared/dwfoundation/dw/core/logger/Logger.hpp>
38#include <dwshared/dwfoundation/dw/cuda/misc/DevicePtr.hpp>
58 return 0U != (
static_cast<uint32_t
>(flags) & (1U <<
static_cast<uint32_t
>(type)));
65 flags |= (1U <<
static_cast<uint32_t
>(type));
80 static constexpr char LOG_TAG[]{
"Buffer"};
112 void* m_ptr{
nullptr};
136 cudaExternalMemory_t m_cudaHandle{};
137 void* m_ptr{
nullptr};
164 dw::core::Optional<BufferCPU> m_bufferCpu{};
165 dw::core::Optional<BufferCUDA> m_bufferCuda{};
173 dw::core::Logger::LoggerStream& out,
Buffer& buffer);
179 dw::core::Logger::LoggerStream& out,
BufferProperties const& bufferProperties);
const BufferProperties & getProperties() const
virtual ~BufferBase()=default
BufferBase(BufferProperties properties)
virtual void bindNvSciBufObj(NvSciBufObj bufObj)
virtual void fillNvSciBufAttrs(NvSciBufAttrList attrList) const
static constexpr char LOG_TAG[]
BufferProperties m_properties
void * getCpuPtr(size_t offset)
void bindNvSciBufObj(NvSciBufObj bufObj) override
void fillSpecificAttributes(NvSciBufAttrList attrList) const
void fillSpecificAttributes(NvSciBufAttrList attrList) const
core::DevicePtr< void > getCudaPtr(size_t offset)
void bindNvSciBufObj(NvSciBufObj bufObj) override
void * getCpuPtr(size_t offset)
void fillNvSciBufAttrs(NvSciBufAttrList attrList) const override
void bindNvSciBufObj(NvSciBufObj bufObj) override
Buffer(BufferProperties properties)
core::DevicePtr< void > getCudaPtr(size_t offset)
void BufferFlagsEnableBackend(BufferFlags &flags, BufferBackendType type)
bool BufferFlagsBackendEnabled(BufferFlags flags, BufferBackendType type)
dw::core::Logger::LoggerStream & operator<<(dw::core::Logger::LoggerStream &out, Buffer &buffer)
BufferFlags enabledBackends