function varargout = maxk(varargin)
%MAXK Find K largest elements of gpuArray
%   Y = MAXK(X,K)
%   Y = MAXK(X,K,DIM)
%   Y = MAXK(...,'ComparisonMethod',C)
%   [Y,I] = MAXK(...)
%   
%   Example:
%    
%       N = 1000;
%       D = gpuArray(magic(N))
%       m = maxk(D,10)
%       m1 = maxk(D,10,1)
%       m2 = max(D,10,2,'ComparisonMethod','real')
%   
%   m and m1 are a set of K gpuArray row vectors, m2 is a set of K gpuArray  
%   column vectors.
%   
%   See also MAXK, GPUARRAY, MAGIC.
%   


%   Copyright 2018 The MathWorks, Inc.

try
    [varargout{1:nargout}] = parallel.internal.flowthrough.maxk(varargin{:});
catch ME
    throw(ME);
end

end