Do more. Code less. Free software for GPU computing.
<scroll to top>

Multi-GPU and device management

Basics

AFAPI void info ()
 Print diagnostic information on driver, runtime, memory, and devices.
AFAPI void deviceset (int index)
 Switch to specified device.
AFAPI int deviceget ()
 Return the index of current device.
AFAPI int devicecount ()
 Returns the number of available devices.

Function Documentation

AFAPI void af::info ( )

Print diagnostic information on driver, runtime, memory, and devices.

Examples:
examples/misc/hello_world.cpp, examples/multiGPU/multiGPU_Gemv.cpp, and examples/template/template.cpp.
AFAPI void af::deviceset ( int  index)

Switch to specified device.

Requires ArrayFire Pro to index beyond first device.

Parameters:
[in]indexIndex of device to select.
Examples:
examples/multiGPU/multiGPU_Gemv.cpp.
AFAPI int af::deviceget ( )

Return the index of current device.

Returns:
index of current device
AFAPI int af::devicecount ( )

Returns the number of available devices.

Returns:
the number of available devices
Examples:
examples/multiGPU/multiGPU_Gemv.cpp.
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines