GPUMLib  0.2.2
GPU Machine Learning Library
Public Member Functions | Protected Member Functions | Protected Attributes | Friends | List of all members
BaseArray< Type > Class Template Referenceabstract

Base class for HostArray and DeviceArray classes (Array base class) More...

#include <BaseArray.h>

Inheritance diagram for BaseArray< Type >:
DeviceArray< cudafloat * > DeviceArray< int > DeviceArray< Type > HostArray< Type >

Public Member Functions

virtual void Dispose ()=0
 Disposes the array.
 
int Length () const
 
Type * Pointer () const
 
int ResizeWithoutPreservingData (int size)
 

Protected Member Functions

void Init ()
 
void MoveFrom (BaseArray< Type > &other)
 
virtual void Alloc (int size)=0
 

Protected Attributes

Type * arrayData
 
int size
 

Friends

class CudaArray< Type >
 

Detailed Description

template<class Type>
class GPUMLib::BaseArray< Type >

Base class for HostArray and DeviceArray classes (Array base class)

Definition at line 32 of file BaseArray.h.

Member Function Documentation

int Length ( ) const
inline

Gets the length of the array. You can use this function to check if the array was effectively allocated.

Returns
the number of elements of the array

Definition at line 63 of file BaseArray.h.

Type* Pointer ( ) const
inline

Gets a pointer to the array data

Attention
Use with caution
Returns
a pointer to the array data

Definition at line 70 of file BaseArray.h.

int ResizeWithoutPreservingData ( int  size)
inline

Resizes the array without preserving its data

Parameters
sizenew size of the array
Returns
the number of elements of the array after being resized.

Definition at line 77 of file BaseArray.h.


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