Struct ocl::enums::ArgVal [−][src]
pub struct ArgVal<'a> { /* fields omitted */ }
A reference to a kernel argument value.
Example:
let kernel = core::create_kernel(&program, "multiply")?; core::set_kernel_arg(&kernel, 0, ArgVal::scalar(&10.0f32))?; core::set_kernel_arg(&kernel, 1, ArgVal::mem(&buffer))?;
Methods
impl<'a> ArgVal<'a>
[src]
impl<'a> ArgVal<'a>
pub fn mem(mem: &'a Mem) -> ArgVal<'a>
[src]
pub fn mem(mem: &'a Mem) -> ArgVal<'a>
Returns a new ArgVal
referring to a Mem
object.
pub fn mem_null() -> ArgVal<'a>
[src]
pub fn mem_null() -> ArgVal<'a>
Returns a new ArgVal
corresponding to a null Mem
object.
pub fn sampler(sampler: &'a Sampler) -> ArgVal<'a>
[src]
pub fn sampler(sampler: &'a Sampler) -> ArgVal<'a>
Returns a new ArgVal
referring to a Sampler
object.
pub fn sampler_null() -> ArgVal<'a>
[src]
pub fn sampler_null() -> ArgVal<'a>
Returns a new ArgVal
referring to a null Sampler
object.
pub fn primitive<T>(prm: &'a T) -> ArgVal<'a> where
T: OclPrm,
[src]
pub fn primitive<T>(prm: &'a T) -> ArgVal<'a> where
T: OclPrm,
Returns a new ArgVal
referring to a scalar or vector primitive.
pub fn scalar<T>(scalar: &'a T) -> ArgVal<'a> where
T: OclPrm,
[src]
pub fn scalar<T>(scalar: &'a T) -> ArgVal<'a> where
T: OclPrm,
Returns a new ArgVal
referring to a scalar primitive.
pub fn vector<T>(vector: &'a T) -> ArgVal<'a> where
T: OclPrm,
[src]
pub fn vector<T>(vector: &'a T) -> ArgVal<'a> where
T: OclPrm,
Returns a new ArgVal
referring to a vector primitive.
pub fn local<T>(length: &usize) -> ArgVal<'a> where
T: OclPrm,
[src]
pub fn local<T>(length: &usize) -> ArgVal<'a> where
T: OclPrm,
Returns a new ArgVal
corresponding to a __local
argument.
To specify a __local
argument size in bytes, use ::raw
instead
(with value
: std::ptr::null()
).
pub unsafe fn from_raw(size: usize, value: *const c_void) -> ArgVal<'a>
[src]
pub unsafe fn from_raw(size: usize, value: *const c_void) -> ArgVal<'a>
Returns a new ArgVal
containing the size in bytes and a raw pointer
to the argument value.
Safety
Caller must ensure that the value pointed to by value
lives until
the call to ::set_kernel_arg
returns and that size
accurately
reflects the total number of bytes that should be read.
pub fn as_raw(&self) -> (usize, *const c_void)
[src]
pub fn as_raw(&self) -> (usize, *const c_void)
Returns the size (in bytes) and raw pointer to the contained kernel argument value.
pub fn is_null(&self) -> bool
[src]
pub fn is_null(&self) -> bool
Returns true
if this ArgVal
represents a null Mem
or Sampler
object.
Trait Implementations
impl<'a> Debug for ArgVal<'a>
[src]
impl<'a> Debug for ArgVal<'a>
fn fmt(&self, f: &mut Formatter) -> Result<(), Error>
[src]
fn fmt(&self, f: &mut Formatter) -> Result<(), Error>
Formats the value using the given formatter. Read more
impl<'a> Clone for ArgVal<'a>
[src]
impl<'a> Clone for ArgVal<'a>