Functions

CUDA API functions
[Raytrix Lightfield API]

Functions for selecting a CUDA device. More...

Functions

RXLF_API bool Raytrix::RxCudaDeviceCount (int &iDeviceCount)
 Returns the number of CUDA devices installed.
RXLF_API bool Raytrix::RxCudaDeviceMemInfo (unsigned &uFreeMem, unsigned &uTotalMem)
 Return free and total amount of memory on the selected CUDA device.
RXLF_API bool Raytrix::RxCudaDeviceProp (int iDevice, CRxString &sxName, unsigned &iCCMajor, unsigned &iCCMinor)
 Get the name and the compute capability major and minor version for a CUDA device.
RXLF_API bool Raytrix::RxCudaSelectDevice (int iDevice=-1, bool bUseGL=false)
 Select a CUDA device.

Detailed Description

Functions for selecting a CUDA device.


Function Documentation

RXLF_API bool Raytrix::RxCudaDeviceCount ( int &  iDeviceCount )

Returns the number of CUDA devices installed.

Parameters:
iDeviceCountContains the number of CUDA devices on return.
Returns:
true if successful, false otherwise. If false is returned the error that caused the failure can be obtained by calling RxGetLastError().
Examples:
RxExApiCamera01.cpp.
RXLF_API bool Raytrix::RxCudaDeviceMemInfo ( unsigned &  uFreeMem,
unsigned &  uTotalMem 
)

Return free and total amount of memory on the selected CUDA device.

Parameters:
uFreeMemOn return contains the amount of free memory in bytes.
uTotalMemOn return contains the amount of total memory in bytes.
Attention:
Note that this function returns with an error if called before the first call of RxRayBind().
Returns:
true if successful, false otherwise. If false is returned the error that caused the failure can be obtained by calling RxGetLastError().
RXLF_API bool Raytrix::RxCudaDeviceProp ( int  iDevice,
CRxString &  sxName,
unsigned &  iCCMajor,
unsigned &  iCCMinor 
)

Get the name and the compute capability major and minor version for a CUDA device.

Parameters:
iDeviceZero-based ID of the CUDA device.
sxNameOn return contains the name of the CUDA device.
iCCMajorOn return contains the major version of the CUDA device compute capability.
iCCMinorOn return contains the minor version of the CUDA device compute capability.
Returns:
true if successful, false otherwise. If false is returned the error that caused the failure can be obtained by calling RxGetLastError().
Examples:
RxExApiCamera01.cpp.
RXLF_API bool Raytrix::RxCudaSelectDevice ( int  iDevice = -1,
bool  bUseGL = false 
)

Select a CUDA device.

Parameters:
iDeviceThe zero-based CUDA device ID or -1 for automatic selection.
bUseGLFlag indicating whether to initialize CUDA for OpenGL interop. or not.
Attention:
This function must be called once and only once per process. The selected CUDA device cannot be changed during runtime.

Use the functions RxCudaDeviceCount() and RxCudaDeviceProp() to obtain information about the installed CUDA devices and then select the most appropriate CUDA device with this function. If iDevice is set to -1, the first appropriate CUDA device is selected.

To exchange image data generated by CUDA directly with an OpenGL rendering context on the same device, bUseGL has to be set to true and the CUDA device has to support OpenGL 3.0 or higher. Note that CUDA/DirectX interop. is currently not supported.

For further details on CUDA/OpenGL interop. see CUDA/OpenGL interop. functions.

Returns:
true if successful, false otherwise. If false is returned the error that caused the failure can be obtained by calling RxGetLastError().
Examples:
RxExApiBasic01.cpp, RxExApiBasic02.cpp, RxExApiCamera01.cpp, and RxExApiProgress01.cpp.
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Events Defines