arrayfire.library module

Module containing enums and other constants.

class arrayfire.library.BACKEND[source]

Bases: enum.Enum

Backend libraries

CPU = 1
CUDA = 2
DEFAULT = 0
OPENCL = 4
class arrayfire.library.COLORMAP[source]

Bases: enum.Enum

Colormaps

BLUE = 6
COLORS = 2
DEFAULT = 0
HEAT = 5
MOOD = 4
RED = 3
SPECTRUM = 1
class arrayfire.library.CONNECTIVITY[source]

Bases: enum.Enum

Neighborhood connectivity

EIGHT = 8
FOUR = 4
class arrayfire.library.CONV_DOMAIN[source]

Bases: enum.Enum

Convolution domain

AUTO = 0
FREQ = 2
SPATIAL = 1
class arrayfire.library.CONV_MODE[source]

Bases: enum.Enum

Convolution mode

DEFAULT = 0
EXPAND = 1
class arrayfire.library.CSPACE[source]

Bases: enum.Enum

Colorspace formats

GRAY = 0
HSV = 2
RGB = 1
YCbCr = 3
class arrayfire.library.Dtype[source]

Bases: enum.Enum

Error values. For internal use only.

b8 = 4
c32 = 1
c64 = 3
f32 = 0
f64 = 2
s16 = 10
s32 = 5
s64 = 8
u16 = 11
u32 = 6
u64 = 9
u8 = 7
class arrayfire.library.ERR[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_MEM = 101
RUNTIME = 103
SIZE = 203
TYPE = 204
UNKNOWN = 999
class arrayfire.library.HOMOGRAPHY[source]

Bases: enum.Enum

Homography Types

LMEDS = 1
RANSAC = 0
class arrayfire.library.IMAGE_FORMAT[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
class arrayfire.library.INTERP[source]

Bases: enum.Enum

Interpolation method

BILINEAR = 2
CUBIC = 3
LINEAR = 1
LOWER = 4
NEAREST = 0
class arrayfire.library.MARKER[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
class arrayfire.library.MATCH[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

class arrayfire.library.MATPROP[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.

class arrayfire.library.NORM[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
class arrayfire.library.PAD[source]

Bases: enum.Enum

Edge padding types

SYM = 1
ZERO = 0
class arrayfire.library.Source[source]

Bases: enum.Enum

Source of the pointer

device = 0
host = 1
class arrayfire.library.YCC_STD[source]

Bases: enum.Enum

YCC Standard formats

BT_2020 = 2020
BT_601 = 601
BT_709 = 709
arrayfire.library.get_active_backend()[source]

Get the current active backend

name : str.
Backend name
arrayfire.library.get_available_backends()[source]

Get names of available backends

Returns:

names : tuple 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:

count : int

Number of available backends

arrayfire.library.get_backend_id(A)[source]

Get backend name of an array

Parameters:

A : af.Array

Returns:

name : str.

Backend name

arrayfire.library.get_device_id(A)[source]

Get the device id of the array

Parameters:

A : af.Array

Returns:

dev : Integer

id of the device array was created on

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

Set a specific backend by name

Parameters:

name : str.

unsafe : optional: bool. Default: False.

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