Reference

Contents

Index

OpenCL.ConstType
Const(A::CLDeviceArray)

Mark a CLDeviceArray as constant/read-only. The invariant guaranteed is that you will not modify an CLDeviceArray for the duration of the current kernel.

This API can only be used on devices with compute capability 3.5 or higher.

Warning

Experimental API. Subject to change without deprecation.

source
Base.resize!Method

resize!(a::CLVector, n::Integer)

Resize a to contain n elements. If n is smaller than the current collection length, the first n elements will be retained. If n is larger, the new elements are not guaranteed to be initialized.

source
Base.unsafe_wrapMethod
unsafe_wrap(Array, arr::CLArray)

Wrap a Julia Array around the buffer that backs a CLArray. This is only possible if the GPU array is backed by host memory, such as unified (host or shared) memory, or shared virtual memory.

source
OpenCL.formatMethod

Format string using dict-like variables, replacing all accurancies of %(key) with value.

Example: s = "Hello, %(name)" format(s, name="Tom") ==> "Hello, Tom"

source
OpenCL.kernel_convertFunction
kernel_convert(x)

This function is called for every argument to be passed to a kernel, allowing it to be converted to a GPU-friendly format. By default, the function does nothing and returns the input object x as-is.

Do not add methods to this function, but instead extend the underlying Adapt.jl package and register methods for the the OpenCL.KernelAdaptor type.

source
OpenCL.return_typeMethod
OpenCL.return_type(f, tt) -> r::Type

Return a type r such that f(args...)::r where args::tt.

source
OpenCL.cl.CLPtrType
CLPtr{T}

A memory address that refers to data of type T that is accessible from q device. A CLPtr is ABI compatible with regular Ptr objects, e.g. it can be used to ccall a function that expects a Ptr to device memory, but it prevents erroneous conversions between the two.

source
OpenCL.cl.PtrOrCLPtrType
PtrOrCLPtr{T}

A special pointer type, ABI-compatible with both Ptr and CLPtr, for use in ccall expressions to convert values to either a device or a host type (in that order). This is required for APIs which accept pointers that either point to host or device memory.

source
OpenCL.cl.UnifiedDeviceMemoryType
UnifiedDeviceMemory

A buffer of device memory, owned by a specific device. Generally, may only be accessed by the device that owns it.

source
OpenCL.cl.UnifiedHostMemoryType
UnifiedHostMemory

A buffer of memory on the host. May be accessed by the host, and all devices within the host driver. Frequently used as staging areas to transfer data to or from devices.

source
OpenCL.cl.@checkedMacro
@checked function foo(...)
    rv = ...
    return rv
end

Macro for wrapping a function definition returning a status code. Two versions of the function will be generated: foo, with the function body wrapped by an invocation of the check function (to be implemented by the caller of this macro), and unchecked_foo where no such invocation is present and the status code is returned to the caller.

source