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§
Sourcefn evaluate_batch_gpu(
&self,
points: &OptimGpuArray<f64>,
) -> ScirsResult<OptimGpuArray<f64>>
fn evaluate_batch_gpu( &self, points: &OptimGpuArray<f64>, ) -> ScirsResult<OptimGpuArray<f64>>
Evaluate function on GPU for a batch of points
Sourcefn gradient_batch_gpu(
&self,
points: &OptimGpuArray<f64>,
) -> ScirsResult<OptimGpuArray<f64>>
fn gradient_batch_gpu( &self, points: &OptimGpuArray<f64>, ) -> ScirsResult<OptimGpuArray<f64>>
Evaluate gradient on GPU for a batch of points
Provided Methods§
Sourcefn hessian_batch_gpu(
&self,
points: &OptimGpuArray<f64>,
) -> ScirsResult<OptimGpuArray<f64>>
fn hessian_batch_gpu( &self, points: &OptimGpuArray<f64>, ) -> ScirsResult<OptimGpuArray<f64>>
Evaluate hessian on GPU (if supported)
Sourcefn supports_gpu(&self) -> bool
fn supports_gpu(&self) -> bool
Check if function supports GPU acceleration