Supported data types
ArrayFire provides one generic container object, the array on which functions and mathematical operations are performed. The array
can represent one of many different basic data types:
- f32 real single-precision (
float
) - c32 complex single-precision (
cfloat
) - f64 real double-precision (
double
) - c64 complex double-precision (
cdouble
) - f16 real half-precision (
half_float::half
) - b8 8-bit boolean values (
bool
) - s32 32-bit signed integer (
int
) - u32 32-bit unsigned integer (
unsigned
) - u8 8-bit unsigned values (
unsigned char
) - s64 64-bit signed integer (
intl
) - u64 64-bit unsigned integer (
uintl
) - s16 16-bit signed integer (
short
) - u16 16-bit unsigned integer (
unsigned short
)
Most of these data types are supported on all modern GPUs; however, some older devices may lack support for double precision arrays. In this case, a runtime error will be generated when the array is constructed.
If not specified otherwise, array
s are created as single precision floating point numbers (f32
).