function inputs = prepareSolverInputs(inputs, isData)
;%#ok<NOSEM> Undocumented

% Ensure that data inputs to the iterative solvers are on the GPU and that
% non-data inputs are on the host.

% Copyright 2014 The MathWorks, Inc.

for ii=1:min(length(inputs),length(isData))
    if isData(ii) && isnumeric(inputs{ii})
        % Data input - make sure it is on the GPU
        inputs{ii} = gpuArray(inputs{ii});
    else
        % Not data, so gather
        inputs{ii} = gather(inputs{ii});
    end
end
end