Device management
void info (bool isdebug=false)
 Print diagnostic information on driver, runtime, memory, and devices. More...
 
void deviceprop (char *d_name, char *d_platform, char *d_toolkit, char *d_compute)
 Returns information about current device and platform. More...
 
void deviceset (int index)
 Switch to specified device. More...
 
int deviceget ()
 Return the index of current device. More...
 
int devicecount ()
 Returns the number of available devices. More...
 

Detailed Description

Function Documentation

void af::info ( bool  isdebug = false)

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

Parameters
[in]isdebugToggle printing memory manager diagnostics (default: false)

Example output:

ArrayFire v1.99 (build 4cb72d2) by AccelerEyes (Linux)
Platform: OpenCL 1.1 CUDA 4.2.1
Device info:
0: [2047 MB] GeForce GT 650M (current)
1: [7876 MB] Intel(R) Core(TM) i7-3610QM CPU @ 2.30GHz
Examples:
examples/benchmarks/blas.cpp, examples/benchmarks/fft.cpp, examples/benchmarks/pi.cpp, examples/financial/blackscholes.cpp, examples/getting_started/convolve.cpp, examples/getting_started/gfor.cpp, examples/getting_started/integer.cpp, examples/getting_started/lin_algebra.cpp, examples/helloworld/helloworld.cpp, examples/image_processing/image_demo.cpp, examples/image_processing/optical_flow.cpp, examples/machine_learning/kmeans.cpp, examples/machine_learning/neuralnetwork.cpp, examples/multi_device/gemv.cpp, examples/pde/fdtd.cpp, examples/pde/swe.cpp, examples/visualization/blip.cpp, and examples/visualization/vortex.cpp.
void af::deviceprop ( char *  d_name,
char *  d_platform,
char *  d_toolkit,
char *  d_compute 
)

Returns information about current device and platform.

Requires char arrays to be allocated before calling. Recommended size is 64 characters.

Parameters
[in]d_nameStores returned device name
[in]d_platformStores returned platform
[in]d_toolkitStores returned toolkit information
[in]d_computeStores returned compute capability

Example usage:

char name[64], platform[64], toolkit[64], compute[64];
af::deviceprop(name, platform, toolkit, compute);
printf("\nName: %s", name);
printf("\nPlatform: %s", platform);
printf("\nToolkit: %s", toolkit);
printf("\nCompute: %s", compute);

Example output:

//CUDA
//Name: GeForce_GTX_680
//Platform: CUDA
//Toolkit: v5.5
//Compute: 3.0
//OpenCL
//Name: GeForce_GTX_680
//Platform: OpenCL
//Toolkit: NVIDIA CUDA
//Compute: 1.1
int af::deviceget ( )

Return the index of current device.

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

Returns the number of available devices.

Returns
the number of available devices
Examples:
examples/multi_device/gemv.cpp.