[−][src]Struct ocl_core::types::structs::ArgVal
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]
pub fn mem(mem: &'a Mem) -> ArgVal<'a>
[src]
Returns a new ArgVal
referring to a Mem
object.
pub fn mem_null() -> ArgVal<'a>
[src]
Returns a new ArgVal
corresponding to a null Mem
object.
pub fn sampler(sampler: &'a Sampler) -> ArgVal<'a>
[src]
Returns a new ArgVal
referring to a Sampler
object.
pub fn sampler_null() -> ArgVal<'a>
[src]
Returns a new ArgVal
referring to a null Sampler
object.
pub fn primitive<T>(prm: &'a T) -> ArgVal<'a> where
T: OclPrm,
[src]
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]
T: OclPrm,
Returns a new ArgVal
referring to a scalar primitive.
pub fn vector<T>(vector: &'a T) -> ArgVal<'a> where
T: OclPrm,
[src]
T: OclPrm,
Returns a new ArgVal
referring to a vector primitive.
pub fn local<T>(length: &usize) -> ArgVal<'a> where
T: OclPrm,
[src]
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: size_t,
value: *const c_void,
is_mem: bool
) -> ArgVal<'a>
[src]
size: size_t,
value: *const c_void,
is_mem: bool
) -> 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) -> (size_t, *const c_void)
[src]
Returns the size (in bytes) and raw pointer to the contained kernel argument value.
pub fn is_mem_null(&self) -> bool
[src]
Returns true
if this ArgVal
represents a null Mem
or Sampler
object.
Trait Implementations
impl<'a> Clone for ArgVal<'a>
[src]
fn clone(&self) -> ArgVal<'a>
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl<'a> Debug for ArgVal<'a>
[src]
Auto Trait Implementations
impl<'a> !Send for ArgVal<'a>
impl<'a> Unpin for ArgVal<'a>
impl<'a> !Sync for ArgVal<'a>
impl<'a> UnwindSafe for ArgVal<'a>
impl<'a> RefUnwindSafe for ArgVal<'a>
Blanket Implementations
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,