pub struct KernelDescriptor {
pub name: String,
pub source: KernelSource,
pub compile_options: Vec<String>,
pub parameters: Vec<KernelParameter>,
pub workgroup_size_hint: Option<(u32, u32, u32)>,
pub cache: bool,
}Expand description
Kernel descriptor for creation
Fields§
§name: StringKernel name/entry point
source: KernelSourceKernel source code or bytecode
compile_options: Vec<String>Compilation options
parameters: Vec<KernelParameter>Kernel parameters description
workgroup_size_hint: Option<(u32, u32, u32)>Workgroup size hint
cache: boolWhether to cache the compiled kernel
Implementations§
Source§impl KernelDescriptor
impl KernelDescriptor
Sourcepub fn new(name: String, source: KernelSource) -> Self
pub fn new(name: String, source: KernelSource) -> Self
Create a new kernel descriptor
Sourcepub fn with_compile_option(self, option: String) -> Self
pub fn with_compile_option(self, option: String) -> Self
Add a compilation option
Sourcepub fn with_parameter(self, param: KernelParameter) -> Self
pub fn with_parameter(self, param: KernelParameter) -> Self
Add a kernel parameter
Sourcepub fn with_workgroup_size_hint(self, size: (u32, u32, u32)) -> Self
pub fn with_workgroup_size_hint(self, size: (u32, u32, u32)) -> Self
Set workgroup size hint
Sourcepub fn without_cache(self) -> Self
pub fn without_cache(self) -> Self
Disable kernel caching
Trait Implementations§
Source§impl Clone for KernelDescriptor
impl Clone for KernelDescriptor
Source§fn clone(&self) -> KernelDescriptor
fn clone(&self) -> KernelDescriptor
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for KernelDescriptor
impl RefUnwindSafe for KernelDescriptor
impl Send for KernelDescriptor
impl Sync for KernelDescriptor
impl Unpin for KernelDescriptor
impl UnsafeUnpin for KernelDescriptor
impl UnwindSafe for KernelDescriptor
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more