Enum ocl::enums::KernelArg
[−]
[src]
pub enum KernelArg<'a, T> where
T: 'a + OclPrm, {
Mem(&'a Mem),
MemNull,
Sampler(&'a Sampler),
SamplerNull,
Scalar(T),
Vector(T),
Local(&'a usize),
UnsafePointer {
size: usize,
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: TheVectorvariant is poorly tested and probably a bit platform dependent. Use at your own risk.UnsafePointer: Really know what you're doing when using theUnsafePointervariant. Setting its properties,sizeandvalue, 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_memfor 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.
MemNullType T is ignored.
Sampler(&'a Sampler)Type T is ignored.
SamplerNullType T is ignored.
Scalar(T)Vector(T)Local(&'a usize)Length in multiples of T (not bytes).
UnsafePointersize: size in bytes. Type T is ignored.
Fields of UnsafePointer
size: usize | |
value: *const c_void |
Trait Implementations
impl<'a, T> Debug for KernelArg<'a, T> where
T: 'a + OclPrm + Debug, [src]
T: 'a + OclPrm + Debug,