1:- module(array, []).
55:- reexport(library(array/core)). 56:- reexport(library(array/compile), [program/2, eval/3, kernels/3, source/2, device_options/2]). 57:- reexport(library(array/handle), [compile/3, compile/2, compile_all/3, run/3, signature/3, release/1, run/4, run_all/4, realize/3, flush_handles/0, signature_all/4]). 58:- reexport(library(array/opencl), [opencl_device/2]). 59:- reexport(library(array/answer), [print_array/1, print_array/2]).
Multidimensional arrays as boxes of equations, compiled to OpenCL
A program is a sequence of boxes, over/2: each box runs its equations at every point of its axes, like a loop nest, and an equation writes one element of an array, a name. From the boxes the compiler derives the kernels, which axes are parallel, what fuses, what lives in registers or local memory, and runs them on any OpenCL device; eval/3 runs the same boxes in Prolog, exactly, the reference to check a device against. Shapes and subscripts are clpBNR constraints, so an extent may stay unknown: one compiled program serves every size, and a subscript out of bounds is an error before anything runs.
The user-facing predicates of the pack, from the modules under array/:
The modules under array/ export more, for tools and tests: load them by name. So are array/api, the functional overlay `Y @= Expr`, and array/grad, the derivatives of a program.
The pack writes caches under $XDG_CACHE_HOME or ~/.cache, each safe to delete: array_eval, the compiled reference programs of eval/3, the flag eval_cache_directory; array_cl, the binaries of OpenCL programs, the flag cl_program_cache_directory; and array_tune, the options tune_device/2 measured for a device, the flag array_tune_file.