Skip to main content

RudaTask

Trait RudaTask 

Source
pub trait RudaTask<C: Compiler>:
    KernelMetadata
    + Send
    + Sync {
    // Required method
    fn compile(
        &self,
        compiler: &mut C,
        compilation_options: &C::CompilationOptions,
        mode: ExecutionMode,
        address_type: StorageType,
    ) -> Result<CompiledKernel<C>, CompilationError>;

    // Provided method
    fn kernel_definition(&self) -> Option<KernelDefinition> { ... }
}
Expand description

Kernel trait with the ComputeShader that will be compiled and cached based on the provided id.

Required Methods§

Source

fn compile( &self, compiler: &mut C, compilation_options: &C::CompilationOptions, mode: ExecutionMode, address_type: StorageType, ) -> Result<CompiledKernel<C>, CompilationError>

Compile a kernel and return the compiled form with an optional non-text representation

Provided Methods§

Source

fn kernel_definition(&self) -> Option<KernelDefinition>

Export the shared IR when this task originates from a kernel definition. Source-only tasks do not have an IR representation.

Trait Implementations§

Source§

impl<C: Compiler> KernelMetadata for Box<dyn RudaTask<C>>

Source§

fn id(&self) -> KernelId

Identifier for the kernel, used for caching kernel compilation.
Source§

fn name(&self) -> &'static str

Name of the kernel for debugging.
Source§

fn address_type(&self) -> StorageType

Type of addresses in this kernel

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§