scirs2_fft/
sparse_fft_cuda_kernels.rs

1//! GPU kernel stub for sparse FFT algorithms
2//!
3//! This module provides a compatibility layer for GPU-accelerated sparse FFT.
4//! All GPU operations must be migrated to use scirs2-core::gpu module.
5//! Direct CUDA implementations are FORBIDDEN by the strict acceleration policy.
6
7use crate::error::{FFTError, FFTResult};
8use crate::gpu_kernel_stub::MIGRATION_MESSAGE;
9use crate::sparse_fft::{SparseFFTAlgorithm, SparseFFTResult, WindowFunction};
10use scirs2_core::numeric::Complex64;
11use scirs2_core::numeric::NumCast;
12use std::fmt::Debug;
13
14/// CUDA window kernel stub
15pub struct CUDAWindowKernel;
16
17impl CUDAWindowKernel {
18    pub fn new(_window: WindowFunction) -> Self {
19        Self
20    }
21
22    pub fn apply(&self, _data: &mut [Complex64]) -> FFTResult<()> {
23        Err(FFTError::NotImplementedError(MIGRATION_MESSAGE.to_string()))
24    }
25}
26
27/// CUDA sublinear sparse FFT kernel stub
28pub struct CUDASublinearSparseFFTKernel;
29
30impl CUDASublinearSparseFFTKernel {
31    pub fn new(_algorithm: SparseFFTAlgorithm) -> Self {
32        Self
33    }
34
35    pub fn execute<T>(&self, _input: &[T], _k: usize) -> FFTResult<SparseFFTResult>
36    where
37        T: NumCast + Copy + Debug,
38    {
39        Err(FFTError::NotImplementedError(MIGRATION_MESSAGE.to_string()))
40    }
41}
42
43/// Execute CUDA sublinear sparse FFT (stub)
44#[allow(dead_code)]
45pub fn execute_cuda_sublinear_sparse_fft<T>(
46    _input: &[T],
47    _k: usize,
48    _algorithm: SparseFFTAlgorithm,
49) -> FFTResult<SparseFFTResult>
50where
51    T: NumCast + Copy + Debug,
52{
53    Err(FFTError::NotImplementedError(MIGRATION_MESSAGE.to_string()))
54}
55
56/// CUDA compressed sensing sparse FFT kernel stub
57pub struct CUDACompressedSensingSparseFFTKernel;
58
59impl CUDACompressedSensingSparseFFTKernel {
60    pub fn new() -> Self {
61        Self
62    }
63
64    pub fn execute<T>(&self, _input: &[T], _k: usize) -> FFTResult<SparseFFTResult>
65    where
66        T: NumCast + Copy + Debug,
67    {
68        Err(FFTError::NotImplementedError(MIGRATION_MESSAGE.to_string()))
69    }
70}
71
72impl Default for CUDACompressedSensingSparseFFTKernel {
73    fn default() -> Self {
74        Self::new()
75    }
76}
77
78/// Execute CUDA compressed sensing sparse FFT (stub)
79#[allow(dead_code)]
80pub fn execute_cuda_compressed_sensing_sparse_fft<T>(
81    _input: &[T],
82    _k: usize,
83) -> FFTResult<SparseFFTResult>
84where
85    T: NumCast + Copy + Debug,
86{
87    Err(FFTError::NotImplementedError(MIGRATION_MESSAGE.to_string()))
88}