scirs2_fft/
sparse_fft_cuda_kernels_iterative.rs

1//! Stub implementations for all GPU kernel modules
2//!
3//! This file contains stub implementations for all GPU kernel modules.
4//! All actual GPU operations must be migrated to use scirs2-core::gpu module.
5
6use crate::error::{FFTError, FFTResult};
7use crate::gpu_kernel_stub::MIGRATION_MESSAGE;
8use crate::sparse_fft::SparseFFTResult;
9use scirs2_core::numeric::NumCast;
10use std::fmt::Debug;
11
12// ============ sparse_fft_cuda_kernels_frequency_pruning.rs stubs ============
13
14/// CUDA frequency pruning sparse FFT kernel stub
15pub struct CUDAFrequencyPruningSparseFFTKernel;
16
17impl CUDAFrequencyPruningSparseFFTKernel {
18    pub fn new() -> Self {
19        Self
20    }
21}
22
23impl Default for CUDAFrequencyPruningSparseFFTKernel {
24    fn default() -> Self {
25        Self::new()
26    }
27}
28
29/// Execute CUDA frequency pruning sparse FFT (stub)
30#[allow(dead_code)]
31pub fn execute_cuda_frequency_pruning_sparse_fft<T>(
32    _input: &[T],
33    _k: usize,
34    _threshold: f64,
35) -> FFTResult<SparseFFTResult>
36where
37    T: NumCast + Copy + Debug,
38{
39    Err(FFTError::NotImplementedError(MIGRATION_MESSAGE.to_string()))
40}
41
42// ============ sparse_fft_cuda_kernels_iterative.rs stubs ============
43
44/// CUDA iterative sparse FFT kernel stub
45pub struct CUDAIterativeSparseFFTKernel;
46
47impl CUDAIterativeSparseFFTKernel {
48    pub fn new() -> Self {
49        Self
50    }
51}
52
53impl Default for CUDAIterativeSparseFFTKernel {
54    fn default() -> Self {
55        Self::new()
56    }
57}
58
59/// Execute CUDA iterative sparse FFT (stub)
60#[allow(dead_code)]
61pub fn execute_cuda_iterative_sparse_fft<T>(
62    _input: &[T],
63    _k: usize,
64    _max_iterations: usize,
65) -> FFTResult<SparseFFTResult>
66where
67    T: NumCast + Copy + Debug,
68{
69    Err(FFTError::NotImplementedError(MIGRATION_MESSAGE.to_string()))
70}
71
72// ============ sparse_fft_cuda_kernels_spectral_flatness.rs stubs ============
73
74/// CUDA spectral flatness sparse FFT kernel stub
75pub struct CUDASpectralFlatnessSparseFFTKernel;
76
77impl CUDASpectralFlatnessSparseFFTKernel {
78    pub fn new() -> Self {
79        Self
80    }
81}
82
83impl Default for CUDASpectralFlatnessSparseFFTKernel {
84    fn default() -> Self {
85        Self::new()
86    }
87}
88
89/// Execute CUDA spectral flatness sparse FFT (stub)
90#[allow(dead_code)]
91pub fn execute_cuda_spectral_flatness_sparse_fft<T>(
92    _input: &[T],
93    _k: usize,
94    _flatness_threshold: f64,
95) -> FFTResult<SparseFFTResult>
96where
97    T: NumCast + Copy + Debug,
98{
99    Err(FFTError::NotImplementedError(MIGRATION_MESSAGE.to_string()))
100}