Enum ocl_core::types::enums::KernelArg
[−]
[src]
pub enum KernelArg<'a, T: 'a + OclPrm> { Mem(&'a Mem), MemNull, Sampler(&'a Sampler), SamplerNull, Scalar(T), Vector(T), Local(&'a usize), UnsafePointer { size: size_t, value: *const c_void, }, }
[UNSAFE] Kernel argument option type.
The type argument T
is ignored for Mem
, Sampler
, and UnsafePointer
(just put usize
or anything).
Safety
If there was some way for this enum to be marked unsafe it would be.
The Mem
, Sampler
, Scalar
, and Local
variants are tested and will
work perfectly well.
Vector
: TheVector
variant is poorly tested and probably a bit platform dependent. Use at your own risk.UnsafePointer
: Really know what you're doing when using theUnsafePointer
variant. Setting its properties,size
andvalue
, incorrectly can cause bugs, crashes, and data integrity issues that are very hard to track down. This is due to the fact that the pointer value is intended to be a pointer to a memory structure in YOUR programs memory, NOT a copy of an OpenCL object pointer (such as acl_h::cl_mem
for example, which is itself a*mut libc::c_void
). This is made more complicated by the fact that the pointer can also be a pointer to a scalar (ex:*const u32
, etc.). See the SDK docs for more details.
Variants
Mem(&'a Mem)
Type T
is ignored.
MemNull
Type T
is ignored.
Sampler(&'a Sampler)
Type T
is ignored.
SamplerNull
Type T
is ignored.
Scalar(T)
Vector(T)
Local(&'a usize)
Length in multiples of T (not bytes).
UnsafePointer
size
: size in bytes. Type T
is ignored.
Fields
size: size_t | |
value: *const c_void |