Reference
Contents
Index
OpenCL.Const
OpenCL.OutOfGPUMemoryError
OpenCL.cl.CLPtr
OpenCL.cl.PtrOrCLPtr
OpenCL.cl.UnifiedDeviceMemory
OpenCL.cl.UnifiedHostMemory
OpenCL.cl.UnifiedSharedMemory
Base.resize!
Base.unsafe_wrap
OpenCL.format
OpenCL.kernel_convert
OpenCL.return_type
OpenCL.cl.@checked
OpenCL.Const
— TypeConst(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.
OpenCL.OutOfGPUMemoryError
— TypeOutOfGPUMemoryError()
An operation allocated too much GPU memory.
Base.resize!
— Methodresize!(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.
Base.unsafe_wrap
— Methodunsafe_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.
OpenCL.format
— MethodFormat string using dict-like variables, replacing all accurancies of %(key)
with value
.
Example: s = "Hello, %(name)" format(s, name="Tom") ==> "Hello, Tom"
OpenCL.kernel_convert
— Functionkernel_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.
OpenCL.return_type
— MethodOpenCL.return_type(f, tt) -> r::Type
Return a type r
such that f(args...)::r
where args::tt
.
OpenCL.cl.CLPtr
— TypeCLPtr{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.
OpenCL.cl.PtrOrCLPtr
— TypePtrOrCLPtr{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.
OpenCL.cl.UnifiedDeviceMemory
— TypeUnifiedDeviceMemory
A buffer of device memory, owned by a specific device. Generally, may only be accessed by the device that owns it.
OpenCL.cl.UnifiedHostMemory
— TypeUnifiedHostMemory
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.
OpenCL.cl.UnifiedSharedMemory
— TypeUnifiedSharedMemory
A managed buffer that is shared between the host and one or more devices.
OpenCL.cl.@checked
— Macro@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.