GpuFunction

Trait GpuFunction 

Source
pub trait GpuFunction {
    // Required methods
    fn evaluate_batch_gpu(
        &self,
        points: &OptimGpuArray<f64>,
    ) -> ScirsResult<OptimGpuArray<f64>>;
    fn gradient_batch_gpu(
        &self,
        points: &OptimGpuArray<f64>,
    ) -> ScirsResult<OptimGpuArray<f64>>;

    // Provided methods
    fn hessian_batch_gpu(
        &self,
        points: &OptimGpuArray<f64>,
    ) -> ScirsResult<OptimGpuArray<f64>> { ... }
    fn supports_gpu(&self) -> bool { ... }
}
Expand description

GPU-accelerated function evaluation interface

Required Methods§

Source

fn evaluate_batch_gpu( &self, points: &OptimGpuArray<f64>, ) -> ScirsResult<OptimGpuArray<f64>>

Evaluate function on GPU for a batch of points

Source

fn gradient_batch_gpu( &self, points: &OptimGpuArray<f64>, ) -> ScirsResult<OptimGpuArray<f64>>

Evaluate gradient on GPU for a batch of points

Provided Methods§

Source

fn hessian_batch_gpu( &self, points: &OptimGpuArray<f64>, ) -> ScirsResult<OptimGpuArray<f64>>

Evaluate hessian on GPU (if supported)

Source

fn supports_gpu(&self) -> bool

Check if function supports GPU acceleration

Implementors§