pub struct AdaptiveKernelSelector { /* private fields */ }Expand description
Adaptive kernel selection coordinator
Implementations§
Source§impl AdaptiveKernelSelector
impl AdaptiveKernelSelector
Sourcepub fn new(performance_modeler: Arc<RuntimePerformanceModeler>) -> Self
pub fn new(performance_modeler: Arc<RuntimePerformanceModeler>) -> Self
Create a new adaptive kernel selector
Sourcepub fn register_kernel(&self, kernel: KernelImplementation) -> Result<()>
pub fn register_kernel(&self, kernel: KernelImplementation) -> Result<()>
Register a kernel implementation
Sourcepub fn register_custom_kernel(
&self,
kernel: Box<dyn CustomKernel + Send + Sync>,
) -> Result<()>
pub fn register_custom_kernel( &self, kernel: Box<dyn CustomKernel + Send + Sync>, ) -> Result<()>
Register a custom kernel
Sourcepub fn select_kernel(
&self,
operation_type: OperationType,
backend_type: BackendType,
inputs: &KernelInputs,
workload: &WorkloadCharacteristics,
system_state: &SystemState,
) -> Result<KernelSelection>
pub fn select_kernel( &self, operation_type: OperationType, backend_type: BackendType, inputs: &KernelInputs, workload: &WorkloadCharacteristics, system_state: &SystemState, ) -> Result<KernelSelection>
Select optimal kernel for given inputs
Sourcepub fn update_performance_feedback(
&self,
kernel_id: &str,
actual_performance: ActualPerformance,
predicted_performance: Option<PerformancePrediction>,
) -> Result<()>
pub fn update_performance_feedback( &self, kernel_id: &str, actual_performance: ActualPerformance, predicted_performance: Option<PerformancePrediction>, ) -> Result<()>
Update performance feedback
Sourcepub fn get_selection_statistics(&self) -> Result<SelectionStatistics>
pub fn get_selection_statistics(&self) -> Result<SelectionStatistics>
Get selection statistics
Sourcepub fn benchmark_kernels(
&self,
operation_type: OperationType,
backend_type: BackendType,
test_inputs: &[KernelInputs],
) -> Result<BenchmarkResults>
pub fn benchmark_kernels( &self, operation_type: OperationType, backend_type: BackendType, test_inputs: &[KernelInputs], ) -> Result<BenchmarkResults>
Benchmark kernels for calibration
Auto Trait Implementations§
impl Freeze for AdaptiveKernelSelector
impl !RefUnwindSafe for AdaptiveKernelSelector
impl Send for AdaptiveKernelSelector
impl Sync for AdaptiveKernelSelector
impl Unpin for AdaptiveKernelSelector
impl UnsafeUnpin for AdaptiveKernelSelector
impl !UnwindSafe for AdaptiveKernelSelector
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> 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