Raytrix Light Field SDK  4.0
Logo
Public Types | Public Member Functions | List of all members
Rx::LFR::CCudaDevice Class Reference

Detailed Description

Provides methods for interacting with a certain CUDA device.

Inherits Rx::LFR::CParametersPimpl< CCudaDevice_Impl, Params::ECudaDevice::ID, Interfaces::ECudaDevice::ID >.

Public Types

typedef Interfaces::ECudaDevice::ID EnumInterfaceType
 
typedef Params::ECudaDevice::ID EnumType
 The type of the parameter enum. Is used by managed wrapper classes. More...
 

Public Member Functions

 CCudaDevice (CCudaDevice_Impl *pxImpl)
 Constructor. Only for internal purposes. More...
 
 CCudaDevice (CCudaDevice &&xCudaDevice)
 Move constructor. More...
 
 ~CCudaDevice ()
 Destructor. More...
 
void GetComputeCapability (unsigned &uMajor, unsigned &uMinor) const
 Gets the compute capability of this CUDA device. The minimum compute capability is 3.0. More...
 
int GetDeviceID () const
 Gets the ID of this CUDA device. More...
 
CCudaDevice_Impl & GetImpl ()
 Gets the non constant implementation. More...
 
const CCudaDevice_Impl & GetImpl () const
 Gets the constant implementation. More...
 
void * GetInterface (Interfaces::ECudaDevice::ID eInterface)
 Gets the interface defined by the given interface ID. More...
 
const void * GetInterface (Interfaces::ECudaDevice::ID eInterface) const
 Gets the interface defined by the given interface ID. More...
 
TInterface * GetInterface (Interfaces::ECudaDevice::ID eInterface)
 Gets the interface defined by the given interface ID. More...
 
const TInterface * GetInterface (Interfaces::ECudaDevice::ID eInterface) const
 Gets the interface defined by the given interface ID. More...
 
CParameters< Params::ECudaDevice::ID > & GetParams ()
 
const CParameters< Params::ECudaDevice::ID > & GetParams () const
 
bool HasComputeCapability (unsigned uMajor, unsigned uMinor) const
 Queries if this CUDA device supports the given compute capability. More...
 
bool HasInterface (Interfaces::ECudaDevice::ID eInterface)
 Queries if this object has the given interface. More...
 
bool Lock (int iTimeout=-1) const
 Locks this CUDA device. This waits until locked or until the timeout has been expired. More...
 
void MakeCurrent () const
 Makes this CUDA device current for the calling thread. More...
 
CCudaDeviceoperator= (CCudaDevice &&xCudaDevice)
 Move assignment operator. More...
 
void QueryMemoryInfo (size_t &nFree, size_t &nTotal) const
 Queries the free and the total amount of available device memory in bytes. More...
 
void Unlock () const
 Unlocks this CUDA device. Does nothing if not locked by the calling thread. More...
 

Member Typedef Documentation

The type of the parameter enum. Is used by managed wrapper classes.

Constructor & Destructor Documentation

Rx::LFR::CCudaDevice::CCudaDevice ( CCudaDevice_Impl *  pxImpl)

Constructor. Only for internal purposes.

Parameters
pxImpl[out] The implementation class.
Rx::LFR::CCudaDevice::CCudaDevice ( CCudaDevice &&  xCudaDevice)

Move constructor.

Parameters
xCudaDevice[in,out] The cuda device instance.
Rx::LFR::CCudaDevice::~CCudaDevice ( )

Destructor.

Member Function Documentation

void Rx::LFR::CCudaDevice::GetComputeCapability ( unsigned &  uMajor,
unsigned &  uMinor 
) const

Gets the compute capability of this CUDA device. The minimum compute capability is 3.0.

Parameters
uMajor[out] The major part of the compute capability version.
uMinor[out] The minor part of the compute capability version.
int Rx::LFR::CCudaDevice::GetDeviceID ( ) const

Gets the ID of this CUDA device.

Returns
The internal CUDA device ID.
CCudaDevice_Impl & Rx::LFR::CPimpl< CCudaDevice_Impl , Interfaces::ECudaDevice::ID >::GetImpl ( )
inlineinherited

Gets the non constant implementation.

Returns
The implementation.
const CCudaDevice_Impl & Rx::LFR::CPimpl< CCudaDevice_Impl , Interfaces::ECudaDevice::ID >::GetImpl ( ) const
inlineinherited

Gets the constant implementation.

Returns
The implementation.
void* Rx::LFR::CPimpl< CCudaDevice_Impl , Interfaces::ECudaDevice::ID >::GetInterface ( Interfaces::ECudaDevice::ID  eInterface)
inherited

Gets the interface defined by the given interface ID.

Parameters
eInterfaceThe interface ID.
Returns
Null if it fails, else the interface.
const void* Rx::LFR::CPimpl< CCudaDevice_Impl , Interfaces::ECudaDevice::ID >::GetInterface ( Interfaces::ECudaDevice::ID  eInterface) const
inherited

Gets the interface defined by the given interface ID.

Parameters
eInterfaceThe interface ID.
Returns
Null if it fails, else the interface.
TInterface* Rx::LFR::CPimpl< CCudaDevice_Impl , Interfaces::ECudaDevice::ID >::GetInterface ( Interfaces::ECudaDevice::ID  eInterface)
inlineinherited

Gets the interface defined by the given interface ID.

Template Parameters
TInterfaceThe interface type.
Parameters
eInterfaceThe interface.
Returns
Null if it fails, else the interface.
const TInterface* Rx::LFR::CPimpl< CCudaDevice_Impl , Interfaces::ECudaDevice::ID >::GetInterface ( Interfaces::ECudaDevice::ID  eInterface) const
inlineinherited

Gets the interface defined by the given interface ID.

Template Parameters
TInterfaceThe interface type.
Parameters
eInterfaceThe interface ID.
Returns
Null if it fails, else the interface.
bool Rx::LFR::CCudaDevice::HasComputeCapability ( unsigned  uMajor,
unsigned  uMinor 
) const

Queries if this CUDA device supports the given compute capability.

Parameters
uMajorThe major part of the compute capability version.
uMinorThe minor part of the compute capability version.
Returns
True if this CUDA device supports the given compute capability, false if not.
bool Rx::LFR::CPimpl< CCudaDevice_Impl , Interfaces::ECudaDevice::ID >::HasInterface ( Interfaces::ECudaDevice::ID  eInterface)
inlineinherited

Queries if this object has the given interface.

Parameters
eInterfaceThe interface to query.
Returns
True if this class has the given interface, false if not.
bool Rx::LFR::CCudaDevice::Lock ( int  iTimeout = -1) const

Locks this CUDA device. This waits until locked or until the timeout has been expired.

Parameters
iTimeout(optional) Timeout in milliseconds. -1 will wait infinetly.
Returns
True if it succeeds, false on timeout.
void Rx::LFR::CCudaDevice::MakeCurrent ( ) const

Makes this CUDA device current for the calling thread.

CCudaDevice& Rx::LFR::CCudaDevice::operator= ( CCudaDevice &&  xCudaDevice)

Move assignment operator.

Parameters
xCudaDevice[in,out] The cuda device instance.
Returns
The instance.
void Rx::LFR::CCudaDevice::QueryMemoryInfo ( size_t &  nFree,
size_t &  nTotal 
) const

Queries the free and the total amount of available device memory in bytes.

Parameters
nFree[out] Free device memory in bytes.
nTotal[out] Total device memory in bytes.
void Rx::LFR::CCudaDevice::Unlock ( ) const

Unlocks this CUDA device. Does nothing if not locked by the calling thread.