The cl-opencl-utils Reference Manual

This is the cl-opencl-utils Reference Manual, generated automatically by Declt version 4.0 beta 2 "William Riker" on Sun Sep 15 04:18:26 2024 GMT+0.

Table of Contents


1 Introduction


2 Systems

The main system appears first, followed by any subsystem dependency.


2.1 cl-opencl-utils

OpenCL utility library built on cl-opencl

Author

Gary Hollis

License

GPLv3

Dependency

cl-opencl (system).

Source

cl-opencl-utils.asd.

Child Components

3 Files

Files are sorted by type and then listed depth-first from the systems components trees.


3.1 Lisp


3.1.1 cl-opencl-utils/cl-opencl-utils.asd

Source

cl-opencl-utils.asd.

Parent Component

cl-opencl-utils (system).

ASDF Systems

cl-opencl-utils.


3.1.2 cl-opencl-utils/package.lisp

Source

cl-opencl-utils.asd.

Parent Component

cl-opencl-utils (system).

Packages

cl-opencl-utils.


3.1.3 cl-opencl-utils/utils.lisp

Dependency

package.lisp (file).

Source

cl-opencl-utils.asd.

Parent Component

cl-opencl-utils (system).

Public Interface
Internals

3.1.4 cl-opencl-utils/macro.lisp

Dependency

utils.lisp (file).

Source

cl-opencl-utils.asd.

Parent Component

cl-opencl-utils (system).

Public Interface

defclcmacro (macro).

Internals

3.1.5 cl-opencl-utils/clc.lisp

Dependency

macro.lisp (file).

Source

cl-opencl-utils.asd.

Parent Component

cl-opencl-utils (system).

Public Interface

clc (function).

Internals

3.1.6 cl-opencl-utils/clc-utils.lisp

Dependency

clc.lisp (file).

Source

cl-opencl-utils.asd.

Parent Component

cl-opencl-utils (system).


3.1.7 cl-opencl-utils/function.lisp

Dependency

clc-utils.lisp (file).

Source

cl-opencl-utils.asd.

Parent Component

cl-opencl-utils (system).

Public Interface
Internals

3.1.8 cl-opencl-utils/struct.lisp

Dependency

function.lisp (file).

Source

cl-opencl-utils.asd.

Parent Component

cl-opencl-utils (system).

Public Interface
Internals

3.1.9 cl-opencl-utils/syntax.lisp

Dependency

struct.lisp (file).

Source

cl-opencl-utils.asd.

Parent Component

cl-opencl-utils (system).


3.1.10 cl-opencl-utils/headers.lisp

Dependency

syntax.lisp (file).

Source

cl-opencl-utils.asd.

Parent Component

cl-opencl-utils (system).

Public Interface
Internals

3.1.11 cl-opencl-utils/var.lisp

Dependency

headers.lisp (file).

Source

cl-opencl-utils.asd.

Parent Component

cl-opencl-utils (system).

Public Interface

defclcglobalvar (macro).

Internals

3.1.12 cl-opencl-utils/control.lisp

Dependency

var.lisp (file).

Source

cl-opencl-utils.asd.

Parent Component

cl-opencl-utils (system).


3.1.13 cl-opencl-utils/bool.lisp

Dependency

control.lisp (file).

Source

cl-opencl-utils.asd.

Parent Component

cl-opencl-utils (system).


3.1.14 cl-opencl-utils/math.lisp

Dependency

bool.lisp (file).

Source

cl-opencl-utils.asd.

Parent Component

cl-opencl-utils (system).


3.1.15 cl-opencl-utils/raw-functions.lisp

Dependency

math.lisp (file).

Source

cl-opencl-utils.asd.

Parent Component

cl-opencl-utils (system).

Public Interface

3.1.16 cl-opencl-utils/compile.lisp

Dependency

raw-functions.lisp (file).

Source

cl-opencl-utils.asd.

Parent Component

cl-opencl-utils (system).

Public Interface
Internals

program-source (function).


3.1.17 cl-opencl-utils/complex.lisp

Dependency

compile.lisp (file).

Source

cl-opencl-utils.asd.

Parent Component

cl-opencl-utils (system).

Public Interface

3.1.18 cl-opencl-utils/math-functions.lisp

Dependency

complex.lisp (file).

Source

cl-opencl-utils.asd.

Parent Component

cl-opencl-utils (system).


3.1.19 cl-opencl-utils/libcerf.lisp

Dependency

math-functions.lisp (file).

Source

cl-opencl-utils.asd.

Parent Component

cl-opencl-utils (system).


3.1.20 cl-opencl-utils/cleanup.lisp

Dependency

libcerf.lisp (file).

Source

cl-opencl-utils.asd.

Parent Component

cl-opencl-utils (system).

Public Interface

with-opencl-cleanup (macro).


3.1.21 cl-opencl-utils/map-reduce.lisp

Dependency

cleanup.lisp (file).

Source

cl-opencl-utils.asd.

Parent Component

cl-opencl-utils (system).

Public Interface

3.1.22 cl-opencl-utils/convolution.lisp

Dependency

map-reduce.lisp (file).

Source

cl-opencl-utils.asd.

Parent Component

cl-opencl-utils (system).

Public Interface

make-opencl-convolutor (function).


3.1.23 cl-opencl-utils/function-sampling.lisp

Dependency

convolution.lisp (file).

Source

cl-opencl-utils.asd.

Parent Component

cl-opencl-utils (system).

Public Interface

make-opencl-function-sampler (function).


3.1.24 cl-opencl-utils/integration.lisp

Dependency

function-sampling.lisp (file).

Source

cl-opencl-utils.asd.

Parent Component

cl-opencl-utils (system).

Public Interface

3.1.25 cl-opencl-utils/spline.lisp

Dependency

integration.lisp (file).

Source

cl-opencl-utils.asd.

Parent Component

cl-opencl-utils (system).

Public Interface

3.1.26 cl-opencl-utils/random.lisp

Dependency

spline.lisp (file).

Source

cl-opencl-utils.asd.

Parent Component

cl-opencl-utils (system).


3.1.27 cl-opencl-utils/blas.lisp

Dependency

random.lisp (file).

Source

cl-opencl-utils.asd.

Parent Component

cl-opencl-utils (system).

Public Interface

make-opencl-axpy (function).


3.1.28 cl-opencl-utils/rk4.lisp

Dependency

blas.lisp (file).

Source

cl-opencl-utils.asd.

Parent Component

cl-opencl-utils (system).

Public Interface

make-opencl-rk4 (function).


4 Packages

Packages are listed by definition order.


4.1 cl-opencl-utils

Source

package.lisp.

Use List
  • cffi.
  • cl-opencl.
  • common-lisp.
Public Interface
Internals

5 Definitions

Definitions are sorted by export status, category, package, and then by lexicographic order.


5.1 Public Interface


5.1.1 Special variables

Special Variable: +opencl-add-rexpr+
Package

cl-opencl-utils.

Source

map-reduce.lisp.

Special Variable: +opencl-complex-add-rexpr+
Package

cl-opencl-utils.

Source

map-reduce.lisp.


5.1.2 Macros

Macro: defclcfun (fname return-type clc-args &body body)

Defines a OpenCL C function which is loaded automatically into a program’s code.

Package

cl-opencl-utils.

Source

function.lisp.

Macro: defclcglobalvar (form)

Defines a global variable using form. form should be one of (var ...) or (vararray ...). The name of the global variable is taken from the var form.

Package

cl-opencl-utils.

Source

var.lisp.

Macro: defclckernel (fname clc-args &body body)

Defines a OpenCL C kernel which is loaded automatically into a program’s code.

Package

cl-opencl-utils.

Source

function.lisp.

Macro: defclcmacro (name (&rest args) &body body)

Defines a Lispified OpenCL C macro.

Package

cl-opencl-utils.

Source

macro.lisp.

Macro: defclcstruct (sname &body slots)

Defines both a CFFI struct and an analogous struct available to OpenCL C.

Package

cl-opencl-utils.

Source

struct.lisp.

Macro: defclcstruct-no-cffi (sname &body slots)

Defines struct available to OpenCL C, but no CFFI type.

Package

cl-opencl-utils.

Source

struct.lisp.

Macro: deffileclcfun (type name clc-args body-path &key headers cheaders functions)

Calls defrawclcfun using the contents of a source file located at body-path. body-path is evaluated, no other arguments are evaluated. Make sure that the file contains only the body with enclosing braces {}, and does not include the prototype, name, or type information. Can include these in a comment, and this is recommended for good style.

Package

cl-opencl-utils.

Source

raw-functions.lisp.

Macro: defheader (fnames provided &key flags)

Macro version of defheader-fn

Package

cl-opencl-utils.

Source

headers.lisp.

Macro: defrawclcfun (type name clc-args body-string &key headers cheaders functions)

Defines a OpenCL C function from its type, name, argument list, string for body, and allows specification of explicit header, cheader and function dependencies of the function. No arguments are evaluated. Make sure that the string contains only the body with enclosing braces {}, and does not include the prototype, name, or type information. Can include these in a comment.

Package

cl-opencl-utils.

Source

raw-functions.lisp.

Macro: program-source-from-forms (&body top-level-forms)

Macro version of program-fn where top-level-forms are not evaluated.

Package

cl-opencl-utils.

Source

compile.lisp.

Macro: program-source-from-functions (&rest functions)

Returns all source code needed to create program using the functions supplied.

Package

cl-opencl-utils.

Source

compile.lisp.

Macro: program-source-from-kernels (&rest kernels)

Returns all source code needed to create program using the kernels supplied.

Package

cl-opencl-utils.

Source

compile.lisp.

Macro: undefclcfun (fname)
Package

cl-opencl-utils.

Source

function.lisp.

Macro: undefclckernel (fname)
Package

cl-opencl-utils.

Source

function.lisp.

Macro: undefclcstruct (sname)
Package

cl-opencl-utils.

Source

struct.lisp.

Macro: with-defheader (fnames defclcs &key additional flags)

Defines a C header as well as executing the defclc forms

Package

cl-opencl-utils.

Source

headers.lisp.

Macro: with-opencl-cleanup ((var return-cleanup) &body body)

Many functions in cl-opencl-utils return a list (object cleanup) where cleanup is called once object is no longer needed. This macro sets var to the value of object and automatically calls the cleanup function at the end of the body.

Package

cl-opencl-utils.

Source

cleanup.lisp.


5.1.3 Ordinary functions

Function: c-type-name (type-keyword)
Package

cl-opencl-utils.

Source

utils.lisp.

Function: clc (form)

Looks up either 1. Form if form is an atom, or 2. First element of form if form is a list in the operator table *opsymbol->opfunction* and calls the function mapped there with no arguments for atoms or the remaining arguments in the form for lists. If there is no defined operator corresponding to the first element of the list, standard function call notation is assumed and the symbol is downcased as a string for the function name.

Package

cl-opencl-utils.

Source

clc.lisp.

Function: compile-flags (clc)

Returns all compilation flags required by code form clc

Package

cl-opencl-utils.

Source

headers.lisp.

Function: defheader-fn (fnames provided &key flags)

Defines a OpenCL C header or set of headers by its filename(s) fnames, the OpenCL C objects it provides, and the flags necessary for compiling and linking.

flags must be a string of compile & link flags for your OpenCL C compiler.

Package

cl-opencl-utils.

Source

headers.lisp.

Function: explicit-headers (symbol)

Returns list of explicit headers for that symbol

Package

cl-opencl-utils.

Source

headers.lisp.

Function: make-opencl-axpy (queue &key type)

Returns (axpy cleanup) where axpy is of the form (lambda (a xbuf
ybuf &key count event-wait-list)...) which sets ybuf to the value of a*x + y where a is a scalar x and y are OpenCL buffers treated as vectors. The return value of
axpy is an event to be waited on for the completion of the OpenCL
operation.

cleanup should be called once the axpy function is no longer needed.
with-opencl-cleanup is useful here.

count is the number of elements to use in the x and y buffers. If not
supplied, then the minimum number of elements that would fit in xbuf
or ybuf of the given type will be used.

type is the OpenCL type to use for a, xbuf, and ybuf.

Package

cl-opencl-utils.

Source

blas.lisp.

Function: make-opencl-complex-integrator (queue expr &key mode nparams preamble headers options)

Same as make-opencl-integrator, but with complex output values for expr. See make-opencl-integrator documentation for details on return values and usage. The only missing keyword parameter is type, as the (:struct cl_complex) type uses double-precision.

Package

cl-opencl-utils.

Source

integration.lisp.

Function: make-opencl-convolutor (queue expr-a expr-b domain &key nparams-a nparams-b type ndomain preamble headers options)

Returns a list (convolutor cleanup), where convolutor accepts an
input value and returns the convolution of functions A and B at that
point, and cleanup is a function to call to cleanup foreign and OpenCL
memory allocations.

expr-A and expr-B should be functions that accept a list of strings
and return an OpenCL C expression for the A or B function value
respectively. The first string will be the primary argument, and the
rest of the the strings will be parameter values.

ndomain is the number of samples to take from domain in order to
perform the numerical integration.

convolutor will be a function (lambda (x &key params-A params-B event-wait-list)...) with sticky values for params-A and params-B so that they only need
supplying when they need to be changed. The number of parameters are
set by the nparams-A and nparams-B for A and B respectively.

Package

cl-opencl-utils.

Source

convolution.lisp.

Function: make-opencl-function-sampler (queue expr &key domain-type range-type nparams preamble headers options)

Returns a list (function cleanup) where function is of the form

(lambda (out-buffer &key low high nsamples out-start event-wait-list) ...)

that will perform a function sampling operation according to the input parameters. out-buffer must be an OpenCL memory object with write ability, and low, high, and nsamples are parameters for function sampling that must be set at least once. The optional parameters are sticky, so that once set, they maintain their value until changed.
The results will be written to out-buffer starting at out-start. out-start defaults to 0. The return value of the generated function is an event that will need to be waited on and released at some point.

queue must be an OpenCL queue handle.

input-type should be a CFFI type designator.

If output-type is not specified, it is assumed to be input-type.

expr should be a Lisp function accepting one string and returning OpenCL C code for an expression of a unary operation to apply to the variable referenced in the string argument. The expression can refer to code defined in the preamble string argument or included in one of the headers. opencl-function-expr can be useful to generate expressions from already-defined OpenCL C functions.

memobj is the source memory buffer.

preamble can be Lispified OpenCL C code or a string of OpenCL C code to be placed below headers but above the reduction kernel. Useful for defining utility functions to call in the expression.

headers can be a list of device header file names to include in the kernel OpenCL C code.

options can be compiler options for the OpenCL kernel.

start can be an initial index offset to start reading from the buffer.

end can be a final index offset to stop reading from the buffer. Uses subseq index convention, i.e. the element at index=end is not included.

kernel and program will need to be released at some point once you’re done using the reducer.

Package

cl-opencl-utils.

Source

function-sampling.lisp.

Function: make-opencl-integrator (queue expr &key mode nparams type preamble headers options)

Returns a list (integrator cleanup), where integrator is of the form

(lambda (xlow xhigh &key params (ndomain (expt 10 3)) event-wait-list)...)

which returns the value of the integral of a function between xlow and xhigh, where the function is supplied as a Lispified OpenCL expression generated by the expr function.

expr should accept a string representing the input x value and returning Lispified OpenCL C code for the value of the function at that x value, optionally accepting additional parameter arguments up to nparams.

ndomain controls the number of points sampled from the domain [xlow,xhigh] and is a sticky parameter in that once it’s set, it maintains its value until changed.

params are a sticky argument supplying optional parameters to the integrated function.

mode can be one of :simpson, :midpoint, :trapezoid, :left, or :right to use the corresponding sampling method.

Package

cl-opencl-utils.

Source

integration.lisp.

Function: make-opencl-mapper (queue input-types mexpr &key nparams output-type preamble headers options)

Returns a list (mapper cleanup) where mapper is of the form

(lambda (in-buffers out-buffer &key params event-wait-list) ...)

that will perform a map operation according to the input parameters. in-buffers and out-buffer must be a list of OpenCL memory objects and a single object respectively. The results will be written to out-buffer starting at 0. If only a subset of a buffer should be read from or written to, use OpenCL sub buffers via cl-create-sub-buffer. The return value of the generated function is an event that will need to be waited on and released at some point.

cleanup should be called once the mapper is done being used so that OpenCL memory can be cleaned up. The with-opencl-cleanup macro can be useful.

queue must be an OpenCL queue handle.

input-types should be a list of CFFI type designators or a single type designator. In the case of a single type designator, in-starts and in-ends are assumed to be indices rather than lists of indices.

If output-type is not specified, it is assumed to be the first input-type.

mexpr should be a Lisp function accepting one string and returning OpenCL C code for an expression of a unary operation to apply to the variable referenced in the string argument. The expression can refer to code defined in the preamble string argument or included in one of the headers.

params can be a list of parameters to supply to the mexpr form in addition to the primary argument. They will be handed to OpenCL through a buffer.

memobj is the source memory buffer.

preamble can be a string of OpenCL C code to be placed below headers but above the reduction kernel. Useful for defining utility functions to call in the expression.

headers can be a list of device header file names to include in the kernel OpenCL C code.

options can be compiler options for the OpenCL kernel.

kernel and program will need to be released at some point once you’re done using the reducer.

Package

cl-opencl-utils.

Source

map-reduce.lisp.

Function: make-opencl-reducer (queue type rexpr &key preamble headers options)

Returns a list (reducer cleanup) where reducer is of the form

(lambda (buffer &key start end event-wait-list) ...)

that will perform a reduction operation according to the input parameters. buffer must an OpenCL memory object, and start and end are optional indices into the buffer. cleanup should be called once the reducer is done being used so that OpenCL memory can be cleaned up.

queue must be an OpenCL queue handle.

type should be a CFFI type designator.

rexpr should be a Lisp function accepting two strings and returning either Lispified OpenCL C code or a string for an OpenCL C expression of a binary operation. The expression can refer to code defined in the preamble string argument or included in one of the headers.

memobj is the source memory buffer.

preamble can be a string of OpenCL C code to be placed below headers but above the reduction kernel. Useful for defining utility functions to call in the expression.

headers can be a list of device header file names to include in the kernel OpenCL C code.

options can be compiler options for the OpenCL kernel.

start can be an initial index offset to start reading from the buffer.

end can be a final index offset to stop reading from the buffer. Uses subseq index convention, i.e. the element at index=end is not included.

kernel and program will need to be released at some point once you’re done using the reducer.

Package

cl-opencl-utils.

Source

map-reduce.lisp.

Function: make-opencl-rk4 (queue dy/dx-kernels y-count &key x0 nparams type)

Returns (stepper cleanup) where stepper is of the form (lambda (buf
&key x-delta event-wait-list params x0) ...) and has the effect of stepping the differential equation solution for y(x) forward by x-delta using the RK4 algorithm.
buf will be modified by this, as it will contain the estimated value
of y(x + x-delta).

params is an optional argument supplying values to be placed in the
last argument to the kernel, either as a list of data to transfer to
the device or a buffer ID for data already on the device. If
parameters will be supplied, set nparams to the total number of
parameters required. It is up to the user to interpret the parameters
and make use of them in the various kernels supplied as arguments.

x-delta is a sticky parameter that retains its value between calls
until changed.

x0 when set to non-NIL will manually set the x0 value before starting
another iteration of the RK4 algorithm. This is useful for reusing an
existing RK4 stepper starting at a different place on the x-axis but
for the same differential equation. Make sure to set the values of
the supplied buffer to the proper initial conditions prior to calling
the stepper function.

The x0 argument supplied to make-opencl-rk4 is automatically set to
either 0f0 or 0d0 depending on the value of type.

Each element of dy/dx-kernels should the symbol name of a kernel or a
kernel of the form

(kernel dy/dx-kernel
((var x (global (pointer type)))
(var y (global (pointer type)))
(var dy (global (pointer type)))
(var params (global (pointer type))))
...)

which has the effect of setting dy to the value of dy/dx given x and
y. x will always be a single value, but there are y-count elements
available in y.

Note that each dy/dx-kernel does not need to check (get-global-id 0)
to see if it is below y-count, as this is automatically checked before
the kernel is called.

Package

cl-opencl-utils.

Source

rk4.lisp.

Function: make-opencl-spline-form (name xs coefs &key type)

Returns Lispified OpenCL code for a spline function called name. Can be supplied to the preamble of other utilities like make-opencl-integrator or make-opencl-function-sampler.

Package

cl-opencl-utils.

Source

spline.lisp.

Function: opencl-function-expr (fname)

Returns an expression function generating the Lispified OpenCL code to call that function when supplied with a list of arguments. Useful for multiple utilities, e.g. make-opencl-reducer, make-opencl-mapper, make-opencl-convolutor.

Package

cl-opencl-utils.

Source

utils.lisp.

Function: program-source-from-forms-fn (&rest top-level-forms)

Returns string for the entire OpenCL C program consisting of the top-level forms preceded by any required headers

Package

cl-opencl-utils.

Source

compile.lisp.

Function: program-source-from-functions-fn (&rest functions)

Returns string source code of program containing all code needed for the supplied function names, including other functions and header includes.

Package

cl-opencl-utils.

Source

compile.lisp.

Function: program-source-from-kernels-fn (&rest kernels)

Returns string source code of program containing all code needed for the supplied kernel names, including other functions and header includes.

Package

cl-opencl-utils.

Source

compile.lisp.

Function: required-headers (form)

Returns the list of required headers for a form

Package

cl-opencl-utils.

Source

headers.lisp.

Function: serialize-spline-coef-array (array)

Creates list of coefficients from 2-D coefficient array as stored in a cl-ana polynomial-spline.

Package

cl-opencl-utils.

Source

spline.lisp.

Function: set-explicit-clc-functions (symbol functions &optional op)

Defines explicit function dependencies. op can be :set, :add, or :reset.

Package

cl-opencl-utils.

Source

function.lisp.

Function: set-explicit-headers (symbol headers &optional op)

Defines explicit headers for symbol. op can be :set, :add,
or :reset to either set the header list, add new headers to the list, or clear all headers for that symbol.

Do not use keyword symbols. Symbols are treated as package-less.

Package

cl-opencl-utils.

Source

headers.lisp.


5.1.4 Standalone methods

Method: translate-from-foreign (pointer (type cl_complex))
Package

cffi.

Source

complex.lisp.

Method: translate-into-foreign-memory (z (type cl_complex) pointer)
Package

cffi.

Source

complex.lisp.


5.1.5 Classes

Class: cl_complex
Package

cl-opencl-utils.

Source

complex.lisp.

Direct superclasses
  • foreign-struct-type.
  • translatable-foreign-type.
Direct methods

5.2 Internals


5.2.1 Special variables

Special Variable: *clc-alt-funs*

Map from OpenCL C function symbol to alternative definitions

Package

cl-opencl-utils.

Source

function.lisp.

Special Variable: *clc-compile-flags*

Default compilation flags for all OpenCL C programs

Package

cl-opencl-utils.

Source

headers.lisp.

Special Variable: *clc-funs*

Map from OpenCL C function symbol or string to function code description

Package

cl-opencl-utils.

Source

function.lisp.

Special Variable: *clc-gvars*
Package

cl-opencl-utils.

Source

var.lisp.

Special Variable: *clc-macros*
Package

cl-opencl-utils.

Source

macro.lisp.

Special Variable: *clc-structs*
Package

cl-opencl-utils.

Source

struct.lisp.

Special Variable: *explicit-funs*

Map from OpenCL C function symbol to explicit function symbol dependencies.

Package

cl-opencl-utils.

Source

function.lisp.

Special Variable: *explicit-headers*

Map from symbol to explicit list of headers required by that symbol.

Package

cl-opencl-utils.

Source

headers.lisp.

Special Variable: *headers*
Package

cl-opencl-utils.

Source

headers.lisp.

Special Variable: *opsymbol->opfunction*

Map from operation symbol to C-generating function.

Package

cl-opencl-utils.

Source

clc.lisp.


5.2.2 Macros

Macro: aif (test then &optional else)
Package

cl-opencl-utils.

Source

clc.lisp.

Macro: defclc (opname lambda-list &body body)

Defines an operator which takes arguments as specified in lambda-list and executes the body. Body must return the resulting string for the generated OpenCL C code.

&body will be replaced with &rest in the lambda-list since it will be supplied to the lambda operator.

Package

cl-opencl-utils.

Source

clc.lisp.

Macro: defclcaltfun (fname return-type clc-args &body body)
Package

cl-opencl-utils.

Source

function.lisp.

Macro: make-opencl-handler (queue args buffers event-binding (&body init-body) (&body cleanup-body) &body body)

Macro that ultimately returns a list (handler cleanup) where handler and cleanup have been generated according to the input specifications.

* args are non-buffer arguments to the handler function.

* buffers are buffer arguments to the handler function. Each entry in buffers should have the form (namesymbol type &key count flags init) where the buffers are initialized with init if supplied and then set to new values whenever new values are supplied. Note that namesymbol is a symbol for the parameter argument, not the buffer itself. The corresponding buffer is only updated when a non-NIL value for the parameter is supplied.

* event-binding should be a symbol for the event list that will be used by the handler. It will also be used by the parameter update code executed before the supplied code body is executed, so if out-of-order execution is a possibility then the event list will need to be treated properly by the code body.

* init-body will be called before returning the (handler cleanup) result list. This allows e.g. setting up kernel arguments or further initialization prior to return.

* cleanup-body will be placed at the top of the cleanup function body to e.g. cleanup after programs and kernels created for the handler.

Parameters can be non-sequence atoms or sequences. Non-sequence atoms will be converted into a sequence prior to writing to a buffer. No nested sequences are supported, as there is no way to know how to unflatten the data in general, and so there is no good reason to send unflattened data as an OpenCL parameter.

There is a macro (buffer (param)...) defined in the handler body that allows you to acquire the parameter buffer given the parameter argument symbol as the argument to the macro. This is useful for e.g. copying buffers.

Package

cl-opencl-utils.

Source

utils.lisp.


5.2.3 Ordinary functions

Function: altdefinitions (fsym)
Package

cl-opencl-utils.

Source

function.lisp.

Function: altprototypes (altdefs)
Package

cl-opencl-utils.

Source

function.lisp.

Function: compress (list &key key test sort-by singleton-pairs)

Compress list such that duplicate elements are combined into a single pair entry which has as the car the element value and as the cdr the count.

The singleton-pairs option controls whether single elements are still placed inside a pair. This is useful when the elements of the list you wish to compress are cons cells, as this would otherwise lead to ambiguity in the result.

Package

cl-opencl-utils.

Source

headers.lisp.

Function: definition (fsym)

Returns OpenCL C code for the definition of a function.

Package

cl-opencl-utils.

Source

function.lisp.

Function: depackage (symbol)
Package

cl-opencl-utils.

Source

clc.lisp.

Function: ensure-sequence (x)
Package

cl-opencl-utils.

Source

utils.lisp.

Function: expand-clc-macros (expr)

Finds & repeatedly expands any res-macros present in expr until none are present.

Package

cl-opencl-utils.

Source

macro.lisp.

Function: explicit-clc-functions (symbol)

Returns explicit OpenCL C function dependencies of that symbol.

Package

cl-opencl-utils.

Source

function.lisp.

Function: generate-clc->header ()

Returns map from clc to header for that clc symbol

Package

cl-opencl-utils.

Source

headers.lisp.

Function: list->set (list &optional test)

Returns list with duplicates removed

Package

cl-opencl-utils.

Source

function.lisp.

Function: mkstr (&rest args)
Package

cl-opencl-utils.

Source

clc.lisp.

Function: program-source (&rest top-level-forms)

Returns full program source code (minus headers) given top-level forms

Package

cl-opencl-utils.

Source

compile.lisp.

Function: prototype (function-code)

Returns OpenCL C code for the prototype of a function definition

Package

cl-opencl-utils.

Source

function.lisp.

Function: required-functions (code)

Returns list of required functions for code

Package

cl-opencl-utils.

Source

function.lisp.

Function: required-gvars (code)

Returns list of required global variables of code in dependence ordering.

Package

cl-opencl-utils.

Source

var.lisp.

Function: required-structs (code)

Returns list of required structs for code in order of dependence.

Package

cl-opencl-utils.

Source

struct.lisp.

Function: required-structs-worker (code)

Returns list of required structs for code in reverse order of dependence.

Package

cl-opencl-utils.

Source

struct.lisp.

Function: single (list)

Checks to see if list is a list with exactly one element.

Package

cl-opencl-utils.

Source

clc.lisp.

Function: struct-definition (structsym)

Returns OpenCL C code for the definition of a struct.

Package

cl-opencl-utils.

Source

struct.lisp.

Function: undefclcaltfun (fname)
Package

cl-opencl-utils.

Source

function.lisp.


5.2.4 Generic functions

Generic Function: lisp->clc (lisp-object &rest args)

Generates an OpenCL string for the Lisp object.
args can be used along with side effects to ensure that the OpenCL C string is sensible.

Package

cl-opencl-utils.

Source

clc.lisp.

Methods
Method: lisp->clc ((x float) &rest args)
Method: lisp->clc ((x integer) &rest args)
Method: lisp->clc ((x string) &rest args)
Method: lisp->clc (x &rest args)

Appendix A Indexes


A.1 Concepts


A.2 Functions

Jump to:   A   C   D   E   F   G   L   M   O   P   R   S   T   U   W  
Index Entry  Section

A
aif: Private macros
altdefinitions: Private ordinary functions
altprototypes: Private ordinary functions

C
c-type-name: Public ordinary functions
clc: Public ordinary functions
compile-flags: Public ordinary functions
compress: Private ordinary functions

D
defclc: Private macros
defclcaltfun: Private macros
defclcfun: Public macros
defclcglobalvar: Public macros
defclckernel: Public macros
defclcmacro: Public macros
defclcstruct: Public macros
defclcstruct-no-cffi: Public macros
deffileclcfun: Public macros
defheader: Public macros
defheader-fn: Public ordinary functions
definition: Private ordinary functions
defrawclcfun: Public macros
depackage: Private ordinary functions

E
ensure-sequence: Private ordinary functions
expand-clc-macros: Private ordinary functions
explicit-clc-functions: Private ordinary functions
explicit-headers: Public ordinary functions

F
Function, altdefinitions: Private ordinary functions
Function, altprototypes: Private ordinary functions
Function, c-type-name: Public ordinary functions
Function, clc: Public ordinary functions
Function, compile-flags: Public ordinary functions
Function, compress: Private ordinary functions
Function, defheader-fn: Public ordinary functions
Function, definition: Private ordinary functions
Function, depackage: Private ordinary functions
Function, ensure-sequence: Private ordinary functions
Function, expand-clc-macros: Private ordinary functions
Function, explicit-clc-functions: Private ordinary functions
Function, explicit-headers: Public ordinary functions
Function, generate-clc->header: Private ordinary functions
Function, list->set: Private ordinary functions
Function, make-opencl-axpy: Public ordinary functions
Function, make-opencl-complex-integrator: Public ordinary functions
Function, make-opencl-convolutor: Public ordinary functions
Function, make-opencl-function-sampler: Public ordinary functions
Function, make-opencl-integrator: Public ordinary functions
Function, make-opencl-mapper: Public ordinary functions
Function, make-opencl-reducer: Public ordinary functions
Function, make-opencl-rk4: Public ordinary functions
Function, make-opencl-spline-form: Public ordinary functions
Function, mkstr: Private ordinary functions
Function, opencl-function-expr: Public ordinary functions
Function, program-source: Private ordinary functions
Function, program-source-from-forms-fn: Public ordinary functions
Function, program-source-from-functions-fn: Public ordinary functions
Function, program-source-from-kernels-fn: Public ordinary functions
Function, prototype: Private ordinary functions
Function, required-functions: Private ordinary functions
Function, required-gvars: Private ordinary functions
Function, required-headers: Public ordinary functions
Function, required-structs: Private ordinary functions
Function, required-structs-worker: Private ordinary functions
Function, serialize-spline-coef-array: Public ordinary functions
Function, set-explicit-clc-functions: Public ordinary functions
Function, set-explicit-headers: Public ordinary functions
Function, single: Private ordinary functions
Function, struct-definition: Private ordinary functions
Function, undefclcaltfun: Private ordinary functions

G
generate-clc->header: Private ordinary functions
Generic Function, lisp->clc: Private generic functions

L
lisp->clc: Private generic functions
lisp->clc: Private generic functions
lisp->clc: Private generic functions
lisp->clc: Private generic functions
lisp->clc: Private generic functions
list->set: Private ordinary functions

M
Macro, aif: Private macros
Macro, defclc: Private macros
Macro, defclcaltfun: Private macros
Macro, defclcfun: Public macros
Macro, defclcglobalvar: Public macros
Macro, defclckernel: Public macros
Macro, defclcmacro: Public macros
Macro, defclcstruct: Public macros
Macro, defclcstruct-no-cffi: Public macros
Macro, deffileclcfun: Public macros
Macro, defheader: Public macros
Macro, defrawclcfun: Public macros
Macro, make-opencl-handler: Private macros
Macro, program-source-from-forms: Public macros
Macro, program-source-from-functions: Public macros
Macro, program-source-from-kernels: Public macros
Macro, undefclcfun: Public macros
Macro, undefclckernel: Public macros
Macro, undefclcstruct: Public macros
Macro, with-defheader: Public macros
Macro, with-opencl-cleanup: Public macros
make-opencl-axpy: Public ordinary functions
make-opencl-complex-integrator: Public ordinary functions
make-opencl-convolutor: Public ordinary functions
make-opencl-function-sampler: Public ordinary functions
make-opencl-handler: Private macros
make-opencl-integrator: Public ordinary functions
make-opencl-mapper: Public ordinary functions
make-opencl-reducer: Public ordinary functions
make-opencl-rk4: Public ordinary functions
make-opencl-spline-form: Public ordinary functions
Method, lisp->clc: Private generic functions
Method, lisp->clc: Private generic functions
Method, lisp->clc: Private generic functions
Method, lisp->clc: Private generic functions
Method, translate-from-foreign: Public standalone methods
Method, translate-into-foreign-memory: Public standalone methods
mkstr: Private ordinary functions

O
opencl-function-expr: Public ordinary functions

P
program-source: Private ordinary functions
program-source-from-forms: Public macros
program-source-from-forms-fn: Public ordinary functions
program-source-from-functions: Public macros
program-source-from-functions-fn: Public ordinary functions
program-source-from-kernels: Public macros
program-source-from-kernels-fn: Public ordinary functions
prototype: Private ordinary functions

R
required-functions: Private ordinary functions
required-gvars: Private ordinary functions
required-headers: Public ordinary functions
required-structs: Private ordinary functions
required-structs-worker: Private ordinary functions

S
serialize-spline-coef-array: Public ordinary functions
set-explicit-clc-functions: Public ordinary functions
set-explicit-headers: Public ordinary functions
single: Private ordinary functions
struct-definition: Private ordinary functions

T
translate-from-foreign: Public standalone methods
translate-into-foreign-memory: Public standalone methods

U
undefclcaltfun: Private ordinary functions
undefclcfun: Public macros
undefclckernel: Public macros
undefclcstruct: Public macros

W
with-defheader: Public macros
with-opencl-cleanup: Public macros


A.4 Data types

Jump to:   B   C   F   H   I   L   M   P   R   S   U   V  
Index Entry  Section

B
blas.lisp: The cl-opencl-utils/blas․lisp file
bool.lisp: The cl-opencl-utils/bool․lisp file

C
cl-opencl-utils: The cl-opencl-utils system
cl-opencl-utils: The cl-opencl-utils package
cl-opencl-utils.asd: The cl-opencl-utils/cl-opencl-utils․asd file
Class, cl_complex: Public classes
clc-utils.lisp: The cl-opencl-utils/clc-utils․lisp file
clc.lisp: The cl-opencl-utils/clc․lisp file
cleanup.lisp: The cl-opencl-utils/cleanup․lisp file
cl_complex: Public classes
compile.lisp: The cl-opencl-utils/compile․lisp file
complex.lisp: The cl-opencl-utils/complex․lisp file
control.lisp: The cl-opencl-utils/control․lisp file
convolution.lisp: The cl-opencl-utils/convolution․lisp file

F
File, blas.lisp: The cl-opencl-utils/blas․lisp file
File, bool.lisp: The cl-opencl-utils/bool․lisp file
File, cl-opencl-utils.asd: The cl-opencl-utils/cl-opencl-utils․asd file
File, clc-utils.lisp: The cl-opencl-utils/clc-utils․lisp file
File, clc.lisp: The cl-opencl-utils/clc․lisp file
File, cleanup.lisp: The cl-opencl-utils/cleanup․lisp file
File, compile.lisp: The cl-opencl-utils/compile․lisp file
File, complex.lisp: The cl-opencl-utils/complex․lisp file
File, control.lisp: The cl-opencl-utils/control․lisp file
File, convolution.lisp: The cl-opencl-utils/convolution․lisp file
File, function-sampling.lisp: The cl-opencl-utils/function-sampling․lisp file
File, function.lisp: The cl-opencl-utils/function․lisp file
File, headers.lisp: The cl-opencl-utils/headers․lisp file
File, integration.lisp: The cl-opencl-utils/integration․lisp file
File, libcerf.lisp: The cl-opencl-utils/libcerf․lisp file
File, macro.lisp: The cl-opencl-utils/macro․lisp file
File, map-reduce.lisp: The cl-opencl-utils/map-reduce․lisp file
File, math-functions.lisp: The cl-opencl-utils/math-functions․lisp file
File, math.lisp: The cl-opencl-utils/math․lisp file
File, package.lisp: The cl-opencl-utils/package․lisp file
File, random.lisp: The cl-opencl-utils/random․lisp file
File, raw-functions.lisp: The cl-opencl-utils/raw-functions․lisp file
File, rk4.lisp: The cl-opencl-utils/rk4․lisp file
File, spline.lisp: The cl-opencl-utils/spline․lisp file
File, struct.lisp: The cl-opencl-utils/struct․lisp file
File, syntax.lisp: The cl-opencl-utils/syntax․lisp file
File, utils.lisp: The cl-opencl-utils/utils․lisp file
File, var.lisp: The cl-opencl-utils/var․lisp file
function-sampling.lisp: The cl-opencl-utils/function-sampling․lisp file
function.lisp: The cl-opencl-utils/function․lisp file

H
headers.lisp: The cl-opencl-utils/headers․lisp file

I
integration.lisp: The cl-opencl-utils/integration․lisp file

L
libcerf.lisp: The cl-opencl-utils/libcerf․lisp file

M
macro.lisp: The cl-opencl-utils/macro․lisp file
map-reduce.lisp: The cl-opencl-utils/map-reduce․lisp file
math-functions.lisp: The cl-opencl-utils/math-functions․lisp file
math.lisp: The cl-opencl-utils/math․lisp file

P
Package, cl-opencl-utils: The cl-opencl-utils package
package.lisp: The cl-opencl-utils/package․lisp file

R
random.lisp: The cl-opencl-utils/random․lisp file
raw-functions.lisp: The cl-opencl-utils/raw-functions․lisp file
rk4.lisp: The cl-opencl-utils/rk4․lisp file

S
spline.lisp: The cl-opencl-utils/spline․lisp file
struct.lisp: The cl-opencl-utils/struct․lisp file
syntax.lisp: The cl-opencl-utils/syntax․lisp file
System, cl-opencl-utils: The cl-opencl-utils system

U
utils.lisp: The cl-opencl-utils/utils․lisp file

V
var.lisp: The cl-opencl-utils/var․lisp file