function mdl = fitrtree(X,Y,varargin)
%FITRTREE Fit a regression decision tree using gpuArray inputs
%   MDL = FITRTREE(TBL,RESPONSEVARNAME)
%   MDL = FITRTREE(TBL,FORMULA)
%   MDL = FITRTREE(TBL,Y)
%   MDL = FITRTREE(X,Y)
%   MDL = FITRTREE(___,'PARAM1',val1,'PARAM2',val2,...)
%
%   Limitations:
%   1) For data with categorical predictors, "NumVariablesToSample" must be
%      "all".
%   2) Surrogate splits are not supported.
%   3) You can specify the name-value argument 'PredictorSelection' only as
%      'allsplits'.
%
%   See also FITRTREE, GPUARRAY.

%   Copyright 2021-2022 The MathWorks, Inc.

% Validate the inputs.
narginchk(2,inf);
[X,Y,varargin{:}] = validateInputsForRegressionFitFunction(X,Y,varargin);

% Call underlying toolbox function.
mdl = parallel.internal.array.callToolboxFunction("stats/classreg/fitrtree", X, Y, varargin{:});
end