uncomplicate.neanderthal.opencl

Specialized constructors that use OpenCL engine by default, and convenient macros for creating and maintaining engines in appropriate OpenCL context. A convenience over agnostic uncomplicate.neanderthal.core functions.

*opencl-factory*

dynamic

Dynamically bound OpenCL factory that is used in vector and matrix constructors.

clge

(clge m n source options)(clge m n arg)(clge m n)(clge a)

Creates a GE matrix using GPU engine provided to the bound *opencl-factory* (see uncomplicate.neanderthal.core/ge).

clsy

(clsy n source options)(clsy n arg)(clsy arg)

Creates a SY matrix using GPU engine provided to the bound *opencl-factory* (see uncomplicate.neanderthal.core/tr).

cltr

(cltr n source options)(cltr n arg)(cltr arg)

Creates a TR matrix using GPU engine provided to the bound *opencl-factory* (see uncomplicate.neanderthal.core/tr).

clv

(clv source)(clv x & xs)

Creates a vector using GPU engine provided to the bound *opencl-factory* (see uncomplicate.neanderthal.core/vctr).

factory-by-type

(factory-by-type data-type)

opencl-double

Constructor of a double-precision floating point OpenCL factory.

opencl-float

Constructor of a single precision floating point OpenCL factory.

set-engine!

(set-engine! factory queue)(set-engine! factory)(set-engine!)

Creates an OpenCL factory using the provided factory constructor function. The created factory will work using the provided queue and its context, and will be bound to the root of *opencl-factory*. Enables the use of clv, clge, cltr, etc. globally.

with-default-engine

macro

(with-default-engine & body)

Creates an OpenCL factory using the default OpenCL factory (single precision floating point), that works in the default OpenCL queue and context acquired through ClojureCL’s *context* and command-queue` bindings. The created factory will be bound to *opencl-factory*.

(with-default
  (with-default-engine
    (with-release [gpu-x (clv (range 3))]
      (sum gpu-x))))

with-engine

macro

(with-engine factory queue & body)

Creates an OpenCL factory using the provided factory constructor function. The created factory will work using the provided queue and its context, and will be bound to *opencl-factory*. Enables the use of clv, clge, cltr, etc. in its body.

(with-default
  (with-engine clblast-float *command-queue*
    (with-release [gpu-x (clv (range 3))]
      (sum gpu-x))))