Raytrix Light Field SDK  v3.1
Logo
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Properties Events Groups Pages
CUDA API functions

Functions for selecting a CUDA device. More...

Functions

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

Detailed Description

Functions for selecting a CUDA device.

Function Documentation

RXLF_API int Rx::ApiLF::RxCudaDeviceCount ( )

Returns the number of CUDA devices installed.

Halcon Plugin - Function Name:
rx_cuda_device_count
Returns
The number of CUDA devices.
RXLF_API void Rx::ApiLF::RxCudaDeviceMemInfo ( size_t &  nFreeMem,
size_t &  nTotalMem 
)

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

Warning
This function will throw an Rx::ApiLF::CRxApiException if called before the first call of Rx::ApiLF::RxRayBind.
Halcon Plugin - Function Name:
rx_cuda_device_mem_info
Parameters
[out]nFreeMemOn return contains the amount of free memory in bytes.
[out]nTotalMemOn return contains the amount of total memory in bytes.
RXLF_API void Rx::ApiLF::RxCudaDeviceProp ( int  iDevice,
Rx::CRxString sxName,
unsigned &  iCCMajor,
unsigned &  iCCMinor 
)

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

Halcon Plugin - Function Name:
rx_cuda_device_prop
Parameters
iDeviceZero-based ID of the CUDA device.
[out]sxNameOn return contains the name of the CUDA device.
[out]iCCMajorOn return contains the major version of the CUDA device compute capability.
[out]iCCMinorOn return contains the minor version of the CUDA device compute capability.
RXLF_API void Rx::ApiLF::RxCudaSelectDevice ( int  iDevice = -1,
bool  bUseGL = false 
)

Select a CUDA device.

Attention
This function must be called once and only once per process. The selected CUDA device cannot be changed during runtime.

Use the functions Rx::ApiLF::RxCudaDeviceCount and Rx::ApiLF::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.

Halcon Plugin - Function Name:
rx_cuda_select_device
Parameters
iDevice(Optional) The zero-based CUDA device ID or -1 for automatic selection.
bUseGL(Optional) Flag indicating whether to initialize CUDA for OpenGL interop. or not.
See also
CUDA/OpenGL interop. functions.