scirs2_fft/gpu_kernel_stub.rs
1//! GPU kernel stub module for FFT operations
2//!
3//! This module provides a compatibility layer for GPU-accelerated FFT operations.
4//! All GPU operations are redirected to the scirs2-core GPU module to comply with
5//! the strict acceleration policy.
6//!
7//! IMPORTANT: Direct CUDA/OpenCL/Metal API calls are FORBIDDEN in individual modules.
8//! All GPU operations MUST go through scirs2-core::gpu.
9
10use crate::error::{FFTError, FFTResult};
11use scirs2_core::numeric::Complex64;
12
13/// Placeholder for GPU kernel implementations
14///
15/// All actual GPU operations should be registered with and executed through
16/// the scirs2-core GPU kernel registry.
17pub struct GpuFftKernel {
18 name: String,
19}
20
21impl GpuFftKernel {
22 /// Create a new GPU FFT kernel stub
23 pub fn new(name: &str) -> Self {
24 Self {
25 name: name.to_string(),
26 }
27 }
28
29 /// Execute the kernel (stub implementation)
30 ///
31 /// In the real implementation, this would dispatch to scirs2-core::gpu
32 pub fn execute(&self, _input: &[Complex64]) -> FFTResult<Vec<Complex64>> {
33 Err(FFTError::NotImplementedError(format!(
34 "GPU kernel '{}' not yet migrated to scirs2-core GPU system. \
35 Direct GPU implementations are forbidden - all GPU operations must use scirs2-core::gpu",
36 self.name
37 )))
38 }
39}
40
41/// Check if GPU is available through core
42#[allow(dead_code)]
43pub fn is_gpu_available() -> bool {
44 // This should use scirs2-core::gpu capabilities
45 false
46}
47
48/// Message for functions that need migration
49pub const MIGRATION_MESSAGE: &str =
50 "This GPU functionality needs to be migrated to use scirs2-core::gpu module. \
51 Direct CUDA/OpenCL/Metal implementations are forbidden by the strict acceleration policy.";