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

#include <Buffer.h>

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

Classes

struct  DeviceData
 
struct  DeviceDataForBuffers
 
struct  DeviceDataForCopyableData
 
struct  DeviceDataForGroups
 
struct  DeviceDataForTextures
 

Public Types

typedef std::shared_ptr< DeviceBufferSP
 
- 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

 DeviceBuffer (Context *const context, OWLDataType type)
 
std::string toString () const override
 
DeviceDatagetDD (const DeviceContext::SP &device) const
 
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
 
RegisteredObject::DeviceData::SP createOn (const DeviceContext::SP &device) 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 ()
 

Additional Inherited Members

- 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
 
- Static Public Attributes inherited from owl::Object
static std::atomic< uint64_t > nextAvailableID
 

Detailed Description

a device-side buffer that has its own cuda-malloc'ed memory on each device. DeviceBuffers are fastest to access on the device, BUT* are not visible on the host, and are replicated in the sense that changing to a device buffer on one GPU will not be visible on other GPUs

Constructor & Destructor Documentation

◆ DeviceBuffer()

owl::DeviceBuffer::DeviceBuffer ( Context *const  context,
OWLDataType  type 
)

contructor - creates the right device data type based on content type

Member Function Documentation

◆ clear()

void owl::DeviceBuffer::clear ( )
overridevirtual

clear the buffer by setting its contents to zero

Implements owl::Buffer.

◆ createOn()

RegisteredObject::DeviceData::SP owl::DeviceBuffer::createOn ( const DeviceContext::SP &  device)
override

creates the device-specific data for this group

◆ getDD()

DeviceBuffer::DeviceData & owl::DeviceBuffer::getDD ( const DeviceContext::SP &  device) const
inline

get reference to given device-specific data for this object

◆ resize()

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

resize this buffer - actual work will get done in DeviceData

Implements owl::Buffer.

◆ toString()

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

pretty-printer, for debugging

Reimplemented from owl::Buffer.

◆ upload() [1/2]

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

upload to only ONE device - only makes sense for device buffers

Implements owl::Buffer.

◆ upload() [2/2]

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

upload to device data(s) of that buffer - actual work will get done in DeviceData

Implements owl::Buffer.


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