UPDATE: Since release B.0.4, the wavenumber and PML variables in k-Wave have been stored as vectors (instead of replicated matrices) and then applied using bsxfun. This function is not natively supported by GPUmat and the performance of the replacement version (see below) may not be optimal.
To get started using the k-Wave Toolbox with a graphics processing unit (GPU)
- Check you have a CUDA-enabled GPU
- Install the latest drivers
- Install the CUDA Toolkit
- Download the GPUmat Toolbox
- Copy the functions from the
k-Wave Toolbox\Other\GPUmatfolder to theGPUmat\@GPUtypefolder, renaming their extensions from.txtto.m(these are wrapper functions forbsxfun,fft3, andifft3in the GPUmat toolbox) - Make sure both the k-Wave and GPUmat toolboxes are on your MATLAB path, then try running
>> GPUstart
and then
>> tic; fft2(GPUsingle(rand(100, 100))); toc;
to check the GPU is working - Try running a k-Wave simulation with the optional input
'DataCast', 'GPUsingle'