CUDA
We also support CUDA.jl.
Load
Before using a CuArray simply invoke.
using CUDAOur routines need as input array either only Arrays or CuArrays. To get the deconvolution running, both the PSF and the measured array needs to be a CuArray. See also our 3D example here.
Issues with Regularizers
Our CPU regularizers are expressed with Tullio.jl, which is currently not performant (and partly unsupported) with GPUs. Therefore TV(), GR(), TH(), Tikhonov() and HS() automatically dispatch to GPU compliant view/broadcast based implementations when called on a CuArray. You can use the explicit variants DeconvOptim.TV_cuda, DeconvOptim.GR_cuda, DeconvOptim.TH_cuda, DeconvOptim.Tikhonov_cuda and DeconvOptim.HS_cuda, but this should not be necessary and is discouraged.
All regularizers (both the Tullio and the view/broadcast based variants) accept num_dims=nothing in which case the number of dimensions is inferred from the array upon use. For GR()/TV()/Tikhonov() the CPU path then pre-compiles a @tullio kernel for each dimension 1:NMAX (NMAX = 10) and dispatches on ndims(arr); arrays with more dimensions or CuArrays fall back to the view/broadcast based kernels and automatically choose num_dims. All regularizers support sum_dims (the dimensions over which the regularizer is computed, with the rest summed over) and per-dimension weights (matched positionally to sum_dims). Tikhonov()/DeconvOptim.Tikhonov_cuda additionally support all three modes ("laplace", "spatial_grad_square", "identity") and step.