├── .gitignore ├── ArrayFireNim.nimble ├── ArrayFireNim ├── ArrayFireNim.nim └── raw.nim ├── LICENSE.md ├── README.md ├── assets └── man.jpg ├── generator ├── arrayfire.json └── generate.nim └── tests ├── config.nims ├── test_basic.nim ├── test_benchmark.nim ├── test_computer_vision.nim ├── test_getting_started.nim ├── test_graphics.nim ├── test_integer.nim ├── test_la.nim └── test_memory.nim /.gitignore: -------------------------------------------------------------------------------- 1 | .idea 2 | .vscode 3 | src/generate/arrayfire.json 4 | bin/ 5 | 6 | # ignore files with no extention: 7 | * 8 | !*/ 9 | !*.* 10 | 11 | # normal ignores: 12 | *.exe 13 | nimcache 14 | *.pdb 15 | *.ilk 16 | *.dll 17 | tmp/ 18 | -------------------------------------------------------------------------------- /ArrayFireNim.nimble: -------------------------------------------------------------------------------- 1 | # Package 2 | 3 | version = "0.3.2" 4 | author = "bitstorm" 5 | description = "Nim wrapper for ArrayFire" 6 | license = "BSD-3-Clause" 7 | srcDir = "src" 8 | backend = "cpp" 9 | 10 | 11 | # Dependencies 12 | 13 | requires "nim >= 1.6.0" -------------------------------------------------------------------------------- /ArrayFireNim/ArrayFireNim.nim: -------------------------------------------------------------------------------- 1 | import strutils 2 | import tables 3 | import times 4 | import typetraits 5 | import std/sequtils 6 | import std/algorithm 7 | import std/math 8 | include raw 9 | 10 | 11 | when sizeof(int) == 8: 12 | const sysint* = DType.S64 13 | const sysuint* = DType.U64 14 | else: 15 | const sysint* = DType.S32 16 | const sysuint* = DType.U32 17 | 18 | when sizeof(float) == 8: 19 | const sysfloat* = DType.F64 20 | else: 21 | const sysfloat = DType.F32 22 | 23 | type 24 | Complex32* {.final, header: "arrayfire.h", importcpp: "af::cfloat".} = object 25 | real*: cfloat 26 | imag*: cfloat 27 | 28 | Complex64* {.final, header: "arrayfire.h", 29 | importcpp: "af::cdouble".} = object 30 | real*: cdouble 31 | imag*: cdouble 32 | 33 | type 34 | BatchFuncT* = proc (lhs: AFArray; rhs: AFArray): AFArray {.cdecl.} 35 | 36 | type 37 | Cell* = object 38 | row*: cint 39 | col*: cint 40 | title*: cstring 41 | cmap*: Colormap 42 | 43 | Dim1* = tuple 44 | d0: int 45 | 46 | Dim2* = tuple 47 | d0: int 48 | d1: int 49 | 50 | Dim3* = tuple 51 | d0: int 52 | d1: int 53 | d2: int 54 | 55 | 56 | proc dim4s*[T: int | DimT](dims: openarray[T]): Dim4 = 57 | var all_dims = [DimT(1), DimT(1), DimT(1), DimT(1)] 58 | let count = min(4, len(dims)) 59 | for i in 0..= 0: 443 | x.add(t) 444 | else: 445 | cycles = max(minCycles, int(trunc(targetDurationPerTest / t * float(cycles)))) 446 | sort(x, SortOrder.Ascending) 447 | x[int(nrSamples / 2)] / float(cycles) 448 | 449 | 450 | 451 | template gfor*(s, last, actions: untyped) = 452 | var s = aseq(aseq(cdouble(last)), true) 453 | while(gforToggle()): 454 | actions 455 | 456 | template gfor*(s, first, last, actions: untyped) = 457 | s = aseq(aseq(cdouble(first), cdouble(last)), true) 458 | while(gforToggle()): 459 | actions 460 | 461 | template gfor*(s, first, last, step, actions: untyped) = 462 | s = aseq(aseq(cdouble(first), cdouble(last), cdouble(step)), true) 463 | while(gforToggle()): 464 | actions 465 | 466 | template window*(wvar: untyped; width: int; height: int; title: string) = 467 | var wvar: Window 468 | wvar.setSize(width, height) 469 | wvar.setTitle(title) 470 | 471 | template window*(wvar: untyped; title: string) = 472 | var wvar: Window 473 | wvar.setTitle(title) 474 | 475 | proc to_seq_typed[S, T](a: AFArray; count: int; s: typedesc[S]; t: typedesc[ T]): seq[T] = 476 | result = newSeq[T]() 477 | let dtype = a.dtype() 478 | let c_item_size = get_DType_size(dtype) 479 | let num_items = if count > 0: count else: len(a) 480 | 481 | let cdata: pointer = alloc0(c_item_size*len(a)) 482 | a.host(cdata) 483 | 484 | for i in 0..()", header : "arrayfire.h".} 639 | 640 | proc scalar_r*(this: AFArray): cdouble 641 | {.noSideEffect, cdecl, importcpp: "#.scalar()", header : "arrayfire.h".} 642 | 643 | proc svd*(afin: AFArray): (AFArray, AFArray, AFArray) = 644 | let u = afa() 645 | let s = afa() 646 | let v = afa() 647 | svd(u, s, v, afin) 648 | return (u, s, v) 649 | -------------------------------------------------------------------------------- /ArrayFireNim/raw.nim: -------------------------------------------------------------------------------- 1 | when defined(Windows): 2 | from os import nil 3 | const AF_INCLUDE_PATH = "\"" & os.joinPath(os.getEnv("AF_PATH"), "include") & "\"" 4 | const AF_LIB_PATH = "\"" & os.joinPath(os.getEnv("AF_PATH"), "lib\\af.lib") & "\"" 5 | {.passC: "/GS /W3 /Zc:wchar_t /FS /Zi /Gm- /O2 /Ob2 /Zc:inline /fp:precise /external:W0 /D \"_MBCS\" /D \"WIN32\" /D \"_WINDOWS\" /D \"WIN32_LEAN_AND_MEAN\" /D \"VC_EXTRALEAN\" /D \"NOMINMAX\" " & " -I" & AF_INCLUDE_PATH.} 6 | {.passL: "/DYNAMICBASE " & AF_LIB_PATH .} 7 | elif defined(Linux): 8 | {.passC: "-std=c++11".} 9 | {.passL: "-lGL -laf".} 10 | elif defined(MacOsX): 11 | from os import nil 12 | const AF_INCLUDE_PATH = "\"" & os.joinPath(os.getEnv("AF_PATH"), "include") & "\"" 13 | const AF_LIB_PATH = "\"" & os.joinPath(os.getEnv("AF_PATH"), "lib") & "\"" 14 | {.passC: "-std=c++11" & " -I " & AF_INCLUDE_PATH.} 15 | {.passL: "-laf" & " -L" & AF_LIB_PATH.} 16 | when sizeof(int) == 8: 17 | type DimT* = clonglong 18 | else: 19 | type DimT* = cint 20 | 21 | type 22 | AF_Array_Handle* = distinct pointer 23 | 24 | #region Types 25 | 26 | type 27 | AF_Seq* {.final, header : "arrayfire.h", importcpp: "af::seq".} = object 28 | Dim4* {.final, header : "arrayfire.h", importcpp: "af::dim4".} = object 29 | AF_Exception* {.final, header : "arrayfire.h", importcpp: "af::exception".} = object 30 | IndexT* {.final, header : "arrayfire.h", importcpp: "af::index".} = object 31 | AFArray* {.final, header : "arrayfire.h", importcpp: "af::array".} = object 32 | Event* {.final, header : "arrayfire.h", importcpp: "af::event".} = object 33 | Features* {.final, header : "arrayfire.h", importcpp: "af::features".} = object 34 | Window* {.final, header : "arrayfire.h", importcpp: "af::Window".} = object 35 | RandomEngine* {.final, header : "arrayfire.h", importcpp: "af::randomEngine".} = object 36 | 37 | #endregion 38 | 39 | #region Enums 40 | 41 | type 42 | Err* {.pure, header : "arrayfire.h", import_cpp: "af_err", size: sizeof(cint).} = enum 43 | AF_SUCCESS = 0, 44 | AF_ERR_NO_MEM = 101, 45 | AF_ERR_DRIVER = 102, 46 | AF_ERR_RUNTIME = 103, 47 | AF_ERR_INVALID_ARRAY = 201, 48 | AF_ERR_ARG = 202, 49 | AF_ERR_SIZE = 203, 50 | AF_ERR_TYPE = 204, 51 | AF_ERR_DIFF_TYPE = 205, 52 | AF_ERR_BATCH = 207, 53 | AF_ERR_DEVICE = 208, 54 | AF_ERR_NOT_SUPPORTED = 301, 55 | AF_ERR_NOT_CONFIGURED = 302, 56 | AF_ERR_NONFREE = 303, 57 | AF_ERR_NO_DBL = 401, 58 | AF_ERR_NO_GFX = 402, 59 | AF_ERR_NO_HALF = 403, 60 | AF_ERR_LOAD_LIB = 501, 61 | AF_ERR_LOAD_SYM = 502, 62 | AF_ERR_ARR_BKND_MISMATCH = 503, 63 | AF_ERR_INTERNAL = 998, 64 | AF_ERR_UNKNOWN = 999 65 | 66 | Dtype* {.pure, header : "arrayfire.h", import_cpp: "af_dtype", size: sizeof(cint).} = enum 67 | F32 = 0, 68 | C32 = 1, 69 | F64 = 2, 70 | C64 = 3, 71 | B8 = 4, 72 | S32 = 5, 73 | U32 = 6, 74 | U8 = 7, 75 | S64 = 8, 76 | U64 = 9, 77 | S16 = 10, 78 | U16 = 11, 79 | F16 = 12 80 | 81 | Source* {.pure, header : "arrayfire.h", import_cpp: "af_source", size: sizeof(cint).} = enum 82 | AFDEVICE = 0, 83 | AFHOST = 1 84 | 85 | InterpType* {.pure, header : "arrayfire.h", import_cpp: "af_interp_type", size: sizeof(cint).} = enum 86 | AF_INTERP_NEAREST = 0, 87 | AF_INTERP_LINEAR = 1, 88 | AF_INTERP_BILINEAR = 2, 89 | AF_INTERP_CUBIC = 3, 90 | AF_INTERP_LOWER = 4, 91 | AF_INTERP_LINEAR_COSINE = 5, 92 | AF_INTERP_BILINEAR_COSINE = 6, 93 | AF_INTERP_BICUBIC = 7, 94 | AF_INTERP_CUBIC_SPLINE = 8, 95 | AF_INTERP_BICUBIC_SPLINE = 9 96 | 97 | BorderType* {.pure, header : "arrayfire.h", import_cpp: "af_border_type", size: sizeof(cint).} = enum 98 | AF_PAD_ZERO = 0, 99 | AF_PAD_SYM = 1, 100 | AF_PAD_CLAMP_TO_EDGE = 2, 101 | AF_PAD_PERIODIC = 3 102 | 103 | Connectivity* {.pure, header : "arrayfire.h", import_cpp: "af_connectivity", size: sizeof(cint).} = enum 104 | AF_CONNECTIVITY_4 = 4, 105 | AF_CONNECTIVITY_8 = 8 106 | 107 | ConvMode* {.pure, header : "arrayfire.h", import_cpp: "af_conv_mode", size: sizeof(cint).} = enum 108 | AF_CONV_DEFAULT = 0, 109 | AF_CONV_EXPAND = 1 110 | 111 | ConvDomain* {.pure, header : "arrayfire.h", import_cpp: "af_conv_domain", size: sizeof(cint).} = enum 112 | AF_CONV_AUTO = 0, 113 | AF_CONV_SPATIAL = 1, 114 | AF_CONV_FREQ = 2 115 | 116 | MatchType* {.pure, header : "arrayfire.h", import_cpp: "af_match_type", size: sizeof(cint).} = enum 117 | AF_SAD = 0, 118 | AF_ZSAD = 1, 119 | AF_LSAD = 2, 120 | AF_SSD = 3, 121 | AF_ZSSD = 4, 122 | AF_LSSD = 5, 123 | AF_NCC = 6, 124 | AF_ZNCC = 7, 125 | AF_SHD = 8 126 | 127 | YccStd* {.pure, header : "arrayfire.h", import_cpp: "af_ycc_std", size: sizeof(cint).} = enum 128 | AF_YCC_601 = 601, 129 | AF_YCC_709 = 709, 130 | AF_YCC_2020 = 2020 131 | 132 | CspaceT* {.pure, header : "arrayfire.h", import_cpp: "af_cspace_t", size: sizeof(cint).} = enum 133 | AF_GRAY = 0, 134 | AF_RGB = 1, 135 | AF_HSV = 2, 136 | AF_YCBCR = 3 137 | 138 | MatProp* {.pure, header : "arrayfire.h", import_cpp: "af_mat_prop", size: sizeof(cint).} = enum 139 | AF_MAT_NONE = 0, 140 | AF_MAT_TRANS = 1, 141 | AF_MAT_CTRANS = 2, 142 | AF_MAT_CONJ = 4, 143 | AF_MAT_UPPER = 32, 144 | AF_MAT_LOWER = 64, 145 | AF_MAT_DIAG_UNIT = 128, 146 | AF_MAT_SYM = 512, 147 | AF_MAT_POSDEF = 1024, 148 | AF_MAT_ORTHOG = 2048, 149 | AF_MAT_TRI_DIAG = 4096, 150 | AF_MAT_BLOCK_DIAG = 8192 151 | 152 | NormType* {.pure, header : "arrayfire.h", import_cpp: "af_norm_type", size: sizeof(cint).} = enum 153 | AF_NORM_VECTOR_1 = 0, 154 | AF_NORM_VECTOR_INF = 1, 155 | AF_NORM_EUCLID = 2, 156 | AF_NORM_VECTOR_P = 3, 157 | AF_NORM_MATRIX_1 = 4, 158 | AF_NORM_MATRIX_INF = 5, 159 | AF_NORM_MATRIX_2 = 6, 160 | AF_NORM_MATRIX_L_PQ = 7 161 | 162 | ImageFormat* {.pure, header : "arrayfire.h", import_cpp: "af_image_format", size: sizeof(cint).} = enum 163 | AF_FIF_BMP = 0, 164 | AF_FIF_ICO = 1, 165 | AF_FIF_JPEG = 2, 166 | AF_FIF_JNG = 3, 167 | AF_FIF_PNG = 13, 168 | AF_FIF_PPM = 14, 169 | AF_FIF_PPMRAW = 15, 170 | AF_FIF_TIFF = 18, 171 | AF_FIF_PSD = 20, 172 | AF_FIF_HDR = 26, 173 | AF_FIF_EXR = 29, 174 | AF_FIF_JP2 = 31, 175 | AF_FIF_RAW = 34 176 | 177 | MomentType* {.pure, header : "arrayfire.h", import_cpp: "af_moment_type", size: sizeof(cint).} = enum 178 | AF_MOMENT_M00 = 1, 179 | AF_MOMENT_M01 = 2, 180 | AF_MOMENT_M10 = 4, 181 | AF_MOMENT_M11 = 8, 182 | AF_MOMENT_FIRST_ORDER = 15 183 | 184 | HomographyType* {.pure, header : "arrayfire.h", import_cpp: "af_homography_type", size: sizeof(cint).} = enum 185 | AF_HOMOGRAPHY_RANSAC = 0, 186 | AF_HOMOGRAPHY_LMEDS = 1 187 | 188 | Backend* {.pure, header : "arrayfire.h", import_cpp: "af_backend", size: sizeof(cint).} = enum 189 | AF_BACKEND_DEFAULT = 0, 190 | AF_BACKEND_CPU = 1, 191 | AF_BACKEND_CUDA = 2, 192 | AF_BACKEND_OPENCL = 4 193 | 194 | SomeenumT* {.pure, header : "arrayfire.h", import_cpp: "SomeenumT", size: sizeof(cint).} = enum 195 | AF_ID = 0 196 | 197 | BinaryOp* {.pure, header : "arrayfire.h", import_cpp: "af_binary_op", size: sizeof(cint).} = enum 198 | AF_BINARY_ADD = 0, 199 | AF_BINARY_MUL = 1, 200 | AF_BINARY_MIN = 2, 201 | AF_BINARY_MAX = 3 202 | 203 | RandomEngineType* {.pure, header : "arrayfire.h", import_cpp: "af_random_engine_type", size: sizeof(cint).} = enum 204 | AF_RANDOM_ENGINE_PHILOX = 100, 205 | AF_RANDOM_ENGINE_THREEFRY = 200, 206 | AF_RANDOM_ENGINE_MERSENNE = 300 207 | 208 | Colormap* {.pure, header : "arrayfire.h", import_cpp: "af_colormap", size: sizeof(cint).} = enum 209 | AF_COLORMAP_DEFAULT = 0, 210 | AF_COLORMAP_SPECTRUM = 1, 211 | AF_COLORMAP_COLORS = 2, 212 | AF_COLORMAP_RED = 3, 213 | AF_COLORMAP_MOOD = 4, 214 | AF_COLORMAP_HEAT = 5, 215 | AF_COLORMAP_BLUE = 6, 216 | AF_COLORMAP_INFERNO = 7, 217 | AF_COLORMAP_MAGMA = 8, 218 | AF_COLORMAP_PLASMA = 9, 219 | AF_COLORMAP_VIRIDIS = 10 220 | 221 | MarkerType* {.pure, header : "arrayfire.h", import_cpp: "af_marker_type", size: sizeof(cint).} = enum 222 | AF_MARKER_NONE = 0, 223 | AF_MARKER_POINT = 1, 224 | AF_MARKER_CIRCLE = 2, 225 | AF_MARKER_SQUARE = 3, 226 | AF_MARKER_TRIANGLE = 4, 227 | AF_MARKER_CROSS = 5, 228 | AF_MARKER_PLUS = 6, 229 | AF_MARKER_STAR = 7 230 | 231 | CannyThreshold* {.pure, header : "arrayfire.h", import_cpp: "af_canny_threshold", size: sizeof(cint).} = enum 232 | AF_CANNY_THRESHOLD_MANUAL = 0, 233 | AF_CANNY_THRESHOLD_AUTO_OTSU = 1 234 | 235 | Storage* {.pure, header : "arrayfire.h", import_cpp: "af_storage", size: sizeof(cint).} = enum 236 | AF_STORAGE_DENSE = 0, 237 | AF_STORAGE_CSR = 1, 238 | AF_STORAGE_CSC = 2, 239 | AF_STORAGE_COO = 3 240 | 241 | FluxFunction* {.pure, header : "arrayfire.h", import_cpp: "af_flux_function", size: sizeof(cint).} = enum 242 | AF_FLUX_DEFAULT = 0, 243 | AF_FLUX_QUADRATIC = 1, 244 | AF_FLUX_EXPONENTIAL = 2 245 | 246 | DiffusionEq* {.pure, header : "arrayfire.h", import_cpp: "af_diffusion_eq", size: sizeof(cint).} = enum 247 | AF_DIFFUSION_DEFAULT = 0, 248 | AF_DIFFUSION_GRAD = 1, 249 | AF_DIFFUSION_MCDE = 2 250 | 251 | TopkFunction* {.pure, header : "arrayfire.h", import_cpp: "af_topk_function", size: sizeof(cint).} = enum 252 | AF_TOPK_DEFAULT = 0, 253 | AF_TOPK_MIN = 1, 254 | AF_TOPK_MAX = 2 255 | 256 | VarBias* {.pure, header : "arrayfire.h", import_cpp: "af_var_bias", size: sizeof(cint).} = enum 257 | AF_VARIANCE_DEFAULT = 0, 258 | AF_VARIANCE_SAMPLE = 1, 259 | AF_VARIANCE_POPULATION = 2 260 | 261 | IterativeDeconvAlgo* {.pure, header : "arrayfire.h", import_cpp: "af_iterative_deconv_algo", size: sizeof(cint).} = enum 262 | AF_ITERATIVE_DECONV_DEFAULT = 0, 263 | AF_ITERATIVE_DECONV_LANDWEBER = 1, 264 | AF_ITERATIVE_DECONV_RICHARDSONLUCY = 2 265 | 266 | InverseDeconvAlgo* {.pure, header : "arrayfire.h", import_cpp: "af_inverse_deconv_algo", size: sizeof(cint).} = enum 267 | AF_INVERSE_DECONV_DEFAULT = 0, 268 | AF_INVERSE_DECONV_TIKHONOV = 1 269 | 270 | ConvGradientType* {.pure, header : "arrayfire.h", import_cpp: "af_conv_gradient_type", size: sizeof(cint).} = enum 271 | AF_CONV_GRADIENT_DEFAULT = 0, 272 | AF_CONV_GRADIENT_FILTER = 1, 273 | AF_CONV_GRADIENT_DATA = 2, 274 | AF_CONV_GRADIENT_BIAS = 3 275 | 276 | #endregion 277 | 278 | 279 | #region Functions 280 | 281 | proc devicecount*( ) : int32 {.importcpp: "af::devicecount(@)", header: "arrayfire.h".} 282 | proc deviceget*( ) : int32 {.importcpp: "af::deviceget(@)", header: "arrayfire.h".} 283 | proc deviceset*( device : int32 ) {.importcpp: "af::deviceset(@)", header: "arrayfire.h".} 284 | proc loadimage*( filename : cstring, is_color : bool ) : AFArray {.importcpp: "af::loadimage(@)", header: "arrayfire.h".} 285 | proc saveimage*( filename : cstring, af_in : AFArray ) {.importcpp: "af::saveimage(@)", header: "arrayfire.h".} 286 | proc gaussiankernel*( rows : int32, cols : int32, sig_r : float64, sig_c : float64 ) : AFArray {.importcpp: "af::gaussiankernel(@)", header: "arrayfire.h".} 287 | proc alltrue*( af_in : AFArray, dim : int32 ) : AFArray {.importcpp: "af::alltrue(@)", header: "arrayfire.h".} 288 | proc anytrue*( af_in : AFArray, dim : int32 ) : AFArray {.importcpp: "af::anytrue(@)", header: "arrayfire.h".} 289 | proc setunique*( af_in : AFArray, is_sorted : bool ) : AFArray {.importcpp: "af::setunique(@)", header: "arrayfire.h".} 290 | proc setunion*( first : AFArray, second : AFArray, is_unique : bool ) : AFArray {.importcpp: "af::setunion(@)", header: "arrayfire.h".} 291 | proc setintersect*( first : AFArray, second : AFArray, is_unique : bool ) : AFArray {.importcpp: "af::setintersect(@)", header: "arrayfire.h".} 292 | proc histequal*( af_in : AFArray, hist : AFArray ) : AFArray {.importcpp: "af::histequal(@)", header: "arrayfire.h".} 293 | proc colorspace*( image : AFArray, to : CSpaceT, af_from : CSpaceT ) : AFArray {.importcpp: "af::colorspace(@)", header: "arrayfire.h".} 294 | proc filter*( image : AFArray, kernel : AFArray ) : AFArray {.importcpp: "af::filter(@)", header: "arrayfire.h".} 295 | proc mul*( af_in : AFArray, dim : int32 ) : AFArray {.importcpp: "af::mul(@)", header: "arrayfire.h".} 296 | proc deviceprop*( d_name : cstring, d_platform : cstring, d_toolkit : cstring, d_compute : cstring ) {.importcpp: "af::deviceprop(@)", header: "arrayfire.h".} 297 | proc asum*( af_in : AFArray, dim : int32 ) : AFArray {.importcpp: "af::sum(@)", header: "arrayfire.h".} 298 | proc asum*( af_in : AFArray, dim : int32, nanval : float64 ) : AFArray {.importcpp: "af::sum(@)", header: "arrayfire.h".} 299 | proc sumByKey*( keys_out : AFArray, vals_out : AFArray, keys : AFArray, vals : AFArray, dim : int32 ) {.importcpp: "af::sumByKey(@)", header: "arrayfire.h".} 300 | proc sumByKey*( keys_out : AFArray, vals_out : AFArray, keys : AFArray, vals : AFArray, dim : int32, nanval : float64 ) {.importcpp: "af::sumByKey(@)", header: "arrayfire.h".} 301 | proc product*( af_in : AFArray, dim : int32 ) : AFArray {.importcpp: "af::product(@)", header: "arrayfire.h".} 302 | proc product*( af_in : AFArray, dim : int32, nanval : float64 ) : AFArray {.importcpp: "af::product(@)", header: "arrayfire.h".} 303 | proc productByKey*( keys_out : AFArray, vals_out : AFArray, keys : AFArray, vals : AFArray, dim : int32 ) {.importcpp: "af::productByKey(@)", header: "arrayfire.h".} 304 | proc productByKey*( keys_out : AFArray, vals_out : AFArray, keys : AFArray, vals : AFArray, dim : int32, nanval : float64 ) {.importcpp: "af::productByKey(@)", header: "arrayfire.h".} 305 | proc amin*( af_in : AFArray, dim : int32 ) : AFArray {.importcpp: "af::min(@)", header: "arrayfire.h".} 306 | proc minByKey*( keys_out : AFArray, vals_out : AFArray, keys : AFArray, vals : AFArray, dim : int32 ) {.importcpp: "af::minByKey(@)", header: "arrayfire.h".} 307 | proc amax*( af_in : AFArray, dim : int32 ) : AFArray {.importcpp: "af::max(@)", header: "arrayfire.h".} 308 | proc maxByKey*( keys_out : AFArray, vals_out : AFArray, keys : AFArray, vals : AFArray, dim : int32 ) {.importcpp: "af::maxByKey(@)", header: "arrayfire.h".} 309 | proc amax*( val : AFArray, idx : AFArray, af_in : AFArray, ragged_len : AFArray, dim : int32 ) {.importcpp: "af::max(@)", header: "arrayfire.h".} 310 | proc allTrueByKey*( keys_out : AFArray, vals_out : AFArray, keys : AFArray, vals : AFArray, dim : int32 ) {.importcpp: "af::allTrueByKey(@)", header: "arrayfire.h".} 311 | proc anyTrueByKey*( keys_out : AFArray, vals_out : AFArray, keys : AFArray, vals : AFArray, dim : int32 ) {.importcpp: "af::anyTrueByKey(@)", header: "arrayfire.h".} 312 | proc count*( af_in : AFArray, dim : int32 ) : AFArray {.importcpp: "af::count(@)", header: "arrayfire.h".} 313 | proc countByKey*( keys_out : AFArray, vals_out : AFArray, keys : AFArray, vals : AFArray, dim : int32 ) {.importcpp: "af::countByKey(@)", header: "arrayfire.h".} 314 | proc amin*( val : AFArray, idx : AFArray, af_in : AFArray, dim : int32 ) {.importcpp: "af::min(@)", header: "arrayfire.h".} 315 | proc amax*( val : AFArray, idx : AFArray, af_in : AFArray, dim : int32 ) {.importcpp: "af::max(@)", header: "arrayfire.h".} 316 | proc accum*( af_in : AFArray, dim : int32 ) : AFArray {.importcpp: "af::accum(@)", header: "arrayfire.h".} 317 | proc scan*( af_in : AFArray, dim : int32, op : BinaryOp, inclusive_scan : bool ) : AFArray {.importcpp: "af::scan(@)", header: "arrayfire.h".} 318 | proc scanByKey*( key : AFArray, af_in : AFArray, dim : int32, op : BinaryOp, inclusive_scan : bool ) : AFArray {.importcpp: "af::scanByKey(@)", header: "arrayfire.h".} 319 | proc where*( af_in : AFArray ) : AFArray {.importcpp: "af::where(@)", header: "arrayfire.h".} 320 | proc diff1*( af_in : AFArray, dim : int32 ) : AFArray {.importcpp: "af::diff1(@)", header: "arrayfire.h".} 321 | proc diff2*( af_in : AFArray, dim : int32 ) : AFArray {.importcpp: "af::diff2(@)", header: "arrayfire.h".} 322 | proc sort*( af_in : AFArray, dim : uint32, isAscending : bool ) : AFArray {.importcpp: "af::sort(@)", header: "arrayfire.h".} 323 | proc sort*( af_out : AFArray, indices : AFArray, af_in : AFArray, dim : uint32, isAscending : bool ) {.importcpp: "af::sort(@)", header: "arrayfire.h".} 324 | proc sort*( out_keys : AFArray, out_values : AFArray, keys : AFArray, values : AFArray, dim : uint32, isAscending : bool ) {.importcpp: "af::sort(@)", header: "arrayfire.h".} 325 | proc amin*( lhs : AFArray, rhs : AFArray ) : AFArray {.importcpp: "af::min(@)", header: "arrayfire.h".} 326 | proc amin*( lhs : AFArray, rhs : float64 ) : AFArray {.importcpp: "af::min(@)", header: "arrayfire.h".} 327 | proc amin*( lhs : float64, rhs : AFArray ) : AFArray {.importcpp: "af::min(@)", header: "arrayfire.h".} 328 | proc amax*( lhs : AFArray, rhs : AFArray ) : AFArray {.importcpp: "af::max(@)", header: "arrayfire.h".} 329 | proc amax*( lhs : AFArray, rhs : float64 ) : AFArray {.importcpp: "af::max(@)", header: "arrayfire.h".} 330 | proc amax*( lhs : float64, rhs : AFArray ) : AFArray {.importcpp: "af::max(@)", header: "arrayfire.h".} 331 | proc clamp*( af_in : AFArray, lo : AFArray, hi : AFArray ) : AFArray {.importcpp: "af::clamp(@)", header: "arrayfire.h".} 332 | proc clamp*( af_in : AFArray, lo : AFArray, hi : float64 ) : AFArray {.importcpp: "af::clamp(@)", header: "arrayfire.h".} 333 | proc clamp*( af_in : AFArray, lo : float64, hi : AFArray ) : AFArray {.importcpp: "af::clamp(@)", header: "arrayfire.h".} 334 | proc clamp*( af_in : AFArray, lo : float64, hi : float64 ) : AFArray {.importcpp: "af::clamp(@)", header: "arrayfire.h".} 335 | proc rem*( lhs : AFArray, rhs : AFArray ) : AFArray {.importcpp: "af::rem(@)", header: "arrayfire.h".} 336 | proc rem*( lhs : AFArray, rhs : float64 ) : AFArray {.importcpp: "af::rem(@)", header: "arrayfire.h".} 337 | proc rem*( lhs : float64, rhs : AFArray ) : AFArray {.importcpp: "af::rem(@)", header: "arrayfire.h".} 338 | proc af_mod*( lhs : AFArray, rhs : AFArray ) : AFArray {.importcpp: "af::mod(@)", header: "arrayfire.h".} 339 | proc af_mod*( lhs : AFArray, rhs : float64 ) : AFArray {.importcpp: "af::mod(@)", header: "arrayfire.h".} 340 | proc af_mod*( lhs : float64, rhs : AFArray ) : AFArray {.importcpp: "af::mod(@)", header: "arrayfire.h".} 341 | proc abs*( af_in : AFArray ) : AFArray {.importcpp: "af::abs(@)", header: "arrayfire.h".} 342 | proc arg*( af_in : AFArray ) : AFArray {.importcpp: "af::arg(@)", header: "arrayfire.h".} 343 | proc sign*( af_in : AFArray ) : AFArray {.importcpp: "af::sign(@)", header: "arrayfire.h".} 344 | proc round*( af_in : AFArray ) : AFArray {.importcpp: "af::round(@)", header: "arrayfire.h".} 345 | proc trunc*( af_in : AFArray ) : AFArray {.importcpp: "af::trunc(@)", header: "arrayfire.h".} 346 | proc floor*( af_in : AFArray ) : AFArray {.importcpp: "af::floor(@)", header: "arrayfire.h".} 347 | proc ceil*( af_in : AFArray ) : AFArray {.importcpp: "af::ceil(@)", header: "arrayfire.h".} 348 | proc hypot*( lhs : AFArray, rhs : AFArray ) : AFArray {.importcpp: "af::hypot(@)", header: "arrayfire.h".} 349 | proc hypot*( lhs : AFArray, rhs : float64 ) : AFArray {.importcpp: "af::hypot(@)", header: "arrayfire.h".} 350 | proc hypot*( lhs : float64, rhs : AFArray ) : AFArray {.importcpp: "af::hypot(@)", header: "arrayfire.h".} 351 | proc sin*( af_in : AFArray ) : AFArray {.importcpp: "af::sin(@)", header: "arrayfire.h".} 352 | proc cos*( af_in : AFArray ) : AFArray {.importcpp: "af::cos(@)", header: "arrayfire.h".} 353 | proc tan*( af_in : AFArray ) : AFArray {.importcpp: "af::tan(@)", header: "arrayfire.h".} 354 | proc asin*( af_in : AFArray ) : AFArray {.importcpp: "af::asin(@)", header: "arrayfire.h".} 355 | proc acos*( af_in : AFArray ) : AFArray {.importcpp: "af::acos(@)", header: "arrayfire.h".} 356 | proc atan*( af_in : AFArray ) : AFArray {.importcpp: "af::atan(@)", header: "arrayfire.h".} 357 | proc atan2*( lhs : AFArray, rhs : AFArray ) : AFArray {.importcpp: "af::atan2(@)", header: "arrayfire.h".} 358 | proc atan2*( lhs : AFArray, rhs : float64 ) : AFArray {.importcpp: "af::atan2(@)", header: "arrayfire.h".} 359 | proc atan2*( lhs : float64, rhs : AFArray ) : AFArray {.importcpp: "af::atan2(@)", header: "arrayfire.h".} 360 | proc sinh*( af_in : AFArray ) : AFArray {.importcpp: "af::sinh(@)", header: "arrayfire.h".} 361 | proc cosh*( af_in : AFArray ) : AFArray {.importcpp: "af::cosh(@)", header: "arrayfire.h".} 362 | proc tanh*( af_in : AFArray ) : AFArray {.importcpp: "af::tanh(@)", header: "arrayfire.h".} 363 | proc asinh*( af_in : AFArray ) : AFArray {.importcpp: "af::asinh(@)", header: "arrayfire.h".} 364 | proc acosh*( af_in : AFArray ) : AFArray {.importcpp: "af::acosh(@)", header: "arrayfire.h".} 365 | proc atanh*( af_in : AFArray ) : AFArray {.importcpp: "af::atanh(@)", header: "arrayfire.h".} 366 | proc complex*( af_in : AFArray ) : AFArray {.importcpp: "af::complex(@)", header: "arrayfire.h".} 367 | proc complex*( real : AFArray, imag : AFArray ) : AFArray {.importcpp: "af::complex(@)", header: "arrayfire.h".} 368 | proc complex*( real : AFArray, imag : float64 ) : AFArray {.importcpp: "af::complex(@)", header: "arrayfire.h".} 369 | proc complex*( real : float64, imag : AFArray ) : AFArray {.importcpp: "af::complex(@)", header: "arrayfire.h".} 370 | proc real*( af_in : AFArray ) : AFArray {.importcpp: "af::real(@)", header: "arrayfire.h".} 371 | proc imag*( af_in : AFArray ) : AFArray {.importcpp: "af::imag(@)", header: "arrayfire.h".} 372 | proc conjg*( af_in : AFArray ) : AFArray {.importcpp: "af::conjg(@)", header: "arrayfire.h".} 373 | proc root*( nth_root : AFArray, value : AFArray ) : AFArray {.importcpp: "af::root(@)", header: "arrayfire.h".} 374 | proc root*( nth_root : AFArray, value : float64 ) : AFArray {.importcpp: "af::root(@)", header: "arrayfire.h".} 375 | proc root*( nth_root : float64, value : AFArray ) : AFArray {.importcpp: "af::root(@)", header: "arrayfire.h".} 376 | proc pow*( base : AFArray, exponent : AFArray ) : AFArray {.importcpp: "af::pow(@)", header: "arrayfire.h".} 377 | proc pow*( base : AFArray, exponent : float64 ) : AFArray {.importcpp: "af::pow(@)", header: "arrayfire.h".} 378 | proc pow*( base : float64, exponent : AFArray ) : AFArray {.importcpp: "af::pow(@)", header: "arrayfire.h".} 379 | proc pow2*( af_in : AFArray ) : AFArray {.importcpp: "af::pow2(@)", header: "arrayfire.h".} 380 | proc sigmoid*( af_in : AFArray ) : AFArray {.importcpp: "af::sigmoid(@)", header: "arrayfire.h".} 381 | proc exp*( af_in : AFArray ) : AFArray {.importcpp: "af::exp(@)", header: "arrayfire.h".} 382 | proc expm1*( af_in : AFArray ) : AFArray {.importcpp: "af::expm1(@)", header: "arrayfire.h".} 383 | proc erf*( af_in : AFArray ) : AFArray {.importcpp: "af::erf(@)", header: "arrayfire.h".} 384 | proc erfc*( af_in : AFArray ) : AFArray {.importcpp: "af::erfc(@)", header: "arrayfire.h".} 385 | proc log*( af_in : AFArray ) : AFArray {.importcpp: "af::log(@)", header: "arrayfire.h".} 386 | proc log1p*( af_in : AFArray ) : AFArray {.importcpp: "af::log1p(@)", header: "arrayfire.h".} 387 | proc log10*( af_in : AFArray ) : AFArray {.importcpp: "af::log10(@)", header: "arrayfire.h".} 388 | proc log2*( af_in : AFArray ) : AFArray {.importcpp: "af::log2(@)", header: "arrayfire.h".} 389 | proc sqrt*( af_in : AFArray ) : AFArray {.importcpp: "af::sqrt(@)", header: "arrayfire.h".} 390 | proc rsqrt*( af_in : AFArray ) : AFArray {.importcpp: "af::rsqrt(@)", header: "arrayfire.h".} 391 | proc cbrt*( af_in : AFArray ) : AFArray {.importcpp: "af::cbrt(@)", header: "arrayfire.h".} 392 | proc factorial*( af_in : AFArray ) : AFArray {.importcpp: "af::factorial(@)", header: "arrayfire.h".} 393 | proc tgamma*( af_in : AFArray ) : AFArray {.importcpp: "af::tgamma(@)", header: "arrayfire.h".} 394 | proc lgamma*( af_in : AFArray ) : AFArray {.importcpp: "af::lgamma(@)", header: "arrayfire.h".} 395 | proc iszero*( af_in : AFArray ) : AFArray {.importcpp: "af::iszero(@)", header: "arrayfire.h".} 396 | proc isInf*( af_in : AFArray ) : AFArray {.importcpp: "af::isInf(@)", header: "arrayfire.h".} 397 | proc isNaN*( af_in : AFArray ) : AFArray {.importcpp: "af::isNaN(@)", header: "arrayfire.h".} 398 | proc info*( ) {.importcpp: "af::info(@)", header: "arrayfire.h".} 399 | proc infoString*( verbose : bool ) : cstring {.importcpp: "af::infoString(@)", header: "arrayfire.h".} 400 | proc deviceInfo*( d_name : cstring, d_platform : cstring, d_toolkit : cstring, d_compute : cstring ) {.importcpp: "af::deviceInfo(@)", header: "arrayfire.h".} 401 | proc getDeviceCount*( ) : int32 {.importcpp: "af::getDeviceCount(@)", header: "arrayfire.h".} 402 | proc getDevice*( ) : int32 {.importcpp: "af::getDevice(@)", header: "arrayfire.h".} 403 | proc isDoubleAvailable*( device : int32 ) : bool {.importcpp: "af::isDoubleAvailable(@)", header: "arrayfire.h".} 404 | proc isHalfAvailable*( device : int32 ) : bool {.importcpp: "af::isHalfAvailable(@)", header: "arrayfire.h".} 405 | proc setDevice*( device : int32 ) {.importcpp: "af::setDevice(@)", header: "arrayfire.h".} 406 | proc sync*( device : int32 ) {.importcpp: "af::sync(@)", header: "arrayfire.h".} 407 | proc af_alloc*( elements : uint32, af_type : Dtype ) {.importcpp: "af::alloc(@)", header: "arrayfire.h".} 408 | proc allocV2*( bytes : uint32 ) {.importcpp: "af::allocV2(@)", header: "arrayfire.h".} 409 | proc free*( af_ptr : pointer ) {.importcpp: "af::free(@)", header: "arrayfire.h".} 410 | proc freeV2*( af_ptr : pointer ) {.importcpp: "af::freeV2(@)", header: "arrayfire.h".} 411 | proc pinned*( elements : uint32, af_type : Dtype ) {.importcpp: "af::pinned(@)", header: "arrayfire.h".} 412 | proc freePinned*( af_ptr : pointer ) {.importcpp: "af::freePinned(@)", header: "arrayfire.h".} 413 | proc allocHost*( elements : uint32, af_type : Dtype ) {.importcpp: "af::allocHost(@)", header: "arrayfire.h".} 414 | proc freeHost*( af_ptr : pointer ) {.importcpp: "af::freeHost(@)", header: "arrayfire.h".} 415 | proc deviceMemInfo*( alloc_bytes : uint32, alloc_buffers : uint32, lock_bytes : uint32, lock_buffers : uint32 ) {.importcpp: "af::deviceMemInfo(@)", header: "arrayfire.h".} 416 | proc printMemInfo*( msg : cstring, device_id : int32 ) {.importcpp: "af::printMemInfo(@)", header: "arrayfire.h".} 417 | proc deviceGC*( ) {.importcpp: "af::deviceGC(@)", header: "arrayfire.h".} 418 | proc setMemStepSize*( size : uint32 ) {.importcpp: "af::setMemStepSize(@)", header: "arrayfire.h".} 419 | proc getMemStepSize*( ) : uint32 {.importcpp: "af::getMemStepSize(@)", header: "arrayfire.h".} 420 | proc `+`*(first : Dim4, second : Dim4) : Dim4 {.importcpp: "(# + #)", header: "arrayfire.h".} 421 | proc `-`*(first : Dim4, second : Dim4) : Dim4 {.importcpp: "(# - #)", header: "arrayfire.h".} 422 | proc `*`*(first : Dim4, second : Dim4) : Dim4 {.importcpp: "(# * #)", header: "arrayfire.h".} 423 | proc isSpan*( af_seq : AF_Seq ) : bool {.importcpp: "af::isSpan(@)", header: "arrayfire.h".} 424 | proc seqElements*( af_seq : AF_Seq ) : uint32 {.importcpp: "af::seqElements(@)", header: "arrayfire.h".} 425 | proc calcDim*( af_seq : AF_Seq, parentDim : DimT ) : DimT {.importcpp: "af::calcDim(@)", header: "arrayfire.h".} 426 | proc lookup*( af_in : AFArray, idx : AFArray, dim : int32 ) : AFArray {.importcpp: "af::lookup(@)", header: "arrayfire.h".} 427 | proc copy*( dst : AFArray, src : AFArray, idx0 : IndexT, idx1 : IndexT, idx2 : IndexT, idx3 : IndexT ) {.importcpp: "af::copy(@)", header: "arrayfire.h".} 428 | proc print*( exp : cstring, arr : AFArray ) {.importcpp: "af::print(@)", header: "arrayfire.h".} 429 | proc print*( exp : cstring, arr : AFArray, precision : int32 ) {.importcpp: "af::print(@)", header: "arrayfire.h".} 430 | proc saveArray*( key : cstring, arr : AFArray, filename : cstring, append : bool ) : int32 {.importcpp: "af::saveArray(@)", header: "arrayfire.h".} 431 | proc readArray*( filename : cstring, index : uint32 ) : AFArray {.importcpp: "af::readArray(@)", header: "arrayfire.h".} 432 | proc readArray*( filename : cstring, key : cstring ) : AFArray {.importcpp: "af::readArray(@)", header: "arrayfire.h".} 433 | proc readArrayCheck*( filename : cstring, key : cstring ) : int32 {.importcpp: "af::readArrayCheck(@)", header: "arrayfire.h".} 434 | proc exampleFunction*( af_in : AFArray, param : SomeenumT ) : AFArray {.importcpp: "af::exampleFunction(@)", header: "arrayfire.h".} 435 | proc getSizeOf*( af_type : Dtype ) : uint32 {.importcpp: "af::getSizeOf(@)", header: "arrayfire.h".} 436 | proc real*( val : float64 ) : float32 {.importcpp: "af::real(@)", header: "arrayfire.h".} 437 | proc imag*( val : float64 ) : float32 {.importcpp: "af::imag(@)", header: "arrayfire.h".} 438 | proc abs*( val : float32 ) : float32 {.importcpp: "af::abs(@)", header: "arrayfire.h".} 439 | proc abs*( val : float64 ) : float64 {.importcpp: "af::abs(@)", header: "arrayfire.h".} 440 | proc conj*( val : float32 ) : float32 {.importcpp: "af::conj(@)", header: "arrayfire.h".} 441 | proc conj*( val : float64 ) : float64 {.importcpp: "af::conj(@)", header: "arrayfire.h".} 442 | proc `+`*(lhs : AFArray, rhs : AFArray) : AFArray {.importcpp: "(# + #)", header: "arrayfire.h".} 443 | proc `+`*(lhs : bool, rhs : AFArray) : AFArray {.importcpp: "(# + #)", header: "arrayfire.h".} 444 | proc `+`*(lhs : int32, rhs : AFArray) : AFArray {.importcpp: "(# + #)", header: "arrayfire.h".} 445 | proc `+`*(lhs : uint32, rhs : AFArray) : AFArray {.importcpp: "(# + #)", header: "arrayfire.h".} 446 | proc `+`*(lhs : cstring, rhs : AFArray) : AFArray {.importcpp: "(# + #)", header: "arrayfire.h".} 447 | proc `+`*(lhs : int64, rhs : AFArray) : AFArray {.importcpp: "(# + #)", header: "arrayfire.h".} 448 | proc `+`*(lhs : uint64, rhs : AFArray) : AFArray {.importcpp: "(# + #)", header: "arrayfire.h".} 449 | proc `+`*(lhs : float64, rhs : AFArray) : AFArray {.importcpp: "(# + #)", header: "arrayfire.h".} 450 | proc `+`*(lhs : float32, rhs : AFArray) : AFArray {.importcpp: "(# + #)", header: "arrayfire.h".} 451 | proc `+`*(lhs : AFArray, rhs : bool) : AFArray {.importcpp: "(# + #)", header: "arrayfire.h".} 452 | proc `+`*(lhs : AFArray, rhs : int32) : AFArray {.importcpp: "(# + #)", header: "arrayfire.h".} 453 | proc `+`*(lhs : AFArray, rhs : uint32) : AFArray {.importcpp: "(# + #)", header: "arrayfire.h".} 454 | proc `+`*(lhs : AFArray, rhs : cstring) : AFArray {.importcpp: "(# + #)", header: "arrayfire.h".} 455 | proc `+`*(lhs : AFArray, rhs : int64) : AFArray {.importcpp: "(# + #)", header: "arrayfire.h".} 456 | proc `+`*(lhs : AFArray, rhs : uint64) : AFArray {.importcpp: "(# + #)", header: "arrayfire.h".} 457 | proc `+`*(lhs : AFArray, rhs : float64) : AFArray {.importcpp: "(# + #)", header: "arrayfire.h".} 458 | proc `+`*(lhs : AFArray, rhs : float32) : AFArray {.importcpp: "(# + #)", header: "arrayfire.h".} 459 | proc `+`*(lhs : int16, rhs : AFArray) : AFArray {.importcpp: "(# + #)", header: "arrayfire.h".} 460 | proc `+`*(lhs : uint16, rhs : AFArray) : AFArray {.importcpp: "(# + #)", header: "arrayfire.h".} 461 | proc `+`*(lhs : AFArray, rhs : int16) : AFArray {.importcpp: "(# + #)", header: "arrayfire.h".} 462 | proc `+`*(lhs : AFArray, rhs : uint16) : AFArray {.importcpp: "(# + #)", header: "arrayfire.h".} 463 | proc `-`*(lhs : AFArray, rhs : AFArray) : AFArray {.importcpp: "(# - #)", header: "arrayfire.h".} 464 | proc `-`*(lhs : bool, rhs : AFArray) : AFArray {.importcpp: "(# - #)", header: "arrayfire.h".} 465 | proc `-`*(lhs : int32, rhs : AFArray) : AFArray {.importcpp: "(# - #)", header: "arrayfire.h".} 466 | proc `-`*(lhs : uint32, rhs : AFArray) : AFArray {.importcpp: "(# - #)", header: "arrayfire.h".} 467 | proc `-`*(lhs : cstring, rhs : AFArray) : AFArray {.importcpp: "(# - #)", header: "arrayfire.h".} 468 | proc `-`*(lhs : int64, rhs : AFArray) : AFArray {.importcpp: "(# - #)", header: "arrayfire.h".} 469 | proc `-`*(lhs : uint64, rhs : AFArray) : AFArray {.importcpp: "(# - #)", header: "arrayfire.h".} 470 | proc `-`*(lhs : float64, rhs : AFArray) : AFArray {.importcpp: "(# - #)", header: "arrayfire.h".} 471 | proc `-`*(lhs : float32, rhs : AFArray) : AFArray {.importcpp: "(# - #)", header: "arrayfire.h".} 472 | proc `-`*(lhs : AFArray, rhs : bool) : AFArray {.importcpp: "(# - #)", header: "arrayfire.h".} 473 | proc `-`*(lhs : AFArray, rhs : int32) : AFArray {.importcpp: "(# - #)", header: "arrayfire.h".} 474 | proc `-`*(lhs : AFArray, rhs : uint32) : AFArray {.importcpp: "(# - #)", header: "arrayfire.h".} 475 | proc `-`*(lhs : AFArray, rhs : cstring) : AFArray {.importcpp: "(# - #)", header: "arrayfire.h".} 476 | proc `-`*(lhs : AFArray, rhs : int64) : AFArray {.importcpp: "(# - #)", header: "arrayfire.h".} 477 | proc `-`*(lhs : AFArray, rhs : uint64) : AFArray {.importcpp: "(# - #)", header: "arrayfire.h".} 478 | proc `-`*(lhs : AFArray, rhs : float64) : AFArray {.importcpp: "(# - #)", header: "arrayfire.h".} 479 | proc `-`*(lhs : AFArray, rhs : float32) : AFArray {.importcpp: "(# - #)", header: "arrayfire.h".} 480 | proc `-`*(lhs : int16, rhs : AFArray) : AFArray {.importcpp: "(# - #)", header: "arrayfire.h".} 481 | proc `-`*(lhs : uint16, rhs : AFArray) : AFArray {.importcpp: "(# - #)", header: "arrayfire.h".} 482 | proc `-`*(lhs : AFArray, rhs : int16) : AFArray {.importcpp: "(# - #)", header: "arrayfire.h".} 483 | proc `-`*(lhs : AFArray, rhs : uint16) : AFArray {.importcpp: "(# - #)", header: "arrayfire.h".} 484 | proc `*`*(lhs : AFArray, rhs : AFArray) : AFArray {.importcpp: "(# * #)", header: "arrayfire.h".} 485 | proc `*`*(lhs : bool, rhs : AFArray) : AFArray {.importcpp: "(# * #)", header: "arrayfire.h".} 486 | proc `*`*(lhs : int32, rhs : AFArray) : AFArray {.importcpp: "(# * #)", header: "arrayfire.h".} 487 | proc `*`*(lhs : uint32, rhs : AFArray) : AFArray {.importcpp: "(# * #)", header: "arrayfire.h".} 488 | proc `*`*(lhs : cstring, rhs : AFArray) : AFArray {.importcpp: "(# * #)", header: "arrayfire.h".} 489 | proc `*`*(lhs : int64, rhs : AFArray) : AFArray {.importcpp: "(# * #)", header: "arrayfire.h".} 490 | proc `*`*(lhs : uint64, rhs : AFArray) : AFArray {.importcpp: "(# * #)", header: "arrayfire.h".} 491 | proc `*`*(lhs : float64, rhs : AFArray) : AFArray {.importcpp: "(# * #)", header: "arrayfire.h".} 492 | proc `*`*(lhs : float32, rhs : AFArray) : AFArray {.importcpp: "(# * #)", header: "arrayfire.h".} 493 | proc `*`*(lhs : AFArray, rhs : bool) : AFArray {.importcpp: "(# * #)", header: "arrayfire.h".} 494 | proc `*`*(lhs : AFArray, rhs : int32) : AFArray {.importcpp: "(# * #)", header: "arrayfire.h".} 495 | proc `*`*(lhs : AFArray, rhs : uint32) : AFArray {.importcpp: "(# * #)", header: "arrayfire.h".} 496 | proc `*`*(lhs : AFArray, rhs : cstring) : AFArray {.importcpp: "(# * #)", header: "arrayfire.h".} 497 | proc `*`*(lhs : AFArray, rhs : int64) : AFArray {.importcpp: "(# * #)", header: "arrayfire.h".} 498 | proc `*`*(lhs : AFArray, rhs : uint64) : AFArray {.importcpp: "(# * #)", header: "arrayfire.h".} 499 | proc `*`*(lhs : AFArray, rhs : float64) : AFArray {.importcpp: "(# * #)", header: "arrayfire.h".} 500 | proc `*`*(lhs : AFArray, rhs : float32) : AFArray {.importcpp: "(# * #)", header: "arrayfire.h".} 501 | proc `*`*(lhs : int16, rhs : AFArray) : AFArray {.importcpp: "(# * #)", header: "arrayfire.h".} 502 | proc `*`*(lhs : uint16, rhs : AFArray) : AFArray {.importcpp: "(# * #)", header: "arrayfire.h".} 503 | proc `*`*(lhs : AFArray, rhs : int16) : AFArray {.importcpp: "(# * #)", header: "arrayfire.h".} 504 | proc `*`*(lhs : AFArray, rhs : uint16) : AFArray {.importcpp: "(# * #)", header: "arrayfire.h".} 505 | proc `/`*(lhs : AFArray, rhs : AFArray) : AFArray {.importcpp: "(# / #)", header: "arrayfire.h".} 506 | proc `/`*(lhs : bool, rhs : AFArray) : AFArray {.importcpp: "(# / #)", header: "arrayfire.h".} 507 | proc `/`*(lhs : int32, rhs : AFArray) : AFArray {.importcpp: "(# / #)", header: "arrayfire.h".} 508 | proc `/`*(lhs : uint32, rhs : AFArray) : AFArray {.importcpp: "(# / #)", header: "arrayfire.h".} 509 | proc `/`*(lhs : cstring, rhs : AFArray) : AFArray {.importcpp: "(# / #)", header: "arrayfire.h".} 510 | proc `/`*(lhs : int64, rhs : AFArray) : AFArray {.importcpp: "(# / #)", header: "arrayfire.h".} 511 | proc `/`*(lhs : uint64, rhs : AFArray) : AFArray {.importcpp: "(# / #)", header: "arrayfire.h".} 512 | proc `/`*(lhs : float64, rhs : AFArray) : AFArray {.importcpp: "(# / #)", header: "arrayfire.h".} 513 | proc `/`*(lhs : float32, rhs : AFArray) : AFArray {.importcpp: "(# / #)", header: "arrayfire.h".} 514 | proc `/`*(lhs : AFArray, rhs : bool) : AFArray {.importcpp: "(# / #)", header: "arrayfire.h".} 515 | proc `/`*(lhs : AFArray, rhs : int32) : AFArray {.importcpp: "(# / #)", header: "arrayfire.h".} 516 | proc `/`*(lhs : AFArray, rhs : uint32) : AFArray {.importcpp: "(# / #)", header: "arrayfire.h".} 517 | proc `/`*(lhs : AFArray, rhs : cstring) : AFArray {.importcpp: "(# / #)", header: "arrayfire.h".} 518 | proc `/`*(lhs : AFArray, rhs : int64) : AFArray {.importcpp: "(# / #)", header: "arrayfire.h".} 519 | proc `/`*(lhs : AFArray, rhs : uint64) : AFArray {.importcpp: "(# / #)", header: "arrayfire.h".} 520 | proc `/`*(lhs : AFArray, rhs : float64) : AFArray {.importcpp: "(# / #)", header: "arrayfire.h".} 521 | proc `/`*(lhs : AFArray, rhs : float32) : AFArray {.importcpp: "(# / #)", header: "arrayfire.h".} 522 | proc `/`*(lhs : int16, rhs : AFArray) : AFArray {.importcpp: "(# / #)", header: "arrayfire.h".} 523 | proc `/`*(lhs : uint16, rhs : AFArray) : AFArray {.importcpp: "(# / #)", header: "arrayfire.h".} 524 | proc `/`*(lhs : AFArray, rhs : int16) : AFArray {.importcpp: "(# / #)", header: "arrayfire.h".} 525 | proc `/`*(lhs : AFArray, rhs : uint16) : AFArray {.importcpp: "(# / #)", header: "arrayfire.h".} 526 | proc `==`*(lhs : AFArray, rhs : AFArray) : AFArray {.importcpp: "(# == #)", header: "arrayfire.h".} 527 | proc `==`*(lhs : bool, rhs : AFArray) : AFArray {.importcpp: "(# == #)", header: "arrayfire.h".} 528 | proc `==`*(lhs : int32, rhs : AFArray) : AFArray {.importcpp: "(# == #)", header: "arrayfire.h".} 529 | proc `==`*(lhs : uint32, rhs : AFArray) : AFArray {.importcpp: "(# == #)", header: "arrayfire.h".} 530 | proc `==`*(lhs : cstring, rhs : AFArray) : AFArray {.importcpp: "(# == #)", header: "arrayfire.h".} 531 | proc `==`*(lhs : int64, rhs : AFArray) : AFArray {.importcpp: "(# == #)", header: "arrayfire.h".} 532 | proc `==`*(lhs : uint64, rhs : AFArray) : AFArray {.importcpp: "(# == #)", header: "arrayfire.h".} 533 | proc `==`*(lhs : float64, rhs : AFArray) : AFArray {.importcpp: "(# == #)", header: "arrayfire.h".} 534 | proc `==`*(lhs : float32, rhs : AFArray) : AFArray {.importcpp: "(# == #)", header: "arrayfire.h".} 535 | proc `==`*(lhs : AFArray, rhs : bool) : AFArray {.importcpp: "(# == #)", header: "arrayfire.h".} 536 | proc `==`*(lhs : AFArray, rhs : int32) : AFArray {.importcpp: "(# == #)", header: "arrayfire.h".} 537 | proc `==`*(lhs : AFArray, rhs : uint32) : AFArray {.importcpp: "(# == #)", header: "arrayfire.h".} 538 | proc `==`*(lhs : AFArray, rhs : cstring) : AFArray {.importcpp: "(# == #)", header: "arrayfire.h".} 539 | proc `==`*(lhs : AFArray, rhs : int64) : AFArray {.importcpp: "(# == #)", header: "arrayfire.h".} 540 | proc `==`*(lhs : AFArray, rhs : uint64) : AFArray {.importcpp: "(# == #)", header: "arrayfire.h".} 541 | proc `==`*(lhs : AFArray, rhs : float64) : AFArray {.importcpp: "(# == #)", header: "arrayfire.h".} 542 | proc `==`*(lhs : AFArray, rhs : float32) : AFArray {.importcpp: "(# == #)", header: "arrayfire.h".} 543 | proc `==`*(lhs : int16, rhs : AFArray) : AFArray {.importcpp: "(# == #)", header: "arrayfire.h".} 544 | proc `==`*(lhs : uint16, rhs : AFArray) : AFArray {.importcpp: "(# == #)", header: "arrayfire.h".} 545 | proc `==`*(lhs : AFArray, rhs : int16) : AFArray {.importcpp: "(# == #)", header: "arrayfire.h".} 546 | proc `==`*(lhs : AFArray, rhs : uint16) : AFArray {.importcpp: "(# == #)", header: "arrayfire.h".} 547 | proc `!=`*(lhs : AFArray, rhs : AFArray) : AFArray {.importcpp: "(# != #)", header: "arrayfire.h".} 548 | proc `!=`*(lhs : bool, rhs : AFArray) : AFArray {.importcpp: "(# != #)", header: "arrayfire.h".} 549 | proc `!=`*(lhs : int32, rhs : AFArray) : AFArray {.importcpp: "(# != #)", header: "arrayfire.h".} 550 | proc `!=`*(lhs : uint32, rhs : AFArray) : AFArray {.importcpp: "(# != #)", header: "arrayfire.h".} 551 | proc `!=`*(lhs : cstring, rhs : AFArray) : AFArray {.importcpp: "(# != #)", header: "arrayfire.h".} 552 | proc `!=`*(lhs : int64, rhs : AFArray) : AFArray {.importcpp: "(# != #)", header: "arrayfire.h".} 553 | proc `!=`*(lhs : uint64, rhs : AFArray) : AFArray {.importcpp: "(# != #)", header: "arrayfire.h".} 554 | proc `!=`*(lhs : float64, rhs : AFArray) : AFArray {.importcpp: "(# != #)", header: "arrayfire.h".} 555 | proc `!=`*(lhs : float32, rhs : AFArray) : AFArray {.importcpp: "(# != #)", header: "arrayfire.h".} 556 | proc `!=`*(lhs : AFArray, rhs : bool) : AFArray {.importcpp: "(# != #)", header: "arrayfire.h".} 557 | proc `!=`*(lhs : AFArray, rhs : int32) : AFArray {.importcpp: "(# != #)", header: "arrayfire.h".} 558 | proc `!=`*(lhs : AFArray, rhs : uint32) : AFArray {.importcpp: "(# != #)", header: "arrayfire.h".} 559 | proc `!=`*(lhs : AFArray, rhs : cstring) : AFArray {.importcpp: "(# != #)", header: "arrayfire.h".} 560 | proc `!=`*(lhs : AFArray, rhs : int64) : AFArray {.importcpp: "(# != #)", header: "arrayfire.h".} 561 | proc `!=`*(lhs : AFArray, rhs : uint64) : AFArray {.importcpp: "(# != #)", header: "arrayfire.h".} 562 | proc `!=`*(lhs : AFArray, rhs : float64) : AFArray {.importcpp: "(# != #)", header: "arrayfire.h".} 563 | proc `!=`*(lhs : AFArray, rhs : float32) : AFArray {.importcpp: "(# != #)", header: "arrayfire.h".} 564 | proc `!=`*(lhs : int16, rhs : AFArray) : AFArray {.importcpp: "(# != #)", header: "arrayfire.h".} 565 | proc `!=`*(lhs : uint16, rhs : AFArray) : AFArray {.importcpp: "(# != #)", header: "arrayfire.h".} 566 | proc `!=`*(lhs : AFArray, rhs : int16) : AFArray {.importcpp: "(# != #)", header: "arrayfire.h".} 567 | proc `!=`*(lhs : AFArray, rhs : uint16) : AFArray {.importcpp: "(# != #)", header: "arrayfire.h".} 568 | proc `<`*(lhs : AFArray, rhs : AFArray) : AFArray {.importcpp: "(# < #)", header: "arrayfire.h".} 569 | proc `<`*(lhs : bool, rhs : AFArray) : AFArray {.importcpp: "(# < #)", header: "arrayfire.h".} 570 | proc `<`*(lhs : int32, rhs : AFArray) : AFArray {.importcpp: "(# < #)", header: "arrayfire.h".} 571 | proc `<`*(lhs : uint32, rhs : AFArray) : AFArray {.importcpp: "(# < #)", header: "arrayfire.h".} 572 | proc `<`*(lhs : cstring, rhs : AFArray) : AFArray {.importcpp: "(# < #)", header: "arrayfire.h".} 573 | proc `<`*(lhs : int64, rhs : AFArray) : AFArray {.importcpp: "(# < #)", header: "arrayfire.h".} 574 | proc `<`*(lhs : uint64, rhs : AFArray) : AFArray {.importcpp: "(# < #)", header: "arrayfire.h".} 575 | proc `<`*(lhs : float64, rhs : AFArray) : AFArray {.importcpp: "(# < #)", header: "arrayfire.h".} 576 | proc `<`*(lhs : float32, rhs : AFArray) : AFArray {.importcpp: "(# < #)", header: "arrayfire.h".} 577 | proc `<`*(lhs : AFArray, rhs : bool) : AFArray {.importcpp: "(# < #)", header: "arrayfire.h".} 578 | proc `<`*(lhs : AFArray, rhs : int32) : AFArray {.importcpp: "(# < #)", header: "arrayfire.h".} 579 | proc `<`*(lhs : AFArray, rhs : uint32) : AFArray {.importcpp: "(# < #)", header: "arrayfire.h".} 580 | proc `<`*(lhs : AFArray, rhs : cstring) : AFArray {.importcpp: "(# < #)", header: "arrayfire.h".} 581 | proc `<`*(lhs : AFArray, rhs : int64) : AFArray {.importcpp: "(# < #)", header: "arrayfire.h".} 582 | proc `<`*(lhs : AFArray, rhs : uint64) : AFArray {.importcpp: "(# < #)", header: "arrayfire.h".} 583 | proc `<`*(lhs : AFArray, rhs : float64) : AFArray {.importcpp: "(# < #)", header: "arrayfire.h".} 584 | proc `<`*(lhs : AFArray, rhs : float32) : AFArray {.importcpp: "(# < #)", header: "arrayfire.h".} 585 | proc `<`*(lhs : int16, rhs : AFArray) : AFArray {.importcpp: "(# < #)", header: "arrayfire.h".} 586 | proc `<`*(lhs : uint16, rhs : AFArray) : AFArray {.importcpp: "(# < #)", header: "arrayfire.h".} 587 | proc `<`*(lhs : AFArray, rhs : int16) : AFArray {.importcpp: "(# < #)", header: "arrayfire.h".} 588 | proc `<`*(lhs : AFArray, rhs : uint16) : AFArray {.importcpp: "(# < #)", header: "arrayfire.h".} 589 | proc `<=`*(lhs : AFArray, rhs : AFArray) : AFArray {.importcpp: "(# <= #)", header: "arrayfire.h".} 590 | proc `<=`*(lhs : bool, rhs : AFArray) : AFArray {.importcpp: "(# <= #)", header: "arrayfire.h".} 591 | proc `<=`*(lhs : int32, rhs : AFArray) : AFArray {.importcpp: "(# <= #)", header: "arrayfire.h".} 592 | proc `<=`*(lhs : uint32, rhs : AFArray) : AFArray {.importcpp: "(# <= #)", header: "arrayfire.h".} 593 | proc `<=`*(lhs : cstring, rhs : AFArray) : AFArray {.importcpp: "(# <= #)", header: "arrayfire.h".} 594 | proc `<=`*(lhs : int64, rhs : AFArray) : AFArray {.importcpp: "(# <= #)", header: "arrayfire.h".} 595 | proc `<=`*(lhs : uint64, rhs : AFArray) : AFArray {.importcpp: "(# <= #)", header: "arrayfire.h".} 596 | proc `<=`*(lhs : float64, rhs : AFArray) : AFArray {.importcpp: "(# <= #)", header: "arrayfire.h".} 597 | proc `<=`*(lhs : float32, rhs : AFArray) : AFArray {.importcpp: "(# <= #)", header: "arrayfire.h".} 598 | proc `<=`*(lhs : AFArray, rhs : bool) : AFArray {.importcpp: "(# <= #)", header: "arrayfire.h".} 599 | proc `<=`*(lhs : AFArray, rhs : int32) : AFArray {.importcpp: "(# <= #)", header: "arrayfire.h".} 600 | proc `<=`*(lhs : AFArray, rhs : uint32) : AFArray {.importcpp: "(# <= #)", header: "arrayfire.h".} 601 | proc `<=`*(lhs : AFArray, rhs : cstring) : AFArray {.importcpp: "(# <= #)", header: "arrayfire.h".} 602 | proc `<=`*(lhs : AFArray, rhs : int64) : AFArray {.importcpp: "(# <= #)", header: "arrayfire.h".} 603 | proc `<=`*(lhs : AFArray, rhs : uint64) : AFArray {.importcpp: "(# <= #)", header: "arrayfire.h".} 604 | proc `<=`*(lhs : AFArray, rhs : float64) : AFArray {.importcpp: "(# <= #)", header: "arrayfire.h".} 605 | proc `<=`*(lhs : AFArray, rhs : float32) : AFArray {.importcpp: "(# <= #)", header: "arrayfire.h".} 606 | proc `<=`*(lhs : int16, rhs : AFArray) : AFArray {.importcpp: "(# <= #)", header: "arrayfire.h".} 607 | proc `<=`*(lhs : uint16, rhs : AFArray) : AFArray {.importcpp: "(# <= #)", header: "arrayfire.h".} 608 | proc `<=`*(lhs : AFArray, rhs : int16) : AFArray {.importcpp: "(# <= #)", header: "arrayfire.h".} 609 | proc `<=`*(lhs : AFArray, rhs : uint16) : AFArray {.importcpp: "(# <= #)", header: "arrayfire.h".} 610 | proc `>`*(lhs : AFArray, rhs : AFArray) : AFArray {.importcpp: "(# > #)", header: "arrayfire.h".} 611 | proc `>`*(lhs : bool, rhs : AFArray) : AFArray {.importcpp: "(# > #)", header: "arrayfire.h".} 612 | proc `>`*(lhs : int32, rhs : AFArray) : AFArray {.importcpp: "(# > #)", header: "arrayfire.h".} 613 | proc `>`*(lhs : uint32, rhs : AFArray) : AFArray {.importcpp: "(# > #)", header: "arrayfire.h".} 614 | proc `>`*(lhs : cstring, rhs : AFArray) : AFArray {.importcpp: "(# > #)", header: "arrayfire.h".} 615 | proc `>`*(lhs : int64, rhs : AFArray) : AFArray {.importcpp: "(# > #)", header: "arrayfire.h".} 616 | proc `>`*(lhs : uint64, rhs : AFArray) : AFArray {.importcpp: "(# > #)", header: "arrayfire.h".} 617 | proc `>`*(lhs : float64, rhs : AFArray) : AFArray {.importcpp: "(# > #)", header: "arrayfire.h".} 618 | proc `>`*(lhs : float32, rhs : AFArray) : AFArray {.importcpp: "(# > #)", header: "arrayfire.h".} 619 | proc `>`*(lhs : AFArray, rhs : bool) : AFArray {.importcpp: "(# > #)", header: "arrayfire.h".} 620 | proc `>`*(lhs : AFArray, rhs : int32) : AFArray {.importcpp: "(# > #)", header: "arrayfire.h".} 621 | proc `>`*(lhs : AFArray, rhs : uint32) : AFArray {.importcpp: "(# > #)", header: "arrayfire.h".} 622 | proc `>`*(lhs : AFArray, rhs : cstring) : AFArray {.importcpp: "(# > #)", header: "arrayfire.h".} 623 | proc `>`*(lhs : AFArray, rhs : int64) : AFArray {.importcpp: "(# > #)", header: "arrayfire.h".} 624 | proc `>`*(lhs : AFArray, rhs : uint64) : AFArray {.importcpp: "(# > #)", header: "arrayfire.h".} 625 | proc `>`*(lhs : AFArray, rhs : float64) : AFArray {.importcpp: "(# > #)", header: "arrayfire.h".} 626 | proc `>`*(lhs : AFArray, rhs : float32) : AFArray {.importcpp: "(# > #)", header: "arrayfire.h".} 627 | proc `>`*(lhs : int16, rhs : AFArray) : AFArray {.importcpp: "(# > #)", header: "arrayfire.h".} 628 | proc `>`*(lhs : uint16, rhs : AFArray) : AFArray {.importcpp: "(# > #)", header: "arrayfire.h".} 629 | proc `>`*(lhs : AFArray, rhs : int16) : AFArray {.importcpp: "(# > #)", header: "arrayfire.h".} 630 | proc `>`*(lhs : AFArray, rhs : uint16) : AFArray {.importcpp: "(# > #)", header: "arrayfire.h".} 631 | proc `>=`*(lhs : AFArray, rhs : AFArray) : AFArray {.importcpp: "(# >= #)", header: "arrayfire.h".} 632 | proc `>=`*(lhs : bool, rhs : AFArray) : AFArray {.importcpp: "(# >= #)", header: "arrayfire.h".} 633 | proc `>=`*(lhs : int32, rhs : AFArray) : AFArray {.importcpp: "(# >= #)", header: "arrayfire.h".} 634 | proc `>=`*(lhs : uint32, rhs : AFArray) : AFArray {.importcpp: "(# >= #)", header: "arrayfire.h".} 635 | proc `>=`*(lhs : cstring, rhs : AFArray) : AFArray {.importcpp: "(# >= #)", header: "arrayfire.h".} 636 | proc `>=`*(lhs : int64, rhs : AFArray) : AFArray {.importcpp: "(# >= #)", header: "arrayfire.h".} 637 | proc `>=`*(lhs : uint64, rhs : AFArray) : AFArray {.importcpp: "(# >= #)", header: "arrayfire.h".} 638 | proc `>=`*(lhs : float64, rhs : AFArray) : AFArray {.importcpp: "(# >= #)", header: "arrayfire.h".} 639 | proc `>=`*(lhs : float32, rhs : AFArray) : AFArray {.importcpp: "(# >= #)", header: "arrayfire.h".} 640 | proc `>=`*(lhs : AFArray, rhs : bool) : AFArray {.importcpp: "(# >= #)", header: "arrayfire.h".} 641 | proc `>=`*(lhs : AFArray, rhs : int32) : AFArray {.importcpp: "(# >= #)", header: "arrayfire.h".} 642 | proc `>=`*(lhs : AFArray, rhs : uint32) : AFArray {.importcpp: "(# >= #)", header: "arrayfire.h".} 643 | proc `>=`*(lhs : AFArray, rhs : cstring) : AFArray {.importcpp: "(# >= #)", header: "arrayfire.h".} 644 | proc `>=`*(lhs : AFArray, rhs : int64) : AFArray {.importcpp: "(# >= #)", header: "arrayfire.h".} 645 | proc `>=`*(lhs : AFArray, rhs : uint64) : AFArray {.importcpp: "(# >= #)", header: "arrayfire.h".} 646 | proc `>=`*(lhs : AFArray, rhs : float64) : AFArray {.importcpp: "(# >= #)", header: "arrayfire.h".} 647 | proc `>=`*(lhs : AFArray, rhs : float32) : AFArray {.importcpp: "(# >= #)", header: "arrayfire.h".} 648 | proc `>=`*(lhs : int16, rhs : AFArray) : AFArray {.importcpp: "(# >= #)", header: "arrayfire.h".} 649 | proc `>=`*(lhs : uint16, rhs : AFArray) : AFArray {.importcpp: "(# >= #)", header: "arrayfire.h".} 650 | proc `>=`*(lhs : AFArray, rhs : int16) : AFArray {.importcpp: "(# >= #)", header: "arrayfire.h".} 651 | proc `>=`*(lhs : AFArray, rhs : uint16) : AFArray {.importcpp: "(# >= #)", header: "arrayfire.h".} 652 | proc `||`*(lhs : AFArray, rhs : AFArray) : AFArray {.importcpp: "(# || #)", header: "arrayfire.h".} 653 | proc `||`*(lhs : bool, rhs : AFArray) : AFArray {.importcpp: "(# || #)", header: "arrayfire.h".} 654 | proc `||`*(lhs : int32, rhs : AFArray) : AFArray {.importcpp: "(# || #)", header: "arrayfire.h".} 655 | proc `||`*(lhs : uint32, rhs : AFArray) : AFArray {.importcpp: "(# || #)", header: "arrayfire.h".} 656 | proc `||`*(lhs : cstring, rhs : AFArray) : AFArray {.importcpp: "(# || #)", header: "arrayfire.h".} 657 | proc `||`*(lhs : int64, rhs : AFArray) : AFArray {.importcpp: "(# || #)", header: "arrayfire.h".} 658 | proc `||`*(lhs : uint64, rhs : AFArray) : AFArray {.importcpp: "(# || #)", header: "arrayfire.h".} 659 | proc `||`*(lhs : float64, rhs : AFArray) : AFArray {.importcpp: "(# || #)", header: "arrayfire.h".} 660 | proc `||`*(lhs : float32, rhs : AFArray) : AFArray {.importcpp: "(# || #)", header: "arrayfire.h".} 661 | proc `||`*(lhs : AFArray, rhs : bool) : AFArray {.importcpp: "(# || #)", header: "arrayfire.h".} 662 | proc `||`*(lhs : AFArray, rhs : int32) : AFArray {.importcpp: "(# || #)", header: "arrayfire.h".} 663 | proc `||`*(lhs : AFArray, rhs : uint32) : AFArray {.importcpp: "(# || #)", header: "arrayfire.h".} 664 | proc `||`*(lhs : AFArray, rhs : cstring) : AFArray {.importcpp: "(# || #)", header: "arrayfire.h".} 665 | proc `||`*(lhs : AFArray, rhs : int64) : AFArray {.importcpp: "(# || #)", header: "arrayfire.h".} 666 | proc `||`*(lhs : AFArray, rhs : uint64) : AFArray {.importcpp: "(# || #)", header: "arrayfire.h".} 667 | proc `||`*(lhs : AFArray, rhs : float64) : AFArray {.importcpp: "(# || #)", header: "arrayfire.h".} 668 | proc `||`*(lhs : AFArray, rhs : float32) : AFArray {.importcpp: "(# || #)", header: "arrayfire.h".} 669 | proc `||`*(lhs : int16, rhs : AFArray) : AFArray {.importcpp: "(# || #)", header: "arrayfire.h".} 670 | proc `||`*(lhs : uint16, rhs : AFArray) : AFArray {.importcpp: "(# || #)", header: "arrayfire.h".} 671 | proc `||`*(lhs : AFArray, rhs : int16) : AFArray {.importcpp: "(# || #)", header: "arrayfire.h".} 672 | proc `||`*(lhs : AFArray, rhs : uint16) : AFArray {.importcpp: "(# || #)", header: "arrayfire.h".} 673 | proc `%`*(lhs : AFArray, rhs : AFArray) : AFArray {.importcpp: "(# % #)", header: "arrayfire.h".} 674 | proc `%`*(lhs : bool, rhs : AFArray) : AFArray {.importcpp: "(# % #)", header: "arrayfire.h".} 675 | proc `%`*(lhs : int32, rhs : AFArray) : AFArray {.importcpp: "(# % #)", header: "arrayfire.h".} 676 | proc `%`*(lhs : uint32, rhs : AFArray) : AFArray {.importcpp: "(# % #)", header: "arrayfire.h".} 677 | proc `%`*(lhs : cstring, rhs : AFArray) : AFArray {.importcpp: "(# % #)", header: "arrayfire.h".} 678 | proc `%`*(lhs : int64, rhs : AFArray) : AFArray {.importcpp: "(# % #)", header: "arrayfire.h".} 679 | proc `%`*(lhs : uint64, rhs : AFArray) : AFArray {.importcpp: "(# % #)", header: "arrayfire.h".} 680 | proc `%`*(lhs : float64, rhs : AFArray) : AFArray {.importcpp: "(# % #)", header: "arrayfire.h".} 681 | proc `%`*(lhs : float32, rhs : AFArray) : AFArray {.importcpp: "(# % #)", header: "arrayfire.h".} 682 | proc `%`*(lhs : AFArray, rhs : bool) : AFArray {.importcpp: "(# % #)", header: "arrayfire.h".} 683 | proc `%`*(lhs : AFArray, rhs : int32) : AFArray {.importcpp: "(# % #)", header: "arrayfire.h".} 684 | proc `%`*(lhs : AFArray, rhs : uint32) : AFArray {.importcpp: "(# % #)", header: "arrayfire.h".} 685 | proc `%`*(lhs : AFArray, rhs : cstring) : AFArray {.importcpp: "(# % #)", header: "arrayfire.h".} 686 | proc `%`*(lhs : AFArray, rhs : int64) : AFArray {.importcpp: "(# % #)", header: "arrayfire.h".} 687 | proc `%`*(lhs : AFArray, rhs : uint64) : AFArray {.importcpp: "(# % #)", header: "arrayfire.h".} 688 | proc `%`*(lhs : AFArray, rhs : float64) : AFArray {.importcpp: "(# % #)", header: "arrayfire.h".} 689 | proc `%`*(lhs : AFArray, rhs : float32) : AFArray {.importcpp: "(# % #)", header: "arrayfire.h".} 690 | proc `%`*(lhs : int16, rhs : AFArray) : AFArray {.importcpp: "(# % #)", header: "arrayfire.h".} 691 | proc `%`*(lhs : uint16, rhs : AFArray) : AFArray {.importcpp: "(# % #)", header: "arrayfire.h".} 692 | proc `%`*(lhs : AFArray, rhs : int16) : AFArray {.importcpp: "(# % #)", header: "arrayfire.h".} 693 | proc `%`*(lhs : AFArray, rhs : uint16) : AFArray {.importcpp: "(# % #)", header: "arrayfire.h".} 694 | proc `|`*(lhs : AFArray, rhs : AFArray) : AFArray {.importcpp: "(# | #)", header: "arrayfire.h".} 695 | proc `|`*(lhs : bool, rhs : AFArray) : AFArray {.importcpp: "(# | #)", header: "arrayfire.h".} 696 | proc `|`*(lhs : int32, rhs : AFArray) : AFArray {.importcpp: "(# | #)", header: "arrayfire.h".} 697 | proc `|`*(lhs : uint32, rhs : AFArray) : AFArray {.importcpp: "(# | #)", header: "arrayfire.h".} 698 | proc `|`*(lhs : cstring, rhs : AFArray) : AFArray {.importcpp: "(# | #)", header: "arrayfire.h".} 699 | proc `|`*(lhs : int64, rhs : AFArray) : AFArray {.importcpp: "(# | #)", header: "arrayfire.h".} 700 | proc `|`*(lhs : uint64, rhs : AFArray) : AFArray {.importcpp: "(# | #)", header: "arrayfire.h".} 701 | proc `|`*(lhs : float64, rhs : AFArray) : AFArray {.importcpp: "(# | #)", header: "arrayfire.h".} 702 | proc `|`*(lhs : float32, rhs : AFArray) : AFArray {.importcpp: "(# | #)", header: "arrayfire.h".} 703 | proc `|`*(lhs : AFArray, rhs : bool) : AFArray {.importcpp: "(# | #)", header: "arrayfire.h".} 704 | proc `|`*(lhs : AFArray, rhs : int32) : AFArray {.importcpp: "(# | #)", header: "arrayfire.h".} 705 | proc `|`*(lhs : AFArray, rhs : uint32) : AFArray {.importcpp: "(# | #)", header: "arrayfire.h".} 706 | proc `|`*(lhs : AFArray, rhs : cstring) : AFArray {.importcpp: "(# | #)", header: "arrayfire.h".} 707 | proc `|`*(lhs : AFArray, rhs : int64) : AFArray {.importcpp: "(# | #)", header: "arrayfire.h".} 708 | proc `|`*(lhs : AFArray, rhs : uint64) : AFArray {.importcpp: "(# | #)", header: "arrayfire.h".} 709 | proc `|`*(lhs : AFArray, rhs : float64) : AFArray {.importcpp: "(# | #)", header: "arrayfire.h".} 710 | proc `|`*(lhs : AFArray, rhs : float32) : AFArray {.importcpp: "(# | #)", header: "arrayfire.h".} 711 | proc `|`*(lhs : int16, rhs : AFArray) : AFArray {.importcpp: "(# | #)", header: "arrayfire.h".} 712 | proc `|`*(lhs : uint16, rhs : AFArray) : AFArray {.importcpp: "(# | #)", header: "arrayfire.h".} 713 | proc `|`*(lhs : AFArray, rhs : int16) : AFArray {.importcpp: "(# | #)", header: "arrayfire.h".} 714 | proc `|`*(lhs : AFArray, rhs : uint16) : AFArray {.importcpp: "(# | #)", header: "arrayfire.h".} 715 | proc `^`*(lhs : AFArray, rhs : AFArray) : AFArray {.importcpp: "(# ^ #)", header: "arrayfire.h".} 716 | proc `^`*(lhs : bool, rhs : AFArray) : AFArray {.importcpp: "(# ^ #)", header: "arrayfire.h".} 717 | proc `^`*(lhs : int32, rhs : AFArray) : AFArray {.importcpp: "(# ^ #)", header: "arrayfire.h".} 718 | proc `^`*(lhs : uint32, rhs : AFArray) : AFArray {.importcpp: "(# ^ #)", header: "arrayfire.h".} 719 | proc `^`*(lhs : cstring, rhs : AFArray) : AFArray {.importcpp: "(# ^ #)", header: "arrayfire.h".} 720 | proc `^`*(lhs : int64, rhs : AFArray) : AFArray {.importcpp: "(# ^ #)", header: "arrayfire.h".} 721 | proc `^`*(lhs : uint64, rhs : AFArray) : AFArray {.importcpp: "(# ^ #)", header: "arrayfire.h".} 722 | proc `^`*(lhs : float64, rhs : AFArray) : AFArray {.importcpp: "(# ^ #)", header: "arrayfire.h".} 723 | proc `^`*(lhs : float32, rhs : AFArray) : AFArray {.importcpp: "(# ^ #)", header: "arrayfire.h".} 724 | proc `^`*(lhs : AFArray, rhs : bool) : AFArray {.importcpp: "(# ^ #)", header: "arrayfire.h".} 725 | proc `^`*(lhs : AFArray, rhs : int32) : AFArray {.importcpp: "(# ^ #)", header: "arrayfire.h".} 726 | proc `^`*(lhs : AFArray, rhs : uint32) : AFArray {.importcpp: "(# ^ #)", header: "arrayfire.h".} 727 | proc `^`*(lhs : AFArray, rhs : cstring) : AFArray {.importcpp: "(# ^ #)", header: "arrayfire.h".} 728 | proc `^`*(lhs : AFArray, rhs : int64) : AFArray {.importcpp: "(# ^ #)", header: "arrayfire.h".} 729 | proc `^`*(lhs : AFArray, rhs : uint64) : AFArray {.importcpp: "(# ^ #)", header: "arrayfire.h".} 730 | proc `^`*(lhs : AFArray, rhs : float64) : AFArray {.importcpp: "(# ^ #)", header: "arrayfire.h".} 731 | proc `^`*(lhs : AFArray, rhs : float32) : AFArray {.importcpp: "(# ^ #)", header: "arrayfire.h".} 732 | proc `^`*(lhs : int16, rhs : AFArray) : AFArray {.importcpp: "(# ^ #)", header: "arrayfire.h".} 733 | proc `^`*(lhs : uint16, rhs : AFArray) : AFArray {.importcpp: "(# ^ #)", header: "arrayfire.h".} 734 | proc `^`*(lhs : AFArray, rhs : int16) : AFArray {.importcpp: "(# ^ #)", header: "arrayfire.h".} 735 | proc `^`*(lhs : AFArray, rhs : uint16) : AFArray {.importcpp: "(# ^ #)", header: "arrayfire.h".} 736 | proc `<<`*(lhs : AFArray, rhs : AFArray) : AFArray {.importcpp: "(# << #)", header: "arrayfire.h".} 737 | proc `<<`*(lhs : bool, rhs : AFArray) : AFArray {.importcpp: "(# << #)", header: "arrayfire.h".} 738 | proc `<<`*(lhs : int32, rhs : AFArray) : AFArray {.importcpp: "(# << #)", header: "arrayfire.h".} 739 | proc `<<`*(lhs : uint32, rhs : AFArray) : AFArray {.importcpp: "(# << #)", header: "arrayfire.h".} 740 | proc `<<`*(lhs : cstring, rhs : AFArray) : AFArray {.importcpp: "(# << #)", header: "arrayfire.h".} 741 | proc `<<`*(lhs : int64, rhs : AFArray) : AFArray {.importcpp: "(# << #)", header: "arrayfire.h".} 742 | proc `<<`*(lhs : uint64, rhs : AFArray) : AFArray {.importcpp: "(# << #)", header: "arrayfire.h".} 743 | proc `<<`*(lhs : float64, rhs : AFArray) : AFArray {.importcpp: "(# << #)", header: "arrayfire.h".} 744 | proc `<<`*(lhs : float32, rhs : AFArray) : AFArray {.importcpp: "(# << #)", header: "arrayfire.h".} 745 | proc `<<`*(lhs : AFArray, rhs : bool) : AFArray {.importcpp: "(# << #)", header: "arrayfire.h".} 746 | proc `<<`*(lhs : AFArray, rhs : int32) : AFArray {.importcpp: "(# << #)", header: "arrayfire.h".} 747 | proc `<<`*(lhs : AFArray, rhs : uint32) : AFArray {.importcpp: "(# << #)", header: "arrayfire.h".} 748 | proc `<<`*(lhs : AFArray, rhs : cstring) : AFArray {.importcpp: "(# << #)", header: "arrayfire.h".} 749 | proc `<<`*(lhs : AFArray, rhs : int64) : AFArray {.importcpp: "(# << #)", header: "arrayfire.h".} 750 | proc `<<`*(lhs : AFArray, rhs : uint64) : AFArray {.importcpp: "(# << #)", header: "arrayfire.h".} 751 | proc `<<`*(lhs : AFArray, rhs : float64) : AFArray {.importcpp: "(# << #)", header: "arrayfire.h".} 752 | proc `<<`*(lhs : AFArray, rhs : float32) : AFArray {.importcpp: "(# << #)", header: "arrayfire.h".} 753 | proc `<<`*(lhs : int16, rhs : AFArray) : AFArray {.importcpp: "(# << #)", header: "arrayfire.h".} 754 | proc `<<`*(lhs : uint16, rhs : AFArray) : AFArray {.importcpp: "(# << #)", header: "arrayfire.h".} 755 | proc `<<`*(lhs : AFArray, rhs : int16) : AFArray {.importcpp: "(# << #)", header: "arrayfire.h".} 756 | proc `<<`*(lhs : AFArray, rhs : uint16) : AFArray {.importcpp: "(# << #)", header: "arrayfire.h".} 757 | proc `>>`*(lhs : AFArray, rhs : AFArray) : AFArray {.importcpp: "(# >> #)", header: "arrayfire.h".} 758 | proc `>>`*(lhs : bool, rhs : AFArray) : AFArray {.importcpp: "(# >> #)", header: "arrayfire.h".} 759 | proc `>>`*(lhs : int32, rhs : AFArray) : AFArray {.importcpp: "(# >> #)", header: "arrayfire.h".} 760 | proc `>>`*(lhs : uint32, rhs : AFArray) : AFArray {.importcpp: "(# >> #)", header: "arrayfire.h".} 761 | proc `>>`*(lhs : cstring, rhs : AFArray) : AFArray {.importcpp: "(# >> #)", header: "arrayfire.h".} 762 | proc `>>`*(lhs : int64, rhs : AFArray) : AFArray {.importcpp: "(# >> #)", header: "arrayfire.h".} 763 | proc `>>`*(lhs : uint64, rhs : AFArray) : AFArray {.importcpp: "(# >> #)", header: "arrayfire.h".} 764 | proc `>>`*(lhs : float64, rhs : AFArray) : AFArray {.importcpp: "(# >> #)", header: "arrayfire.h".} 765 | proc `>>`*(lhs : float32, rhs : AFArray) : AFArray {.importcpp: "(# >> #)", header: "arrayfire.h".} 766 | proc `>>`*(lhs : AFArray, rhs : bool) : AFArray {.importcpp: "(# >> #)", header: "arrayfire.h".} 767 | proc `>>`*(lhs : AFArray, rhs : int32) : AFArray {.importcpp: "(# >> #)", header: "arrayfire.h".} 768 | proc `>>`*(lhs : AFArray, rhs : uint32) : AFArray {.importcpp: "(# >> #)", header: "arrayfire.h".} 769 | proc `>>`*(lhs : AFArray, rhs : cstring) : AFArray {.importcpp: "(# >> #)", header: "arrayfire.h".} 770 | proc `>>`*(lhs : AFArray, rhs : int64) : AFArray {.importcpp: "(# >> #)", header: "arrayfire.h".} 771 | proc `>>`*(lhs : AFArray, rhs : uint64) : AFArray {.importcpp: "(# >> #)", header: "arrayfire.h".} 772 | proc `>>`*(lhs : AFArray, rhs : float64) : AFArray {.importcpp: "(# >> #)", header: "arrayfire.h".} 773 | proc `>>`*(lhs : AFArray, rhs : float32) : AFArray {.importcpp: "(# >> #)", header: "arrayfire.h".} 774 | proc `>>`*(lhs : int16, rhs : AFArray) : AFArray {.importcpp: "(# >> #)", header: "arrayfire.h".} 775 | proc `>>`*(lhs : uint16, rhs : AFArray) : AFArray {.importcpp: "(# >> #)", header: "arrayfire.h".} 776 | proc `>>`*(lhs : AFArray, rhs : int16) : AFArray {.importcpp: "(# >> #)", header: "arrayfire.h".} 777 | proc `>>`*(lhs : AFArray, rhs : uint16) : AFArray {.importcpp: "(# >> #)", header: "arrayfire.h".} 778 | proc `&`*(lhs : AFArray, rhs : AFArray) : AFArray {.importcpp: "(# & #)", header: "arrayfire.h".} 779 | proc `&`*(lhs : AFArray, rhs : bool) : AFArray {.importcpp: "(# & #)", header: "arrayfire.h".} 780 | proc `&`*(lhs : AFArray, rhs : float64) : AFArray {.importcpp: "(# & #)", header: "arrayfire.h".} 781 | proc `&`*(lhs : AFArray, rhs : float32) : AFArray {.importcpp: "(# & #)", header: "arrayfire.h".} 782 | proc `&`*(lhs : AFArray, rhs : cstring) : AFArray {.importcpp: "(# & #)", header: "arrayfire.h".} 783 | proc `&`*(lhs : AFArray, rhs : int32) : AFArray {.importcpp: "(# & #)", header: "arrayfire.h".} 784 | proc `&`*(lhs : AFArray, rhs : int64) : AFArray {.importcpp: "(# & #)", header: "arrayfire.h".} 785 | proc `&`*(lhs : AFArray, rhs : int16) : AFArray {.importcpp: "(# & #)", header: "arrayfire.h".} 786 | proc `&`*(lhs : AFArray, rhs : uint64) : AFArray {.importcpp: "(# & #)", header: "arrayfire.h".} 787 | proc `&`*(lhs : AFArray, rhs : uint32) : AFArray {.importcpp: "(# & #)", header: "arrayfire.h".} 788 | proc `&`*(lhs : AFArray, rhs : uint16) : AFArray {.importcpp: "(# & #)", header: "arrayfire.h".} 789 | proc `&`*(lhs : bool, rhs : AFArray) : AFArray {.importcpp: "(# & #)", header: "arrayfire.h".} 790 | proc `&`*(lhs : float64, rhs : AFArray) : AFArray {.importcpp: "(# & #)", header: "arrayfire.h".} 791 | proc `&`*(lhs : float32, rhs : AFArray) : AFArray {.importcpp: "(# & #)", header: "arrayfire.h".} 792 | proc `&`*(lhs : cstring, rhs : AFArray) : AFArray {.importcpp: "(# & #)", header: "arrayfire.h".} 793 | proc `&`*(lhs : int32, rhs : AFArray) : AFArray {.importcpp: "(# & #)", header: "arrayfire.h".} 794 | proc `&`*(lhs : int64, rhs : AFArray) : AFArray {.importcpp: "(# & #)", header: "arrayfire.h".} 795 | proc `&`*(lhs : int16, rhs : AFArray) : AFArray {.importcpp: "(# & #)", header: "arrayfire.h".} 796 | proc `&`*(lhs : uint64, rhs : AFArray) : AFArray {.importcpp: "(# & #)", header: "arrayfire.h".} 797 | proc `&`*(lhs : uint32, rhs : AFArray) : AFArray {.importcpp: "(# & #)", header: "arrayfire.h".} 798 | proc `&`*(lhs : uint16, rhs : AFArray) : AFArray {.importcpp: "(# & #)", header: "arrayfire.h".} 799 | proc `&&`*(lhs : AFArray, rhs : AFArray) : AFArray {.importcpp: "(# && #)", header: "arrayfire.h".} 800 | proc `&&`*(lhs : AFArray, rhs : bool) : AFArray {.importcpp: "(# && #)", header: "arrayfire.h".} 801 | proc `&&`*(lhs : AFArray, rhs : float64) : AFArray {.importcpp: "(# && #)", header: "arrayfire.h".} 802 | proc `&&`*(lhs : AFArray, rhs : float32) : AFArray {.importcpp: "(# && #)", header: "arrayfire.h".} 803 | proc `&&`*(lhs : AFArray, rhs : cstring) : AFArray {.importcpp: "(# && #)", header: "arrayfire.h".} 804 | proc `&&`*(lhs : AFArray, rhs : int32) : AFArray {.importcpp: "(# && #)", header: "arrayfire.h".} 805 | proc `&&`*(lhs : AFArray, rhs : int64) : AFArray {.importcpp: "(# && #)", header: "arrayfire.h".} 806 | proc `&&`*(lhs : AFArray, rhs : int16) : AFArray {.importcpp: "(# && #)", header: "arrayfire.h".} 807 | proc `&&`*(lhs : AFArray, rhs : uint64) : AFArray {.importcpp: "(# && #)", header: "arrayfire.h".} 808 | proc `&&`*(lhs : AFArray, rhs : uint32) : AFArray {.importcpp: "(# && #)", header: "arrayfire.h".} 809 | proc `&&`*(lhs : AFArray, rhs : uint16) : AFArray {.importcpp: "(# && #)", header: "arrayfire.h".} 810 | proc `&&`*(lhs : bool, rhs : AFArray) : AFArray {.importcpp: "(# && #)", header: "arrayfire.h".} 811 | proc `&&`*(lhs : float64, rhs : AFArray) : AFArray {.importcpp: "(# && #)", header: "arrayfire.h".} 812 | proc `&&`*(lhs : float32, rhs : AFArray) : AFArray {.importcpp: "(# && #)", header: "arrayfire.h".} 813 | proc `&&`*(lhs : cstring, rhs : AFArray) : AFArray {.importcpp: "(# && #)", header: "arrayfire.h".} 814 | proc `&&`*(lhs : int32, rhs : AFArray) : AFArray {.importcpp: "(# && #)", header: "arrayfire.h".} 815 | proc `&&`*(lhs : int64, rhs : AFArray) : AFArray {.importcpp: "(# && #)", header: "arrayfire.h".} 816 | proc `&&`*(lhs : int16, rhs : AFArray) : AFArray {.importcpp: "(# && #)", header: "arrayfire.h".} 817 | proc `&&`*(lhs : uint64, rhs : AFArray) : AFArray {.importcpp: "(# && #)", header: "arrayfire.h".} 818 | proc `&&`*(lhs : uint32, rhs : AFArray) : AFArray {.importcpp: "(# && #)", header: "arrayfire.h".} 819 | proc `&&`*(lhs : uint16, rhs : AFArray) : AFArray {.importcpp: "(# && #)", header: "arrayfire.h".} 820 | proc eval*( num : int32, arrays : AFArray ) {.importcpp: "af::eval(@)", header: "arrayfire.h".} 821 | proc eval*( a : AFArray, b : AFArray ) {.importcpp: "af::eval(@)", header: "arrayfire.h".} 822 | proc eval*( a : AFArray, b : AFArray, c : AFArray ) {.importcpp: "af::eval(@)", header: "arrayfire.h".} 823 | proc eval*( a : AFArray, b : AFArray, c : AFArray, d : AFArray ) {.importcpp: "af::eval(@)", header: "arrayfire.h".} 824 | proc eval*( a : AFArray, b : AFArray, c : AFArray, d : AFArray, e : AFArray ) {.importcpp: "af::eval(@)", header: "arrayfire.h".} 825 | proc eval*( a : AFArray, b : AFArray, c : AFArray, d : AFArray, e : AFArray, f : AFArray ) {.importcpp: "af::eval(@)", header: "arrayfire.h".} 826 | proc setManualEvalFlag*( flag : bool ) {.importcpp: "af::setManualEvalFlag(@)", header: "arrayfire.h".} 827 | proc getManualEvalFlag*( ) : bool {.importcpp: "af::getManualEvalFlag(@)", header: "arrayfire.h".} 828 | proc setBackend*( bknd : Backend ) {.importcpp: "af::setBackend(@)", header: "arrayfire.h".} 829 | proc getBackendCount*( ) : uint32 {.importcpp: "af::getBackendCount(@)", header: "arrayfire.h".} 830 | proc getAvailableBackends*( ) : int32 {.importcpp: "af::getAvailableBackends(@)", header: "arrayfire.h".} 831 | proc getBackendId*( af_in : AFArray ) : Backend {.importcpp: "af::getBackendId(@)", header: "arrayfire.h".} 832 | proc getActiveBackend*( ) : Backend {.importcpp: "af::getActiveBackend(@)", header: "arrayfire.h".} 833 | proc getDeviceId*( af_in : AFArray ) : int32 {.importcpp: "af::getDeviceId(@)", header: "arrayfire.h".} 834 | proc matmul*( lhs : AFArray, rhs : AFArray, optLhs : MatProp, optRhs : MatProp ) : AFArray {.importcpp: "af::matmul(@)", header: "arrayfire.h".} 835 | proc matmulNT*( lhs : AFArray, rhs : AFArray ) : AFArray {.importcpp: "af::matmulNT(@)", header: "arrayfire.h".} 836 | proc matmulTN*( lhs : AFArray, rhs : AFArray ) : AFArray {.importcpp: "af::matmulTN(@)", header: "arrayfire.h".} 837 | proc matmulTT*( lhs : AFArray, rhs : AFArray ) : AFArray {.importcpp: "af::matmulTT(@)", header: "arrayfire.h".} 838 | proc matmul*( a : AFArray, b : AFArray, c : AFArray ) : AFArray {.importcpp: "af::matmul(@)", header: "arrayfire.h".} 839 | proc matmul*( a : AFArray, b : AFArray, c : AFArray, d : AFArray ) : AFArray {.importcpp: "af::matmul(@)", header: "arrayfire.h".} 840 | proc dot*( lhs : AFArray, rhs : AFArray, optLhs : MatProp, optRhs : MatProp ) : AFArray {.importcpp: "af::dot(@)", header: "arrayfire.h".} 841 | proc transpose*( af_in : AFArray, conjugate : bool ) : AFArray {.importcpp: "af::transpose(@)", header: "arrayfire.h".} 842 | proc transposeInPlace*( af_in : AFArray, conjugate : bool ) {.importcpp: "af::transposeInPlace(@)", header: "arrayfire.h".} 843 | proc identity*( dims : Dim4, ty : Dtype ) : AFArray {.importcpp: "af::identity(@)", header: "arrayfire.h".} 844 | proc identity*( d0 : DimT, ty : Dtype ) : AFArray {.importcpp: "af::identity(@)", header: "arrayfire.h".} 845 | proc identity*( d0 : DimT, d1 : DimT, ty : Dtype ) : AFArray {.importcpp: "af::identity(@)", header: "arrayfire.h".} 846 | proc identity*( d0 : DimT, d1 : DimT, d2 : DimT, ty : Dtype ) : AFArray {.importcpp: "af::identity(@)", header: "arrayfire.h".} 847 | proc identity*( d0 : DimT, d1 : DimT, d2 : DimT, d3 : DimT, ty : Dtype ) : AFArray {.importcpp: "af::identity(@)", header: "arrayfire.h".} 848 | proc range*( dims : Dim4, seq_dim : int32, ty : Dtype ) : AFArray {.importcpp: "af::range(@)", header: "arrayfire.h".} 849 | proc range*( d0 : DimT, d1 : DimT, d2 : DimT, d3 : DimT, seq_dim : int32, ty : Dtype ) : AFArray {.importcpp: "af::range(@)", header: "arrayfire.h".} 850 | proc iota*( dims : Dim4, tile_dims : Dim4, ty : Dtype ) : AFArray {.importcpp: "af::iota(@)", header: "arrayfire.h".} 851 | proc diag*( af_in : AFArray, num : int32, extract : bool ) : AFArray {.importcpp: "af::diag(@)", header: "arrayfire.h".} 852 | proc join*( dim : int32, first : AFArray, second : AFArray ) : AFArray {.importcpp: "af::join(@)", header: "arrayfire.h".} 853 | proc join*( dim : int32, first : AFArray, second : AFArray, third : AFArray ) : AFArray {.importcpp: "af::join(@)", header: "arrayfire.h".} 854 | proc join*( dim : int32, first : AFArray, second : AFArray, third : AFArray, fourth : AFArray ) : AFArray {.importcpp: "af::join(@)", header: "arrayfire.h".} 855 | proc reorder*( af_in : AFArray, x : uint32, y : uint32, z : uint32, w : uint32 ) : AFArray {.importcpp: "af::reorder(@)", header: "arrayfire.h".} 856 | proc shift*( af_in : AFArray, x : int32, y : int32, z : int32, w : int32 ) : AFArray {.importcpp: "af::shift(@)", header: "arrayfire.h".} 857 | proc moddims*( af_in : AFArray, dims : Dim4 ) : AFArray {.importcpp: "af::moddims(@)", header: "arrayfire.h".} 858 | proc moddims*( af_in : AFArray, d0 : DimT, d1 : DimT, d2 : DimT, d3 : DimT ) : AFArray {.importcpp: "af::moddims(@)", header: "arrayfire.h".} 859 | proc moddims*( af_in : AFArray, ndims : uint32, dims : DimT ) : AFArray {.importcpp: "af::moddims(@)", header: "arrayfire.h".} 860 | proc flat*( af_in : AFArray ) : AFArray {.importcpp: "af::flat(@)", header: "arrayfire.h".} 861 | proc flip*( af_in : AFArray, dim : uint32 ) : AFArray {.importcpp: "af::flip(@)", header: "arrayfire.h".} 862 | proc lower*( af_in : AFArray, is_unit_diag : bool ) : AFArray {.importcpp: "af::lower(@)", header: "arrayfire.h".} 863 | proc upper*( af_in : AFArray, is_unit_diag : bool ) : AFArray {.importcpp: "af::upper(@)", header: "arrayfire.h".} 864 | proc select*( cond : AFArray, a : AFArray, b : AFArray ) : AFArray {.importcpp: "af::select(@)", header: "arrayfire.h".} 865 | proc select*( cond : AFArray, a : AFArray, b : float64 ) : AFArray {.importcpp: "af::select(@)", header: "arrayfire.h".} 866 | proc select*( cond : AFArray, a : float64, b : AFArray ) : AFArray {.importcpp: "af::select(@)", header: "arrayfire.h".} 867 | proc replace*( a : AFArray, cond : AFArray, b : AFArray ) {.importcpp: "af::replace(@)", header: "arrayfire.h".} 868 | proc replace*( a : AFArray, cond : AFArray, b : float64 ) {.importcpp: "af::replace(@)", header: "arrayfire.h".} 869 | proc pad*( af_in : AFArray, beginPadding : Dim4, endPadding : Dim4, padFillType : BorderType ) : AFArray {.importcpp: "af::pad(@)", header: "arrayfire.h".} 870 | proc gforToggle*( ) : bool {.importcpp: "af::gforToggle(@)", header: "arrayfire.h".} 871 | proc gforGet*( ) : bool {.importcpp: "af::gforGet(@)", header: "arrayfire.h".} 872 | proc gforSet*( val : bool ) {.importcpp: "af::gforSet(@)", header: "arrayfire.h".} 873 | proc grad*( dx : AFArray, dy : AFArray, af_in : AFArray ) {.importcpp: "af::grad(@)", header: "arrayfire.h".} 874 | proc loadImageMem*( af_ptr : pointer ) : AFArray {.importcpp: "af::loadImageMem(@)", header: "arrayfire.h".} 875 | proc saveImageMem*( af_in : AFArray, format : ImageFormat ) {.importcpp: "af::saveImageMem(@)", header: "arrayfire.h".} 876 | proc deleteImageMem*( af_ptr : pointer ) {.importcpp: "af::deleteImageMem(@)", header: "arrayfire.h".} 877 | proc loadImageNative*( filename : cstring ) : AFArray {.importcpp: "af::loadImageNative(@)", header: "arrayfire.h".} 878 | proc saveImageNative*( filename : cstring, af_in : AFArray ) {.importcpp: "af::saveImageNative(@)", header: "arrayfire.h".} 879 | proc isImageIOAvailable*( ) : bool {.importcpp: "af::isImageIOAvailable(@)", header: "arrayfire.h".} 880 | proc resize*( af_in : AFArray, odim0 : DimT, odim1 : DimT, af_mathod : InterpType ) : AFArray {.importcpp: "af::resize(@)", header: "arrayfire.h".} 881 | proc resize*( scale0 : float32, scale1 : float32, af_in : AFArray, af_mathod : InterpType ) : AFArray {.importcpp: "af::resize(@)", header: "arrayfire.h".} 882 | proc resize*( scale : float32, af_in : AFArray, af_mathod : InterpType ) : AFArray {.importcpp: "af::resize(@)", header: "arrayfire.h".} 883 | proc rotate*( af_in : AFArray, theta : float32, crop : bool, af_mathod : InterpType ) : AFArray {.importcpp: "af::rotate(@)", header: "arrayfire.h".} 884 | proc transform*( af_in : AFArray, transform : AFArray, odim0 : DimT, odim1 : DimT, af_mathod : InterpType, inverse : bool ) : AFArray {.importcpp: "af::transform(@)", header: "arrayfire.h".} 885 | proc transformCoordinates*( tf : AFArray, d0 : float32, d1 : float32 ) : AFArray {.importcpp: "af::transformCoordinates(@)", header: "arrayfire.h".} 886 | proc translate*( af_in : AFArray, trans0 : float32, trans1 : float32, odim0 : DimT, odim1 : DimT, af_mathod : InterpType ) : AFArray {.importcpp: "af::translate(@)", header: "arrayfire.h".} 887 | proc scale*( af_in : AFArray, scale0 : float32, scale1 : float32, odim0 : DimT, odim1 : DimT, af_mathod : InterpType ) : AFArray {.importcpp: "af::scale(@)", header: "arrayfire.h".} 888 | proc skew*( af_in : AFArray, skew0 : float32, skew1 : float32, odim0 : DimT, odim1 : DimT, inverse : bool, af_mathod : InterpType ) : AFArray {.importcpp: "af::skew(@)", header: "arrayfire.h".} 889 | proc bilateral*( af_in : AFArray, spatial_sigma : float32, chromatic_sigma : float32, is_color : bool ) : AFArray {.importcpp: "af::bilateral(@)", header: "arrayfire.h".} 890 | proc histogram*( af_in : AFArray, nbins : uint32, minval : float64, maxval : float64 ) : AFArray {.importcpp: "af::histogram(@)", header: "arrayfire.h".} 891 | proc histogram*( af_in : AFArray, nbins : uint32 ) : AFArray {.importcpp: "af::histogram(@)", header: "arrayfire.h".} 892 | proc meanShift*( af_in : AFArray, spatial_sigma : float32, chromatic_sigma : float32, iter : uint32, is_color : bool ) : AFArray {.importcpp: "af::meanShift(@)", header: "arrayfire.h".} 893 | proc minfilt*( af_in : AFArray, wind_length : DimT, wind_width : DimT, edge_pad : BorderType ) : AFArray {.importcpp: "af::minfilt(@)", header: "arrayfire.h".} 894 | proc maxfilt*( af_in : AFArray, wind_length : DimT, wind_width : DimT, edge_pad : BorderType ) : AFArray {.importcpp: "af::maxfilt(@)", header: "arrayfire.h".} 895 | proc dilate*( af_in : AFArray, mask : AFArray ) : AFArray {.importcpp: "af::dilate(@)", header: "arrayfire.h".} 896 | proc dilate3*( af_in : AFArray, mask : AFArray ) : AFArray {.importcpp: "af::dilate3(@)", header: "arrayfire.h".} 897 | proc erode*( af_in : AFArray, mask : AFArray ) : AFArray {.importcpp: "af::erode(@)", header: "arrayfire.h".} 898 | proc erode3*( af_in : AFArray, mask : AFArray ) : AFArray {.importcpp: "af::erode3(@)", header: "arrayfire.h".} 899 | proc regions*( af_in : AFArray, connectivity : Connectivity, af_type : Dtype ) : AFArray {.importcpp: "af::regions(@)", header: "arrayfire.h".} 900 | proc sobel*( dx : AFArray, dy : AFArray, img : AFArray, ker_size : uint32 ) {.importcpp: "af::sobel(@)", header: "arrayfire.h".} 901 | proc sobel*( img : AFArray, ker_size : uint32, isFast : bool ) : AFArray {.importcpp: "af::sobel(@)", header: "arrayfire.h".} 902 | proc rgb2gray*( af_in : AFArray, rPercent : float32, gPercent : float32, bPercent : float32 ) : AFArray {.importcpp: "af::rgb2gray(@)", header: "arrayfire.h".} 903 | proc gray2rgb*( af_in : AFArray, rFactor : float32, gFactor : float32, bFactor : float32 ) : AFArray {.importcpp: "af::gray2rgb(@)", header: "arrayfire.h".} 904 | proc hsv2rgb*( af_in : AFArray ) : AFArray {.importcpp: "af::hsv2rgb(@)", header: "arrayfire.h".} 905 | proc rgb2hsv*( af_in : AFArray ) : AFArray {.importcpp: "af::rgb2hsv(@)", header: "arrayfire.h".} 906 | proc unwrap*( af_in : AFArray, wx : DimT, wy : DimT, sx : DimT, sy : DimT, px : DimT, py : DimT, is_column : bool ) : AFArray {.importcpp: "af::unwrap(@)", header: "arrayfire.h".} 907 | proc wrap*( af_in : AFArray, ox : DimT, oy : DimT, wx : DimT, wy : DimT, sx : DimT, sy : DimT, px : DimT, py : DimT, is_column : bool ) : AFArray {.importcpp: "af::wrap(@)", header: "arrayfire.h".} 908 | proc sat*( af_in : AFArray ) : AFArray {.importcpp: "af::sat(@)", header: "arrayfire.h".} 909 | proc ycbcr2rgb*( af_in : AFArray, standard : YCCStd ) : AFArray {.importcpp: "af::ycbcr2rgb(@)", header: "arrayfire.h".} 910 | proc rgb2ycbcr*( af_in : AFArray, standard : YCCStd ) : AFArray {.importcpp: "af::rgb2ycbcr(@)", header: "arrayfire.h".} 911 | proc moments*( af_out : float64, af_in : AFArray, moment : MomentType ) {.importcpp: "af::moments(@)", header: "arrayfire.h".} 912 | proc moments*( af_in : AFArray, moment : MomentType ) : AFArray {.importcpp: "af::moments(@)", header: "arrayfire.h".} 913 | proc canny*( af_in : AFArray, thresholdType : CannyThreshold, lowThresholdRatio : float32, highThresholdRatio : float32, sobelWindow : uint32, isFast : bool ) : AFArray {.importcpp: "af::canny(@)", header: "arrayfire.h".} 914 | proc anisotropicDiffusion*( af_in : AFArray, timestep : float32, conductance : float32, iterations : uint32, fftype : FluxFunction, diffusionKind : DiffusionEq ) : AFArray {.importcpp: "af::anisotropicDiffusion(@)", header: "arrayfire.h".} 915 | proc iterativeDeconv*( af_in : AFArray, ker : AFArray, iterations : uint32, relaxFactor : float32, algo : IterativeDeconvAlgo ) : AFArray {.importcpp: "af::iterativeDeconv(@)", header: "arrayfire.h".} 916 | proc inverseDeconv*( af_in : AFArray, psf : AFArray, gamma : float32, algo : InverseDeconvAlgo ) : AFArray {.importcpp: "af::inverseDeconv(@)", header: "arrayfire.h".} 917 | proc confidenceCC*( af_in : AFArray, seeds : AFArray, radius : uint32, multiplier : uint32, iter : int32, segmentedValue : float64 ) : AFArray {.importcpp: "af::confidenceCC(@)", header: "arrayfire.h".} 918 | proc confidenceCC*( af_in : AFArray, seedx : AFArray, seedy : AFArray, radius : uint32, multiplier : uint32, iter : int32, segmentedValue : float64 ) : AFArray {.importcpp: "af::confidenceCC(@)", header: "arrayfire.h".} 919 | proc confidenceCC*( af_in : AFArray, num_seeds : uint32, seedx : uint32, seedy : uint32, radius : uint32, multiplier : uint32, iter : int32, segmentedValue : float64 ) : AFArray {.importcpp: "af::confidenceCC(@)", header: "arrayfire.h".} 920 | proc svd*( u : AFArray, s : AFArray, vt : AFArray, af_in : AFArray ) {.importcpp: "af::svd(@)", header: "arrayfire.h".} 921 | proc svdInPlace*( u : AFArray, s : AFArray, vt : AFArray, af_in : AFArray ) {.importcpp: "af::svdInPlace(@)", header: "arrayfire.h".} 922 | proc lu*( af_out : AFArray, pivot : AFArray, af_in : AFArray, is_lapack_piv : bool ) {.importcpp: "af::lu(@)", header: "arrayfire.h".} 923 | proc lu*( lower : AFArray, upper : AFArray, pivot : AFArray, af_in : AFArray ) {.importcpp: "af::lu(@)", header: "arrayfire.h".} 924 | proc luInPlace*( pivot : AFArray, af_in : AFArray, is_lapack_piv : bool ) {.importcpp: "af::luInPlace(@)", header: "arrayfire.h".} 925 | proc qr*( af_out : AFArray, tau : AFArray, af_in : AFArray ) {.importcpp: "af::qr(@)", header: "arrayfire.h".} 926 | proc qr*( q : AFArray, r : AFArray, tau : AFArray, af_in : AFArray ) {.importcpp: "af::qr(@)", header: "arrayfire.h".} 927 | proc qrInPlace*( tau : AFArray, af_in : AFArray ) {.importcpp: "af::qrInPlace(@)", header: "arrayfire.h".} 928 | proc cholesky*( af_out : AFArray, af_in : AFArray, is_upper : bool ) : int32 {.importcpp: "af::cholesky(@)", header: "arrayfire.h".} 929 | proc choleskyInPlace*( af_in : AFArray, is_upper : bool ) : int32 {.importcpp: "af::choleskyInPlace(@)", header: "arrayfire.h".} 930 | proc solve*( a : AFArray, b : AFArray, options : MatProp ) : AFArray {.importcpp: "af::solve(@)", header: "arrayfire.h".} 931 | proc solveLU*( a : AFArray, piv : AFArray, b : AFArray, options : MatProp ) : AFArray {.importcpp: "af::solveLU(@)", header: "arrayfire.h".} 932 | proc inverse*( af_in : AFArray, options : MatProp ) : AFArray {.importcpp: "af::inverse(@)", header: "arrayfire.h".} 933 | proc pinverse*( af_in : AFArray, tol : float64, options : MatProp ) : AFArray {.importcpp: "af::pinverse(@)", header: "arrayfire.h".} 934 | proc rank*( af_in : AFArray, tol : float64 ) : uint32 {.importcpp: "af::rank(@)", header: "arrayfire.h".} 935 | proc norm*( af_in : AFArray, af_type : NormType, p : float64, q : float64 ) : float64 {.importcpp: "af::norm(@)", header: "arrayfire.h".} 936 | proc isLAPACKAvailable*( ) : bool {.importcpp: "af::isLAPACKAvailable(@)", header: "arrayfire.h".} 937 | proc convolve2GradientNN*( incoming_gradient : AFArray, original_signal : AFArray, original_filter : AFArray, convolved_output : AFArray, stride : Dim4, padding : Dim4, dilation : Dim4, grad_type : ConvGradientType ) : AFArray {.importcpp: "af::convolve2GradientNN(@)", header: "arrayfire.h".} 938 | proc randu*( dims : Dim4, ty : Dtype, r : RandomEngine ) : AFArray {.importcpp: "af::randu(@)", header: "arrayfire.h".} 939 | proc randn*( dims : Dim4, ty : Dtype, r : RandomEngine ) : AFArray {.importcpp: "af::randn(@)", header: "arrayfire.h".} 940 | proc randu*( dims : Dim4, ty : Dtype ) : AFArray {.importcpp: "af::randu(@)", header: "arrayfire.h".} 941 | proc randu*( d0 : DimT, ty : Dtype ) : AFArray {.importcpp: "af::randu(@)", header: "arrayfire.h".} 942 | proc randu*( d0 : DimT, d1 : DimT, ty : Dtype ) : AFArray {.importcpp: "af::randu(@)", header: "arrayfire.h".} 943 | proc randu*( d0 : DimT, d1 : DimT, d2 : DimT, ty : Dtype ) : AFArray {.importcpp: "af::randu(@)", header: "arrayfire.h".} 944 | proc randu*( d0 : DimT, d1 : DimT, d2 : DimT, d3 : DimT, ty : Dtype ) : AFArray {.importcpp: "af::randu(@)", header: "arrayfire.h".} 945 | proc randn*( dims : Dim4, ty : Dtype ) : AFArray {.importcpp: "af::randn(@)", header: "arrayfire.h".} 946 | proc randn*( d0 : DimT, ty : Dtype ) : AFArray {.importcpp: "af::randn(@)", header: "arrayfire.h".} 947 | proc randn*( d0 : DimT, d1 : DimT, ty : Dtype ) : AFArray {.importcpp: "af::randn(@)", header: "arrayfire.h".} 948 | proc randn*( d0 : DimT, d1 : DimT, d2 : DimT, ty : Dtype ) : AFArray {.importcpp: "af::randn(@)", header: "arrayfire.h".} 949 | proc randn*( d0 : DimT, d1 : DimT, d2 : DimT, d3 : DimT, ty : Dtype ) : AFArray {.importcpp: "af::randn(@)", header: "arrayfire.h".} 950 | proc setDefaultRandomEngineType*( rtype : RandomEngineType ) {.importcpp: "af::setDefaultRandomEngineType(@)", header: "arrayfire.h".} 951 | proc getDefaultRandomEngine*( ) : RandomEngine {.importcpp: "af::getDefaultRandomEngine(@)", header: "arrayfire.h".} 952 | proc setSeed*( seed : uint64 ) {.importcpp: "af::setSeed(@)", header: "arrayfire.h".} 953 | proc getSeed*( ) : uint64 {.importcpp: "af::getSeed(@)", header: "arrayfire.h".} 954 | proc approx1*( af_in : AFArray, pos : AFArray, af_mathod : InterpType, off_grid : float32 ) : AFArray {.importcpp: "af::approx1(@)", header: "arrayfire.h".} 955 | proc approx2*( af_in : AFArray, pos0 : AFArray, pos1 : AFArray, af_mathod : InterpType, off_grid : float32 ) : AFArray {.importcpp: "af::approx2(@)", header: "arrayfire.h".} 956 | proc approx1*( af_in : AFArray, pos : AFArray, interp_dim : int32, idx_start : float64, idx_step : float64, af_mathod : InterpType, off_grid : float32 ) : AFArray {.importcpp: "af::approx1(@)", header: "arrayfire.h".} 957 | proc approx2*( af_in : AFArray, pos0 : AFArray, interp_dim0 : int32, idx_start_dim0 : float64, idx_step_dim0 : float64, pos1 : AFArray, interp_dim1 : int32, idx_start_dim1 : float64, idx_step_dim1 : float64, af_mathod : InterpType, off_grid : float32 ) : AFArray {.importcpp: "af::approx2(@)", header: "arrayfire.h".} 958 | proc fftNorm*( af_in : AFArray, norm_factor : float64, odim0 : DimT ) : AFArray {.importcpp: "af::fftNorm(@)", header: "arrayfire.h".} 959 | proc fft2Norm*( af_in : AFArray, norm_factor : float64, odim0 : DimT, odim1 : DimT ) : AFArray {.importcpp: "af::fft2Norm(@)", header: "arrayfire.h".} 960 | proc fft3Norm*( af_in : AFArray, norm_factor : float64, odim0 : DimT, odim1 : DimT, odim2 : DimT ) : AFArray {.importcpp: "af::fft3Norm(@)", header: "arrayfire.h".} 961 | proc fftInPlace*( af_in : AFArray, norm_factor : float64 ) {.importcpp: "af::fftInPlace(@)", header: "arrayfire.h".} 962 | proc fft2InPlace*( af_in : AFArray, norm_factor : float64 ) {.importcpp: "af::fft2InPlace(@)", header: "arrayfire.h".} 963 | proc fft3InPlace*( af_in : AFArray, norm_factor : float64 ) {.importcpp: "af::fft3InPlace(@)", header: "arrayfire.h".} 964 | proc fft*( af_in : AFArray, odim0 : DimT ) : AFArray {.importcpp: "af::fft(@)", header: "arrayfire.h".} 965 | proc fft2*( af_in : AFArray, odim0 : DimT, odim1 : DimT ) : AFArray {.importcpp: "af::fft2(@)", header: "arrayfire.h".} 966 | proc fft3*( af_in : AFArray, odim0 : DimT, odim1 : DimT, odim2 : DimT ) : AFArray {.importcpp: "af::fft3(@)", header: "arrayfire.h".} 967 | proc dft*( af_in : AFArray, norm_factor : float64, outDims : Dim4 ) : AFArray {.importcpp: "af::dft(@)", header: "arrayfire.h".} 968 | proc dft*( af_in : AFArray, outDims : Dim4 ) : AFArray {.importcpp: "af::dft(@)", header: "arrayfire.h".} 969 | proc dft*( af_in : AFArray ) : AFArray {.importcpp: "af::dft(@)", header: "arrayfire.h".} 970 | proc ifftNorm*( af_in : AFArray, norm_factor : float64, odim0 : DimT ) : AFArray {.importcpp: "af::ifftNorm(@)", header: "arrayfire.h".} 971 | proc ifft2Norm*( af_in : AFArray, norm_factor : float64, odim0 : DimT, odim1 : DimT ) : AFArray {.importcpp: "af::ifft2Norm(@)", header: "arrayfire.h".} 972 | proc ifft3Norm*( af_in : AFArray, norm_factor : float64, odim0 : DimT, odim1 : DimT, odim2 : DimT ) : AFArray {.importcpp: "af::ifft3Norm(@)", header: "arrayfire.h".} 973 | proc ifftInPlace*( af_in : AFArray, norm_factor : float64 ) {.importcpp: "af::ifftInPlace(@)", header: "arrayfire.h".} 974 | proc ifft2InPlace*( af_in : AFArray, norm_factor : float64 ) {.importcpp: "af::ifft2InPlace(@)", header: "arrayfire.h".} 975 | proc ifft3InPlace*( af_in : AFArray, norm_factor : float64 ) {.importcpp: "af::ifft3InPlace(@)", header: "arrayfire.h".} 976 | proc ifft*( af_in : AFArray, odim0 : DimT ) : AFArray {.importcpp: "af::ifft(@)", header: "arrayfire.h".} 977 | proc ifft2*( af_in : AFArray, odim0 : DimT, odim1 : DimT ) : AFArray {.importcpp: "af::ifft2(@)", header: "arrayfire.h".} 978 | proc ifft3*( af_in : AFArray, odim0 : DimT, odim1 : DimT, odim2 : DimT ) : AFArray {.importcpp: "af::ifft3(@)", header: "arrayfire.h".} 979 | proc idft*( af_in : AFArray, norm_factor : float64, outDims : Dim4 ) : AFArray {.importcpp: "af::idft(@)", header: "arrayfire.h".} 980 | proc idft*( af_in : AFArray, outDims : Dim4 ) : AFArray {.importcpp: "af::idft(@)", header: "arrayfire.h".} 981 | proc idft*( af_in : AFArray ) : AFArray {.importcpp: "af::idft(@)", header: "arrayfire.h".} 982 | proc convolve*( signal : AFArray, filter : AFArray, mode : ConvMode, domain : ConvDomain ) : AFArray {.importcpp: "af::convolve(@)", header: "arrayfire.h".} 983 | proc convolve*( col_filter : AFArray, row_filter : AFArray, signal : AFArray, mode : ConvMode ) : AFArray {.importcpp: "af::convolve(@)", header: "arrayfire.h".} 984 | proc convolve1*( signal : AFArray, filter : AFArray, mode : ConvMode, domain : ConvDomain ) : AFArray {.importcpp: "af::convolve1(@)", header: "arrayfire.h".} 985 | proc convolve2*( signal : AFArray, filter : AFArray, mode : ConvMode, domain : ConvDomain ) : AFArray {.importcpp: "af::convolve2(@)", header: "arrayfire.h".} 986 | proc convolve2NN*( signal : AFArray, filter : AFArray, stride : Dim4, padding : Dim4, dilation : Dim4 ) : AFArray {.importcpp: "af::convolve2NN(@)", header: "arrayfire.h".} 987 | proc convolve3*( signal : AFArray, filter : AFArray, mode : ConvMode, domain : ConvDomain ) : AFArray {.importcpp: "af::convolve3(@)", header: "arrayfire.h".} 988 | proc fftConvolve*( signal : AFArray, filter : AFArray, mode : ConvMode ) : AFArray {.importcpp: "af::fftConvolve(@)", header: "arrayfire.h".} 989 | proc fftConvolve1*( signal : AFArray, filter : AFArray, mode : ConvMode ) : AFArray {.importcpp: "af::fftConvolve1(@)", header: "arrayfire.h".} 990 | proc fftConvolve2*( signal : AFArray, filter : AFArray, mode : ConvMode ) : AFArray {.importcpp: "af::fftConvolve2(@)", header: "arrayfire.h".} 991 | proc fftConvolve3*( signal : AFArray, filter : AFArray, mode : ConvMode ) : AFArray {.importcpp: "af::fftConvolve3(@)", header: "arrayfire.h".} 992 | proc fir*( b : AFArray, x : AFArray ) : AFArray {.importcpp: "af::fir(@)", header: "arrayfire.h".} 993 | proc iir*( b : AFArray, a : AFArray, x : AFArray ) : AFArray {.importcpp: "af::iir(@)", header: "arrayfire.h".} 994 | proc medfilt*( af_in : AFArray, wind_length : DimT, wind_width : DimT, edge_pad : BorderType ) : AFArray {.importcpp: "af::medfilt(@)", header: "arrayfire.h".} 995 | proc medfilt1*( af_in : AFArray, wind_width : DimT, edge_pad : BorderType ) : AFArray {.importcpp: "af::medfilt1(@)", header: "arrayfire.h".} 996 | proc medfilt2*( af_in : AFArray, wind_length : DimT, wind_width : DimT, edge_pad : BorderType ) : AFArray {.importcpp: "af::medfilt2(@)", header: "arrayfire.h".} 997 | proc setFFTPlanCacheSize*( cacheSize : uint32 ) {.importcpp: "af::setFFTPlanCacheSize(@)", header: "arrayfire.h".} 998 | proc sparse*( nRows : DimT, nCols : DimT, values : AFArray, rowIdx : AFArray, colIdx : AFArray, stype : Storage ) : AFArray {.importcpp: "af::sparse(@)", header: "arrayfire.h".} 999 | proc sparse*( nRows : DimT, nCols : DimT, nNZ : DimT, values : pointer, rowIdx : int32, colIdx : int32, af_type : Dtype, stype : Storage, src : Source ) : AFArray {.importcpp: "af::sparse(@)", header: "arrayfire.h".} 1000 | proc sparse*( dense : AFArray, stype : Storage ) : AFArray {.importcpp: "af::sparse(@)", header: "arrayfire.h".} 1001 | proc sparseConvertTo*( af_in : AFArray, destStrorage : Storage ) : AFArray {.importcpp: "af::sparseConvertTo(@)", header: "arrayfire.h".} 1002 | proc dense*( sparse : AFArray ) : AFArray {.importcpp: "af::dense(@)", header: "arrayfire.h".} 1003 | proc sparseGetInfo*( values : AFArray, rowIdx : AFArray, colIdx : AFArray, stype : Storage, af_in : AFArray ) {.importcpp: "af::sparseGetInfo(@)", header: "arrayfire.h".} 1004 | proc sparseGetValues*( af_in : AFArray ) : AFArray {.importcpp: "af::sparseGetValues(@)", header: "arrayfire.h".} 1005 | proc sparseGetRowIdx*( af_in : AFArray ) : AFArray {.importcpp: "af::sparseGetRowIdx(@)", header: "arrayfire.h".} 1006 | proc sparseGetColIdx*( af_in : AFArray ) : AFArray {.importcpp: "af::sparseGetColIdx(@)", header: "arrayfire.h".} 1007 | proc sparseGetNNZ*( af_in : AFArray ) : DimT {.importcpp: "af::sparseGetNNZ(@)", header: "arrayfire.h".} 1008 | proc sparseGetStorage*( af_in : AFArray ) : Storage {.importcpp: "af::sparseGetStorage(@)", header: "arrayfire.h".} 1009 | proc mean*( af_in : AFArray, dim : DimT ) : AFArray {.importcpp: "af::mean(@)", header: "arrayfire.h".} 1010 | proc mean*( af_in : AFArray, weights : AFArray, dim : DimT ) : AFArray {.importcpp: "af::mean(@)", header: "arrayfire.h".} 1011 | proc af_var*( af_in : AFArray, isbiased : bool, dim : DimT ) : AFArray {.importcpp: "af::var(@)", header: "arrayfire.h".} 1012 | proc af_var*( af_in : AFArray, bias : VarBias, dim : DimT ) : AFArray {.importcpp: "af::var(@)", header: "arrayfire.h".} 1013 | proc af_var*( af_in : AFArray, weights : AFArray, dim : DimT ) : AFArray {.importcpp: "af::var(@)", header: "arrayfire.h".} 1014 | proc meanvar*( mean : AFArray, af_var : AFArray, af_in : AFArray, weights : AFArray, bias : VarBias, dim : DimT ) {.importcpp: "af::meanvar(@)", header: "arrayfire.h".} 1015 | proc stdev*( af_in : AFArray, dim : DimT ) : AFArray {.importcpp: "af::stdev(@)", header: "arrayfire.h".} 1016 | proc stdev*( af_in : AFArray, bias : VarBias, dim : DimT ) : AFArray {.importcpp: "af::stdev(@)", header: "arrayfire.h".} 1017 | proc cov*( X : AFArray, Y : AFArray, isbiased : bool ) : AFArray {.importcpp: "af::cov(@)", header: "arrayfire.h".} 1018 | proc cov*( X : AFArray, Y : AFArray, bias : VarBias ) : AFArray {.importcpp: "af::cov(@)", header: "arrayfire.h".} 1019 | proc median*( af_in : AFArray, dim : DimT ) : AFArray {.importcpp: "af::median(@)", header: "arrayfire.h".} 1020 | proc topk*( values : AFArray, indices : AFArray, af_in : AFArray, k : int32, dim : int32, order : TopkFunction ) {.importcpp: "af::topk(@)", header: "arrayfire.h".} 1021 | proc fast*( af_in : AFArray, thr : float32, arc_length : uint32, non_max : bool, feature_ratio : float32, edge : uint32 ) : Features {.importcpp: "af::fast(@)", header: "arrayfire.h".} 1022 | proc harris*( af_in : AFArray, max_corners : uint32, min_response : float32, sigma : float32, block_size : uint32, k_thr : float32 ) : Features {.importcpp: "af::harris(@)", header: "arrayfire.h".} 1023 | proc orb*( feat : Features, desc : AFArray, image : AFArray, fast_thr : float32, max_feat : uint32, scl_fctr : float32, levels : uint32, blur_img : bool ) {.importcpp: "af::orb(@)", header: "arrayfire.h".} 1024 | proc sift*( feat : Features, desc : AFArray, af_in : AFArray, n_layers : uint32, contrast_thr : float32, edge_thr : float32, init_sigma : float32, double_input : bool, intensity_scale : float32, feature_ratio : float32 ) {.importcpp: "af::sift(@)", header: "arrayfire.h".} 1025 | proc gloh*( feat : Features, desc : AFArray, af_in : AFArray, n_layers : uint32, contrast_thr : float32, edge_thr : float32, init_sigma : float32, double_input : bool, intensity_scale : float32, feature_ratio : float32 ) {.importcpp: "af::gloh(@)", header: "arrayfire.h".} 1026 | proc hammingMatcher*( idx : AFArray, dist : AFArray, query : AFArray, train : AFArray, dist_dim : DimT, n_dist : uint32 ) {.importcpp: "af::hammingMatcher(@)", header: "arrayfire.h".} 1027 | proc nearestNeighbour*( idx : AFArray, dist : AFArray, query : AFArray, train : AFArray, dist_dim : DimT, n_dist : uint32, dist_type : MatchType ) {.importcpp: "af::nearestNeighbour(@)", header: "arrayfire.h".} 1028 | proc matchTemplate*( searchImg : AFArray, templateImg : AFArray, mType : MatchType ) : AFArray {.importcpp: "af::matchTemplate(@)", header: "arrayfire.h".} 1029 | proc susan*( af_in : AFArray, radius : uint32, diff_thr : float32, geom_thr : float32, feature_ratio : float32, edge : uint32 ) : Features {.importcpp: "af::susan(@)", header: "arrayfire.h".} 1030 | proc dog*( af_in : AFArray, radius1 : int32, radius2 : int32 ) : AFArray {.importcpp: "af::dog(@)", header: "arrayfire.h".} 1031 | proc homography*( H : AFArray, inliers : int32, x_src : AFArray, y_src : AFArray, x_dst : AFArray, y_dst : AFArray, htype : HomographyType, inlier_thr : float32, iterations : uint32, otype : Dtype ) {.importcpp: "af::homography(@)", header: "arrayfire.h".} 1032 | #endregion 1033 | 1034 | 1035 | #region Methods 1036 | proc af_seq*( length : float64 ) : AF_Seq {.constructor, importcpp: "af::seq(@)", header: "arrayfire.h".} 1037 | proc destroy_seq*(this: var AF_Seq) {.importcpp: "#.~seq()", header : "arrayfire.h".} 1038 | proc af_seq*( begin : float64, af_end : float64, step : float64 ) : AF_Seq {.constructor, importcpp: "af::seq(@)", header: "arrayfire.h".} 1039 | proc af_seq*( other : AF_Seq, is_gfor : bool ) : AF_Seq {.constructor, importcpp: "af::seq(@)", header: "arrayfire.h".} 1040 | proc af_seq*( s : AF_Seq ) : AF_Seq {.constructor, importcpp: "af::seq(@)", header: "arrayfire.h".} 1041 | proc `assign`*(this : AF_Seq, s : AF_Seq) {.importcpp: "(# = #)", header: "arrayfire.h".} 1042 | proc `-`*(this : AF_Seq) : AF_Seq {.importcpp: "(# - #)", header: "arrayfire.h".} 1043 | proc `+`*(this : AF_Seq, x : float64) : AF_Seq {.importcpp: "(# + #)", header: "arrayfire.h".} 1044 | proc `-`*(this : AF_Seq, x : float64) : AF_Seq {.importcpp: "(# - #)", header: "arrayfire.h".} 1045 | proc `*`*(this : AF_Seq, x : float64) : AF_Seq {.importcpp: "(# * #)", header: "arrayfire.h".} 1046 | proc `afa`*(this : AF_Seq) : AFArray {.importcpp: "(# afa #)", header: "arrayfire.h".} 1047 | proc init*( this : AF_Seq, begin : float64, af_end : float64, step : float64 ) {.importcpp: "init", header : "arrayfire.h".} 1048 | proc af_seq*( p : AF_Seq ) : AF_Seq {.constructor, importcpp: "af::seq(@)", header: "arrayfire.h".} 1049 | proc dim4*( ) : Dim4 {.constructor, importcpp: "af::dim4(@)", header: "arrayfire.h".} 1050 | proc dim4*( first : DimT, second : DimT, third : DimT, fourth : DimT ) : Dim4 {.constructor, importcpp: "af::dim4(@)", header: "arrayfire.h".} 1051 | proc dim4*( other : Dim4 ) : Dim4 {.constructor, importcpp: "af::dim4(@)", header: "arrayfire.h".} 1052 | proc `assign`*(this : Dim4, other : Dim4) {.importcpp: "(# = #)", header: "arrayfire.h".} 1053 | proc dim4*( ndims : uint32, dims : DimT ) : Dim4 {.constructor, importcpp: "af::dim4(@)", header: "arrayfire.h".} 1054 | proc elements*( this : Dim4 ) : DimT {.importcpp: "elements", header : "arrayfire.h".} 1055 | proc ndims*( this : Dim4 ) : DimT {.importcpp: "ndims", header : "arrayfire.h".} 1056 | proc `==`*(this : Dim4, other : Dim4) : bool {.importcpp: "(# == #)", header: "arrayfire.h".} 1057 | proc `!=`*(this : Dim4, other : Dim4) {.importcpp: "(# != #)", header: "arrayfire.h".} 1058 | proc `*=`*(this : Dim4, other : Dim4) {.importcpp: "(# *= #)", header: "arrayfire.h".} 1059 | proc `+=`*(this : Dim4, other : Dim4) {.importcpp: "(# += #)", header: "arrayfire.h".} 1060 | proc `-=`*(this : Dim4, other : Dim4) {.importcpp: "(# -= #)", header: "arrayfire.h".} 1061 | proc get*( this : Dim4 ) : DimT {.importcpp: "get", header : "arrayfire.h".} 1062 | proc err*( this : AF_Exception ) : Err {.importcpp: "af::err", header : "arrayfire.h".} 1063 | proc exception*( ) : AF_Exception {.constructor, importcpp: "af::exception(@)", header: "arrayfire.h".} 1064 | proc exception*( msg : cstring ) : AF_Exception {.constructor, importcpp: "af::exception(@)", header: "arrayfire.h".} 1065 | proc exception*( file : cstring, line : uint32, err : Err ) : AF_Exception {.constructor, importcpp: "af::exception(@)", header: "arrayfire.h".} 1066 | proc exception*( msg : cstring, file : cstring, line : uint32, err : Err ) : AF_Exception {.constructor, importcpp: "af::exception(@)", header: "arrayfire.h".} 1067 | proc exception*( msg : cstring, af_func : cstring, file : cstring, line : uint32, err : Err ) : AF_Exception {.constructor, importcpp: "af::exception(@)", header: "arrayfire.h".} 1068 | proc destroy_exception*(this: var AF_Exception) {.importcpp: "#.~exception()", header : "arrayfire.h".} 1069 | proc what*( this : AF_Exception ) : cstring {.importcpp: "what", header : "arrayfire.h".} 1070 | proc exception*( p : AF_Exception ) : AF_Exception {.constructor, importcpp: "af::exception(@)", header: "arrayfire.h".} 1071 | proc `assign`*(this : AF_Exception, p : AF_Exception) {.importcpp: "(# = #)", header: "arrayfire.h".} 1072 | proc index*( ) : IndexT {.constructor, importcpp: "af::index(@)", header: "arrayfire.h".} 1073 | proc destroy_index*(this: var IndexT) {.importcpp: "#.~index()", header : "arrayfire.h".} 1074 | proc index*( idx : int32 ) : IndexT {.constructor, importcpp: "af::index(@)", header: "arrayfire.h".} 1075 | proc index*( s0 : AF_Seq ) : IndexT {.constructor, importcpp: "af::index(@)", header: "arrayfire.h".} 1076 | proc index*( idx0 : AFArray ) : IndexT {.constructor, importcpp: "af::index(@)", header: "arrayfire.h".} 1077 | proc index*( idx0 : IndexT ) : IndexT {.constructor, importcpp: "af::index(@)", header: "arrayfire.h".} 1078 | proc isspan*( this : IndexT ) : bool {.importcpp: "isspan", header : "arrayfire.h".} 1079 | proc get*( this : IndexT ) : IndexT {.importcpp: "get", header : "arrayfire.h".} 1080 | proc `assign`*(this : IndexT, idx0 : IndexT) {.importcpp: "(# = #)", header: "arrayfire.h".} 1081 | proc set*( this : AFArray, tmp : AF_Array_Handle ) {.importcpp: "set", header : "arrayfire.h".} 1082 | proc af_array*( ) : AFArray {.constructor, importcpp: "af::array(@)", header: "arrayfire.h".} 1083 | proc af_array*( other : AFArray ) : AFArray {.constructor, importcpp: "af::array(@)", header: "arrayfire.h".} 1084 | proc `assign`*(this : AFArray, other : AFArray) {.importcpp: "(# = #)", header: "arrayfire.h".} 1085 | proc af_array*( handle : AF_Array_Handle ) : AFArray {.constructor, importcpp: "af::array(@)", header: "arrayfire.h".} 1086 | proc af_array*( af_in : AFArray ) : AFArray {.constructor, importcpp: "af::array(@)", header: "arrayfire.h".} 1087 | proc af_array*( dim0 : DimT, ty : Dtype ) : AFArray {.constructor, importcpp: "af::array(@)", header: "arrayfire.h".} 1088 | proc af_array*( dim0 : DimT, dim1 : DimT, ty : Dtype ) : AFArray {.constructor, importcpp: "af::array(@)", header: "arrayfire.h".} 1089 | proc af_array*( dim0 : DimT, dim1 : DimT, dim2 : DimT, ty : Dtype ) : AFArray {.constructor, importcpp: "af::array(@)", header: "arrayfire.h".} 1090 | proc af_array*( dim0 : DimT, dim1 : DimT, dim2 : DimT, dim3 : DimT, ty : Dtype ) : AFArray {.constructor, importcpp: "af::array(@)", header: "arrayfire.h".} 1091 | proc af_array*( dims : Dim4, ty : Dtype ) : AFArray {.constructor, importcpp: "af::array(@)", header: "arrayfire.h".} 1092 | proc af_array*( input : AFArray, dims : Dim4 ) : AFArray {.constructor, importcpp: "af::array(@)", header: "arrayfire.h".} 1093 | proc af_array*( input : AFArray, dim0 : DimT, dim1 : DimT, dim2 : DimT, dim3 : DimT ) : AFArray {.constructor, importcpp: "af::array(@)", header: "arrayfire.h".} 1094 | proc get*( this : AFArray ) : AF_Array_Handle {.importcpp: "get", header : "arrayfire.h".} 1095 | proc elements*( this : AFArray ) : DimT {.importcpp: "elements", header : "arrayfire.h".} 1096 | proc host*( this : AFArray, af_ptr : pointer ) {.importcpp: "host", header : "arrayfire.h".} 1097 | proc dtype*( this : AFArray ) : Dtype {.importcpp: "type", header : "arrayfire.h".} 1098 | proc dims*( this : AFArray ) : Dim4 {.importcpp: "dims", header : "arrayfire.h".} 1099 | proc dims*( this : AFArray, dim : uint32 ) : DimT {.importcpp: "dims", header : "arrayfire.h".} 1100 | proc numdims*( this : AFArray ) : uint32 {.importcpp: "numdims", header : "arrayfire.h".} 1101 | proc bytes*( this : AFArray ) : uint32 {.importcpp: "bytes", header : "arrayfire.h".} 1102 | proc allocated*( this : AFArray ) : uint32 {.importcpp: "allocated", header : "arrayfire.h".} 1103 | proc copy*( this : AFArray ) : AFArray {.importcpp: "copy", header : "arrayfire.h".} 1104 | proc isempty*( this : AFArray ) : bool {.importcpp: "isempty", header : "arrayfire.h".} 1105 | proc isscalar*( this : AFArray ) : bool {.importcpp: "isscalar", header : "arrayfire.h".} 1106 | proc isvector*( this : AFArray ) : bool {.importcpp: "isvector", header : "arrayfire.h".} 1107 | proc isrow*( this : AFArray ) : bool {.importcpp: "isrow", header : "arrayfire.h".} 1108 | proc iscolumn*( this : AFArray ) : bool {.importcpp: "iscolumn", header : "arrayfire.h".} 1109 | proc iscomplex*( this : AFArray ) : bool {.importcpp: "iscomplex", header : "arrayfire.h".} 1110 | proc isreal*( this : AFArray ) : bool {.importcpp: "isreal", header : "arrayfire.h".} 1111 | proc isdouble*( this : AFArray ) : bool {.importcpp: "isdouble", header : "arrayfire.h".} 1112 | proc issingle*( this : AFArray ) : bool {.importcpp: "issingle", header : "arrayfire.h".} 1113 | proc ishalf*( this : AFArray ) : bool {.importcpp: "ishalf", header : "arrayfire.h".} 1114 | proc isrealfloating*( this : AFArray ) : bool {.importcpp: "isrealfloating", header : "arrayfire.h".} 1115 | proc isfloating*( this : AFArray ) : bool {.importcpp: "isfloating", header : "arrayfire.h".} 1116 | proc isinteger*( this : AFArray ) : bool {.importcpp: "isinteger", header : "arrayfire.h".} 1117 | proc isbool*( this : AFArray ) : bool {.importcpp: "isbool", header : "arrayfire.h".} 1118 | proc issparse*( this : AFArray ) : bool {.importcpp: "issparse", header : "arrayfire.h".} 1119 | proc eval*( this : AFArray ) {.importcpp: "eval", header : "arrayfire.h".} 1120 | proc `call`*(this : AFArray, s0 : IndexT) : AFArray {.importcpp: "(# () #)", header: "arrayfire.h".} 1121 | proc `call`*(this : AFArray, s0 : IndexT, s1 : IndexT, s2 : IndexT, s3 : IndexT) : AFArray {.importcpp: "(# () #)", header: "arrayfire.h".} 1122 | proc row*( this : AFArray, index : int32 ) : AFArray {.importcpp: "row", header : "arrayfire.h".} 1123 | proc rows*( this : AFArray, first : int32, last : int32 ) : AFArray {.importcpp: "rows", header : "arrayfire.h".} 1124 | proc col*( this : AFArray, index : int32 ) : AFArray {.importcpp: "col", header : "arrayfire.h".} 1125 | proc cols*( this : AFArray, first : int32, last : int32 ) : AFArray {.importcpp: "cols", header : "arrayfire.h".} 1126 | proc slice*( this : AFArray, index : int32 ) : AFArray {.importcpp: "slice", header : "arrayfire.h".} 1127 | proc slices*( this : AFArray, first : int32, last : int32 ) : AFArray {.importcpp: "slices", header : "arrayfire.h".} 1128 | proc af_as*( this : AFArray, af_type : Dtype ) : AFArray {.importcpp: "as", header : "arrayfire.h".} 1129 | proc destroy_array*(this: var AFArray) {.importcpp: "#.~array()", header : "arrayfire.h".} 1130 | proc T*( this : AFArray ) : AFArray {.importcpp: "T", header : "arrayfire.h".} 1131 | proc H*( this : AFArray ) : AFArray {.importcpp: "H", header : "arrayfire.h".} 1132 | proc `assign`*(this : AFArray, val : AFArray) {.importcpp: "(# = #)", header: "arrayfire.h".} 1133 | proc `assign`*(this : AFArray, val : float64) {.importcpp: "(# = #)", header: "arrayfire.h".} 1134 | proc `assign`*(this : AFArray, val : float32) {.importcpp: "(# = #)", header: "arrayfire.h".} 1135 | proc `assign`*(this : AFArray, val : int32) {.importcpp: "(# = #)", header: "arrayfire.h".} 1136 | proc `assign`*(this : AFArray, val : uint32) {.importcpp: "(# = #)", header: "arrayfire.h".} 1137 | proc `assign`*(this : AFArray, val : bool) {.importcpp: "(# = #)", header: "arrayfire.h".} 1138 | proc `assign`*(this : AFArray, val : cstring) {.importcpp: "(# = #)", header: "arrayfire.h".} 1139 | proc `assign`*(this : AFArray, val : int64) {.importcpp: "(# = #)", header: "arrayfire.h".} 1140 | proc `assign`*(this : AFArray, val : uint64) {.importcpp: "(# = #)", header: "arrayfire.h".} 1141 | proc `assign`*(this : AFArray, val : int16) {.importcpp: "(# = #)", header: "arrayfire.h".} 1142 | proc `assign`*(this : AFArray, val : uint16) {.importcpp: "(# = #)", header: "arrayfire.h".} 1143 | proc `+=`*(this : AFArray, val : AFArray) {.importcpp: "(# += #)", header: "arrayfire.h".} 1144 | proc `+=`*(this : AFArray, val : float64) {.importcpp: "(# += #)", header: "arrayfire.h".} 1145 | proc `+=`*(this : AFArray, val : float32) {.importcpp: "(# += #)", header: "arrayfire.h".} 1146 | proc `+=`*(this : AFArray, val : int32) {.importcpp: "(# += #)", header: "arrayfire.h".} 1147 | proc `+=`*(this : AFArray, val : uint32) {.importcpp: "(# += #)", header: "arrayfire.h".} 1148 | proc `+=`*(this : AFArray, val : bool) {.importcpp: "(# += #)", header: "arrayfire.h".} 1149 | proc `+=`*(this : AFArray, val : cstring) {.importcpp: "(# += #)", header: "arrayfire.h".} 1150 | proc `+=`*(this : AFArray, val : int64) {.importcpp: "(# += #)", header: "arrayfire.h".} 1151 | proc `+=`*(this : AFArray, val : uint64) {.importcpp: "(# += #)", header: "arrayfire.h".} 1152 | proc `+=`*(this : AFArray, val : int16) {.importcpp: "(# += #)", header: "arrayfire.h".} 1153 | proc `+=`*(this : AFArray, val : uint16) {.importcpp: "(# += #)", header: "arrayfire.h".} 1154 | proc `-=`*(this : AFArray, val : AFArray) {.importcpp: "(# -= #)", header: "arrayfire.h".} 1155 | proc `-=`*(this : AFArray, val : float64) {.importcpp: "(# -= #)", header: "arrayfire.h".} 1156 | proc `-=`*(this : AFArray, val : float32) {.importcpp: "(# -= #)", header: "arrayfire.h".} 1157 | proc `-=`*(this : AFArray, val : int32) {.importcpp: "(# -= #)", header: "arrayfire.h".} 1158 | proc `-=`*(this : AFArray, val : uint32) {.importcpp: "(# -= #)", header: "arrayfire.h".} 1159 | proc `-=`*(this : AFArray, val : bool) {.importcpp: "(# -= #)", header: "arrayfire.h".} 1160 | proc `-=`*(this : AFArray, val : cstring) {.importcpp: "(# -= #)", header: "arrayfire.h".} 1161 | proc `-=`*(this : AFArray, val : int64) {.importcpp: "(# -= #)", header: "arrayfire.h".} 1162 | proc `-=`*(this : AFArray, val : uint64) {.importcpp: "(# -= #)", header: "arrayfire.h".} 1163 | proc `-=`*(this : AFArray, val : int16) {.importcpp: "(# -= #)", header: "arrayfire.h".} 1164 | proc `-=`*(this : AFArray, val : uint16) {.importcpp: "(# -= #)", header: "arrayfire.h".} 1165 | proc `*=`*(this : AFArray, val : AFArray) {.importcpp: "(# *= #)", header: "arrayfire.h".} 1166 | proc `*=`*(this : AFArray, val : float64) {.importcpp: "(# *= #)", header: "arrayfire.h".} 1167 | proc `*=`*(this : AFArray, val : float32) {.importcpp: "(# *= #)", header: "arrayfire.h".} 1168 | proc `*=`*(this : AFArray, val : int32) {.importcpp: "(# *= #)", header: "arrayfire.h".} 1169 | proc `*=`*(this : AFArray, val : uint32) {.importcpp: "(# *= #)", header: "arrayfire.h".} 1170 | proc `*=`*(this : AFArray, val : bool) {.importcpp: "(# *= #)", header: "arrayfire.h".} 1171 | proc `*=`*(this : AFArray, val : cstring) {.importcpp: "(# *= #)", header: "arrayfire.h".} 1172 | proc `*=`*(this : AFArray, val : int64) {.importcpp: "(# *= #)", header: "arrayfire.h".} 1173 | proc `*=`*(this : AFArray, val : uint64) {.importcpp: "(# *= #)", header: "arrayfire.h".} 1174 | proc `*=`*(this : AFArray, val : int16) {.importcpp: "(# *= #)", header: "arrayfire.h".} 1175 | proc `*=`*(this : AFArray, val : uint16) {.importcpp: "(# *= #)", header: "arrayfire.h".} 1176 | proc `/=`*(this : AFArray, val : AFArray) {.importcpp: "(# /= #)", header: "arrayfire.h".} 1177 | proc `/=`*(this : AFArray, val : float64) {.importcpp: "(# /= #)", header: "arrayfire.h".} 1178 | proc `/=`*(this : AFArray, val : float32) {.importcpp: "(# /= #)", header: "arrayfire.h".} 1179 | proc `/=`*(this : AFArray, val : int32) {.importcpp: "(# /= #)", header: "arrayfire.h".} 1180 | proc `/=`*(this : AFArray, val : uint32) {.importcpp: "(# /= #)", header: "arrayfire.h".} 1181 | proc `/=`*(this : AFArray, val : bool) {.importcpp: "(# /= #)", header: "arrayfire.h".} 1182 | proc `/=`*(this : AFArray, val : cstring) {.importcpp: "(# /= #)", header: "arrayfire.h".} 1183 | proc `/=`*(this : AFArray, val : int64) {.importcpp: "(# /= #)", header: "arrayfire.h".} 1184 | proc `/=`*(this : AFArray, val : uint64) {.importcpp: "(# /= #)", header: "arrayfire.h".} 1185 | proc `/=`*(this : AFArray, val : int16) {.importcpp: "(# /= #)", header: "arrayfire.h".} 1186 | proc `/=`*(this : AFArray, val : uint16) {.importcpp: "(# /= #)", header: "arrayfire.h".} 1187 | proc `-`*(this : AFArray) : AFArray {.importcpp: "(# - #)", header: "arrayfire.h".} 1188 | proc `!`*(this : AFArray) : AFArray {.importcpp: "(# ! #)", header: "arrayfire.h".} 1189 | proc `~`*(this : AFArray) : AFArray {.importcpp: "(# ~ #)", header: "arrayfire.h".} 1190 | proc nonzeros*( this : AFArray ) : int32 {.importcpp: "nonzeros", header : "arrayfire.h".} 1191 | proc lock*( this : AFArray ) {.importcpp: "lock", header : "arrayfire.h".} 1192 | proc isLocked*( this : AFArray ) : bool {.importcpp: "isLocked", header : "arrayfire.h".} 1193 | proc unlock*( this : AFArray ) {.importcpp: "unlock", header : "arrayfire.h".} 1194 | proc event*( e : Event ) : Event {.constructor, importcpp: "af::event(@)", header: "arrayfire.h".} 1195 | proc event*( other : Event ) : Event {.constructor, importcpp: "af::event(@)", header: "arrayfire.h".} 1196 | proc `assign`*(this : Event, other : Event) {.importcpp: "(# = #)", header: "arrayfire.h".} 1197 | proc event*( ) : Event {.constructor, importcpp: "af::event(@)", header: "arrayfire.h".} 1198 | proc destroy_event*(this: var Event) {.importcpp: "#.~event()", header : "arrayfire.h".} 1199 | proc get*( this : Event ) : Event {.importcpp: "get", header : "arrayfire.h".} 1200 | proc mark*( this : Event ) {.importcpp: "mark", header : "arrayfire.h".} 1201 | proc enqueue*( this : Event ) {.importcpp: "enqueue", header : "arrayfire.h".} 1202 | proc af_block*( this : Event ) {.importcpp: "block", header : "arrayfire.h".} 1203 | proc features*( ) : Features {.constructor, importcpp: "af::features(@)", header: "arrayfire.h".} 1204 | proc features*( n : uint32 ) : Features {.constructor, importcpp: "af::features(@)", header: "arrayfire.h".} 1205 | proc features*( f : Features ) : Features {.constructor, importcpp: "af::features(@)", header: "arrayfire.h".} 1206 | proc destroy_features*(this: var Features) {.importcpp: "#.~features()", header : "arrayfire.h".} 1207 | proc `assign`*(this : Features, other : Features) {.importcpp: "(# = #)", header: "arrayfire.h".} 1208 | proc features*( other : Features ) : Features {.constructor, importcpp: "af::features(@)", header: "arrayfire.h".} 1209 | proc getNumFeatures*( this : Features ) : uint32 {.importcpp: "getNumFeatures", header : "arrayfire.h".} 1210 | proc getX*( this : Features ) : AFArray {.importcpp: "getX", header : "arrayfire.h".} 1211 | proc getY*( this : Features ) : AFArray {.importcpp: "getY", header : "arrayfire.h".} 1212 | proc getScore*( this : Features ) : AFArray {.importcpp: "getScore", header : "arrayfire.h".} 1213 | proc getOrientation*( this : Features ) : AFArray {.importcpp: "getOrientation", header : "arrayfire.h".} 1214 | proc getSize*( this : Features ) : AFArray {.importcpp: "getSize", header : "arrayfire.h".} 1215 | proc get*( this : Features ) : Features {.importcpp: "get", header : "arrayfire.h".} 1216 | proc initWindow*( this : Window, width : int32, height : int32, title : cstring ) {.importcpp: "af::initWindow", header : "arrayfire.h".} 1217 | proc make_window*( p : Window ) : Window {.constructor, importcpp: "af::Window(@)", header: "arrayfire.h".} 1218 | proc `assign`*(this : Window, p : Window) {.importcpp: "(# = #)", header: "arrayfire.h".} 1219 | proc make_window*( ) : Window {.constructor, importcpp: "af::Window(@)", header: "arrayfire.h".} 1220 | proc make_window*( title : cstring ) : Window {.constructor, importcpp: "af::Window(@)", header: "arrayfire.h".} 1221 | proc make_window*( width : int32, height : int32, title : cstring ) : Window {.constructor, importcpp: "af::Window(@)", header: "arrayfire.h".} 1222 | proc make_window*( window : Window ) : Window {.constructor, importcpp: "af::Window(@)", header: "arrayfire.h".} 1223 | proc destroy_Window*(this: var Window) {.importcpp: "#.~Window()", header : "arrayfire.h".} 1224 | proc get*( this : Window ) : Window {.importcpp: "get", header : "arrayfire.h".} 1225 | proc setPos*( this : Window, x : uint32, y : uint32 ) {.importcpp: "setPos", header : "arrayfire.h".} 1226 | proc setTitle*( this : Window, title : cstring ) {.importcpp: "setTitle", header : "arrayfire.h".} 1227 | proc setSize*( this : Window, w : uint32, h : uint32 ) {.importcpp: "setSize", header : "arrayfire.h".} 1228 | proc setColorMap*( this : Window, cmap : ColorMap ) {.importcpp: "setColorMap", header : "arrayfire.h".} 1229 | proc image*( this : Window, af_in : AFArray, title : cstring ) {.importcpp: "image", header : "arrayfire.h".} 1230 | proc plot3*( this : Window, af_in : AFArray, title : cstring ) {.importcpp: "plot3", header : "arrayfire.h".} 1231 | proc plot*( this : Window, af_in : AFArray, title : cstring ) {.importcpp: "plot", header : "arrayfire.h".} 1232 | proc plot*( this : Window, X : AFArray, Y : AFArray, Z : AFArray, title : cstring ) {.importcpp: "plot", header : "arrayfire.h".} 1233 | proc plot*( this : Window, X : AFArray, Y : AFArray, title : cstring ) {.importcpp: "plot", header : "arrayfire.h".} 1234 | proc scatter*( this : Window, af_in : AFArray, marker : MarkerType, title : cstring ) {.importcpp: "scatter", header : "arrayfire.h".} 1235 | proc scatter*( this : Window, X : AFArray, Y : AFArray, Z : AFArray, marker : MarkerType, title : cstring ) {.importcpp: "scatter", header : "arrayfire.h".} 1236 | proc scatter*( this : Window, X : AFArray, Y : AFArray, marker : MarkerType, title : cstring ) {.importcpp: "scatter", header : "arrayfire.h".} 1237 | proc scatter3*( this : Window, P : AFArray, marker : MarkerType, title : cstring ) {.importcpp: "scatter3", header : "arrayfire.h".} 1238 | proc hist*( this : Window, X : AFArray, minval : float64, maxval : float64, title : cstring ) {.importcpp: "hist", header : "arrayfire.h".} 1239 | proc surface*( this : Window, S : AFArray, title : cstring ) {.importcpp: "surface", header : "arrayfire.h".} 1240 | proc surface*( this : Window, xVals : AFArray, yVals : AFArray, S : AFArray, title : cstring ) {.importcpp: "surface", header : "arrayfire.h".} 1241 | proc vectorField*( this : Window, points : AFArray, directions : AFArray, title : cstring ) {.importcpp: "vectorField", header : "arrayfire.h".} 1242 | proc vectorField*( this : Window, xPoints : AFArray, yPoints : AFArray, zPoints : AFArray, xDirs : AFArray, yDirs : AFArray, zDirs : AFArray, title : cstring ) {.importcpp: "vectorField", header : "arrayfire.h".} 1243 | proc vectorField*( this : Window, xPoints : AFArray, yPoints : AFArray, xDirs : AFArray, yDirs : AFArray, title : cstring ) {.importcpp: "vectorField", header : "arrayfire.h".} 1244 | proc setAxesLimits*( this : Window, x : AFArray, y : AFArray, exact : bool ) {.importcpp: "setAxesLimits", header : "arrayfire.h".} 1245 | proc setAxesLimits*( this : Window, x : AFArray, y : AFArray, z : AFArray, exact : bool ) {.importcpp: "setAxesLimits", header : "arrayfire.h".} 1246 | proc setAxesLimits*( this : Window, xmin : float32, xmax : float32, ymin : float32, ymax : float32, exact : bool ) {.importcpp: "setAxesLimits", header : "arrayfire.h".} 1247 | proc setAxesLimits*( this : Window, xmin : float32, xmax : float32, ymin : float32, ymax : float32, zmin : float32, zmax : float32, exact : bool ) {.importcpp: "setAxesLimits", header : "arrayfire.h".} 1248 | proc setAxesTitles*( this : Window, xtitle : cstring, ytitle : cstring, ztitle : cstring ) {.importcpp: "setAxesTitles", header : "arrayfire.h".} 1249 | proc setAxesLabelFormat*( this : Window, xformat : cstring, yformat : cstring, zformat : cstring ) {.importcpp: "setAxesLabelFormat", header : "arrayfire.h".} 1250 | proc grid*( this : Window, rows : int32, cols : int32 ) {.importcpp: "grid", header : "arrayfire.h".} 1251 | proc show*( this : Window ) {.importcpp: "show", header : "arrayfire.h".} 1252 | proc close*( this : Window ) : bool {.importcpp: "close", header : "arrayfire.h".} 1253 | proc setVisibility*( this : Window, isVisible : bool ) {.importcpp: "setVisibility", header : "arrayfire.h".} 1254 | proc `call`*(this : Window, r : int32, c : int32) : Window {.importcpp: "(# () #)", header: "arrayfire.h".} 1255 | proc randomEngine*( typeIn : RandomEngineType, seedIn : uint64 ) : RandomEngine {.constructor, importcpp: "af::randomEngine(@)", header: "arrayfire.h".} 1256 | proc randomEngine*( other : RandomEngine ) : RandomEngine {.constructor, importcpp: "af::randomEngine(@)", header: "arrayfire.h".} 1257 | proc randomEngine*( engine : RandomEngine ) : RandomEngine {.constructor, importcpp: "af::randomEngine(@)", header: "arrayfire.h".} 1258 | proc destroy_randomEngine*(this: var RandomEngine) {.importcpp: "#.~randomEngine()", header : "arrayfire.h".} 1259 | proc `assign`*(this : RandomEngine, other : RandomEngine) {.importcpp: "(# = #)", header: "arrayfire.h".} 1260 | proc setType*( this : RandomEngine, af_type : RandomEngineType ) {.importcpp: "setType", header : "arrayfire.h".} 1261 | proc getType*( this : RandomEngine ) : RandomEngineType {.importcpp: "af::getType", header : "arrayfire.h".} 1262 | proc setSeed*( this : RandomEngine, seed : uint64 ) {.importcpp: "setSeed", header : "arrayfire.h".} 1263 | proc getSeed*( this : RandomEngine ) : uint64 {.importcpp: "getSeed", header : "arrayfire.h".} 1264 | proc get*( this : RandomEngine ) : RandomEngine {.importcpp: "get", header : "arrayfire.h".} 1265 | 1266 | #endregion 1267 | 1268 | -------------------------------------------------------------------------------- /LICENSE.md: -------------------------------------------------------------------------------- 1 | 2 | Copyright (c) 2023 3 | All rights reserved. 4 | 5 | Redistribution and use in source and binary forms, with or without 6 | modification, are permitted provided that the following conditions are met: 7 | 8 | * Redistributions of source code must retain the above copyright notice, this 9 | list of conditions and the following disclaimer. 10 | 11 | * Redistributions in binary form must reproduce the above copyright notice, 12 | this list of conditions and the following disclaimer in the documentation 13 | and/or other materials provided with the distribution. 14 | 15 | * Neither the name of [project] nor the names of its 16 | contributors may be used to endorse or promote products derived from 17 | this software without specific prior written permission. 18 | 19 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 20 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 21 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 22 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 23 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 24 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 25 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 26 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 27 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 28 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # The Arrayfire Nim wrapper has moved 2 | Please visit the new version at [SciNim](https://github.com/SciNim/Arrayfire-Nim) to get to the latest version of the wrapper, this repository has been archived and will not be maintained any more 3 | 4 | ## Please Note 5 | ArrayFire-Nim is not affiliated with or endorsed by ArrayFire. The ArrayFire literal 6 | mark is used under a limited license granted by ArrayFire the trademark holder 7 | in the United States and other countries. 8 | 9 | This repository is not maintained any more 10 | -------------------------------------------------------------------------------- /assets/man.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bitstormFA/ArrayFire-Nim/6079baaa38371c6c681dfce6448b11f22b3e7926/assets/man.jpg -------------------------------------------------------------------------------- /generator/generate.nim: -------------------------------------------------------------------------------- 1 | import std/json 2 | import std/strutils 3 | import std/sequtils 4 | import std/options 5 | import std/tables 6 | import std/strformat 7 | import std/algorithm 8 | import std/sugar 9 | import print 10 | from std/re import nil 11 | 12 | var type_rename = {"array": "AFArray", "dim_t": "DimT", 13 | "af_array": "AF_Array_Handle", 14 | "ArrayProxy": "AFArray", 15 | "cuchar": "cstring", 16 | "exception": "AF_Exception", 17 | "seq": "AF_Seq", 18 | "af_cfloat": "cdouble", 19 | "af_cdouble": "float64", 20 | "cdouble": "float64", 21 | "af_someenum_t": "SomeenumT", 22 | "cfloat": "float32", 23 | "af_seq": "AF_Seq", "index": "IndexT", 24 | ":int": "int32", 25 | ":unsigned-int": "uint32", 26 | ":char": "cstring", 27 | ":unsigned-char": "cstring", 28 | ":_Bool": "bool", 29 | ":long": "int32", 30 | "CSpace": "CSpaceT", 31 | ":unsigned-long": "uint32", 32 | ":long-long": "int64", 33 | ":unsigned-long-long": "uint64", 34 | ":double": "float64", 35 | ":float": "float32", 36 | ":short": "int16", 37 | ":void": "pointer", 38 | ":unsigned-short": "uint16", 39 | "size_t": "uint32", 40 | "ptr": "pointer"}.toTable() 41 | 42 | const function_rename = {"mod": "af_mod", "alloc": "af_alloc", "var": "af_var", "block": "af_block", "=": "assign", 43 | "type": "dtype", "array": "af_array", "sum": "asum", "min": "amin", "max": "amax", 44 | "seq": "af_seq", "as": "af_as", "Window": "make_window", "()": "call"}.toTable() 45 | 46 | const skip_functions = @["batchFunc", "timeit", "tile", "toString"] 47 | 48 | const skip_enums: seq[string] = @[] 49 | 50 | const skip_types = @["array_proxy", "ArrayProxy"] 51 | 52 | const operator_rename = {"array": "afa"}.toTable() 53 | 54 | const parameter_rename = {"in": "af_in", "out": "af_out", "from": "af_from", "seq": "af_seq", 55 | "method": "af_mathod", "var": "af_var", "func": "af_func", 56 | "end": "af_end", "type": "af_type", "s_": "s", "": "p", 57 | "ptr": "af_ptr"}.toTable() 58 | 59 | const skip_signatures = @["evalafarray"] 60 | 61 | 62 | type 63 | DefType{.pure.} = enum 64 | Enum, Typedef, Pointer, Other 65 | 66 | TypeEntry = object 67 | name: string 68 | dtype: DefType 69 | id: int 70 | content: string 71 | 72 | EnumField = object 73 | name: string 74 | eval: int 75 | 76 | EnumDef = object 77 | name: string 78 | fields: seq[EnumField] 79 | 80 | CType = object 81 | name: string 82 | bit_size: int 83 | 84 | Parameter = object 85 | name: string 86 | reference: bool 87 | ctype: CType 88 | 89 | Function = object 90 | name: string 91 | ns: string 92 | parameters: seq[Parameter] 93 | return_type: CType 94 | 95 | ClassDef = object 96 | name: string 97 | ns: string 98 | id: int 99 | bit_size: int 100 | methods: seq[Function] 101 | 102 | proc tanslate_predefined_types(n: string): string = 103 | result = type_rename.getOrDefault(n, n) 104 | 105 | proc make_type_name(n: string): string = 106 | if n.startsWith(":"): 107 | return n 108 | var start_name = n 109 | if n in type_rename: 110 | result = type_rename[n] 111 | else: 112 | var elements = start_name.split("_") 113 | if elements[0] == "af": 114 | elements.delete(0) 115 | for e in elements: 116 | let upperName = e[0].toUpperAscii() & e[1 .. ^1] 117 | result = result & upperName 118 | type_rename[n] = result 119 | 120 | proc analyze_type_node(node: JsonNode): Option[TypeEntry] = 121 | let name = node["name"].getStr() 122 | let type_child = node["type"] 123 | let tag = type_child["tag"].getStr() 124 | let id = type_child{"id"}.getInt(-1) 125 | let dtype = case tag: 126 | of ":enum": DefType.Enum 127 | of ":int": DefType.Typedef 128 | of ":long": DefType.Typedef 129 | of ":long-long": DefType.Typedef 130 | of ":pointer": DefType.Pointer 131 | else: 132 | DefType.Other 133 | if dtype == DefType.Other: 134 | return none(TypeEntry) 135 | else: 136 | return some(TypeEntry(name: name, dtype: dtype, id: id, content: tag)) 137 | 138 | proc childs_with_tag(node: JsonNode, tag: string): seq[JsonNode] = 139 | for child in node.items(): 140 | if child{"tag"}.getStr("") == tag: 141 | result.add(child) 142 | 143 | proc get_type_defs(node: JsonNode): (Table[int, TypeEntry], Table[string, TypeEntry]) = 144 | var enums = Table[int, TypeEntry]() 145 | var type_defs = Table[string, TypeEntry]() 146 | for child in node.childs_with_tag("typedef"): 147 | let td = analyze_type_node(child) 148 | if td.isSome(): 149 | let td = td.get() 150 | case td.dtype: 151 | of DefType.Enum: 152 | enums[td.id] = td 153 | of DefType.Typedef: 154 | type_defs[td.name] = td 155 | else: 156 | discard 157 | return (enums, type_defs) 158 | 159 | proc get_namespaces(node: JsonNode): Table[int, string] = 160 | for child in node.childs_with_tag("namespace"): 161 | if child.hasKey("id") and child.hasKey("name"): 162 | let name = child["name"].getStr() 163 | let id = child["id"].getInt() 164 | result[id] = name 165 | 166 | proc get_enums(node: JsonNode, type_defs: Table[int, TypeEntry]): seq[EnumDef] = 167 | for child in node.childs_with_tag("enum"): 168 | let id = child["id"].getInt() 169 | if not type_defs.hasKey(id): 170 | continue 171 | let td = type_defs[id] 172 | let name = tanslate_predefined_types(td.name) 173 | var enum_fields = newSeq[EnumField]() 174 | for field in child["fields"]: 175 | let field_name = field["name"].getStr() 176 | let field_val = field["value"].getInt() 177 | enum_fields.add(EnumField(name: field_name, eval: field_val)) 178 | result.add(EnumDef(name: name, fields: enum_fields)) 179 | 180 | proc get_type(node: JsonNode): CType = 181 | var type_node = if node.hasKey("type"): node["type"] else: node 182 | let tag = type_node["tag"].getStr() 183 | let name = make_type_name(type_node{"name"}.getStr(tag)) 184 | let bit_size = node{"bit-size"}.getInt(0) 185 | return CType(name: name, bit_size: 0) 186 | 187 | 188 | proc get_parameters(node: JsonNode): seq[Parameter] = 189 | var reference = false 190 | for p in node["parameters"]: 191 | var name = p["name"].getStr() 192 | name = re.replace(name, re.re"_$", "") 193 | var type_node = p["type"] 194 | if type_node.hasKey("type"): #reference 195 | reference = true 196 | type_node = type_node["type"] 197 | let ctype = get_type(type_node) 198 | result.add(Parameter(name: name, ctype: ctype, reference: reference)) 199 | 200 | 201 | proc get_method_function(node: JsonNode, name_spaces: Table[int, string]): Function = 202 | let name = node["name"].getStr().strip() 203 | let parameters = get_parameters(node) 204 | let return_type = get_type(node["return-type"]) 205 | let ns_id = node{"ns"}.getInt(-111) 206 | let namespace = name_spaces.getOrDefault(ns_id, "") 207 | result = Function(name: name, ns: namespace, parameters: parameters, 208 | return_type: return_type) 209 | 210 | proc get_classes(node: JsonNode, name_spaces: Table[int, string]): seq[ClassDef] = 211 | for child in node.childs_with_tag("class"): 212 | let name = child["name"].getStr() 213 | let id = child["id"].getInt() 214 | let ns_id = child{"ns"}.getInt(-1) 215 | let ns = name_spaces.getOrDefault(ns_id, "") 216 | var methods = newSeq[Function]() 217 | for m in child["methods"]: 218 | let cmethod = get_method_function(m, name_spaces) 219 | methods.add(cmethod) 220 | let class_def = ClassDef(name: name, ns: ns, id: id, methods: methods) 221 | if len(methods) > 0: 222 | result.add(class_def) 223 | 224 | proc af_childs(node: JsonNode): JsonNode = # find all nodes which belong to the af namespace 225 | var af_node = %* [] 226 | # filter out nodes for af definition 227 | for e in node.items(): 228 | if "/af/" in e{"location"}.getStr("") or e{"name"}.getStr("") == "af": 229 | af_node.add(e) 230 | return af_node 231 | 232 | proc get_functions(node: JsonNode, name_spaces: Table[int, string]): seq[Function] = 233 | for child in node.childs_with_tag("function"): 234 | let f = get_method_function(child, name_spaces) 235 | result.add(f) 236 | 237 | proc enum_entries_sort(x, y: EnumField): int = 238 | if (x.eval > y.eval) or (x.eval == y.eval and len(x.name) > len(y.name)): 1 239 | else: -1 240 | 241 | proc sort_filter_enum_entries(s: seq[EnumField]): seq[EnumField] = 242 | let sorted_entries = s.sorted(enum_entries_sort) 243 | var already_used = newSeq[int]() 244 | for ee in sorted_entries: 245 | if ee.eval notin already_used: 246 | already_used.add(ee.eval) 247 | result.add(ee) 248 | 249 | proc render_enum(e: EnumDef, public: bool = true): string = 250 | let public_flag = if public: "*" else: "" 251 | let name = make_type_name(e.name) 252 | result = &""" {name}{public_flag} {{.pure, header : "arrayfire.h", import_cpp: "{e.name}", size: sizeof(cint).}} = enum """ & "\n" 253 | var items = newSeq[string]() 254 | for ee in sort_filter_enum_entries(e.fields): 255 | items.add(fmt" {ee.name.toUpperAscii()} = {ee.eval}") 256 | let items_s = items.join(",\n") 257 | result = result & items_s & "\n" 258 | type_rename[e.name] = name 259 | 260 | proc render_ctype(c: CType, is_return_type:bool = false): string = 261 | if is_return_type and c.name == ":void": # has a different meeting in return type 262 | result = ":void" 263 | else: 264 | result = tanslate_predefined_types(c.name) 265 | 266 | proc render_parameter(p: Parameter): string = 267 | let type_name = render_ctype(p.ctype) 268 | let parameter_name = parameter_rename.getOrDefault(p.name, p.name) 269 | result = fmt"{parameter_name} : {type_name}" 270 | 271 | proc render_parameters(ps: seq[Parameter]): string = 272 | var p_strings = newSeq[string]() 273 | for p in ps: 274 | p_strings.add(render_parameter(p)) 275 | result = if len(p_strings) > 0: p_strings.join(", ") else: "" 276 | 277 | proc is_simple_parameter(n: string): bool = 278 | if n.startsWith(":"): 279 | result = true 280 | elif n.startsWith("int") or n.startsWith("float") or n.startsWith("long") or n.startsWith("double"): 281 | result = true 282 | else: 283 | result = false 284 | 285 | proc skip_function(f: Function, skip_simple:bool = true): bool = 286 | result = false 287 | if f.name in skip_functions: 288 | return true 289 | var all_c_types = true 290 | for p in f.parameters: 291 | if not is_simple_parameter(p.ctype.name): 292 | all_c_types = false 293 | break 294 | if all_c_types and f.name.startsWith("operator") and skip_simple: 295 | return true 296 | for p in f.parameters: 297 | if p.ctype.name.toLowerAscii == "istream" or 298 | p.ctype.name.toLowerAscii == "ostream": 299 | result = true 300 | break 301 | 302 | proc render_destructor(c: ClassDef): string = 303 | let type_name = tanslate_predefined_types(c.name) 304 | result = &"""proc destroy_{c.name}*(this: var {type_name}) {{.importcpp: "#.~{c.name}()", header : "arrayfire.h".}}""" 305 | 306 | proc render_function(f: Function, public: bool = true, is_constructor: bool = false, is_method: bool = false): string = 307 | let public_flag = if public: "*" else: "" 308 | let parameter_string = render_parameters(f.parameters) 309 | let rt_raw = render_ctype(f.return_type, is_return_type=true) 310 | let rt = if rt_raw == ":void": "" else: &": {rt_raw}" 311 | let ns_prefix = if f.ns == "": "" else: &"{f.ns}::" 312 | 313 | if f.name.startsWith("operator"): 314 | var name = f.name.replace("operator", "").strip() 315 | name = operator_rename.getOrDefault(name, name) 316 | let nim_name = function_rename.getOrDefault(name, name) 317 | result = "proc `" & $nim_name & "`" 318 | result = result & &"{public_flag}({parameter_string}) {rt} " & &"""{{.importcpp: "(# {name} #)", header: "arrayfire.h".}}""" 319 | else: 320 | let nim_name = function_rename.getOrDefault(f.name, f.name) 321 | result = &"proc {nim_name}{public_flag}" 322 | result = result & fmt"( {parameter_string} ) {rt} " 323 | if is_constructor: 324 | result = result & &"""{{.constructor, importcpp: "af::{f.name}(@)", header: "arrayfire.h".}}""" 325 | elif is_method: 326 | result = result & &"""{{.importcpp: "{ns_prefix}{f.name}", header : "arrayfire.h".}}""" 327 | else: 328 | result = result & &"""{{.importcpp: "{ns_prefix}{f.name}(@)", header: "arrayfire.h".}}""" 329 | 330 | proc render_class_methods(c: ClassDef): seq[string] = 331 | let this_ctype = CType(name: c.name, bit_size: 0) 332 | let this_parameter = Parameter(name: "this", reference: false, 333 | ctype: this_ctype) 334 | var already_processed = newSeq[Function]() 335 | for m in c.methods: 336 | if skip_function(m, false): 337 | continue 338 | if m.name.startsWith("~"): 339 | result.add(render_destructor(c)) 340 | else: 341 | if m.name.contains("[]"): continue # index will be handled in handwritten code 342 | let is_constructor = if m.name == c.name: true else: false 343 | var return_type = if is_constructor: CType(name: c.name, 344 | bit_size: 0) else: m.return_type 345 | if m.name.endsWith("=") and not m.name.endsWith("=="): 346 | return_type = CType(name: ":void", bit_size:0) 347 | 348 | let tt = @[this_parameter] 349 | var new_params = if not is_constructor: tt & m.parameters else: m.parameters 350 | var f = Function(name: m.name, ns: m.ns, parameters: new_params, 351 | return_type: return_type) 352 | if f notin already_processed: 353 | result.add(render_function(f, is_constructor = is_constructor, ismethod=true)) 354 | already_processed.add(f) 355 | 356 | proc render_type(c: ClassDef): string = 357 | let nim_type = tanslate_predefined_types(c.name) 358 | let imp = if c.name == "AFArray_proxy": "af::array" else: "af" 359 | return &""" {nim_type}* {{.final, header : "arrayfire.h", importcpp: "{imp}::{c.name}".}} = object""" 360 | 361 | proc function_signature(f: Function): string = 362 | var param_types = newSeq[string]() 363 | for p in f.parameters: 364 | param_types.add(render_ctype(p.ctype).toLowerAscii()) 365 | result = f.name.toLowerAscii() & param_types.join("_") 366 | 367 | proc generate(json_def_file: string, outfile_name: string) = 368 | let outfile = open(outfile_name, fmWrite) 369 | defer: outfile.close() 370 | 371 | var af_node = af_childs(parseFile(json_def_file)) 372 | 373 | let (enums_types, type_defs) = get_type_defs(af_node) 374 | let namespaces = get_namespaces(af_node) 375 | let enums = get_enums(af_node, enums_types) 376 | let cclasses = get_classes(af_node, name_spaces) 377 | let functions = get_functions(af_node, name_spaces) 378 | 379 | outfile.write(""" 380 | when defined(Windows): 381 | from os import nil 382 | const AF_INCLUDE_PATH = "\"" & os.joinPath(os.getEnv("AF_PATH"), "include") & "\"" 383 | const AF_LIB_PATH = "\"" & os.joinPath(os.getEnv("AF_PATH"), "lib\\af.lib") & "\"" 384 | {.passC: "/GS /W3 /Zc:wchar_t /FS /Zi /Gm- /O2 /Ob2 /Zc:inline /fp:precise /external:W0 /D \"_MBCS\" /D \"WIN32\" /D \"_WINDOWS\" /D \"WIN32_LEAN_AND_MEAN\" /D \"VC_EXTRALEAN\" /D \"NOMINMAX\" " & " -I" & AF_INCLUDE_PATH.} 385 | {.passL: "/DYNAMICBASE " & AF_LIB_PATH .} 386 | elif defined(Linux): 387 | {.passC: "-std=c++11".} 388 | {.passL: "-lGL -laf".} 389 | elif defined(MacOsX): 390 | from os import nil 391 | const AF_INCLUDE_PATH = "\"" & os.joinPath(os.getEnv("AF_PATH"), "include") & "\"" 392 | const AF_LIB_PATH = "\"" & os.joinPath(os.getEnv("AF_PATH"), "lib") & "\"" 393 | {.passC: "-std=c++11" & " -I " & AF_INCLUDE_PATH.} 394 | {.passL: "-laf" & " -L" & AF_LIB_PATH.} 395 | when sizeof(int) == 8: 396 | type DimT* = clonglong 397 | else: 398 | type DimT* = cint 399 | 400 | type 401 | AF_Array_Handle* = distinct pointer 402 | """) 403 | 404 | outfile.write("\n#region Types \n\n") 405 | outfile.write("type\n") 406 | for c in cclasses: 407 | if c.name in skip_types: 408 | continue 409 | outfile.write(render_type(c)) 410 | outfile.write("\n") 411 | outfile.write("\n#endregion\n\n") 412 | 413 | 414 | outfile.write("#region Enums\n\n") 415 | outfile.write("type\n") 416 | for e in enums: 417 | if e.name in skip_enums: continue 418 | outfile.write(render_enum(e)) 419 | outfile.write("\n") 420 | outfile.write("#endregion\n\n") 421 | 422 | 423 | outfile.write("\n#region Functions\n\n") 424 | var process_functions = newSeq[string]() 425 | for f in functions: 426 | if skip_function(f): 427 | continue 428 | let sig = function_signature(f) 429 | if sig in skip_signatures: 430 | continue 431 | if sig notin process_functions: 432 | process_functions.add(sig) 433 | outfile.write(render_function(f)) 434 | outfile.write("\n") 435 | outfile.write("#endregion\n\n ") 436 | 437 | 438 | outfile.write("\n#region Methods\n") 439 | for c in cclasses: 440 | if c.name in skip_types: 441 | continue 442 | let method_renders = deduplicate(render_class_methods(c)) 443 | outfile.write(method_renders.join("\n")) 444 | outfile.write("\n") 445 | outfile.write("\n#endregion\n\n") 446 | 447 | 448 | generate("generator/arrayfire.json", "ArrayFireNim/raw.nim") 449 | -------------------------------------------------------------------------------- /tests/config.nims: -------------------------------------------------------------------------------- 1 | when not compiles(nimVersion): 2 | const nimVersion = (major: NimMajor, minor: NimMinor, patch: NimPatch) 3 | 4 | when nimVersion >= (1, 3, 3): 5 | switch("backend", "cpp") 6 | switch("path", "$projectDir/../ArrayFireNim") 7 | switch("outdir", "$projectDir/../bin") -------------------------------------------------------------------------------- /tests/test_basic.nim: -------------------------------------------------------------------------------- 1 | import ArrayFireNim 2 | import unittest 3 | import strutils 4 | import std/strformat 5 | 6 | 7 | test "backend test": 8 | let backends = available_backends() 9 | echo "available backends $1" % $backends 10 | for b in backends: 11 | echo "testing backend $1" % $b 12 | setBackend(b) 13 | let active = getActiveBackend() 14 | check active == b 15 | let bc = getBackendCount() 16 | echo &"number of available backends: {bc}" 17 | check bc > 0 18 | 19 | test "matrix construction with specified matrix type": 20 | let m1d = afa(9, @[1, 2, 3, 4, 5, 6, 7, 8, 9], Dtype.F64) 21 | echo m1d 22 | let n1d = afa(@[1, 2, 3, 4, 5, 6, 7, 8, 9], Dtype.S16) 23 | check m1d.dims(0) == 9 24 | check m1d.ndims == 1 25 | check len(m1d) == 9 26 | check m1d.elements == n1d.elements 27 | check m1d.dtype == Dtype.F64 28 | check n1d.dtype == Dtype.S16 29 | 30 | test "matrix construction without matrix type": 31 | let m1d = afa(9, @[1'i32, 2'i32, 3'i32]) 32 | check(m1d.dtype == Dtype.S32) 33 | let m2d = afa(1, 1, [1]) 34 | check(m2d.dtype == Dtype.S32) 35 | let m3d = afa(2, 2, 2, @[1, 2, 3, 4, 5, 6, 7, 8]) 36 | check(m3d.dtype == Dtype.S32) 37 | let m4d = afa(dim4(2, 2, 2, 2), 1..16) 38 | check(m4d.dtype == Dtype.S32) 39 | 40 | test "matrix from constant": 41 | let m0 = constant(-1, 3, 3, Dtype.S32) 42 | echo m0 43 | echo m0.dtype 44 | check m0.dtype == Dtype.S32 45 | check m0.len == 9 46 | check m0.to_seq(int) == @[-1, -1, -1, -1, -1, -1, -1, -1, -1] 47 | 48 | let m1 = constant(1, 2, 2, Dtype.U64) 49 | check(m1.dtype == DType.U64) 50 | check(m1.len == 4) 51 | check(m1.to_seq(int) == @[1, 1, 1, 1]) 52 | 53 | test "random value matrix construction": 54 | let m0 = randu(3, 3, Dtype.F64) 55 | check(m0.dtype == Dtype.F64) 56 | let m1 = randn(2, 2, Dtype.F32) 57 | check(m1.dtype == Dtype.F32) 58 | 59 | test "matrix properties": 60 | let m0 = constant(10, 3, 3, Dtype.C64) 61 | check(m0.dtype == Dtype.C64) 62 | check(m0.len == 9) 63 | check(m0.ndims == 2) 64 | check(m0.dims == dim4(3, 3)) 65 | check(m0.to_seq(int) == @[10, 10, 10, 10, 10, 10, 10, 10, 10]) 66 | check(m0.first_as(float) == 10.0) 67 | 68 | test "matrix indexing": 69 | #construct 3x3 Matrix with int32 values 70 | #1 4 7 71 | #2 5 8 72 | #3 6 9 73 | var a = afa(3, 3, 1..9, Dtype.F64) 74 | 75 | #first element 76 | let ap = a[0] 77 | check(a[0].first_as(int) == 1) 78 | 79 | #last element 80 | check(a[-1].first_as(int) == 9) 81 | 82 | #alternative last element 83 | check(a[iend].first_as(int) == 9) 84 | 85 | #second to last element 86 | check(a[iend-1].first_as(int) == 8) 87 | 88 | #second row 89 | check(a[1, span].to_seq(int) == @[2, 5, 8]) 90 | 91 | #last row 92 | check(a.row(iend).to_seq(int) == @[3, 6, 9]) 93 | 94 | #all but first row 95 | check(a.cols(1, iend).to_seq(int) == @[4, 5, 6, 7, 8, 9]) 96 | 97 | #assign value to view spanning all elements 98 | a[span] = 4 99 | check(a.to_seq(int) == @[4, 4, 4, 4, 4, 4, 4, 4, 4]) 100 | 101 | #set first row to 0 102 | a[0, span] = 0 103 | check(a.to_seq(int) == @[0, 4, 4, 0, 4, 4, 0, 4, 4]) 104 | -------------------------------------------------------------------------------- /tests/test_benchmark.nim: -------------------------------------------------------------------------------- 1 | import ArrayFireNim 2 | import unittest 3 | import strutils 4 | import strformat 5 | import std/math 6 | 7 | test "benchmark blas": 8 | setDevice(0) 9 | info() 10 | 11 | echo "Benchmark N-by-N matrix multiply\n" 12 | 13 | var peak: float = 0 14 | 15 | for n in countup(128, 2048, 128): 16 | stdout.write fmt"{n:>5} x {n:>5}: " 17 | 18 | let a = constant(1, n, n, Dtype.F32) 19 | let time = timeit: 20 | var b = matmul(a, a) 21 | b.eval() 22 | 23 | let ops = float(2 * n ^ 3) 24 | let gflops = ops / (time * 1e9) 25 | 26 | if gflops > peak: 27 | peak = gflops 28 | echo fmt"{gflops:>8.0f}" 29 | 30 | echo fmt"### peak {peak:8} Gflops\n" 31 | 32 | test "benchmark fft": 33 | setDevice(0) 34 | info() 35 | echo "Benchmarking N-by-N 2D FFT" 36 | 37 | for m in 7..12: 38 | var n = (1 shl m) 39 | 40 | stdout.write fmt"{n:>5} x {n:>5}: " 41 | let a = randu(n, n, Dtype.F32) 42 | 43 | let time = timeit: 44 | let b = fft2(a) 45 | b.eval() 46 | 47 | let gflops = float64(10 * n * n * m) / (time * 1e9) 48 | 49 | echo fmt"{gflops:>8.0f} Gflops" 50 | -------------------------------------------------------------------------------- /tests/test_computer_vision.nim: -------------------------------------------------------------------------------- 1 | import ArrayFireNim 2 | import unittest 3 | import strutils 4 | import std/times 5 | 6 | test "fast": 7 | setDevice(0) 8 | info() 9 | var img_color = loadImage("assets/man.jpg", true) 10 | let img = colorSpace(img_color, CspaceT.AF_GRAY, CSpaceT.AF_RGB) 11 | 12 | img_color /= 255i16 13 | 14 | let feat = fast(img, 20.0, 9, true, 0.05, 3) 15 | 16 | let hx = feat.getX().to_seq(float) 17 | let hy = feat.getY().to_seq(float) 18 | 19 | let draw_len = 3 20 | 21 | for f in 0.. 0.05: 44 | break 45 | 46 | discard wnd.close() 47 | 48 | test "harris": 49 | setDevice(0) 50 | info() 51 | 52 | var img_color = loadImage("assets/man.jpg", true) 53 | let img = colorSpace(img_color, CSpaceT.AF_GRAY, CSpaceT.AF_RGB) 54 | 55 | img_color /= 255.0f32 56 | 57 | var (ix, iy) = img.grad() 58 | 59 | 60 | var ixx = ix * ix 61 | var ixy = ix * iy 62 | var iyy = iy * iy 63 | 64 | var gauss_filt = gaussianKernel(5, 5, 1.0, 1.0) 65 | 66 | ixx = ixx.convolve(gauss_filt, ConvMode.AF_CONV_DEFAULT, ConvDomain.AF_CONV_AUTO) 67 | ixy = ixy.convolve(gauss_filt, ConvMode.AF_CONV_DEFAULT, ConvDomain.AF_CONV_AUTO) 68 | iyy = iyy.convolve(gauss_filt, ConvMode.AF_CONV_DEFAULT, ConvDomain.AF_CONV_AUTO) 69 | 70 | var itr = ixx + iyy 71 | 72 | var idet = ixx * iyy - ixy * ixy 73 | 74 | var response = idet - 0.04 * (itr * itr) 75 | 76 | var mask = constant(1, dim4(3, 3), ty = Dtype.F32) 77 | 78 | var max_resp = dilate(response, mask) 79 | 80 | var corners = response > 1e5 81 | corners = corners * response 82 | 83 | corners = (corners == max_resp) * corners 84 | 85 | var h_corners = corners.to_seq(float) 86 | 87 | var good_corners: cuint = 0 88 | 89 | let draw_len: int = 3 90 | 91 | for y in draw_len.. 1e5: 94 | 95 | img_color[y, aseq(x-draw_len, x+draw_len), 0] = 0 96 | img_color[y, aseq(x-draw_len, x+draw_len), 1] = 1 97 | img_color[y, aseq(x-draw_len, x+draw_len), 2] = 0 98 | 99 | img_color[aseq(y-draw_len, y+draw_len), x, 0] = 0; 100 | img_color[aseq(y-draw_len, y+draw_len), x, 1] = 1; 101 | img_color[aseq(y-draw_len, y+draw_len), x, 2] = 0; 102 | 103 | good_corners+=1 104 | 105 | 106 | echo "Corners found: $1" % $good_corners 107 | window(wnd2, "Harris Corner Detector") 108 | 109 | let t0 = cpuTime() 110 | 111 | while not wnd2.close(): 112 | wnd2.image(img_color, "ArrayFire") 113 | let time = cpuTime()-t0 114 | if time > 0.05: 115 | break 116 | 117 | discard wnd2.close() 118 | -------------------------------------------------------------------------------- /tests/test_getting_started.nim: -------------------------------------------------------------------------------- 1 | import ArrayFireNim 2 | import unittest 3 | import strutils 4 | 5 | 6 | test "integer": 7 | setDevice(0) 8 | info() 9 | 10 | echo "\n== Matrix creation" 11 | let h_A = @[1, 2, 4, -1, 2, 0, 4, 2, 3] 12 | let h_B = @[2, 3, -5, 6, 0, 10, -12, 0, 1] 13 | var A = afa(3, 3, h_A); 14 | var B = afa(3, 3, h_B); 15 | 16 | echo $A 17 | print("A.col(0)", A.col(0)) 18 | print("A.row(0)", A.row(0)) 19 | A[0] = 11 20 | A[1] = 100 21 | echo $A 22 | echo $B 23 | 24 | 25 | A[1, span] = B[2, span] 26 | echo $A 27 | 28 | echo "\n-- Bitwise operations" 29 | print("A & B", A&B) 30 | print("A | B", A|B) 31 | print("A ^ B", A ^ B) 32 | 33 | echo "\n-- Logical operations" 34 | print("A && B", A && B) 35 | 36 | echo "\n-- Transpose" 37 | echo $A 38 | print("Transpose", A.T) 39 | print("Hermitian Transpose", A.H) 40 | 41 | 42 | echo("\n-- Flip"); 43 | echo $A 44 | print("Flip Dim0", A.flip(0)) 45 | print("Flip Dim1", A.flip(1)) 46 | 47 | echo "\n-- Sum along columns" 48 | echo $A 49 | print("A.sum", A.asum(-1)) 50 | 51 | echo "\n-- Product along columns" 52 | echo $A 53 | print("A.product", A.product(-1)) 54 | 55 | echo "\n-- Minimum along columns" 56 | echo $A 57 | print("A.mmin", A.amin(-1)) 58 | 59 | echo "\n-- Maximum along columns" 60 | echo $A 61 | print("A.mmax", A.amax(-1)) 62 | 63 | 64 | 65 | echo "\n-- Minimum along columns with index" 66 | echo $A 67 | var idx = afa() 68 | var mout = afa() 69 | amin(mout, idx, A, -1) 70 | print("OUT", mout) 71 | print("idx", idx) 72 | 73 | test "convolve": 74 | setDevice(0) 75 | info() 76 | let h_dx = @[1'f32/12'f32, 8'f32/12'f32, 0'f32, 8'f32/12'f32, 1'f32/12'f32, ] 77 | let h_spread = @[1'f32/5'f32, 1'f32/5'f32, 1'f32/5'f32, 1'f32/5'f32, ] 78 | 79 | var img = randu(640, 480, Dtype.F32) 80 | var dx = afa(5, 1, h_dx) 81 | var spread = afa(1, 5, h_spread) 82 | 83 | echo $dx 84 | echo $spread 85 | 86 | echo $dx.dims 87 | echo $spread.dims 88 | 89 | var kernel = matmul(dx, spread, MatProp.AF_MAT_NONE, MatProp.AF_MAT_NONE) 90 | 91 | let fulltime = timeit: 92 | var full_out = convolve2(img, kernel, ConvMode.AF_CONV_DEFAULT, ConvDomain.AF_CONV_AUTO) 93 | 94 | let dseptime = timeit: 95 | var dsep_out = convolve(dx, spread, img, ConvMode.AF_CONV_DEFAULT) 96 | 97 | 98 | echo "full 2d convolution: $1" % fulltime.formatFloat(precision = 4) 99 | echo "separable, device pointers: $1" % dseptime.formatFloat(precision = 4) 100 | 101 | test "rainfall": 102 | setDevice(0) 103 | info() 104 | let days = 9 105 | let sites = 4 106 | let n = 10 107 | 108 | let dayI = @[0, 0, 1, 2, 5, 5, 6, 6, 7, 8] 109 | let siteI = @[2, 3, 0, 1, 1, 2, 0, 1, 2, 1] 110 | let measurementI = @[9, 5, 6, 3, 3, 8, 2, 6, 5, 10] 111 | 112 | let day = afa(n, dayI) 113 | let site = afa(n, siteI) 114 | let measurement = afa(n, measurementI) 115 | 116 | var rainfall = constant(0, sites, ty = DType.S32) 117 | 118 | gfor(s, sites): 119 | rainfall[s] = asum(measurement * (site == s)) 120 | 121 | echo "total rainfall for each site $1\n" % $rainfall.to_seq(int) 122 | check(rainfall.to_seq(int) == @[8, 22, 22, 5]) 123 | 124 | let is_between = (1i32 <= day) && (day <= 5i32) 125 | 126 | var rain_between = sum_as_float(measurement * is_between) 127 | 128 | echo "rain between days: $1\n" % $rain_between 129 | check(rain_between == 20.0) 130 | 131 | var rainy_days = sum_as_int(diff1(day, 0) > 0i32) + 1 132 | 133 | echo "number of days with rain: " & $rainy_days 134 | check(rainy_days == 7) 135 | 136 | var per_day = constant(0, days, DType.F32) 137 | 138 | gfor(d, days): 139 | per_day[d] = asum(measurement * (day == d)) 140 | 141 | 142 | echo "total rainfall each day: $1 \n" % $per_day 143 | check(per_day.to_seq(int) == @[14, 6, 3, 0, 0, 11, 8, 5, 10]) 144 | 145 | let days_over_five = sum_as_int(per_day > 5i32) 146 | echo "number of days > 5: " & $days_over_five 147 | check(days_over_five == 5) 148 | -------------------------------------------------------------------------------- /tests/test_graphics.nim: -------------------------------------------------------------------------------- 1 | import ArrayFireNim 2 | import unittest 3 | 4 | test "join": 5 | setBackend(Backend.AF_BACKEND_CUDA) 6 | let a = randu(dim4(10,10), Dtype.F32) 7 | let b = randu(dim4(10,10), Dtype.F32) 8 | let c = join(1, a, b) 9 | echo c.dims 10 | 11 | # currently also breaks the cpp version 12 | # test "field": 13 | # setBackend(Backend.AF_BACKEND_DEFAULT) #with 3.4.1 this does not work on CUDA 14 | 15 | # echo $get_available_backends() 16 | # echo $getactivebackend() 17 | 18 | # let MINIMUM = -3.0 19 | # let MAXIMUM = 3.0 20 | # let STEP = 0.18 21 | 22 | # var scale = 2.0 23 | 24 | # window(myWindow, 1024, 1024, "2D Vector Field example") 25 | 26 | # myWindow.grid(1, 2) 27 | 28 | # var dataRange: AFArray = aseq(MINIMUM, MAXIMUM, STEP) 29 | 30 | # var x = tile(dataRange, 1, dataRange.dims(0)) 31 | # var y = tile(dataRange.T, dataRange.dims(0), 1) 32 | 33 | # x.eval() 34 | # y.eval() 35 | 36 | # let t0 = cpuTime() 37 | 38 | # while not myWindow.close(): 39 | # var points = join(1, flat(x), flat(y)) 40 | 41 | # var saddle = join(1, flat(x), -1 * flat(y)) 42 | 43 | # var bvals = sin(scale * (x*x + y*y)) 44 | # let t = constant(1, x.elements(), Dtype.F32) 45 | # let v = flat(bvals) 46 | # echo v.dtype 47 | # let hbowl = join(1, v, t) 48 | # hbowl.eval() 49 | 50 | # echo points.dims 51 | 52 | # myWindow[0, 0].vectorField(points, saddle, "Saddle point") 53 | # myWindow[0, 1].vectorField(points, hbowl, "hilly bowl (in a loop with varying amplitude)") 54 | 55 | # myWindow.show() 56 | 57 | # scale -= 0.0010 58 | # if scale < -0.1: 59 | # scale = 2 60 | 61 | # let time = cpuTime() - t0 62 | # if time > 0.3: 63 | # break 64 | 65 | # discard myWindow.close() 66 | -------------------------------------------------------------------------------- /tests/test_integer.nim: -------------------------------------------------------------------------------- 1 | import ArrayFireNim 2 | import unittest 3 | 4 | test "basic logic and bitwise operations": 5 | set_backend(Backend.AF_BACKEND_DEFAULT) 6 | var a = afa(3,3, @[1, 2, 4, -1, 2, 0, 4, 2, 3]) 7 | var b = afa(3,3,@[2, 3, -5, 6, 0, 10, -12, 0, 1]) 8 | 9 | let ac0 = a.col(0) # access first column 10 | let ar0 = a.row(0) # access first row 11 | 12 | check ac0.to_seq(int) == @[1,2,4] 13 | check ar0.to_seq(int) == @[1,-1,4] 14 | 15 | a[0] = 11 16 | a[1] = 100 17 | 18 | check a[0].first_as(int) == 11 # check content of element 0 19 | check a[1].first_as(int) == 100 # check content of element 1 20 | 21 | a[1, span] = b[2, span] # set first column from a to content of first column in b 22 | check a.to_seq(int) == @[11, -5, 4, -1, 10, 0, 4, 1, 3] 23 | 24 | let a_and_b = a & b 25 | check a_and_b.to_seq(int) == @[2, 3, 0, 6, 0, 0, 4, 0, 1] 26 | 27 | let a_or_b = a | b 28 | check a_or_b.to_seq(int) == @[11, -5, -1, -1, 10, 10, -12, 1, 3] 29 | 30 | let a_not_b = a ^ b 31 | check a_not_b.to_seq(int) == @[9, -8, -1, -7, 10, 10, -16, 1, 2] 32 | 33 | let a_land_b = a && b 34 | check a_land_b.to_seq(int) == @[1, 1, 1, 1, 0, 0, 1, 0, 1] 35 | 36 | let a_lor_b = a || b 37 | check a_lor_b.to_seq(int) == @[1, 1, 1, 1, 1, 1, 1, 1, 1] 38 | 39 | let a_transpose = a.T 40 | check a_transpose.to_seq(int) == @[11, -1, 4, -5, 10, 1, 4, 0, 3] 41 | 42 | let a_flipv = a.flip(0) 43 | check a_flipv.to_seq(int) == @[4, -5, 11, 0, 10, -1, 3, 1, 4] 44 | 45 | test "equal check arrays": 46 | let a = afa(3,3, 1..9) 47 | let a2 = afa(3,3, 1..9) 48 | let a3 = afa(3,3, 1..9, Dtype.F32) 49 | let b = constant(-1, 3,3, Dtype.S32) 50 | check (a == a3).alltrue(-1).to_seq(int) == @[1,1,1] 51 | 52 | 53 | 54 | 55 | -------------------------------------------------------------------------------- /tests/test_la.nim: -------------------------------------------------------------------------------- 1 | import ArrayFireNim 2 | import unittest 3 | 4 | test "svd": 5 | let ain = afa(2,3, @[1, 4, 2, 5, 3, 6], Dtype.F32) 6 | let (u, s, v) = svd(ain) 7 | let s_mat = diag(s, 0, false) 8 | let in_recon = matmul(u, s_mat, v[aseq(2), span]) 9 | 10 | # echo ain 11 | # echo s 12 | # echo u 13 | # echo s_mat 14 | # echo v 15 | # echo in_recon 16 | 17 | check in_recon.to_seq(int) == @[1, 4, 2, 5, 3, 6] -------------------------------------------------------------------------------- /tests/test_memory.nim: -------------------------------------------------------------------------------- 1 | import ArrayFireNim 2 | # this is meant to be run with valgrind 3 | 4 | proc alloc_and_assign() = 5 | var a = randu(10000,10000, Dtype.F64) 6 | let view = a[aseq(0, 200), aseq(200,300)] 7 | var v2 = view * view 8 | v2 *= cdouble(1.5) 9 | a += 2i32 10 | let b = a * 2i32 11 | let c = b + a 12 | c.eval() 13 | 14 | 15 | set_backend(Backend.AF_BACKEND_CPU) 16 | alloc_and_assign() 17 | 18 | --------------------------------------------------------------------------------