CUDA
C/C++    Fortran   

Device management

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.

Example output:

  ArrayFire v1.2 (build dc0a42a) by AccelerEyes (64-bit Mac OSX)
  License: Standalone (/Users/chris/.arrayfire.lic)
  Addons: MGL4, DLA, SLA
  CUDA toolkit 4.2
  GPU0 GeForce GT 330M, 512 MB, Compute 1.2 (single)
  Display Device: GPU0 GeForce GT 330M
  Memory Usage: 193 MB free (512 MB total)
Examples:
examples/benchmarks/blas.cpp, examples/helloworld/helloworld.cpp, examples/image_processing/image_demo.cpp, and examples/multi_gpu/gemv.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/multi_gpu/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/multi_gpu/gemv.cpp.