Image Utilities (IU)
 All Data Structures Namespaces Functions Variables Typedefs Enumerations Friends Groups Pages
Data Structures | Public Types | Public Member Functions | Static Public Attributes
iu::LinearDeviceMemory< PixelType, Ndim > Class Template Reference

Linear device memory class. More...

#include <lineardevicememory.h>

Inheritance diagram for iu::LinearDeviceMemory< PixelType, Ndim >:
iu::LinearMemory< Ndim >

Data Structures

struct  KernelData
 Struct pointer KernelData that can be used in CUDA kernels. More...
 

Public Types

typedef PixelType pixel_type
 

Public Member Functions

 LinearDeviceMemory ()
 
virtual ~LinearDeviceMemory ()
 
 LinearDeviceMemory (const Size< Ndim > &size)
 
 LinearDeviceMemory (const unsigned int &numel)
 
 LinearDeviceMemory (PixelType *device_data, const Size< Ndim > &size, bool ext_data_pointer=false)
 
 LinearDeviceMemory (PixelType *device_data, const unsigned int &numel, bool ext_data_pointer=false)
 
PixelType * data (unsigned int offset=0)
 
const PixelType * data (unsigned int offset=0) const
 
thrust::device_ptr< PixelType > begin (void)
 
thrust::device_ptr< PixelType > end (void)
 
virtual size_t bytes () const
 
virtual unsigned int bitDepth () const
 
virtual bool onDevice () const
 
ndarray_ref< PixelType, Ndim > ref () const
 
 LinearDeviceMemory (const ndarray_ref< PixelType, Ndim > &x)
 
template<>
 LinearDeviceMemory (const ndarray_ref< float, 1 > &x)
 
- Public Member Functions inherited from iu::LinearMemory< Ndim >
 LinearMemory ()
 
 LinearMemory (const Size< Ndim > &size)
 
 LinearMemory (const unsigned int &numel)
 
bool sameType (const LinearMemory &from)
 
virtual ~LinearMemory ()
 
unsigned int numel () const
 
Size< Ndim > size () const
 
Size< Ndim > stride () const
 

Static Public Attributes

static const unsigned int ndim = Ndim
 

Additional Inherited Members

- Protected Member Functions inherited from iu::LinearMemory< Ndim >
void computeStride ()
 
- Protected Attributes inherited from iu::LinearMemory< Ndim >
Size< Ndim > size_
 

Detailed Description

template<typename PixelType, unsigned int Ndim>
class iu::LinearDeviceMemory< PixelType, Ndim >

Linear device memory class.

Member Typedef Documentation

template<typename PixelType, unsigned int Ndim>
typedef PixelType iu::LinearDeviceMemory< PixelType, Ndim >::pixel_type

Define the current pixel type.

Constructor & Destructor Documentation

template<typename PixelType, unsigned int Ndim>
iu::LinearDeviceMemory< PixelType, Ndim >::LinearDeviceMemory ( )
inline

Constructor.

template<typename PixelType, unsigned int Ndim>
virtual iu::LinearDeviceMemory< PixelType, Ndim >::~LinearDeviceMemory ( )
inlinevirtual

Destructor.

template<typename PixelType, unsigned int Ndim>
iu::LinearDeviceMemory< PixelType, Ndim >::LinearDeviceMemory ( const Size< Ndim > &  size)
inline

Special constructor.

Parameters
sizesize of linear memory
template<typename PixelType, unsigned int Ndim>
iu::LinearDeviceMemory< PixelType, Ndim >::LinearDeviceMemory ( const unsigned int &  numel)
inline

Special constructor.

Parameters
numelNumber of elements of linear memory
template<typename PixelType, unsigned int Ndim>
iu::LinearDeviceMemory< PixelType, Ndim >::LinearDeviceMemory ( PixelType *  device_data,
const Size< Ndim > &  size,
bool  ext_data_pointer = false 
)
inline

Special constructor.

Parameters
device_dataDevice data pointer
sizesize of the memory
ext_data_pointerUse external data pointer as internal data pointer
template<typename PixelType, unsigned int Ndim>
iu::LinearDeviceMemory< PixelType, Ndim >::LinearDeviceMemory ( PixelType *  device_data,
const unsigned int &  numel,
bool  ext_data_pointer = false 
)
inline

Special constructor.

Parameters
device_dataDevice data pointer
numelNumber of elements of the memory
ext_data_pointerUse external data pointer as internal data pointer
template<typename PixelType, unsigned int Ndim>
iu::LinearDeviceMemory< PixelType, Ndim >::LinearDeviceMemory ( const ndarray_ref< PixelType, Ndim > &  x)

construct from ndarray_ref – include ndarray/ndarray_iu.h

template<>
iu::LinearDeviceMemory< float, 1 >::LinearDeviceMemory ( const ndarray_ref< float, 1 > &  x)

Template specialization. Construct from ndarray_ref.

Member Function Documentation

template<typename PixelType, unsigned int Ndim>
thrust::device_ptr<PixelType> iu::LinearDeviceMemory< PixelType, Ndim >::begin ( void  )
inline

Returns a thrust device pointer that can be used in custom operators

Returns
Thrust pointer of the begin of the memory
template<typename PixelType, unsigned int Ndim>
virtual unsigned int iu::LinearDeviceMemory< PixelType, Ndim >::bitDepth ( ) const
inlinevirtual

Returns the bit depth of the data pointer.

Reimplemented from iu::LinearMemory< Ndim >.

template<typename PixelType, unsigned int Ndim>
virtual size_t iu::LinearDeviceMemory< PixelType, Ndim >::bytes ( ) const
inlinevirtual

Returns the total amount of bytes saved in the data buffer.

Reimplemented from iu::LinearMemory< Ndim >.

template<typename PixelType, unsigned int Ndim>
PixelType* iu::LinearDeviceMemory< PixelType, Ndim >::data ( unsigned int  offset = 0)
inline

Returns a pointer to the device buffer. The pointer can be offset to position offset.

Parameters
offsetOffset of the pointer array.
Returns
Pointer to the device buffer.
template<typename PixelType, unsigned int Ndim>
const PixelType* iu::LinearDeviceMemory< PixelType, Ndim >::data ( unsigned int  offset = 0) const
inline

Returns a const pointer to the device buffer. The pointer can be offset to position offset.

Parameters
offsetOffset of the pointer array.
Returns
Const pointer to the device buffer.
template<typename PixelType, unsigned int Ndim>
thrust::device_ptr<PixelType> iu::LinearDeviceMemory< PixelType, Ndim >::end ( void  )
inline

Returns a thrust device pointer that can be used in custom operators

Returns
Thrust pointer of the end of the memory
template<typename PixelType, unsigned int Ndim>
virtual bool iu::LinearDeviceMemory< PixelType, Ndim >::onDevice ( ) const
inlinevirtual

Returns flag if the image data resides on the device/GPU (TRUE) or host/GPU (FALSE)

Reimplemented from iu::LinearMemory< Ndim >.

template<typename PixelType, unsigned int Ndim>
ndarray_ref<PixelType, Ndim> iu::LinearDeviceMemory< PixelType, Ndim >::ref ( ) const

convert to ndarray_ref – include ndarray/ndarray_iu.h


The documentation for this class was generated from the following file: