Clover Git
OpenCL 1.1 software implementation
Public Member Functions

Coal::DeviceBuffer Class Reference

Device-specific memory buffer. More...

#include <deviceinterface.h>

Inheritance diagram for Coal::DeviceBuffer:

List of all members.

Public Member Functions

 DeviceBuffer ()
virtual ~DeviceBuffer ()
virtual bool allocate ()=0
 Allocate the buffer on the device.
virtual DeviceInterfacedevice () const =0
 Coal::DeviceInterface of this buffer
virtual bool allocated () const =0
 Allocation status.
virtual void * nativeGlobalPointer () const =0
 Host-accessible memory pointer.

Detailed Description

Device-specific memory buffer.

This class is the backing-store used on a device for a Coal::MemObject. It is created by Coal::DeviceInterface::createDeviceBuffer().

Definition at line 170 of file deviceinterface.h.


Constructor & Destructor Documentation

Coal::DeviceBuffer::DeviceBuffer ( ) [inline]

Definition at line 173 of file deviceinterface.h.

virtual Coal::DeviceBuffer::~DeviceBuffer ( ) [inline, virtual]

Definition at line 174 of file deviceinterface.h.


Member Function Documentation

virtual bool Coal::DeviceBuffer::allocate ( ) [pure virtual]

Allocate the buffer on the device.

Returns:
true when success, false otherwise

Implemented in Coal::CPUBuffer.

Referenced by Coal::MemObject::allocate().

virtual bool Coal::DeviceBuffer::allocated ( ) const [pure virtual]

Allocation status.

Returns:
true if already allocated, false otherwise

Implemented in Coal::CPUBuffer.

Referenced by Coal::MemObject::allocate().

virtual DeviceInterface* Coal::DeviceBuffer::device ( ) const [pure virtual]

Coal::DeviceInterface of this buffer

Returns:
parent Coal::DeviceInterface

Implemented in Coal::CPUBuffer.

virtual void* Coal::DeviceBuffer::nativeGlobalPointer ( ) const [pure virtual]

Host-accessible memory pointer.

This function returns what is passed as arguments to native kernels (clEnqueueNativeKernel(), Coal::NativeKernelEvent) in place of Coal::MemObject pointers.

For Coal::CPUDevice, it's simply a pointer in RAM, but hardware-accelerated devices may need to do some copying or mapping.

Warning:
Beware that this data may get written to by the native kernel.
Returns:
A memory pointer usable by a host native kernel

Implemented in Coal::CPUBuffer.

Referenced by Coal::NativeKernelEvent::NativeKernelEvent().


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Defines