arrayfire.library module

Module containing enums and other constants.

classarrayfire.library.BACKEND(value)[source]

Bases:enum.Enum

Backend libraries

CPU=1
CUDA=2
DEFAULT=0
OPENCL=4
classarrayfire.library.BINARYOP(value)[source]

Bases:enum.Enum

Binary Operators

ADD=0
MAX=3
MIN=2
MUL=1
classarrayfire.library.CANNY_THRESHOLD(value)[source]

Bases:enum.Enum

Canny Edge Threshold types

AUTO_OTSU=1
MANUAL=0
classarrayfire.library.COLORMAP(value)[source]

Bases:enum.Enum

Colormaps

BLUE=6
COLORS=2
DEFAULT=0
HEAT=5
MOOD=4
RED=3
SPECTRUM=1
classarrayfire.library.CONNECTIVITY(value)[source]

Bases:enum.Enum

Neighborhood connectivity

EIGHT=8
FOUR=4
classarrayfire.library.CONV_DOMAIN(value)[source]

Bases:enum.Enum

Convolution domain

AUTO=0
FREQ=2
SPATIAL=1
classarrayfire.library.CONV_GRADIENT(value)[source]

Bases:enum.Enum

Convolution gradient type

BIAS=3
DATA=2
DEFAULT=0
FILTER=1
classarrayfire.library.CONV_MODE(value)[source]

Bases:enum.Enum

Convolution mode

DEFAULT=0
EXPAND=1
classarrayfire.library.CSPACE(value)[source]

Bases:enum.Enum

Colorspace formats

GRAY=0
HSV=2
RGB=1
YCbCr=3
classarrayfire.library.DIFFUSION(value)[source]

Bases:enum.Enum

Diffusion equations

DEFAULT=0
GRAD=1
MCDE=2
classarrayfire.library.Dtype(value)[source]

Bases:enum.Enum

Error values. For internal use only.

b8=4
c32=1
c64=3
f16=12
f32=0
f64=2
s16=10
s32=5
s64=8
u16=11
u32=6
u64=9
u8=7
classarrayfire.library.ERR(value)[source]

Bases:enum.Enum

Error values. For internal use only.

ARG=202
ARR_BKND_MISMATCH=503
BATCH=207
DEVICE=208
DIFF_TYPE=205
DRIVER=102
INTERNAL=998
INVALID_ARRAY=201
LOAD_LIB=501
LOAD_SYM=502
NONE=0
NONFREE=303
NOT_CONFIGURED=302
NOT_SUPPORTED=301
NO_DBL=401
NO_GFX=402
NO_HALF=403
NO_MEM=101
RUNTIME=103
SIZE=203
TYPE=204
UNKNOWN=999
classarrayfire.library.FLUX(value)[source]

Bases:enum.Enum

Flux functions

DEFAULT=0
EXPONENTIAL=2
QUADRATIC=1
classarrayfire.library.HOMOGRAPHY(value)[source]

Bases:enum.Enum

Homography Types

LMEDS=1
RANSAC=0
classarrayfire.library.IMAGE_FORMAT(value)[source]

Bases:enum.Enum

Image Formats

BMP=0
EXR=29
HDR=26
ICO=1
JNG=3
JP2=31
JPEG=2
PNG=13
PPM=14
PPMRAW=15
PSD=20
RAW=34
TIFF=18
classarrayfire.library.INTERP(value)[source]

Bases:enum.Enum

Interpolation method

BICUBIC=7
BICUBIC_SPLINE=9
BILINEAR=2
BILINEAR_COSINE=6
CUBIC=3
CUBIC_SPLINE=8
LINEAR=1
LINEAR_COSINE=5
LOWER=4
NEAREST=0
classarrayfire.library.INVERSE_DECONV(value)[source]

Bases:enum.Enum

Inverse deconvolution algorithm

DEFAULT=0
TIKHONOV=1
classarrayfire.library.ITERATIVE_DECONV(value)[source]

Bases:enum.Enum

Iterative deconvolution algorithm

DEFAULT=0
LANDWEBER=1
RICHARDSONLUCY=2
classarrayfire.library.MARKER(value)[source]

Bases:enum.Enum

Markers used for different points in graphics plots

CIRCLE=2
CROSS=5
NONE=0
PLUS=6
POINT=1
SQUARE=3
STAR=7
TRIANGE=4
classarrayfire.library.MATCH(value)[source]

Bases:enum.Enum

Match type

LSAD=2

Sum of squared differences

LSSD=5

Normalized cross correlation

NCC=6

Zero mean NCC

SAD=0

Zero mean SAD

SHD=8
SSD=3

Zero mean SSD

ZNCC=7

Sum of hamming distances

ZSAD=1

Locally scaled SAD

ZSSD=4

Locally scaled SSD

classarrayfire.library.MATPROP(value)[source]

Bases:enum.Enum

Matrix properties

BLOCK_DIAG=8192
CTRANS=2

Upper triangular matrix.

DIAG_UNIT=128

Symmetric matrix.

LOWER=64

Treat diagonal as units.

NONE=0

Transposed.

ORTHOG=2048

Tri diagonal matrix.

POSDEF=1024

Orthogonal matrix.

SYM=512

Positive definite matrix.

TRANS=1

Conjugate transposed.

TRI_DIAG=4096

Block diagonal matrix.

UPPER=32

Lower triangular matrix.

classarrayfire.library.MOMENT(value)[source]

Bases:enum.Enum

Image Moments types

FIRST_ORDER=15
M00=1
M01=2
M10=4
M11=8
classarrayfire.library.NORM(value)[source]

Bases:enum.Enum

Norm types

EUCLID=2
MATRIX_1=4
MATRIX_2=6
MATRIX_INF=5
MATRIX_L_PQ=7
VECTOR_1=0
VECTOR_2=2
VECTOR_INF=1
VECTOR_P=3
classarrayfire.library.PAD(value)[source]

Bases:enum.Enum

Edge padding types

CLAMP_TO_EDGE=2
PERIODIC=3
SYM=1
ZERO=0
classarrayfire.library.RANDOM_ENGINE(value)[source]

Bases:enum.Enum

Random engine types

DEFAULT=100
MERSENNE_GP11213=300
PHILOX=100
PHILOX_4X32_10=100
THREEFRY=200
THREEFRY_2X32_16=200
classarrayfire.library.STORAGE(value)[source]

Bases:enum.Enum

Matrix Storage types

COO=3
CSC=2
CSR=1
DENSE=0
classarrayfire.library.Source(value)[source]

Bases:enum.Enum

Source of the pointer

device=0
host=1
classarrayfire.library.TOPK(value)[source]

Bases:enum.Enum

Top-K ordering

DEFAULT=0
MAX=2
MIN=1
classarrayfire.library.VARIANCE(value)[source]

Bases:enum.Enum

Variance bias type

DEFAULT=0
POPULATION=2
SAMPLE=1
classarrayfire.library.YCC_STD(value)[source]

Bases:enum.Enum

YCC Standard formats

BT_2020=2020
BT_601=601
BT_709=709
classarrayfire.library.af_cdouble_t[source]

Bases:_ctypes.Structure

Attributes
imag

Structure/Union member

real

Structure/Union member

imag

Structure/Union member

real

Structure/Union member

classarrayfire.library.af_cfloat_t[source]

Bases:_ctypes.Structure

Attributes
imag

Structure/Union member

real

Structure/Union member

imag

Structure/Union member

real

Structure/Union member

arrayfire.library.get_active_backend()[source]

Get the current active backend

namestr.

Backend name

arrayfire.library.get_available_backends()[source]

Get names of available backends

Returns
namestuple of strings

Names of available backends

arrayfire.library.get_backend()[source]

Return the name of the backend

arrayfire.library.get_backend_count()[source]

Get number of available backends

Returns
countint

Number of available backends

arrayfire.library.get_backend_id(A)[source]

Get backend name of an array

Parameters
Aaf.Array
Returns
namestr.

Backend name

arrayfire.library.get_device_id(A)[source]

Get the device id of the array

Parameters
Aaf.Array
Returns
devInteger

id of the device array was created on

arrayfire.library.get_size_of(dtype)[source]

Get the size of the type represented by arrayfire.Dtype

arrayfire.library.set_backend(name,unsafe=False)[source]

Set a specific backend by name

Parameters
namestr.
unsafeoptional: bool. Default: False.

If False, does not switch backend if current backend is not unified backend.