OWL
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Public Attributes | List of all members
owl::HostPinnedBuffer Struct Reference

#include <Buffer.h>

Inheritance diagram for owl::HostPinnedBuffer:
owl::Buffer owl::RegisteredObject owl::ContextObject owl::Object

Public Types

typedef std::shared_ptr< HostPinnedBufferSP
 
- Public Types inherited from owl::Buffer
typedef std::shared_ptr< BufferSP
 
- Public Types inherited from owl::ContextObject
typedef std::shared_ptr< ContextObjectSP
 
- Public Types inherited from owl::Object
typedef std::shared_ptr< ObjectSP
 

Public Member Functions

 HostPinnedBuffer (Context *const context, OWLDataType type)
 
virtual ~HostPinnedBuffer ()
 
std::string toString () const override
 
void resize (size_t newElementCount) override
 
void upload (const void *hostPtr, size_t offset, int64_t count) override
 
void upload (const int deviceID, const void *hostPtr, size_t offset, int64_t count) override
 
void clear () override
 
- Public Member Functions inherited from owl::Buffer
 Buffer (Context *const context, OWLDataType type)
 
virtual ~Buffer ()
 
std::string toString () const override
 
Buffer::DeviceDatagetDD (const DeviceContext::SP &device) const
 
const void * getPointer (const DeviceContext::SP &device) const
 
size_t getElementCount () const
 
size_t sizeInBytes () const
 
virtual void clear ()=0
 
virtual void resize (size_t newElementCount)=0
 
virtual void upload (const void *hostPtr, size_t offset, int64_t count)=0
 
virtual void upload (const int deviceID, const void *hostPtr, size_t offset, int64_t count)=0
 
RegisteredObject::DeviceData::SP createOn (const DeviceContext::SP &device) override
 
void destroy ()
 
- Public Member Functions inherited from owl::RegisteredObject
 RegisteredObject (Context *const context, ObjectRegistry &registry)
 
- Public Member Functions inherited from owl::ContextObject
 ContextObject (Context *const context)
 
std::string toString () const override
 
- Public Member Functions inherited from owl::Object
 Object ()
 
virtual std::string toString () const
 
virtual DeviceData::SP createOn (const std::shared_ptr< DeviceContext > &device)
 
void createDeviceData (const std::vector< std::shared_ptr< DeviceContext > > &devices)
 
template<typename T >
std::shared_ptr< T > as ()
 

Public Attributes

void * cudaHostPinnedMem { 0 }
 
- Public Attributes inherited from owl::Buffer
const OWLDataType type
 
size_t elementCount { 0 }
 
- Public Attributes inherited from owl::RegisteredObject
int ID
 
ObjectRegistryregistry
 
- Public Attributes inherited from owl::ContextObject
Context *const context
 
- Public Attributes inherited from owl::Object
const size_t uniqueID
 
std::vector< DeviceData::SP > deviceData
 

Additional Inherited Members

- Static Public Attributes inherited from owl::Object
static std::atomic< uint64_t > nextAvailableID
 

Detailed Description

a buffer that uses CUDA host-pinned memory. only makes sense for copyable data types

Constructor & Destructor Documentation

◆ ~HostPinnedBuffer()

owl::HostPinnedBuffer::~HostPinnedBuffer ( )
virtual

destructor that frees any allocated host-pinned memory

Member Function Documentation

◆ clear()

void owl::HostPinnedBuffer::clear ( )
overridevirtual

clear the buffer by setting its contents to zero

Implements owl::Buffer.

◆ resize()

void owl::HostPinnedBuffer::resize ( size_t  newElementCount)
overridevirtual

resize buffer to new num elements

Implements owl::Buffer.

◆ toString()

std::string owl::HostPinnedBuffer::toString ( ) const
overridevirtual

pretty-printer, for debugging

Reimplemented from owl::Buffer.

◆ upload() [1/2]

void owl::HostPinnedBuffer::upload ( const int  deviceID,
const void *  hostPtr,
size_t  offset,
int64_t  count 
)
overridevirtual

upload data from host, to only given device ID

Implements owl::Buffer.

◆ upload() [2/2]

void owl::HostPinnedBuffer::upload ( const void *  hostPtr,
size_t  offset,
int64_t  count 
)
overridevirtual

upload data from host, using as many bytes as required by elemnetCount and dataSize

Implements owl::Buffer.

Member Data Documentation

◆ cudaHostPinnedMem

void* owl::HostPinnedBuffer::cudaHostPinnedMem { 0 }

pointer to the (shared) cuda pinned mem - this gets alloced once and is valid on both host and devices


The documentation for this struct was generated from the following files: