Elliot,
Usually pstdElastic3D
is called like this:
sensor_data = pstdElastic3D(kgrid, medium, source, sensor)
To run it on the GPU, define an input_args
cell array with DataCast
set to gpuArray-single
and give it to pstdElastic3D
, like this:
input_args = {'DataCast','gpuArray-single'};
sensor_data = pstdElastic3D(kgrid, medium, source, sensor, input_args{:});
I recommend reading the k-Wave documentation/examples, which has this information and more (http://www.k-wave.org/documentation/pstdElastic3D.php)
---
Additionally, to change the GPU you are running the simulation on, MATLAB's parallel computing toolbox has a function called gpuDevice
, which indexes devices differently than usual: it starts at 1 instead of 0. So to set your device to the zeroth Nvidia device, use:
gpuDevice(1);