#[allow(unused_imports)]
use crate::{Result, Tensor, TensorError};
#[allow(unused_imports)]
use num_complex::Complex;
#[allow(unused_imports)]
use scirs2_core::numeric::{Float, FromPrimitive, Signed};
#[allow(unused_imports)]
use std::fmt::Debug;
#[cfg(feature = "gpu")]
use wgpu::util::DeviceExt;
#[cfg(feature = "gpu")]
#[repr(C)]
#[derive(Debug, Clone, Copy, bytemuck::Pod, bytemuck::Zeroable)]
pub struct FFTInfo {
pub n: u32,
pub log2_n: u32,
pub batch_size: u32,
pub is_inverse: u32,
}
#[cfg(feature = "gpu")]
pub fn gpu_fft_dispatch<T>(
gpu_buffer: &crate::gpu::buffer::GpuBuffer<T>,
shape: &[usize],
) -> Result<Tensor<Complex<T>>>
where
T: Float
+ Send
+ Sync
+ 'static
+ FromPrimitive
+ Signed
+ Debug
+ Default
+ bytemuck::Pod
+ bytemuck::Zeroable,
Complex<T>: Default + bytemuck::Pod + bytemuck::Zeroable,
{
Err(TensorError::unsupported_operation_simple(
"GPU FFT dispatch not yet implemented in refactored module".to_string(),
))
}
#[cfg(feature = "gpu")]
pub fn gpu_ifft_dispatch<T>(
gpu_buffer: &crate::gpu::buffer::GpuBuffer<T>,
shape: &[usize],
) -> Result<Tensor<Complex<T>>>
where
T: Float
+ Send
+ Sync
+ 'static
+ FromPrimitive
+ Signed
+ Debug
+ Default
+ bytemuck::Pod
+ bytemuck::Zeroable,
Complex<T>: Default + bytemuck::Pod + bytemuck::Zeroable,
{
Err(TensorError::unsupported_operation_simple(
"GPU IFFT dispatch not yet implemented in refactored module".to_string(),
))
}
#[cfg(feature = "gpu")]
pub fn gpu_rfft_dispatch<T>(
gpu_buffer: &crate::gpu::buffer::GpuBuffer<T>,
shape: &[usize],
) -> Result<Tensor<Complex<T>>>
where
T: Float
+ Send
+ Sync
+ 'static
+ FromPrimitive
+ Signed
+ Debug
+ Default
+ bytemuck::Pod
+ bytemuck::Zeroable,
Complex<T>: Default + bytemuck::Pod + bytemuck::Zeroable,
{
Err(TensorError::unsupported_operation_simple(
"GPU RFFT dispatch not yet implemented in refactored module".to_string(),
))
}
#[cfg(feature = "gpu")]
pub fn gpu_fft2_dispatch<T>(
gpu_buffer: &crate::gpu::buffer::GpuBuffer<T>,
shape: &[usize],
) -> Result<Tensor<Complex<T>>>
where
T: Float
+ Send
+ Sync
+ 'static
+ FromPrimitive
+ Signed
+ Debug
+ Default
+ bytemuck::Pod
+ bytemuck::Zeroable,
Complex<T>: Default + bytemuck::Pod + bytemuck::Zeroable,
{
Err(TensorError::unsupported_operation_simple(
"GPU 2D FFT dispatch not yet implemented in refactored module".to_string(),
))
}
#[cfg(feature = "gpu")]
pub fn gpu_ifft2_dispatch<T>(
gpu_buffer: &crate::gpu::buffer::GpuBuffer<T>,
shape: &[usize],
) -> Result<Tensor<Complex<T>>>
where
T: Float
+ Send
+ Sync
+ 'static
+ FromPrimitive
+ Signed
+ Debug
+ Default
+ bytemuck::Pod
+ bytemuck::Zeroable,
Complex<T>: Default + bytemuck::Pod + bytemuck::Zeroable,
{
Err(TensorError::unsupported_operation_simple(
"GPU 2D IFFT dispatch not yet implemented in refactored module".to_string(),
))
}
#[cfg(feature = "gpu")]
pub fn gpu_fft3_dispatch<T>(
gpu_buffer: &crate::gpu::buffer::GpuBuffer<T>,
shape: &[usize],
) -> Result<Tensor<Complex<T>>>
where
T: Float
+ Send
+ Sync
+ 'static
+ FromPrimitive
+ Signed
+ Debug
+ Default
+ bytemuck::Pod
+ bytemuck::Zeroable,
Complex<T>: Default + bytemuck::Pod + bytemuck::Zeroable,
{
Err(TensorError::unsupported_operation_simple(
"GPU 3D FFT dispatch not yet implemented in refactored module".to_string(),
))
}
#[cfg(feature = "gpu")]
pub fn gpu_ifft3_dispatch<T>(
gpu_buffer: &crate::gpu::buffer::GpuBuffer<T>,
shape: &[usize],
) -> Result<Tensor<Complex<T>>>
where
T: Float
+ Send
+ Sync
+ 'static
+ FromPrimitive
+ Signed
+ Debug
+ Default
+ bytemuck::Pod
+ bytemuck::Zeroable,
Complex<T>: Default + bytemuck::Pod + bytemuck::Zeroable,
{
Err(TensorError::unsupported_operation_simple(
"GPU 3D IFFT dispatch not yet implemented in refactored module".to_string(),
))
}