This is the cl-opencl Reference Manual, generated automatically by Declt version 4.0 beta 2 "William Riker" on Sun Dec 15 05:13:59 2024 GMT+0.
The main system appears first, followed by any subsystem dependency.
cl-opencl
CFFI for OpenCL and Lisp wrapper API
Gary Hollis
Public Domain
cffi-grovel
(system).
cffi
(system).
package.lisp
(file).
base-types.lisp
(file).
grovel.lisp
(file).
cl-opencl-cffi.lisp
(file).
cl-opencl.lisp
(file).
utils.lisp
(file).
Files are sorted by type and then listed depth-first from the systems components trees.
cl-opencl/cl-opencl.asd
cl-opencl/package.lisp
cl-opencl/base-types.lisp
cl-opencl/grovel.lisp
cl-opencl/cl-opencl-cffi.lisp
cl-opencl/cl-opencl.lisp
cl-opencl/utils.lisp
cl-opencl/base-types.lisp
package.lisp
(file).
cl-opencl
(system).
cl-opencl/grovel.lisp
base-types.lisp
(file).
cl-opencl
(system).
cl-opencl/cl-opencl-cffi.lisp
grovel.lisp
(file).
cl-opencl
(system).
+null+
(special variable).
clbuildprogram
(function).
clclonekernel
(function).
clcompileprogram
(function).
clcreatebuffer
(function).
clcreatebufferwithproperties
(function).
clcreatecommandqueue
(function).
clcreatecommandqueuewithproperties
(function).
clcreatecommandqueuewithpropertieskhr
(function).
clcreatecontext
(function).
clcreatecontextfromtype
(function).
clcreateeventfromglsynckhr
(function).
clcreatefromglbuffer
(function).
clcreatefromglrenderbuffer
(function).
clcreatefromgltexture
(function).
clcreatefromgltexture2d
(function).
clcreatefromgltexture3d
(function).
clcreateimage
(function).
clcreateimage2d
(function).
clcreateimage3d
(function).
clcreateimagewithproperties
(function).
clcreatekernel
(function).
clcreatekernelsinprogram
(function).
clcreatepipe
(function).
clcreateprogramwithbinary
(function).
clcreateprogramwithbuiltinkernels
(function).
clcreateprogramwithil
(function).
clcreateprogramwithilkhr
(function).
clcreateprogramwithsource
(function).
clcreatesampler
(function).
clcreatesamplerwithproperties
(function).
clcreatesubbuffer
(function).
clcreatesubdevices
(function).
clcreatesubdevicesext
(function).
clcreateuserevent
(function).
clenqueueacquireglobjects
(function).
clenqueueacquiregrallocobjectsimg
(function).
clenqueuebarrier
(function).
clenqueuebarrierwithwaitlist
(function).
clenqueuecopybuffer
(function).
clenqueuecopybufferrect
(function).
clenqueuecopybuffertoimage
(function).
clenqueuecopyimage
(function).
clenqueuecopyimagetobuffer
(function).
clenqueuefillbuffer
(function).
clenqueuefillimage
(function).
clenqueuemapbuffer
(function).
clenqueuemapimage
(function).
clenqueuemarker
(function).
clenqueuemarkerwithwaitlist
(function).
clenqueuemigratememobjects
(function).
clenqueuenativekernel
(function).
clenqueuendrangekernel
(function).
clenqueuereadbuffer
(function).
clenqueuereadbufferrect
(function).
clenqueuereadimage
(function).
clenqueuereleaseglobjects
(function).
clenqueuereleasegrallocobjectsimg
(function).
clenqueuesvmfree
(function).
clenqueuesvmfreearm
(function).
clenqueuesvmmap
(function).
clenqueuesvmmaparm
(function).
clenqueuesvmmemcpy
(function).
clenqueuesvmmemcpyarm
(function).
clenqueuesvmmemfill
(function).
clenqueuesvmmemfillarm
(function).
clenqueuesvmmigratemem
(function).
clenqueuesvmunmap
(function).
clenqueuesvmunmaparm
(function).
clenqueuetask
(function).
clenqueueunmapmemobject
(function).
clenqueuewaitforevents
(function).
clenqueuewritebuffer
(function).
clenqueuewritebufferrect
(function).
clenqueuewriteimage
(function).
clfinish
(function).
clflush
(function).
clgetcommandqueueinfo
(function).
clgetdeviceandhosttimer
(function).
clgetdeviceids
(function).
clgetdeviceimageinfoqcom
(function).
clgetdeviceinfo
(function).
clgeteventinfo
(function).
clgeteventprofilinginfo
(function).
clgetextensionfunctionaddress
(function).
clgetextensionfunctionaddressforplatform
(function).
clgetglcontextinfokhr
(function).
clgetglobjectinfo
(function).
clgetgltextureinfo
(function).
clgethosttimer
(function).
clgetimageinfo
(function).
clgetkernelarginfo
(function).
clgetkernelinfo
(function).
clgetkernelsubgroupinfo
(function).
clgetkernelsubgroupinfokhr
(function).
clgetkernelworkgroupinfo
(function).
clgetmemobjectinfo
(function).
clgetpipeinfo
(function).
clgetplatformids
(function).
clgetplatforminfo
(function).
clgetprogrambuildinfo
(function).
clgetprograminfo
(function).
clgetsamplerinfo
(function).
clgetsupportedimageformats
(function).
clicdgetplatformidskhr
(function).
climportmemoryarm
(function).
cllinkprogram
(function).
cllogmessagestostderrapple
(function).
cllogmessagestostdoutapple
(function).
cllogmessagestosystemlogapple
(function).
clreleasecommandqueue
(function).
clreleasecontext
(function).
clreleasedevice
(function).
clreleasedeviceext
(function).
clreleaseevent
(function).
clreleasekernel
(function).
clreleasememobject
(function).
clreleaseprogram
(function).
clreleasesampler
(function).
clretaincommandqueue
(function).
clretaincontext
(function).
clretaindevice
(function).
clretaindeviceext
(function).
clretainevent
(function).
clretainkernel
(function).
clretainmemobject
(function).
clretainprogram
(function).
clretainsampler
(function).
clsetcommandqueueproperty
(function).
clsetdefaultdevicecommandqueue
(function).
clseteventcallback
(function).
clsetkernelarg
(function).
clsetkernelargsvmpointer
(function).
clsetkernelargsvmpointerarm
(function).
clsetkernelexecinfo
(function).
clsetkernelexecinfoarm
(function).
clsetmemobjectdestructorapple
(function).
clsetmemobjectdestructorcallback
(function).
clsetprogramreleasecallback
(function).
clsetprogramspecializationconstant
(function).
clsetusereventstatus
(function).
clsvmalloc
(function).
clsvmallocarm
(function).
clsvmfree
(function).
clsvmfreearm
(function).
clterminatecontextkhr
(function).
clunloadcompiler
(function).
clunloadplatformcompiler
(function).
clwaitforevents
(function).
cl-opencl/cl-opencl.lisp
cl-opencl-cffi.lisp
(file).
cl-opencl
(system).
3d-array->list
(function).
cl-build-program
(function).
cl-clone-kernel
(function).
cl-compile-program
(function).
cl-create-buffer
(function).
cl-create-command-queue
(function).
cl-create-context
(function).
cl-create-context-from-type
(function).
cl-create-from-gl-buffer
(function).
cl-create-from-gl-renderbuffer
(function).
cl-create-from-gl-texture
(function).
cl-create-image
(function).
cl-create-kernel
(function).
cl-create-kernels-in-program
(function).
cl-create-pipe
(function).
cl-create-program-with-binary
(function).
cl-create-program-with-built-in-kernels
(function).
cl-create-program-with-il
(function).
cl-create-program-with-source
(function).
cl-create-sampler
(function).
cl-create-sub-buffer
(function).
cl-create-sub-devices
(function).
cl-create-user-event
(function).
cl-enqueue-acquire-gl-objects
(function).
cl-enqueue-barrier
(function).
cl-enqueue-copy-buffer
(function).
cl-enqueue-copy-buffer-rect
(function).
cl-enqueue-copy-buffer-to-image
(function).
cl-enqueue-copy-image
(function).
cl-enqueue-copy-image-to-buffer
(function).
cl-enqueue-fill-buffer
(function).
cl-enqueue-fill-image
(function).
cl-enqueue-map-buffer
(function).
cl-enqueue-map-image
(function).
cl-enqueue-marker
(function).
cl-enqueue-migrate-mem-objects
(function).
cl-enqueue-ndrange-kernel
(function).
cl-enqueue-read-buffer
(function).
cl-enqueue-read-buffer-rect
(function).
cl-enqueue-read-image
(function).
cl-enqueue-release-gl-objects
(function).
cl-enqueue-unmap-mem-object
(function).
cl-enqueue-write-buffer
(function).
cl-enqueue-write-buffer-rect
(function).
cl-enqueue-write-image
(function).
cl-finish
(function).
cl-flush
(function).
cl-get-command-queue-info
(function).
cl-get-device-and-host-timer
(function).
cl-get-device-ids
(function).
cl-get-device-info
(function).
cl-get-event-info
(function).
cl-get-event-profiling-info
(function).
cl-get-gl-object-info
(function).
cl-get-gl-texture-info
(function).
cl-get-host-timer
(function).
cl-get-image-info
(function).
cl-get-kernel-arg-info
(function).
cl-get-kernel-info
(function).
cl-get-kernel-sub-group-info
(function).
cl-get-kernel-work-group-info
(function).
cl-get-mem-object-info
(function).
cl-get-pipe-info
(function).
cl-get-platform-ids
(function).
cl-get-platform-info
(function).
cl-get-program-binaries
(function).
cl-get-program-build-info
(function).
cl-get-program-info
(function).
cl-get-sampler-info
(function).
cl-get-supported-image-formats
(function).
cl-link-program
(function).
cl-release-command-queue
(function).
cl-release-context
(function).
cl-release-device
(function).
cl-release-event
(function).
cl-release-kernel
(function).
cl-release-mem-object
(function).
cl-release-program
(function).
cl-release-sampler
(function).
cl-retain-command-queue
(function).
cl-retain-context
(function).
cl-retain-device
(function).
cl-retain-event
(function).
cl-retain-kernel
(function).
cl-retain-mem-object
(function).
cl-retain-program
(function).
cl-retain-sampler
(function).
cl-set-default-device-command-queue
(function).
cl-set-event-callback
(function).
cl-set-kernel-arg
(function).
cl-set-kernel-arg-svm-pointer
(function).
cl-set-kernel-exec-info
(function).
cl-set-mem-object-destructor-callback
(function).
cl-set-program-release-callback
(function).
cl-set-user-event-status
(function).
cl-svm-alloc
(function).
cl-svm-free
(function).
cl-unload-platform-compiler
(function).
cl-wait-and-release-events
(function).
cl-wait-for-events
(function).
fill-image-channel-type->data-type
(function).
read-binary-data-from-pathname
(function).
release-opencl-event
(function).
sequence->3d-array
(function).
with-opencl-command-queue
(macro).
with-opencl-context
(macro).
write-binary-data-to-pathname
(function).
bytes->pixel!
(function).
case=
(macro).
check-opencl-error
(macro).
event-wait-list->foreign
(function).
format->type-info
(function).
image-channel-type->data-type
(function).
join-flags
(function).
lisp->pixel!
(function).
pixel->bytes!
(function).
pixel->lisp
(function).
zero-mem
(function).
cl-opencl/utils.lisp
cl-opencl.lisp
(file).
cl-opencl
(system).
cl-build-program-with-log
(function).
cl-enqueue-kernel
(function).
describe-opencl-devices
(function).
describe-opencl-platforms
(function).
find-opencl-platform-by-name
(function).
get-opencl-kernel-work-size
(function).
Packages are listed by definition order.
cl-opencl
cffi
.
cl-opencl-cffi
.
common-lisp
.
3d-array->list
(function).
cl-build-program
(function).
cl-build-program-with-log
(function).
cl-clone-kernel
(function).
cl-compile-program
(function).
cl-create-buffer
(function).
cl-create-command-queue
(function).
cl-create-context
(function).
cl-create-context-from-type
(function).
cl-create-from-gl-buffer
(function).
cl-create-from-gl-renderbuffer
(function).
cl-create-from-gl-texture
(function).
cl-create-image
(function).
cl-create-kernel
(function).
cl-create-kernels-in-program
(function).
cl-create-pipe
(function).
cl-create-program-with-binary
(function).
cl-create-program-with-built-in-kernels
(function).
cl-create-program-with-il
(function).
cl-create-program-with-source
(function).
cl-create-sampler
(function).
cl-create-sub-buffer
(function).
cl-create-sub-devices
(function).
cl-create-user-event
(function).
cl-enqueue-acquire-gl-objects
(function).
cl-enqueue-barrier
(function).
cl-enqueue-copy-buffer
(function).
cl-enqueue-copy-buffer-rect
(function).
cl-enqueue-copy-buffer-to-image
(function).
cl-enqueue-copy-image
(function).
cl-enqueue-copy-image-to-buffer
(function).
cl-enqueue-fill-buffer
(function).
cl-enqueue-fill-image
(function).
cl-enqueue-kernel
(function).
cl-enqueue-map-buffer
(function).
cl-enqueue-map-image
(function).
cl-enqueue-marker
(function).
cl-enqueue-migrate-mem-objects
(function).
cl-enqueue-ndrange-kernel
(function).
cl-enqueue-read-buffer
(function).
cl-enqueue-read-buffer-rect
(function).
cl-enqueue-read-image
(function).
cl-enqueue-release-gl-objects
(function).
cl-enqueue-unmap-mem-object
(function).
cl-enqueue-write-buffer
(function).
cl-enqueue-write-buffer-rect
(function).
cl-enqueue-write-image
(function).
cl-finish
(function).
cl-flush
(function).
cl-get-command-queue-info
(function).
cl-get-device-and-host-timer
(function).
cl-get-device-ids
(function).
cl-get-device-info
(function).
cl-get-event-info
(function).
cl-get-event-profiling-info
(function).
cl-get-gl-object-info
(function).
cl-get-gl-texture-info
(function).
cl-get-host-timer
(function).
cl-get-image-info
(function).
cl-get-kernel-arg-info
(function).
cl-get-kernel-info
(function).
cl-get-kernel-sub-group-info
(function).
cl-get-kernel-work-group-info
(function).
cl-get-mem-object-info
(function).
cl-get-pipe-info
(function).
cl-get-platform-ids
(function).
cl-get-platform-info
(function).
cl-get-program-binaries
(function).
cl-get-program-build-info
(function).
cl-get-program-info
(function).
cl-get-sampler-info
(function).
cl-get-supported-image-formats
(function).
cl-link-program
(function).
cl-release-command-queue
(function).
cl-release-context
(function).
cl-release-device
(function).
cl-release-event
(function).
cl-release-kernel
(function).
cl-release-mem-object
(function).
cl-release-program
(function).
cl-release-sampler
(function).
cl-retain-command-queue
(function).
cl-retain-context
(function).
cl-retain-device
(function).
cl-retain-event
(function).
cl-retain-kernel
(function).
cl-retain-mem-object
(function).
cl-retain-program
(function).
cl-retain-sampler
(function).
cl-set-default-device-command-queue
(function).
cl-set-event-callback
(function).
cl-set-kernel-arg
(function).
cl-set-kernel-arg-svm-pointer
(function).
cl-set-kernel-exec-info
(function).
cl-set-mem-object-destructor-callback
(function).
cl-set-program-release-callback
(function).
cl-set-user-event-status
(function).
cl-svm-alloc
(function).
cl-svm-free
(function).
cl-unload-platform-compiler
(function).
cl-wait-and-release-events
(function).
cl-wait-for-events
(function).
describe-opencl-devices
(function).
describe-opencl-platforms
(function).
fill-image-channel-type->data-type
(function).
find-opencl-platform-by-name
(function).
get-opencl-kernel-work-size
(function).
read-binary-data-from-pathname
(function).
release-opencl-event
(function).
sequence->3d-array
(function).
with-opencl-command-queue
(macro).
with-opencl-context
(macro).
write-binary-data-to-pathname
(function).
bytes->pixel!
(function).
case=
(macro).
check-opencl-error
(macro).
event-wait-list->foreign
(function).
format->type-info
(function).
image-channel-type->data-type
(function).
join-flags
(function).
lisp->pixel!
(function).
pixel->bytes!
(function).
pixel->lisp
(function).
zero-mem
(function).
cl-opencl-cffi
cffi
.
common-lisp
.
+null+
(special variable).
clbuildprogram
(function).
clclonekernel
(function).
clcompileprogram
(function).
clcreatebuffer
(function).
clcreatebufferwithproperties
(function).
clcreatecommandqueue
(function).
clcreatecommandqueuewithproperties
(function).
clcreatecommandqueuewithpropertieskhr
(function).
clcreatecontext
(function).
clcreatecontextfromtype
(function).
clcreateeventfromglsynckhr
(function).
clcreatefromglbuffer
(function).
clcreatefromglrenderbuffer
(function).
clcreatefromgltexture
(function).
clcreatefromgltexture2d
(function).
clcreatefromgltexture3d
(function).
clcreateimage
(function).
clcreateimage2d
(function).
clcreateimage3d
(function).
clcreateimagewithproperties
(function).
clcreatekernel
(function).
clcreatekernelsinprogram
(function).
clcreatepipe
(function).
clcreateprogramwithbinary
(function).
clcreateprogramwithbuiltinkernels
(function).
clcreateprogramwithil
(function).
clcreateprogramwithilkhr
(function).
clcreateprogramwithsource
(function).
clcreatesampler
(function).
clcreatesamplerwithproperties
(function).
clcreatesubbuffer
(function).
clcreatesubdevices
(function).
clcreatesubdevicesext
(function).
clcreateuserevent
(function).
clenqueueacquireglobjects
(function).
clenqueueacquiregrallocobjectsimg
(function).
clenqueuebarrier
(function).
clenqueuebarrierwithwaitlist
(function).
clenqueuecopybuffer
(function).
clenqueuecopybufferrect
(function).
clenqueuecopybuffertoimage
(function).
clenqueuecopyimage
(function).
clenqueuecopyimagetobuffer
(function).
clenqueuefillbuffer
(function).
clenqueuefillimage
(function).
clenqueuemapbuffer
(function).
clenqueuemapimage
(function).
clenqueuemarker
(function).
clenqueuemarkerwithwaitlist
(function).
clenqueuemigratememobjects
(function).
clenqueuenativekernel
(function).
clenqueuendrangekernel
(function).
clenqueuereadbuffer
(function).
clenqueuereadbufferrect
(function).
clenqueuereadimage
(function).
clenqueuereleaseglobjects
(function).
clenqueuereleasegrallocobjectsimg
(function).
clenqueuesvmfree
(function).
clenqueuesvmfreearm
(function).
clenqueuesvmmap
(function).
clenqueuesvmmaparm
(function).
clenqueuesvmmemcpy
(function).
clenqueuesvmmemcpyarm
(function).
clenqueuesvmmemfill
(function).
clenqueuesvmmemfillarm
(function).
clenqueuesvmmigratemem
(function).
clenqueuesvmunmap
(function).
clenqueuesvmunmaparm
(function).
clenqueuetask
(function).
clenqueueunmapmemobject
(function).
clenqueuewaitforevents
(function).
clenqueuewritebuffer
(function).
clenqueuewritebufferrect
(function).
clenqueuewriteimage
(function).
clfinish
(function).
clflush
(function).
clgetcommandqueueinfo
(function).
clgetdeviceandhosttimer
(function).
clgetdeviceids
(function).
clgetdeviceimageinfoqcom
(function).
clgetdeviceinfo
(function).
clgeteventinfo
(function).
clgeteventprofilinginfo
(function).
clgetextensionfunctionaddress
(function).
clgetextensionfunctionaddressforplatform
(function).
clgetglcontextinfokhr
(function).
clgetglobjectinfo
(function).
clgetgltextureinfo
(function).
clgethosttimer
(function).
clgetimageinfo
(function).
clgetkernelarginfo
(function).
clgetkernelinfo
(function).
clgetkernelsubgroupinfo
(function).
clgetkernelsubgroupinfokhr
(function).
clgetkernelworkgroupinfo
(function).
clgetmemobjectinfo
(function).
clgetpipeinfo
(function).
clgetplatformids
(function).
clgetplatforminfo
(function).
clgetprogrambuildinfo
(function).
clgetprograminfo
(function).
clgetsamplerinfo
(function).
clgetsupportedimageformats
(function).
clicdgetplatformidskhr
(function).
climportmemoryarm
(function).
cllinkprogram
(function).
cllogmessagestostderrapple
(function).
cllogmessagestostdoutapple
(function).
cllogmessagestosystemlogapple
(function).
clreleasecommandqueue
(function).
clreleasecontext
(function).
clreleasedevice
(function).
clreleasedeviceext
(function).
clreleaseevent
(function).
clreleasekernel
(function).
clreleasememobject
(function).
clreleaseprogram
(function).
clreleasesampler
(function).
clretaincommandqueue
(function).
clretaincontext
(function).
clretaindevice
(function).
clretaindeviceext
(function).
clretainevent
(function).
clretainkernel
(function).
clretainmemobject
(function).
clretainprogram
(function).
clretainsampler
(function).
clsetcommandqueueproperty
(function).
clsetdefaultdevicecommandqueue
(function).
clseteventcallback
(function).
clsetkernelarg
(function).
clsetkernelargsvmpointer
(function).
clsetkernelargsvmpointerarm
(function).
clsetkernelexecinfo
(function).
clsetkernelexecinfoarm
(function).
clsetmemobjectdestructorapple
(function).
clsetmemobjectdestructorcallback
(function).
clsetprogramreleasecallback
(function).
clsetprogramspecializationconstant
(function).
clsetusereventstatus
(function).
clsvmalloc
(function).
clsvmallocarm
(function).
clsvmfree
(function).
clsvmfreearm
(function).
clterminatecontextkhr
(function).
clunloadcompiler
(function).
clunloadplatformcompiler
(function).
clwaitforevents
(function).
Definitions are sorted by export status, category, package, and then by lexicographic order.
Macro to automate queue creation and release.
Sets var to an OpenCL context that is released after use.
Converts a 3-D array into a list. The ordering taken from sequence
is controlled via the index-mode option.
index-mode :first means (0 0 0), (1 0 0), ..., (0 1 0), (1 1 0), ... index ordering.
index-mode :last means (0 0 0), (0 0 1), ..., (0 1 0), (0 1 1), ... index ordering.
So for example:
(3D-array->list #3A(((1) (4)) ((2) (5)) ((3) (6))) :index-mode :first) ==> (1 2 3 4 5 6),
(3D-array->list #3A(((1) (4)) ((2) (5)) ((3) (6))) :index-mode :last) ==> (1 4 2 5 3 6).
Builds program for devices. notify-function must be a callback defined with cffi:defcallback, and user-data must be a CFFI pointer to allocated foreign data. Note that (callback somecallback) must be supplied as an argument as per usual CFFI usage.
Compiles a program according to options for each of the devices listed. If header-programs is supplied, then header-names needs to contain the names of each of the header-programs as referred to in the program source code. When supplied, user-data should be a foreign pointer to data used by the callback function, which should be defined using cffi:defcallback. Note that the function pointer of the callback must be supplied, not the callback name.
Creates buffer with two main modes of operation:
1. Size-based.
2. Data-based.
For size-based, either set size to the number of bytes to allocate in
the buffer, or set type and count to match the number of elements
available in the buffer of a given type. Note that count is ignored
when size or count are specified as it will be calculated when data is
supplied. To partially fill space with data, create the buffer and
then write to the buffer as separate queue commands.
For data-based, set type and data to the foreign type and a sequence
of data to place into the buffer. Note that this means initializing
the buffer with data requires the data-based option. Also note that
+CL-MEM-COPY-HOST-PTR+ will automatically be set when data is
supplied.
Only one of these should be used, and the size-based mode takes
precedence. If neither are used, then an error is thrown.
flags should be a list of flags to join with logior or a single integer.
Uses clCreateCommandQueueWithProperties to create command queue with optional properties set. If queue-size is non-NIL, then the +CL-QUEUE-ON-DEVICE+ bitfield will automatically be set in the properties list. The properties list should be a list of integer constants as parsed by the groveler.
Creates context from platform and list of devices. The platform
will be automatically added to the properties list if add-platform-p
is non-NIL. properties can be a list of (PROPCODE1 value1 PROPCODE2
value2 ...).
callback must be a function pointer, e.g. (callback somefunction).
Creates context from platform and type of device rather than device ID.
Returns OpenCL buffer handle to OpenGL buffer object.
Returns OpenCL image handle to an OpenGL renderbuffer.
Returns OpenCL image handle to OpenGL texture object. target must be an OpenGL target code.
Creates a program given a list of devices and a list of binary data arrays, one binary data array per supplied device. Each array should contain integer elements between the values 0 and 255 inclusively to denote bytes of data. A type of (UNSIGNED-BYTE 8) is recommended for the array element type to optimize storage. Data located in files can be loaded with read-binary-data-from-pathname.
Creates program from built-in kernel names. devices is a list of cl-device-id device handles, and kernels is either a list of Lisp strings or a single string of semicolon-separated names denoting the kernel names to include in the program. Note that all kernels must be defined in all devices for this to succeed.
Creates program from intermediate language binary data. il should be an array where the elements denote bytes, so (unsigned-byte 8) is the recommended element type. read-binary-data-from-pathname is available to load binary data stored in a file into such an array.
Creates program using source. source may either be a string or a list of source strings.
Creates sampler with given settings. NOTE: At the time of writing, the headers on my system did not have the CL_FILTER_NEAREST_KHR constant defined, which is the default value for the CL_SAMPLER_MIP_FILTER_MODE_KHR property. It’s not included in the groveler file for this reason.
Creates num-devices sub-devices from existing device given the
supplied properties list. Must set exactly one of equally, by-counts,
or by-affinity.
The value of equally is the number of partitions to equally-divide the
compute device into.
The value of by-counts is a list of compute unit counts for each
sub-device created, one element per sub-device.
The value of by-affinity must be one of :numa, :L1, :L2, :L3, :L4, or
:next, denoting division of a device into units sharing NUMA code,
L1/2/3/4 cache, or division into the next smaller level of
memory (NUMA,L4,L3,L2,L1). cl-get-device-info with the parameter
+CL-DEVICE-PARTITION-TYPE+ can be used on a sub-device to determine
what level of partitioning occurred.
In all cases, a list of device IDs will be returned.
Enqueues actual acquisition of OpenGL objects.
Enqueues barrier with optional event wait list. With NIL event-wait-list, the enqueued command waits until all previous commands have finished. An event is returned which identifies this marker unless event-p is NIL.
Enqueues copy from src-buffer to dst-buffer. Return value is a an event for copy completion.
Enqueues rectangular copy from src-buffer to dst-buffer. Return
value is an event for copy completion.
src-origin and dst-origin can be lists with 3 elements denoting the
origin in the source and destination buffers respectively.
NOTE: In contrast to other similar functions, width should denote the width in bytes, while height and depth are the number of rows and slices respectively. The product (* width height depth) will be the total amount of data copied.
Enqueues a buffer copy to image command. Asynchronous operation only.
Return value is event for copy completion.
region can be a list (width height depth). If not supplied, default
is entire destination image.
src-offset is the offset for the buffer read.
dst-origin is the origin for the image write.
event-wait-list can be a list of events which the copy command is dependent on.
Enqueues an image copy command. Asynchronous operation only.
Return value is event for copy completion.
region can be a list (width height depth). If not supplied, default
is entire source image.
src-origin and dst-origin are source and destination origins to be
read or write respectively.
event-wait-list can be a list of events which the copy command is dependent on.
Enqueues an image copy to buffer command. Asynchronous operation only.
Return value is event for copy completion.
region can be a list (width height depth). If not supplied, default
is entire source image.
src-origin is the origin for the image read.
dst-offset is the offset for the buffer write.
event-wait-list can be a list of events which the copy command is dependent on.
Enqueues fill write to buffer. byte-pattern should be a list of
(unsigned-byte 8) values that will repeatedly be written into the
buffer. size should be the number of bytes in total to write.
There is only asynchronous operation for this write function. Return value is a list of an event and a cleanup function to call once the event has completed.
Enqueues a fill command into the image buffer. Pixel data input
must be either a single floating-point number or a 4-element list of
either floats or integers depending on the channel type. See
clEnqueueFillImage OpenCL documentation for rules on when to use
integers or floats.
There is only one mode: Asynchronous operation. Result is a list of an event and a function to call which will cleanup foreign memory.
origin can be a list of three pixel indices (x y z) denoting the starting point for reading from the image. Default value is (0 0 0).
region can be a list of (width height depth) in pixels denoting the region of pixels to read starting at origin. Default region is the entire image.
Enqueues an image map to buffer command. Synchronous or asynchronous operation controlled by blocking-p. Return value is:
Synchronous: List (pointer row-pitch slice-pitch)
Asynchronous: List (event pointer row-pitch slice-pitch) where event
is for map operation completion.
region can be a list (width height depth). If not supplied, default
is entire source image.
origin is the origin for the image.
event-wait-list can be a list of events which the copy command is dependent on.
Enqueues marker with optional event wait list. With NIL event-wait-list, the enqueued command waits until all previous commands have finished. An event is returned which identifies this marker unless event-p is NIL.
Enqueues migration of memory objects to the device associated with the supplied command queue. Return value is an event for command completion.
Enqueues a data-parallel kernel for execution. global-work-size
and local-work-size must be lists that share dimensionality, and if
supplied, so must global-work-offset.
global-work-offset can denote a non-default offset for the global ID
of each thread.
Return value is an event for kernel execution completion.
Enqueues reading from a buffer in the command queue. type should
be the foreign type stored in the buffer, and count can either be the
number of elements to read or a list of dimensions of the array to
read. They will be used to construct a CFFI array type denoting how
the foreign array data is stored, i.e. (:array element-type count)
or (:array element-type . count). make-array-args will be passed to
cffi:foreign-array-to-lisp along with the read data and the
array-type. There are 2 main modes of operation:
blocking-p NIL: Asynchronous read. cl-enqueue-read-buffer will
return a list with two elements: An event handle and a function that
when called with no arguments will return the data read out of the
buffer as well as cleaning up allocated foreign memory. If an error
occurs while attempting to enqueue the read instruction, the foreign
memory will be freed before signaling an error. The event handle
returned will need to eventually have cl-release-event called on it to
avoid a memory leak.
blocking-p non-NIL: Synchronous read. cl-enqueue-read-buffer will
return the data read out of the buffer.
offset can denote an offset in bytes at which to start reading from
the buffer.
NOTE: Do not throw away the buffer read function for asynchronous mode, as there is no reasonable way to avoid a memory leak. Even with finalization, the OpenCL queue would need to be blocked by the finalizer to avoid a segfault.
Enqueues rectangular reading from a buffer in the command queue.
type should be the foreign type used to stored the data in the buffer,
and count can either be the number of elements to read or the
dimensions of an array to read from the buffer. They will be used to
create a CFFI array type denoting how the foreign array data is
stored, i.e. (:array element-type count) or (:array element-type
. count). make-array-args will be passed to
cffi:foreign-array-to-lisp along with the read data and the
array-type. There are 2 main modes of operation:
blocking-p NIL: Asynchronous read. cl-enqueue-read-buffer will
return a list with two elements: An event handle and a function that
when called with no arguments will return the data read out of the
buffer as well as cleaning up allocated foreign memory. If an error
occurs while attempting to enqueue the read instruction, the foreign
memory will be freed before signaling an error. The event handle
returned will need to eventually have cl-release-event called on it to
avoid a memory leak.
blocking-p non-NIL: Synchronous read. cl-enqueue-read-buffer will
return the data read out of the buffer.
buffer-origin can be NIL or a list of 3 elements denoting the 3-D
origin to start readinfrom the buffer. Set unused dimensions’ origins
to 0.
width, height, and depth need to be set to reasonable values. Note
that width denotes the number of elements rather than bytes. You can
make them match your array-type, but all that is required is that the
array-type has enough space to store the data.
NOTE: Do not throw away the buffer read function for asynchronous mode, as there is no reasonable way to avoid a memory leak. Even with finalization, the OpenCL queue would need to be blocked by the finalizer to avoid a segfault.
Enqueues a read command into the image buffer. Image data result
is either a 3-D array of pixel->lisp formatted data matching channel
dimensions of the image, or if bytes-p is non-NIL, an array
of (unsigned-byte 8) data matching the size of the image.
There are two modes of operation: Synchronous and asynchronous.
blocking-p non-NIL: Synchronous operation. Result is returned
directly. blocking-p NIL: Asynchronous operation. Result is a
list of an event and a function to call which will return the
previously mentioned array of formatted data.
origin can be a list of three pixel indices (x y z) denoting the starting point for reading from the image. Default value is (0 0 0).
region can be a list of (width height depth) in pixels denoting the region of pixels to read starting at origin. Default region is the entire image.
Enqueues release of previously acquired OpenGL objects.
Enqueues unmapping obj which was mapped to map-ptr. Asynchronous operation only. Return value is an event for operation completion.
Enqueues write instructions for the buffer and supplied data.
There are two modes of operation: blocking and non-blocking.
data is a sequence of data to write into the buffer.
blocking-p is NIL: Asynchronous operation. Data is queued for
writing, but not necessarily written on return. The return value is a
list containing an event handle and a cleanup function to free the
foreign data once the write has completed.
blocking-p is non-NIL: Synchronous operation. The return value
is irrelevant and no foreign memory management is necessary.
element-type should be a CFFI type.
offset is a byte-offset into the output buffer.
event-wait-list can be a list of events required to finish before the write should occur.
Enqueues rectangular write into buffer. There are two modes of operation:
blocking-p NIL: Asynchronous write. Return value is a list
containing an event handle and a cleanup function to call once the
event has completed in order to free allocated foreign memory.
data should be a sequence or a 3-D array. If data is a 3-D array,
then width-height-depth will be set to match the array. If data is a
sequence, then the width-height-depth parameters should match the
number of elements in the sequence. The 3D-array->list utility
function will be used to convert a 3-D array into a list before
exporting to foreign memory if a 3-D array is supplied. To control
index ordering, call 3D-array->list directly or supply a sequence.
Default behavior of 3D-array->sequence is :index-mode :first, see
function documentation. OpenCL uses :first index convention.
blocking-p non-NIL: Synchronous write. Return value is NIL.
buffer-origin can be a list of integers to denote an offset in the
buffer write destination (see OpenCL documentation), or NIL to denote
the default non-offset write.
Set width, height, and depth to reasonable values if using a data list. Note that width refers to the number of elements rather than bytes, which is computed from element-type.
Enqueues a write command into the image buffer. Image data input
must either be 3-D array of pixel->lisp formatted data matching the
channel dimensions of the image, or if bytes-p is non-NIL, an array
of (unsigned-byte 8) data matching the size of the image.
There are two modes of operation: Synchronous and asynchronous.
blocking-p non-NIL: Synchronous operation. Result is NIL.
blocking-p NIL: Asynchronous operation. Result is a list of an event
and a function to call which will cleanup foreign memory.
origin can be a list of three pixel indices (x y z) denoting the starting point for reading from the image. Default value is (0 0 0).
region can be a list of (width height depth) in pixels denoting the region of pixels to read starting at origin. Default region is the entire image.
Returns list of (device-timestamp host-timestamp).
Returns platform information.
Returns a list (gl-type gl-id) for the OpenCL object obj.
param can take the following values:
+CL-GL-TEXTURE-TARGET+ +CL-GL-MIPMAP-LEVEL+
Returns timestamp for host.
Queries kernel sub-group information. input must be set to
reasonable values per param value.
+CL-KERNEL-MAX-SUB-GROUP-SIZE-FOR-NDRANGE+: list of integers. +CL-KERNEL-SUB-GROUP-COUNT-FOR-NDRANGE+: list of integers. +CL-KERNEL-LOCAL-SIZE-FOR-SUB-GROUP-COUNT+: integer. +CL-KERNEL-MAX-NUM-SUB-GROUPS+: ignored. +CL-KERNEL-COMPILE-NUM-SUB-GROUPS+: ignored.
Queries kernel for information about running on given device.
Returns platform information.
Convenience function returning list of binary data arrays for the binaries of a program. Wrapper around necessary calls to cl-get-program-info and foreign memory management.
Get program info from parameters. NOTE: +CL-PROGRAM-BINARIES+ triggers an error message referring to the helper function needed for extracting binaries.
Returns list of plists for the supported image formats.
Links programs into executables for devices. programs must be a list of programs to include in the executable. callback can be a the function pointer to a callback defined via cffi:defcallback, and user-data can be a foreign pointer to data supplied to that callback.
Sets kernel argument. If value is NIL, local memory will be supplied to the kernel. Otherwise, the value will be assumed to be of foreign type. Size is determined by the type and count unless size is explicitly specified. Note that count only has meaning when value is not supplied and therefore only matters when allocating local memory as a kernel argument.
Adjusts kernel execution settings. svm-pointers can be a list of SVM foreign pointer objects. fine-grain-system can be either +CL-TRUE+ or +CL-FALSE+, but the default depends on the system. Both arguments can be set to adjust both settings simultaneously.
Sets release callback for program. callback must be a function pointer to a callback defined via cffi:defcallback. user-data can be a pointer to foreign data given to the callback.
Returns SVM pointer on success. Note that there is no error status returned by OpenCL for clSVMAlloc, so neither is there any error management in this API.
Frees SVM pointer on success. Note that there is no error status returned by OpenCL for clSVMFree, so neither is there any error management in this API.
Waits for and releases events once they have completed. If value is a list, it is assumed to be a list of at least (event cleanup), with possible later elements of the list. If a cleanup function is detected, then the return value for that entry will be the return value of the cleanup. This is useful for cleanup functions which also return an enqueued read or other result.
Waits for events and returns input event list for possible release. If an event is actually a list (event cleanup), then the cleanup will not be called but will still be passed along to output.
Creates a list of alists, one alist per device, containing all the
results of cl-get-device-ids. The first element of each alist
is (:device-id ID), using the same ID as returned by
cl-get-device-ids.
Note that if a parameter causes an error, its result will not be included in the alist.
Creates a list of alists, one alist per platform, containing all
the results of cl-get-platform-ids. The first element of each alist
is (:platform-id ID), using the same ID as returned by
cl-get-platform-ids.
Note that if a parameter causes an error, its result will not be included in the alist.
Searches for an OpenCL platform by the platform name
Returns a list (nglobal nlocal) for the global work size and local work size suitable for the kernel. Note that this enforces nglobal being an integer multiple of nlocal, so there is some possible inefficiency and you will need to ensure that your kernel knows how many submitted jobs actually need to be run. If nglobal is less than the recommended local work size, then only nglobal jobs will be enqueued.
Reads binary data from file located at pathname and returns an
array of (unsigned-byte 8) data suitable for use with the OpenCL
high-level API binary data functions,
e.g. cl-create-program-with-binary.
Handles release for event or (event cleanup) input.
Converts sequence into 3-D array of width-height-depth dimensions.
make-array-key-args will be supplied to make-array. The ordering
taken from sequence is controlled via the index-mode option.
index-mode :first means (0 0 0), (1 0 0), ..., (0 1 0), (1 1 0), ... index ordering.
index-mode :last means (0 0 0), (0 0 1), ..., (0 1 0), (0 1 1), ... index ordering.
So for example:
(sequence->3d-array (list 1 2 3 4 5 6) 3 2 1 :index-mode :first) ==> #3A(((1) (4)) ((2) (5)) ((3) (6))),
(sequence->3d-array (list 1 2 3 4 5 6) 3 2 1 :index-mode :last) ==> #3A(((1) (2)) ((3) (4)) ((5) (6)))
Writes binary data to file located at pathname from an array
of (unsigned-byte 8) data suitable for use with the OpenCL high-level
API binary data functions.
This is in response to issues I currently do not understand when trying to use CFFI groveler constant values in a case statement. Instead of repetitive cond = tests, I use this macro like a case statement.
Macro for automating error management with two modes:
1. NULL err denoting error code will be returned by body.
2. Symbol err-address to denote symbol to use for error address so as
to interact with OpenCL CFFI functions.
If cleanup is non-NIL, it must be a function called before signaling an error. Useful for preventing memory leaks.
Places pixel data from an array of (unsigned-byte 8) data at start in foreign ptr formatted by plist format and using Lisp data lisp-pixel suitable for that pixel type. 1-channel pixels use numeric types, and multi-channel pixels use a list of numerical values.
Places pixel data in foreign ptr formatted by plist format and using Lisp data lisp-pixel suitable for that pixel type. 1-channel pixels use numeric types, and multi-channel pixels use a list of numerical values.
Converts pixel data at ptr into (unsigned-byte 8) data and places it in byte-array starting at start.
Takes foreign data located in pixel-ptr with plist format and returns Lisp data suitable for that pixel type. For 1-channel pixels, numerical value is returned. For multi-channel pixels, a list of numerical values is returned.
Zeroes data at ptr of type
Jump to: | 3
B C D E F G I J L M P R S W Z |
---|
Jump to: | 3
B C D E F G I J L M P R S W Z |
---|
Jump to: | +
S |
---|
Index Entry | Section | ||
---|---|---|---|
| |||
+ | |||
+null+ : | Public special variables | ||
| |||
S | |||
Special Variable, +null+ : | Public special variables | ||
|
Jump to: | +
S |
---|
Jump to: | B C F G P S U |
---|
Jump to: | B C F G P S U |
---|