(let-release bindings & body)
Binds Releasable elements to symbols (like let do), evaluates body, and, if any exception occures, releases the resources held by the bindings. The bindings can also be deeply sequential (see examples)
Example:
(let-release [devs (devices (first (platforms)))
dev (first devs)
ctx (context devs)
queue (command-queue ctx dev)]
(info dev)
(info queue))
Binds Releasable elements to symbols (like let do), evaluates body, and, if any exception occures, releases the resources held by the bindings. The bindings can also be deeply sequential (see examples) - they will be released properly. Example: (let-release [devs (devices (first (platforms))) dev (first devs) ctx (context devs) queue (command-queue ctx dev)] (info dev) (info queue))
Objects that hold resources that can be released after use. For OpenCL objects, releasing means decrementing the reference count of the object.
The errors should be signalled by throwing an exception rather than by the return value.
Objects that hold resources that can be released after use. For OpenCL objects, releasing means decrementing the reference count of the object. The errors should be signalled by throwing an exception rather than by the return value.
(release this)
Releases the resource held by this.
Releases the resource held by this.
(releaseable? this)
Checks whether this is releaseable (in terms of Releaseable protocol).
Checks whether this is releaseable (in terms of Releaseable protocol).
Attach a default dense structure to the raw data of x
. x
can be anything that implements
Viewable, such as DirectByteBuffer.
Changes to the resulting object affect the source x
, even the parts of data that might not
be accessible by x
. Use with caution!
view always creates a new instance that reuses the master's data, but releasing a view never releases the master data.
(view (buffer (vctr float-factory 1 2 3)))
Attach a default dense structure to the raw data of `x`. `x` can be anything that implements Viewable, such as DirectByteBuffer. Changes to the resulting object affect the source `x`, even the parts of data that might not be accessible by `x`. Use with caution! view always creates a new instance that reuses the master's data, but releasing a view never releases the master data. (view (buffer (vctr float-factory 1 2 3)))
(view this)
(with-release bindings & body)
Binds Releasable elements to symbols (like let do), evaluates body, and at the end releases the resources held by the bindings. The bindings can also be deeply sequential (see examples) - they will be released properly.
Example:
(with-release [devs (devices (first (platforms)))
dev (first devs)
ctx (context devs)
queue (command-queue ctx dev)]
(info dev)
(info queue))
Binds Releasable elements to symbols (like let do), evaluates body, and at the end releases the resources held by the bindings. The bindings can also be deeply sequential (see examples) - they will be released properly. Example: (with-release [devs (devices (first (platforms))) dev (first devs) ctx (context devs) queue (command-queue ctx dev)] (info dev) (info queue))
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close