kwave.kspaceFirstOrder3D has CPU (C++) and GPU (CUDA)-accelerated binaries, with the CUDA version providing substantial performance improvements over the CPU version. However, in the current implementation of protocol.calc_solution, the call to run_simulation is hard coded with gpu = False, which disables the use of the CUDA version and significantly degrades performance.
In the MATLAB version of the code, I would have the simulation code try to use the CUDA code and then fall back to the C++ code if the GPU resource wasn't available (via an exception), but we may want a cleaner way to check if the GPU is available here up front. In fact, one of our product requirements is to verify that sufficient computation resources are available, so we could have it always use the GPU and through a well-formed error if the GPU isn't available, although I would prefer that we take more of a "stern warning" approach so that CPU-bound users aren't completely shut out, but clinical system operators using the custom application would be required to be using the appropriate hardware.
kwave.kspaceFirstOrder3D
has CPU (C++) and GPU (CUDA)-accelerated binaries, with the CUDA version providing substantial performance improvements over the CPU version. However, in the current implementation ofprotocol.calc_solution
, the call torun_simulation
is hard coded withgpu = False
, which disables the use of the CUDA version and significantly degrades performance.In the MATLAB version of the code, I would have the simulation code try to use the CUDA code and then fall back to the C++ code if the GPU resource wasn't available (via an exception), but we may want a cleaner way to check if the GPU is available here up front. In fact, one of our product requirements is to verify that sufficient computation resources are available, so we could have it always use the GPU and through a well-formed error if the GPU isn't available, although I would prefer that we take more of a "stern warning" approach so that CPU-bound users aren't completely shut out, but clinical system operators using the custom application would be required to be using the appropriate hardware.