This repository contains MATLAB and CUDA sample code for GPU-accelerated FFT and simulation.
Matlab_CUDA_1.1/- MATLAB scripts, CUDA source files, and example workflows for FFT acceleration.configMinGW64/- MinGW configuration helpers for building MATLAB MEX files on Windows.configMinGW64/mexopts-win64/- 64-bit MinGW configuration for Windows MATLAB builds.nvmex_fix/- Setup notes and environment fixes for building withnvmex.TESTS.md- Optional repository test or verification notes.
- Install MATLAB.
- Install the NVIDIA CUDA Toolkit.
- Set CUDA environment variables:
CUDA_PATHshould point to the CUDA installation directory.- If needed, set
CUDA_LIB_PATHto the CUDA library folder.
- Use
mexornvmexto build the example MEX files.
On Windows:
mex fft2_cuda.c -IC:\CUDA\include -LC:\CUDA\lib -lcudart -lcufft
mex fft2_cuda_sp_dp.c -IC:\CUDA\include -LC:\CUDA\lib -lcudart -lcufft
mex ifft2_cuda.c -IC:\CUDA\include -LC:\CUDA\lib -lcudart -lcufft
nvmex -f nvmexopts.bat Szeta.cu -IC:\cuda\include -LC:\cuda\lib -lcufft -lcudart
- Performance depends on the GPU driver, CUDA toolkit version, and MATLAB version.
- Older results showed about 2x speedup on Windows and 4x speedup on Linux with MATLAB + CUDA.
- GPU memory usage is typically lower than CPU-only execution for these workloads.
- This repository was originally tested with older toolchains; modern setups may require updated build flags and paths.
Matlab_CUDA_1.1/README.txtcontains detailed build and runtime instructions for the MATLAB examples.nvmex_fix/ReadMe.txtcontains environment and path notes fornvmex.configMinGW64/contains Windows-specific build scripts andmexoptsconfiguration.
This root README is the central guide. If you need platform-specific setup or build details, follow the subdirectory documentation first.