diff --git a/stan/math/fwd/fun/mdivide_left_tri_low.hpp b/stan/math/fwd/fun/mdivide_left_tri_low.hpp index 8dfd8f4cb2d..d17a4c385f2 100644 --- a/stan/math/fwd/fun/mdivide_left_tri_low.hpp +++ b/stan/math/fwd/fun/mdivide_left_tri_low.hpp @@ -20,9 +20,6 @@ template , std::decay_t::RowsAtCompileTime, std::decay_t::ColsAtCompileTime> mdivide_left_tri_low(T1&& A, T2&& b) { - constexpr int S1 = std::decay_t::RowsAtCompileTime; - constexpr int C2 = std::decay_t::ColsAtCompileTime; - check_square("mdivide_left_tri_low", "A", A); check_multiplicable("mdivide_left_tri_low", "A", A, "b", b); if (A.size() == 0) { @@ -47,7 +44,6 @@ template * = nullptr, inline Eigen::Matrix, std::decay_t::RowsAtCompileTime, std::decay_t::ColsAtCompileTime> mdivide_left_tri_low(T1&& A, T2&& b) { - constexpr int S1 = std::decay_t::RowsAtCompileTime; check_square("mdivide_left_tri_low", "A", A); check_multiplicable("mdivide_left_tri_low", "A", A, "b", b); if (A.size() == 0) { @@ -64,8 +60,6 @@ template * = nullptr, inline Eigen::Matrix, std::decay_t::RowsAtCompileTime, std::decay_t::ColsAtCompileTime> mdivide_left_tri_low(T1&& A, T2&& b) { - constexpr int S1 = std::decay_t::RowsAtCompileTime; - constexpr int C2 = std::decay_t::ColsAtCompileTime; check_square("mdivide_left_tri_low", "A", A); check_multiplicable("mdivide_left_tri_low", "A", A, "b", b); if (A.size() == 0) { diff --git a/stan/math/opencl/kernel_generator/colwise_reduction.hpp b/stan/math/opencl/kernel_generator/colwise_reduction.hpp index e4520b154c6..088577f8a88 100644 --- a/stan/math/opencl/kernel_generator/colwise_reduction.hpp +++ b/stan/math/opencl/kernel_generator/colwise_reduction.hpp @@ -222,7 +222,6 @@ class colwise_sum_ : public colwise_reduction, T, sum_op> { */ template * = nullptr> inline auto colwise_sum(T&& a) { - auto&& arg_copy = as_operation_cl(std::forward(a)).deep_copy(); return colwise_sum_>( as_operation_cl(std::forward(a))); } @@ -266,7 +265,6 @@ class colwise_prod_ : public colwise_reduction, T, prod_op> { */ template * = nullptr> inline auto colwise_prod(T&& a) { - auto&& arg_copy = as_operation_cl(std::forward(a)).deep_copy(); return colwise_prod_>( as_operation_cl(std::forward(a))); } @@ -315,7 +313,6 @@ class colwise_max_ : public colwise_reduction< */ template * = nullptr> inline auto colwise_max(T&& a) { - auto&& arg_copy = as_operation_cl(std::forward(a)).deep_copy(); return colwise_max_>( as_operation_cl(std::forward(a))); } diff --git a/stan/math/opencl/kernel_generator/reduction_2d.hpp b/stan/math/opencl/kernel_generator/reduction_2d.hpp index 4d019f1012c..b028c50f60a 100644 --- a/stan/math/opencl/kernel_generator/reduction_2d.hpp +++ b/stan/math/opencl/kernel_generator/reduction_2d.hpp @@ -231,7 +231,6 @@ class sum_2d_ : public reduction_2d, T, sum_op> { */ template * = nullptr> inline auto sum_2d(T&& a) { - auto&& arg_copy = as_operation_cl(std::forward(a)).deep_copy(); return sum_2d_>(as_operation_cl(std::forward(a))); } @@ -274,7 +273,6 @@ class prod_2d_ : public reduction_2d, T, prod_op> { */ template * = nullptr> inline auto prod_2d(T&& a) { - auto&& arg_copy = as_operation_cl(std::forward(a)).deep_copy(); return prod_2d_>(as_operation_cl(std::forward(a))); } @@ -321,7 +319,6 @@ class max_2d_ */ template * = nullptr> inline auto max_2d(T&& a) { - auto&& arg_copy = as_operation_cl(std::forward(a)).deep_copy(); return max_2d_>(as_operation_cl(std::forward(a))); } diff --git a/stan/math/opencl/prim/binomial_logit_glm_lpmf.hpp b/stan/math/opencl/prim/binomial_logit_glm_lpmf.hpp index a569498f5e1..340f9250b84 100644 --- a/stan/math/opencl/prim/binomial_logit_glm_lpmf.hpp +++ b/stan/math/opencl/prim/binomial_logit_glm_lpmf.hpp @@ -34,7 +34,6 @@ inline return_type_t binomial_logit_glm_lpmf( const T_beta_cl& beta) { static const char* function = "binomial_logit_glm_lpmf(OpenCL)"; using T_partials_return = partials_return_t; - constexpr bool is_y_vector = !is_stan_scalar::value; constexpr bool is_alpha_vector = !is_stan_scalar::value; const size_t N_instances diff --git a/stan/math/opencl/zeros_strict_tri.hpp b/stan/math/opencl/zeros_strict_tri.hpp index 339f987cb59..8e4b9989328 100644 --- a/stan/math/opencl/zeros_strict_tri.hpp +++ b/stan/math/opencl/zeros_strict_tri.hpp @@ -44,7 +44,6 @@ inline void matrix_cl::zeros_strict_tri() try { return; } this->view_ = both(this->view_, invert(matrix_view)); - cl::CommandQueue& cmdQueue = opencl_context.queue(); opencl_kernels::fill_strict_tri(cl::NDRange(this->rows(), this->cols()), *this, 0.0, this->rows(), this->cols(), matrix_view); diff --git a/stan/math/prim/constraint/unit_vector_free.hpp b/stan/math/prim/constraint/unit_vector_free.hpp index c69a7ac9421..01624e01a4e 100644 --- a/stan/math/prim/constraint/unit_vector_free.hpp +++ b/stan/math/prim/constraint/unit_vector_free.hpp @@ -25,7 +25,7 @@ inline auto unit_vector_free(EigVec&& x) { auto&& x_ref = to_ref(std::forward(x)); check_unit_vector("stan::math::unit_vector_free", "Unit vector variable", x_ref); - return x_ref; + return std::forward(x_ref); } /** diff --git a/stan/math/prim/fun/log_softmax.hpp b/stan/math/prim/fun/log_softmax.hpp index d6c9017edb6..8e34955c048 100644 --- a/stan/math/prim/fun/log_softmax.hpp +++ b/stan/math/prim/fun/log_softmax.hpp @@ -7,6 +7,7 @@ #include #include #include +#include namespace stan { namespace math { @@ -53,7 +54,7 @@ inline auto log_softmax(Container&& x) { std::forward(a), [](auto&& v) -> plain_type_t { if (v.size() == 0) { - return v; + return std::forward(v); } return (v.array() - log_sum_exp(v)).matrix(); }); diff --git a/stan/math/prim/fun/softmax.hpp b/stan/math/prim/fun/softmax.hpp index 63a51876a60..a737a2e2d53 100644 --- a/stan/math/prim/fun/softmax.hpp +++ b/stan/math/prim/fun/softmax.hpp @@ -6,6 +6,7 @@ #include #include #include +#include namespace stan { namespace math { @@ -56,7 +57,7 @@ inline auto softmax(Container&& x) { std::forward(a), [](auto&& v) -> plain_type_t { if (v.size() == 0) { - return v; + return std::forward(v); } const auto theta = (v.array() - v.maxCoeff()).exp(); return (theta / theta.sum()).matrix(); diff --git a/stan/math/prim/prob/normal_sufficient_lpdf.hpp b/stan/math/prim/prob/normal_sufficient_lpdf.hpp index 996b5e2d052..83b8a061ffc 100644 --- a/stan/math/prim/prob/normal_sufficient_lpdf.hpp +++ b/stan/math/prim/prob/normal_sufficient_lpdf.hpp @@ -75,8 +75,6 @@ inline return_type_t normal_sufficient_lpdf( decltype(auto) y_val = to_ref(as_value_column_array_or_scalar(y_ref)); decltype(auto) s_squared_val = to_ref(as_value_column_array_or_scalar(s_squared_ref)); - decltype(auto) n_obs_val_int - = to_ref(as_value_column_array_or_scalar(n_obs_ref)); decltype(auto) n_obs_val = to_ref( promote_scalar(as_value_column_array_or_scalar(n_obs_ref))); decltype(auto) mu_val = to_ref(as_value_column_array_or_scalar(mu_ref)); diff --git a/stan/math/prim/prob/student_t_qf.hpp b/stan/math/prim/prob/student_t_qf.hpp index 5a4b9dbf920..c2c096de9a1 100644 --- a/stan/math/prim/prob/student_t_qf.hpp +++ b/stan/math/prim/prob/student_t_qf.hpp @@ -72,7 +72,6 @@ template ; - static constexpr const char* function = "student_t_qf"; const size_t max_size_all = max_size(p, nu, mu, sigma); Eigen::Matrix result(max_size_all); diff --git a/stan/math/rev/prob/student_t_qf.hpp b/stan/math/rev/prob/student_t_qf.hpp index e44d4cbbc9c..d9ff3e0314b 100644 --- a/stan/math/rev/prob/student_t_qf.hpp +++ b/stan/math/rev/prob/student_t_qf.hpp @@ -39,7 +39,6 @@ inline var student_t_qf(const T_p& p, const T_nu& nu, const T_mu& mu, const double p_val_flip = p_val < 0.5 ? p_val : 1.0 - p_val; const double p_sign = p_val < 0.5 ? -1.0 : 1.0; const double ibeta_arg = inv_inc_beta(0.5 * nu_val, 0.5, 2 * p_val_flip); - const double sqrt_inv_ibeta_m1 = sqrt(inv(ibeta_arg) - 1.0); double ret_val = mu_val + p_sign * sigma_val * sqrt(nu_val) * sqrt(-1.0 + 1.0 / ibeta_arg); @@ -49,7 +48,6 @@ inline var student_t_qf(const T_p& p, const T_nu& nu, const T_mu& mu, const double mu_val = value_of(mu); const double sigma_val = value_of(sigma); const double nu_val = value_of(nu); - const double p_val_flip = p_val < 0.5 ? p_val : 1.0 - p_val; const double p_sign = p_val < 0.5 ? -1.0 : 1.0; const double sqrt_inv_ibeta_m1 = sqrt(inv(ibeta_arg) - 1.0); if constexpr (is_autodiff_v) { diff --git a/test/unit/math/opencl/kernel_generator/calc_if_test.cpp b/test/unit/math/opencl/kernel_generator/calc_if_test.cpp index 0343ae0a350..89c233eb81d 100644 --- a/test/unit/math/opencl/kernel_generator/calc_if_test.cpp +++ b/test/unit/math/opencl/kernel_generator/calc_if_test.cpp @@ -50,7 +50,6 @@ TEST(KernelGenerator, calc_if_multi_result_pass_test) { } TEST(KernelGenerator, calc_if_multi_result_no_output_test) { - double eps = 0; MatrixXd m(2, 2); m << 1, 2, 3, 4; matrix_cl m_cl(m); diff --git a/test/unit/math/opencl/kernel_generator/colwise_reduction_test.cpp b/test/unit/math/opencl/kernel_generator/colwise_reduction_test.cpp index 0ee89e52094..4982efa00e2 100644 --- a/test/unit/math/opencl/kernel_generator/colwise_reduction_test.cpp +++ b/test/unit/math/opencl/kernel_generator/colwise_reduction_test.cpp @@ -59,6 +59,26 @@ TEST(KernelGenerator, colwise_prod_test) { EXPECT_MATRIX_NEAR(correct, res, 1e-9); } +TEST(KernelGenerator, colwise_reductions_rvalue_input) { + MatrixXd m(3, 2); + m << 1.1, 1.2, 1.3, 1.4, 1.5, 1.6; + + matrix_cl res_cl = stan::math::colwise_sum(matrix_cl(m)); + MatrixXd res = stan::math::from_matrix_cl(res_cl).colwise().sum(); + MatrixXd correct = m.colwise().sum(); + EXPECT_MATRIX_NEAR(correct, res, 1e-9); + + matrix_cl prod_cl = stan::math::colwise_prod(matrix_cl(m)); + MatrixXd prod = stan::math::from_matrix_cl(prod_cl).colwise().prod(); + MatrixXd correct_prod = m.colwise().prod(); + EXPECT_MATRIX_NEAR(correct_prod, prod, 1e-9); + + matrix_cl max_cl = stan::math::colwise_max(matrix_cl(m)); + MatrixXd max = stan::math::from_matrix_cl(max_cl).colwise().maxCoeff(); + MatrixXd correct_max = m.colwise().maxCoeff(); + EXPECT_MATRIX_NEAR(correct_max, max, 1e-9); +} + TEST(KernelGenerator, colwise_min_test) { MatrixXd m(3, 2); m << 1.1, 1.2, 1.3, 1.4, 1.5, 1.6; diff --git a/test/unit/math/opencl/kernel_generator/reduction_2d_test.cpp b/test/unit/math/opencl/kernel_generator/reduction_2d_test.cpp index 0569d901a1f..ca92f3a7ee6 100644 --- a/test/unit/math/opencl/kernel_generator/reduction_2d_test.cpp +++ b/test/unit/math/opencl/kernel_generator/reduction_2d_test.cpp @@ -57,6 +57,23 @@ TEST(KernelGenerator, prod_2d_test) { EXPECT_NEAR(correct, res, 1e-9); } +TEST(KernelGenerator, reductions_2d_rvalue_input) { + MatrixXd m(3, 2); + m << 1.1, 1.2, 1.3, 1.4, 1.5, 1.6; + + matrix_cl res_cl = stan::math::sum_2d(matrix_cl(m)); + double res = stan::math::from_matrix_cl(res_cl).sum(); + EXPECT_NEAR(m.sum(), res, 1e-9); + + matrix_cl prod_cl = stan::math::prod_2d(matrix_cl(m)); + double prod = stan::math::from_matrix_cl(prod_cl).prod(); + EXPECT_NEAR(m.prod(), prod, 1e-9); + + matrix_cl max_cl = stan::math::max_2d(matrix_cl(m)); + double max = stan::math::from_matrix_cl(max_cl).maxCoeff(); + EXPECT_NEAR(m.maxCoeff(), max, 1e-9); +} + TEST(KernelGenerator, min_2d_test) { MatrixXd m(3, 2); m << 1.1, 1.2, 1.3, 1.4, 1.5, 1.6; diff --git a/test/unit/math/opencl/matrix_cl_test.cpp b/test/unit/math/opencl/matrix_cl_test.cpp index 92a50033378..eb3f86678d8 100644 --- a/test/unit/math/opencl/matrix_cl_test.cpp +++ b/test/unit/math/opencl/matrix_cl_test.cpp @@ -50,7 +50,6 @@ TEST(MathMatrixCL, matrix_cl_value) { TEST(MathMatrixCL, assignment) { using stan::math::matrix_cl; Eigen::Matrix mat_1; - Eigen::Matrix mat_2; mat_1 << 1, 2, 3, 4; matrix_cl mat1_cl(mat_1); matrix_cl mat2_cl(2, 2); diff --git a/test/unit/math/opencl/prim/mdivide_left_tri_low_test.cpp b/test/unit/math/opencl/prim/mdivide_left_tri_low_test.cpp index c0151631ed1..93e5d029013 100644 --- a/test/unit/math/opencl/prim/mdivide_left_tri_low_test.cpp +++ b/test/unit/math/opencl/prim/mdivide_left_tri_low_test.cpp @@ -49,7 +49,6 @@ inline void mdivide_left_tri_low_Ab_test(int size) { stan::math::matrix_cl m0_cl(m1, stan::math::matrix_cl_view::Lower); stan::math::matrix_d m1_cl = stan::math::from_matrix_cl( stan::math::mdivide_left_tri_low(m0_cl, m0_cl)); - double max_error = 0; for (int i = 0; i < m1_cpu.size(); i++) { stan::test::expect_near_rel("mdivide_left_tri_low (OpenCL)", m1_cpu(i), m1_cl(i)); @@ -77,7 +76,6 @@ inline void mdivide_left_tri_low_A_test(int size) { stan::math::matrix_cl m1_A_cl(m1, stan::math::matrix_cl_view::Lower); m1_cl = stan::math::from_matrix_cl(stan::math::mdivide_left_tri_low(m1_A_cl)); - double max_error = 0; for (int i = 0; i < size; i++) { for (int j = 0; j <= i; j++) { stan::test::expect_near_rel("mdivide_left_tri_low (OpenCL)", m1_cpu(i, j), diff --git a/test/unit/math/opencl/prim/mdivide_right_tri_low_test.cpp b/test/unit/math/opencl/prim/mdivide_right_tri_low_test.cpp index a339cfbb107..d59099dc3cc 100644 --- a/test/unit/math/opencl/prim/mdivide_right_tri_low_test.cpp +++ b/test/unit/math/opencl/prim/mdivide_right_tri_low_test.cpp @@ -48,7 +48,6 @@ inline void mdivide_right_tri_low_Ab_test(int size) { stan::math::matrix_cl m1_A_cl(m1, stan::math::matrix_cl_view::Lower); stan::math::matrix_d m1_cl = stan::math::from_matrix_cl( stan::math::mdivide_right_tri_low(m1_A_cl, m1_A_cl)); - double max_error = 0; for (int i = 0; i < m1_cpu.size(); i++) { stan::test::expect_near_rel("mdivide_right_tri_low (OpenCL)", m1_cpu(i), m1_cl(i)); diff --git a/test/unit/math/opencl/rev/append_array_test.cpp b/test/unit/math/opencl/rev/append_array_test.cpp index 3b2252a767c..4e9023f5e72 100644 --- a/test/unit/math/opencl/rev/append_array_test.cpp +++ b/test/unit/math/opencl/rev/append_array_test.cpp @@ -15,8 +15,6 @@ TEST(OpenCLAppendArray, prim_rev_values_small) { } TEST(OpenCLAppendArray, prim_rev_size_0) { - int N = 0; - std::vector a{}; std::vector b{}; stan::math::test::compare_cpu_opencl_prim_rev(append_array_functor, a, b); diff --git a/test/unit/math/opencl/rev/bernoulli_cdf_test.cpp b/test/unit/math/opencl/rev/bernoulli_cdf_test.cpp index 107708c0d80..79975958028 100644 --- a/test/unit/math/opencl/rev/bernoulli_cdf_test.cpp +++ b/test/unit/math/opencl/rev/bernoulli_cdf_test.cpp @@ -45,7 +45,6 @@ auto bernoulli_cdf_functor = [](const auto& n, const auto& theta) { TEST(ProbDistributionsBernoulliCdf, opencl_matches_cpu_small) { int N = 3; - int M = 2; std::vector n{0, 1, 3}; Eigen::VectorXd theta(N); @@ -59,7 +58,6 @@ TEST(ProbDistributionsBernoulliCdf, opencl_matches_cpu_small) { TEST(ProbDistributionsBernoulliCdf, opencl_matches_cpu_small_n_negative) { int N = 3; - int M = 2; std::vector n{0, 1, -5}; Eigen::VectorXd theta(N); @@ -83,8 +81,6 @@ TEST(ProbDistributionsBernoulliCdf, opencl_broadcast_n) { } TEST(ProbDistributionsBernoulliCdf, opencl_broadcast_theta) { - int N = 3; - std::vector n{0, 1, 0}; double theta_scal = 0.4; diff --git a/test/unit/math/opencl/rev/bernoulli_lccdf_test.cpp b/test/unit/math/opencl/rev/bernoulli_lccdf_test.cpp index 732b1e62f2c..51a2e43a4a6 100644 --- a/test/unit/math/opencl/rev/bernoulli_lccdf_test.cpp +++ b/test/unit/math/opencl/rev/bernoulli_lccdf_test.cpp @@ -45,7 +45,6 @@ auto bernoulli_lccdf_functor = [](const auto& n, const auto& theta) { TEST(ProbDistributionsBernoulliLccdf, opencl_matches_cpu_small) { int N = 3; - int M = 2; std::vector n{0, 0, 0}; Eigen::VectorXd theta(N); @@ -59,7 +58,6 @@ TEST(ProbDistributionsBernoulliLccdf, opencl_matches_cpu_small) { TEST(ProbDistributionsBernoulliLccdf, opencl_matches_cpu_small_n_negative) { int N = 3; - int M = 2; std::vector n{0, 0, -5}; Eigen::VectorXd theta(N); @@ -73,7 +71,6 @@ TEST(ProbDistributionsBernoulliLccdf, opencl_matches_cpu_small_n_negative) { TEST(ProbDistributionsBernoulliLccdf, opencl_matches_cpu_small_n_over_one) { int N = 3; - int M = 2; std::vector n{0, 1, 5}; Eigen::VectorXd theta(N); @@ -97,8 +94,6 @@ TEST(ProbDistributionsBernoulliLccdf, opencl_broadcast_n) { } TEST(ProbDistributionsBernoulliLccdf, opencl_broadcast_theta) { - int N = 3; - std::vector n{0, 0, 0}; double theta_scal = 0.4; diff --git a/test/unit/math/opencl/rev/bernoulli_logit_lpmf_test.cpp b/test/unit/math/opencl/rev/bernoulli_logit_lpmf_test.cpp index 401b88349f7..b6d86ae5e90 100644 --- a/test/unit/math/opencl/rev/bernoulli_logit_lpmf_test.cpp +++ b/test/unit/math/opencl/rev/bernoulli_logit_lpmf_test.cpp @@ -48,7 +48,6 @@ auto bernoulli_logit_lpmf_functor_propto TEST(ProbDistributionsBernoulliLogit, opencl_matches_cpu_small) { int N = 3; - int M = 2; std::vector n{0, 1, 1}; Eigen::VectorXd theta(N); @@ -78,8 +77,6 @@ TEST(ProbDistributionsBernoulliLogit, opencl_broadcast_n) { } TEST(ProbDistributionsBernoulliLogit, opencl_broadcast_theta) { - int N = 3; - std::vector n{0, 1, 0}; double theta = 0.4; diff --git a/test/unit/math/opencl/rev/bernoulli_lpmf_test.cpp b/test/unit/math/opencl/rev/bernoulli_lpmf_test.cpp index 2dd8ae41530..7351e45d7a2 100644 --- a/test/unit/math/opencl/rev/bernoulli_lpmf_test.cpp +++ b/test/unit/math/opencl/rev/bernoulli_lpmf_test.cpp @@ -47,7 +47,6 @@ auto bernoulli_lpmf_functor_propto = [](const auto& n, const auto& theta) { TEST(ProbDistributionsBernoulli, opencl_matches_cpu_small) { int N = 3; - int M = 2; std::vector n{0, 1, 0}; Eigen::VectorXd theta(N); @@ -77,8 +76,6 @@ TEST(ProbDistributionsBernoulli, opencl_broadcast_n) { } TEST(ProbDistributionsBernoulli, opencl_broadcast_theta) { - int N = 3; - std::vector n{0, 1, 0}; double theta_scal = 0.4; diff --git a/test/unit/math/opencl/rev/beta_lpdf_test.cpp b/test/unit/math/opencl/rev/beta_lpdf_test.cpp index dd0c3fce94e..a12ef5a5c80 100644 --- a/test/unit/math/opencl/rev/beta_lpdf_test.cpp +++ b/test/unit/math/opencl/rev/beta_lpdf_test.cpp @@ -85,7 +85,6 @@ auto beta_lpdf_functor_propto TEST(ProbDistributionsBeta, opencl_matches_cpu_small) { int N = 3; - int M = 2; Eigen::VectorXd y(N); y << 0, 0.5, 1; diff --git a/test/unit/math/opencl/rev/beta_proportion_lpdf_test.cpp b/test/unit/math/opencl/rev/beta_proportion_lpdf_test.cpp index 6709ea03e42..157d598bc09 100644 --- a/test/unit/math/opencl/rev/beta_proportion_lpdf_test.cpp +++ b/test/unit/math/opencl/rev/beta_proportion_lpdf_test.cpp @@ -65,7 +65,6 @@ auto beta_proportion_lpdf_functor_propto TEST(ProbDistributionsBetaProportion, opencl_matches_cpu_small) { int N = 3; - int M = 2; Eigen::VectorXd y(N); y << 0.3, 0.8, 1.0; diff --git a/test/unit/math/opencl/rev/binomial_logit_lpmf_test.cpp b/test/unit/math/opencl/rev/binomial_logit_lpmf_test.cpp index 92b85841292..4ee784145d0 100644 --- a/test/unit/math/opencl/rev/binomial_logit_lpmf_test.cpp +++ b/test/unit/math/opencl/rev/binomial_logit_lpmf_test.cpp @@ -114,8 +114,6 @@ TEST(ProbDistributionsBinomialLogit, opencl_broadcast_N) { } TEST(ProbDistributionsBinomialLogit, opencl_broadcast_alpha) { - int N = 3; - std::vector n{0, 1, 12}; std::vector m{0, 1, 123}; double alpha_scal = 0.4; diff --git a/test/unit/math/opencl/rev/binomial_lpmf_test.cpp b/test/unit/math/opencl/rev/binomial_lpmf_test.cpp index 7be5166eb86..e84dc9c6eab 100644 --- a/test/unit/math/opencl/rev/binomial_lpmf_test.cpp +++ b/test/unit/math/opencl/rev/binomial_lpmf_test.cpp @@ -119,8 +119,6 @@ TEST(ProbDistributionsBinomial, opencl_broadcast_N) { } TEST(ProbDistributionsBinomial, opencl_broadcast_theta) { - int N = 3; - std::vector n{0, 1, 12}; std::vector m{0, 1, 123}; double theta_scal = 0.4; diff --git a/test/unit/math/opencl/rev/cauchy_lccdf_test.cpp b/test/unit/math/opencl/rev/cauchy_lccdf_test.cpp index 342bf34c129..29fa178f33b 100644 --- a/test/unit/math/opencl/rev/cauchy_lccdf_test.cpp +++ b/test/unit/math/opencl/rev/cauchy_lccdf_test.cpp @@ -64,7 +64,6 @@ auto cauchy_lccdf_functor TEST(ProbDistributionsCauchyLccdf, opencl_matches_cpu_small) { int N = 3; - int M = 2; Eigen::VectorXd y(N); y << 0.3, -0.6, 1.0; diff --git a/test/unit/math/opencl/rev/cauchy_lpdf_test.cpp b/test/unit/math/opencl/rev/cauchy_lpdf_test.cpp index 7623819af84..a31ab65c0fe 100644 --- a/test/unit/math/opencl/rev/cauchy_lpdf_test.cpp +++ b/test/unit/math/opencl/rev/cauchy_lpdf_test.cpp @@ -67,7 +67,6 @@ auto cauchy_lpdf_functor_propto TEST(ProbDistributionsCauchy, opencl_matches_cpu_small) { int N = 3; - int M = 2; Eigen::VectorXd y(N); y << 0.3, 0.8, 1.0; diff --git a/test/unit/math/opencl/rev/double_exponential_cdf_test.cpp b/test/unit/math/opencl/rev/double_exponential_cdf_test.cpp index fc441df05e9..91f9ed8afd6 100644 --- a/test/unit/math/opencl/rev/double_exponential_cdf_test.cpp +++ b/test/unit/math/opencl/rev/double_exponential_cdf_test.cpp @@ -63,7 +63,6 @@ auto double_exponential_cdf_functor TEST(ProbDistributionsDoubleExponentialCdf, opencl_matches_cpu_small) { int N = 3; - int M = 2; Eigen::VectorXd y(N); y << -0.3, 1.8, 1.4; diff --git a/test/unit/math/opencl/rev/double_exponential_lccdf_test.cpp b/test/unit/math/opencl/rev/double_exponential_lccdf_test.cpp index eca87505ee9..3edb3b9bb21 100644 --- a/test/unit/math/opencl/rev/double_exponential_lccdf_test.cpp +++ b/test/unit/math/opencl/rev/double_exponential_lccdf_test.cpp @@ -66,7 +66,6 @@ auto double_exponential_lccdf_functor TEST(ProbDistributionsDoubleExponentialLccdf, opencl_matches_cpu_small) { int N = 3; - int M = 2; Eigen::VectorXd y(N); y << 0.3, 2.8, 1.0; diff --git a/test/unit/math/opencl/rev/double_exponential_lcdf_test.cpp b/test/unit/math/opencl/rev/double_exponential_lcdf_test.cpp index 6e8f2f57f90..88a0d8e6aa1 100644 --- a/test/unit/math/opencl/rev/double_exponential_lcdf_test.cpp +++ b/test/unit/math/opencl/rev/double_exponential_lcdf_test.cpp @@ -63,7 +63,6 @@ auto double_exponential_lcdf_functor TEST(ProbDistributionsDoubleExponentialLcdf, opencl_matches_cpu_small) { int N = 3; - int M = 2; Eigen::VectorXd y(N); y << 0.3, 0.8, 1.7; diff --git a/test/unit/math/opencl/rev/exp_mod_normal_cdf_test.cpp b/test/unit/math/opencl/rev/exp_mod_normal_cdf_test.cpp index 33c53bb16a7..711b9e38a3e 100644 --- a/test/unit/math/opencl/rev/exp_mod_normal_cdf_test.cpp +++ b/test/unit/math/opencl/rev/exp_mod_normal_cdf_test.cpp @@ -88,7 +88,6 @@ auto exp_mod_normal_cdf_functor TEST(ProbDistributionsDoubleExpModNormalCdf, opencl_matches_cpu_small) { int N = 3; - int M = 2; Eigen::VectorXd y(N); y << -0.3, 1.8, 1.4; @@ -109,7 +108,6 @@ TEST(ProbDistributionsDoubleExpModNormalCdf, opencl_matches_cpu_small) { TEST(ProbDistributionsDoubleExpModNormalCdf, opencl_matches_cpu_small_y_neg_inf) { int N = 3; - int M = 2; Eigen::VectorXd y(N); y << -INFINITY, 1.8, 1.4; diff --git a/test/unit/math/opencl/rev/exp_mod_normal_lccdf_test.cpp b/test/unit/math/opencl/rev/exp_mod_normal_lccdf_test.cpp index 677ce2a2f89..d03eae230b3 100644 --- a/test/unit/math/opencl/rev/exp_mod_normal_lccdf_test.cpp +++ b/test/unit/math/opencl/rev/exp_mod_normal_lccdf_test.cpp @@ -88,7 +88,6 @@ auto exp_mod_normal_lccdf_functor TEST(ProbDistributionsDoubleExpModNormalLccdf, opencl_matches_cpu_small) { int N = 3; - int M = 2; Eigen::VectorXd y(N); y << -0.3, 1.8, 1.4; @@ -109,7 +108,6 @@ TEST(ProbDistributionsDoubleExpModNormalLccdf, opencl_matches_cpu_small) { TEST(ProbDistributionsDoubleExpModNormalLccdf, opencl_matches_cpu_small_y_pos_inf) { int N = 3; - int M = 2; Eigen::VectorXd y(N); y << -0.3, 1.8, INFINITY; @@ -130,7 +128,6 @@ TEST(ProbDistributionsDoubleExpModNormalLccdf, TEST(ProbDistributionsDoubleExpModNormalLccdf, opencl_matches_cpu_small_y_neg_inf) { int N = 3; - int M = 2; Eigen::VectorXd y(N); y << -0.3, 1.8, -INFINITY; diff --git a/test/unit/math/opencl/rev/exponential_cdf_test.cpp b/test/unit/math/opencl/rev/exponential_cdf_test.cpp index 405ba03f6a5..8002466f000 100644 --- a/test/unit/math/opencl/rev/exponential_cdf_test.cpp +++ b/test/unit/math/opencl/rev/exponential_cdf_test.cpp @@ -48,7 +48,6 @@ auto exponential_cdf_functor = [](const auto& y, const auto& beta) { TEST(ProbDistributionsExponentialCdf, opencl_matches_cpu_small) { int N = 3; - int M = 2; Eigen::VectorXd y(N); y << 0.3, 0.8, 1.0; diff --git a/test/unit/math/opencl/rev/exponential_lccdf_test.cpp b/test/unit/math/opencl/rev/exponential_lccdf_test.cpp index 99cea24f1d4..23386c90562 100644 --- a/test/unit/math/opencl/rev/exponential_lccdf_test.cpp +++ b/test/unit/math/opencl/rev/exponential_lccdf_test.cpp @@ -48,7 +48,6 @@ auto exponential_lccdf_functor = [](const auto& y, const auto& beta) { TEST(ProbDistributionsExponentialLccdf, opencl_matches_cpu_small) { int N = 3; - int M = 2; Eigen::VectorXd y(N); y << 0.3, 0.8, 1.0; diff --git a/test/unit/math/opencl/rev/exponential_lcdf_test.cpp b/test/unit/math/opencl/rev/exponential_lcdf_test.cpp index 25d47a0248f..3a236b149a0 100644 --- a/test/unit/math/opencl/rev/exponential_lcdf_test.cpp +++ b/test/unit/math/opencl/rev/exponential_lcdf_test.cpp @@ -48,7 +48,6 @@ auto exponential_lcdf_functor = [](const auto& y, const auto& beta) { TEST(ProbDistributionsExponentialLcdf, opencl_matches_cpu_small) { int N = 3; - int M = 2; Eigen::VectorXd y(N); y << 0.3, 0.8, 1.0; diff --git a/test/unit/math/opencl/rev/exponential_lpdf_test.cpp b/test/unit/math/opencl/rev/exponential_lpdf_test.cpp index 01e5671360a..cbf8018af98 100644 --- a/test/unit/math/opencl/rev/exponential_lpdf_test.cpp +++ b/test/unit/math/opencl/rev/exponential_lpdf_test.cpp @@ -57,7 +57,6 @@ auto exponential_lpdf_functor_propto = [](const auto& y, const auto& beta) { TEST(ProbDistributionsExponential, opencl_matches_cpu_small) { int N = 3; - int M = 2; Eigen::VectorXd y(N); y << 0, 0.5, 12.3; diff --git a/test/unit/math/opencl/rev/frechet_cdf_test.cpp b/test/unit/math/opencl/rev/frechet_cdf_test.cpp index 0fbab3d7f5d..c5302fe7f4b 100644 --- a/test/unit/math/opencl/rev/frechet_cdf_test.cpp +++ b/test/unit/math/opencl/rev/frechet_cdf_test.cpp @@ -63,7 +63,6 @@ auto frechet_cdf_functor TEST(ProbDistributionsFrechetCdf, opencl_matches_cpu_small) { int N = 3; - int M = 2; Eigen::VectorXd y(N); y << 0.3, 0.8, 1.0; diff --git a/test/unit/math/opencl/rev/frechet_lccdf_test.cpp b/test/unit/math/opencl/rev/frechet_lccdf_test.cpp index 36405481bac..918c6671cfc 100644 --- a/test/unit/math/opencl/rev/frechet_lccdf_test.cpp +++ b/test/unit/math/opencl/rev/frechet_lccdf_test.cpp @@ -63,7 +63,6 @@ auto frechet_lccdf_functor TEST(ProbDistributionsFrechetLccdf, opencl_matches_cpu_small) { int N = 3; - int M = 2; Eigen::VectorXd y(N); y << 0.3, 0.8, 1.0; diff --git a/test/unit/math/opencl/rev/frechet_lcdf_test.cpp b/test/unit/math/opencl/rev/frechet_lcdf_test.cpp index a9ab54e177c..905da61790b 100644 --- a/test/unit/math/opencl/rev/frechet_lcdf_test.cpp +++ b/test/unit/math/opencl/rev/frechet_lcdf_test.cpp @@ -63,7 +63,6 @@ auto frechet_lcdf_functor TEST(ProbDistributionsFrechetLcdf, opencl_matches_cpu_small) { int N = 3; - int M = 2; Eigen::VectorXd y(N); y << 0.3, 0.8, 1.0; diff --git a/test/unit/math/opencl/rev/gumbel_cdf_test.cpp b/test/unit/math/opencl/rev/gumbel_cdf_test.cpp index f65c838f4e6..572a06e0bd1 100644 --- a/test/unit/math/opencl/rev/gumbel_cdf_test.cpp +++ b/test/unit/math/opencl/rev/gumbel_cdf_test.cpp @@ -62,7 +62,6 @@ auto gumbel_cdf_functor = [](const auto& y, const auto& mu, const auto& sigma) { TEST(ProbDistributionsGumbelCdf, opencl_matches_cpu_small) { int N = 3; - int M = 2; Eigen::VectorXd y(N); y << 0.3, 0.8, 1.0; diff --git a/test/unit/math/opencl/rev/gumbel_lccdf_test.cpp b/test/unit/math/opencl/rev/gumbel_lccdf_test.cpp index 859e48573c9..f6aa9a09500 100644 --- a/test/unit/math/opencl/rev/gumbel_lccdf_test.cpp +++ b/test/unit/math/opencl/rev/gumbel_lccdf_test.cpp @@ -63,7 +63,6 @@ auto gumbel_lccdf_functor TEST(ProbDistributionsGumbelLccdf, opencl_matches_cpu_small) { int N = 3; - int M = 2; Eigen::VectorXd y(N); y << 0.3, 0.8, 1.0; diff --git a/test/unit/math/opencl/rev/gumbel_lcdf_test.cpp b/test/unit/math/opencl/rev/gumbel_lcdf_test.cpp index 9340c0b4183..b40cc75cef0 100644 --- a/test/unit/math/opencl/rev/gumbel_lcdf_test.cpp +++ b/test/unit/math/opencl/rev/gumbel_lcdf_test.cpp @@ -63,7 +63,6 @@ auto gumbel_lcdf_functor TEST(ProbDistributionsGumbelLcdf, opencl_matches_cpu_small) { int N = 3; - int M = 2; Eigen::VectorXd y(N); y << 0.3, 0.8, 1.0; diff --git a/test/unit/math/opencl/rev/inv_gamma_lpdf_test.cpp b/test/unit/math/opencl/rev/inv_gamma_lpdf_test.cpp index d86600bd966..08bd621ff18 100644 --- a/test/unit/math/opencl/rev/inv_gamma_lpdf_test.cpp +++ b/test/unit/math/opencl/rev/inv_gamma_lpdf_test.cpp @@ -79,7 +79,6 @@ auto inv_gamma_lpdf_functor_propto TEST(ProbDistributionsInvGamma, opencl_matches_cpu_small) { int N = 3; - int M = 2; Eigen::VectorXd y(N); y << 10, 0.5, 1; @@ -102,7 +101,6 @@ TEST(ProbDistributionsInvGamma, opencl_matches_cpu_small) { TEST(ProbDistributionsInvGamma, opencl_matches_cpu_small_zero_y) { int N = 3; - int M = 2; Eigen::VectorXd y(N); y << 0, 0.5, 1; diff --git a/test/unit/math/opencl/rev/log_mix_test.cpp b/test/unit/math/opencl/rev/log_mix_test.cpp index 68bccc12594..dc9eb721b83 100644 --- a/test/unit/math/opencl/rev/log_mix_test.cpp +++ b/test/unit/math/opencl/rev/log_mix_test.cpp @@ -59,7 +59,6 @@ auto log_mix_functor = [](const auto& theta, const auto& lambda) { TEST(OpenCLLogMix, opencl_matches_cpu_small) { int N = 3; - int M = 2; Eigen::VectorXd theta1(N); theta1 << 0.5, 0.4, 0.1; diff --git a/test/unit/math/opencl/rev/logistic_cdf_test.cpp b/test/unit/math/opencl/rev/logistic_cdf_test.cpp index f279c45691e..385dab309b2 100644 --- a/test/unit/math/opencl/rev/logistic_cdf_test.cpp +++ b/test/unit/math/opencl/rev/logistic_cdf_test.cpp @@ -63,7 +63,6 @@ auto logistic_cdf_functor TEST(ProbDistributionsLogisticCdf, opencl_matches_cpu_small) { int N = 3; - int M = 2; Eigen::VectorXd y(N); y << 0.3, 0.8, 1.0; @@ -81,7 +80,6 @@ TEST(ProbDistributionsLogisticCdf, opencl_matches_cpu_small) { TEST(ProbDistributionsLogisticCdf, opencl_matches_cpu_small_y_neg_inf) { int N = 3; - int M = 2; Eigen::VectorXd y(N); y << 0.3, -INFINITY, 1.0; diff --git a/test/unit/math/opencl/rev/logistic_lccdf_test.cpp b/test/unit/math/opencl/rev/logistic_lccdf_test.cpp index 50796ef91b6..00ff9dff489 100644 --- a/test/unit/math/opencl/rev/logistic_lccdf_test.cpp +++ b/test/unit/math/opencl/rev/logistic_lccdf_test.cpp @@ -63,7 +63,6 @@ auto logistic_lccdf_functor TEST(ProbDistributionsLogisticLccdf, opencl_matches_cpu_small) { int N = 3; - int M = 2; Eigen::VectorXd y(N); y << 0.3, 0.8, 1.0; @@ -81,7 +80,6 @@ TEST(ProbDistributionsLogisticLccdf, opencl_matches_cpu_small) { TEST(ProbDistributionsLogisticLccdf, opencl_matches_cpu_small_y_neg_inf) { int N = 3; - int M = 2; Eigen::VectorXd y(N); y << 0.3, -INFINITY, 1.0; diff --git a/test/unit/math/opencl/rev/logistic_lcdf_test.cpp b/test/unit/math/opencl/rev/logistic_lcdf_test.cpp index c3cb1cc9d4e..2a0e9ecd3a0 100644 --- a/test/unit/math/opencl/rev/logistic_lcdf_test.cpp +++ b/test/unit/math/opencl/rev/logistic_lcdf_test.cpp @@ -63,7 +63,6 @@ auto logistic_lcdf_functor TEST(ProbDistributionsLogisticLcdf, opencl_matches_cpu_small) { int N = 3; - int M = 2; Eigen::VectorXd y(N); y << 0.3, 0.8, 1.0; @@ -81,7 +80,6 @@ TEST(ProbDistributionsLogisticLcdf, opencl_matches_cpu_small) { TEST(ProbDistributionsLogisticLcdf, opencl_matches_cpu_small_y_neg_inf) { int N = 3; - int M = 2; Eigen::VectorXd y(N); y << 0.3, -INFINITY, 1.0; diff --git a/test/unit/math/opencl/rev/logistic_lpdf_test.cpp b/test/unit/math/opencl/rev/logistic_lpdf_test.cpp index 44cc923c6ea..9c3ba21f4b7 100644 --- a/test/unit/math/opencl/rev/logistic_lpdf_test.cpp +++ b/test/unit/math/opencl/rev/logistic_lpdf_test.cpp @@ -79,7 +79,6 @@ auto logistic_lpdf_functor_propto TEST(ProbDistributionsLogistic, opencl_matches_cpu_small) { int N = 3; - int M = 2; Eigen::VectorXd y(N); y << 10, -0.5, 1; @@ -181,7 +180,6 @@ TEST(ProbDistributionsLogistic, opencl_matches_cpu_big) { TEST(ProbDistributionsLogistic, opencl_sigma_mu_scalar) { int N = 3; - int M = 2; double sigma = 0.3; double mu = 0.5; diff --git a/test/unit/math/opencl/rev/lognormal_cdf_test.cpp b/test/unit/math/opencl/rev/lognormal_cdf_test.cpp index bb45cc07d4a..4c80c21b39e 100644 --- a/test/unit/math/opencl/rev/lognormal_cdf_test.cpp +++ b/test/unit/math/opencl/rev/lognormal_cdf_test.cpp @@ -63,7 +63,6 @@ auto lognormal_cdf_functor TEST(ProbDistributionsLognormalCdf, opencl_matches_cpu_small) { int N = 3; - int M = 2; Eigen::VectorXd y(N); y << 0.3, 0.8, 1.0; @@ -81,7 +80,6 @@ TEST(ProbDistributionsLognormalCdf, opencl_matches_cpu_small) { TEST(ProbDistributionsLognormalCdf, opencl_matches_cpu_small_y_zero) { int N = 3; - int M = 2; Eigen::VectorXd y(N); y << 0.3, 0.0, 1.0; diff --git a/test/unit/math/opencl/rev/lognormal_lccdf_test.cpp b/test/unit/math/opencl/rev/lognormal_lccdf_test.cpp index 324864b55c3..a3619fcb1a3 100644 --- a/test/unit/math/opencl/rev/lognormal_lccdf_test.cpp +++ b/test/unit/math/opencl/rev/lognormal_lccdf_test.cpp @@ -63,7 +63,6 @@ auto lognormal_lccdf_functor TEST(ProbDistributionsLognormalLccdf, opencl_matches_cpu_small) { int N = 3; - int M = 2; Eigen::VectorXd y(N); y << 0.3, 0.8, 1.0; @@ -81,7 +80,6 @@ TEST(ProbDistributionsLognormalLccdf, opencl_matches_cpu_small) { TEST(ProbDistributionsLognormalLccdf, opencl_matches_cpu_small_y_zero) { int N = 3; - int M = 2; Eigen::VectorXd y(N); y << 0.3, 0.0, 1.0; diff --git a/test/unit/math/opencl/rev/lognormal_lcdf_test.cpp b/test/unit/math/opencl/rev/lognormal_lcdf_test.cpp index b3c9163b015..9fdb5da9a8e 100644 --- a/test/unit/math/opencl/rev/lognormal_lcdf_test.cpp +++ b/test/unit/math/opencl/rev/lognormal_lcdf_test.cpp @@ -63,7 +63,6 @@ auto lognormal_lcdf_functor TEST(ProbDistributionsLognormalLcdf, opencl_matches_cpu_small) { int N = 3; - int M = 2; Eigen::VectorXd y(N); y << 0.3, 0.8, 1.0; @@ -81,7 +80,6 @@ TEST(ProbDistributionsLognormalLcdf, opencl_matches_cpu_small) { TEST(ProbDistributionsLognormalLcdf, opencl_matches_cpu_small_y_zero) { int N = 3; - int M = 2; Eigen::VectorXd y(N); y << 0.3, 0.0, 1.0; diff --git a/test/unit/math/opencl/rev/lognormal_lpdf_test.cpp b/test/unit/math/opencl/rev/lognormal_lpdf_test.cpp index b3c0bdbd490..b984669aa5e 100644 --- a/test/unit/math/opencl/rev/lognormal_lpdf_test.cpp +++ b/test/unit/math/opencl/rev/lognormal_lpdf_test.cpp @@ -85,7 +85,6 @@ auto lognormal_lpdf_functor_propto TEST(ProbDistributionsLognormal, opencl_matches_cpu_small) { int N = 3; - int M = 2; Eigen::VectorXd y(N); y << 0.1, 0.5, 1; @@ -107,7 +106,6 @@ TEST(ProbDistributionsLognormal, opencl_matches_cpu_small) { } TEST(ProbDistributionsLognormal, opencl_matches_cpu_small_zero_y) { int N = 3; - int M = 2; Eigen::VectorXd y(N); y << 0, 0.5, 1; diff --git a/test/unit/math/opencl/rev/multi_normal_cholesky_lpdf_test.cpp b/test/unit/math/opencl/rev/multi_normal_cholesky_lpdf_test.cpp index 221cec889d7..61443d022c4 100644 --- a/test/unit/math/opencl/rev/multi_normal_cholesky_lpdf_test.cpp +++ b/test/unit/math/opencl/rev/multi_normal_cholesky_lpdf_test.cpp @@ -90,7 +90,6 @@ auto multi_normal_cholesky_lpdf_functor_propto TEST(ProbDistributionsMultiNormalCholesky, opencl_matches_cpu_small) { int N = 3; - int M = 2; Eigen::VectorXd y1(N); y1 << 0.5, 0.4, 0.1; diff --git a/test/unit/math/opencl/rev/neg_binomial_2_log_lpmf_test.cpp b/test/unit/math/opencl/rev/neg_binomial_2_log_lpmf_test.cpp index d9e2e89b852..6aea791d8fe 100644 --- a/test/unit/math/opencl/rev/neg_binomial_2_log_lpmf_test.cpp +++ b/test/unit/math/opencl/rev/neg_binomial_2_log_lpmf_test.cpp @@ -69,7 +69,6 @@ auto neg_binomial_2_log_lpmf_functor_propto TEST(ProbDistributionsNegBinomial2Log, opencl_matches_cpu_small) { int N = 3; - int M = 2; std::vector n{1, 0, 12}; Eigen::VectorXd eta(N); @@ -169,9 +168,6 @@ TEST(ProbDistributionsNegBinomial2Log, opencl_matches_cpu_big) { } TEST(ProbDistributionsNegBinomial2Log, opencl_matches_cpu_eta_phi_scalar) { - int N = 3; - int M = 2; - std::vector n{1, 0, 12}; double eta = 0.3; double phi = 0.8; diff --git a/test/unit/math/opencl/rev/neg_binomial_2_lpmf_test.cpp b/test/unit/math/opencl/rev/neg_binomial_2_lpmf_test.cpp index e7e863610d9..591d1598a86 100644 --- a/test/unit/math/opencl/rev/neg_binomial_2_lpmf_test.cpp +++ b/test/unit/math/opencl/rev/neg_binomial_2_lpmf_test.cpp @@ -74,7 +74,6 @@ auto neg_binomial_2_lpmf_functor_propto TEST(muProbDistributionsNegBinomial2, opencl_matches_cpu_small) { int N = 3; - int M = 2; std::vector n{1, 0, 12}; Eigen::VectorXd mu(N); @@ -175,7 +174,6 @@ TEST(muProbDistributionsNegBinomial2, opencl_matches_cpu_big) { TEST(ProbDistributionsNegBinomial2, opencl_scalar_n_mu) { int N = 3; - int M = 2; int n = 1; double mu = 0.3; diff --git a/test/unit/math/opencl/rev/neg_binomial_lpmf_test.cpp b/test/unit/math/opencl/rev/neg_binomial_lpmf_test.cpp index 28014935e8e..ce7613b75e4 100644 --- a/test/unit/math/opencl/rev/neg_binomial_lpmf_test.cpp +++ b/test/unit/math/opencl/rev/neg_binomial_lpmf_test.cpp @@ -74,7 +74,6 @@ auto neg_binomial_lpmf_functor_propto TEST(muProbDistributionsNegBinomial, opencl_matches_cpu_small) { int N = 3; - int M = 2; std::vector n{1, 0, 12}; Eigen::VectorXd alpha(N); diff --git a/test/unit/math/opencl/rev/normal_lccdf_test.cpp b/test/unit/math/opencl/rev/normal_lccdf_test.cpp index e03341403ed..190ff5589a3 100644 --- a/test/unit/math/opencl/rev/normal_lccdf_test.cpp +++ b/test/unit/math/opencl/rev/normal_lccdf_test.cpp @@ -63,7 +63,6 @@ auto normal_lccdf_functor TEST(ProbDistributionsNormalLccdf, opencl_matches_cpu_small) { int N = 3; - int M = 2; Eigen::VectorXd y(N); y << 0.3, 0.8, 1.0; diff --git a/test/unit/math/opencl/rev/normal_lcdf_test.cpp b/test/unit/math/opencl/rev/normal_lcdf_test.cpp index e264c5e1d9c..a062e1304d4 100644 --- a/test/unit/math/opencl/rev/normal_lcdf_test.cpp +++ b/test/unit/math/opencl/rev/normal_lcdf_test.cpp @@ -63,7 +63,6 @@ auto normal_lcdf_functor TEST(ProbDistributionsNormalLcdf, opencl_matches_cpu_small) { int N = 3; - int M = 2; Eigen::VectorXd y(N); y << 0.3, 0.8, 1.0; diff --git a/test/unit/math/opencl/rev/pareto_cdf_test.cpp b/test/unit/math/opencl/rev/pareto_cdf_test.cpp index 89e7fcd3f8b..556bcb4f687 100644 --- a/test/unit/math/opencl/rev/pareto_cdf_test.cpp +++ b/test/unit/math/opencl/rev/pareto_cdf_test.cpp @@ -63,7 +63,6 @@ auto pareto_cdf_functor TEST(ProbDistributionsParetoCdf, opencl_matches_cpu_small) { int N = 3; - int M = 2; Eigen::VectorXd y(N); y << 0.35, 0.9, 1.5; @@ -81,7 +80,6 @@ TEST(ProbDistributionsParetoCdf, opencl_matches_cpu_small) { TEST(ProbDistributionsParetoCdf, opencl_matches_cpu_small_y_lower_than_y_min) { int N = 3; - int M = 2; Eigen::VectorXd y(N); y << 0.35, 0.7, 1.3; diff --git a/test/unit/math/opencl/rev/pareto_lccdf_test.cpp b/test/unit/math/opencl/rev/pareto_lccdf_test.cpp index 64efae248b9..ffd41b62f82 100644 --- a/test/unit/math/opencl/rev/pareto_lccdf_test.cpp +++ b/test/unit/math/opencl/rev/pareto_lccdf_test.cpp @@ -63,7 +63,6 @@ auto pareto_lccdf_functor TEST(ProbDistributionsParetoLccdf, opencl_matches_cpu_small) { int N = 3; - int M = 2; Eigen::VectorXd y(N); y << 0.35, 0.9, 1.5; @@ -82,7 +81,6 @@ TEST(ProbDistributionsParetoLccdf, opencl_matches_cpu_small) { TEST(ProbDistributionsParetoLccdf, opencl_matches_cpu_small_y_lower_than_y_min) { int N = 3; - int M = 2; Eigen::VectorXd y(N); y << 0.35, 0.7, 1.3; diff --git a/test/unit/math/opencl/rev/pareto_lcdf_test.cpp b/test/unit/math/opencl/rev/pareto_lcdf_test.cpp index 24c158cea90..1f2e27bd91d 100644 --- a/test/unit/math/opencl/rev/pareto_lcdf_test.cpp +++ b/test/unit/math/opencl/rev/pareto_lcdf_test.cpp @@ -63,7 +63,6 @@ auto pareto_lcdf_functor TEST(ProbDistributionsParetoLcdf, opencl_matches_cpu_small) { int N = 3; - int M = 2; Eigen::VectorXd y(N); y << 0.35, 0.9, 1.5; @@ -81,7 +80,6 @@ TEST(ProbDistributionsParetoLcdf, opencl_matches_cpu_small) { TEST(ProbDistributionsParetoLcdf, opencl_matches_cpu_small_y_lower_than_y_min) { int N = 3; - int M = 2; Eigen::VectorXd y(N); y << 0.35, 0.7, 1.3; diff --git a/test/unit/math/opencl/rev/pareto_lpdf_test.cpp b/test/unit/math/opencl/rev/pareto_lpdf_test.cpp index 1ab39a71093..e6378bf2634 100644 --- a/test/unit/math/opencl/rev/pareto_lpdf_test.cpp +++ b/test/unit/math/opencl/rev/pareto_lpdf_test.cpp @@ -77,7 +77,6 @@ auto pareto_lpdf_functor_propto TEST(ProbDistributionsPareto, opencl_matches_cpu_small) { int N = 3; - int M = 2; Eigen::VectorXd y(N); y << 0.3, 0.8, 1.0; diff --git a/test/unit/math/opencl/rev/pareto_type_2_cdf_test.cpp b/test/unit/math/opencl/rev/pareto_type_2_cdf_test.cpp index e3bc404da15..13677126159 100644 --- a/test/unit/math/opencl/rev/pareto_type_2_cdf_test.cpp +++ b/test/unit/math/opencl/rev/pareto_type_2_cdf_test.cpp @@ -86,7 +86,6 @@ auto pareto_type_2_cdf_functor TEST(ProbDistributionsParetoType2Cdf, opencl_matches_cpu_small) { int N = 3; - int M = 2; Eigen::VectorXd y(N); y << 0.5, 1.8, 1.4; diff --git a/test/unit/math/opencl/rev/pareto_type_2_lccdf_test.cpp b/test/unit/math/opencl/rev/pareto_type_2_lccdf_test.cpp index fa71fc0cc8f..2d936ba78a9 100644 --- a/test/unit/math/opencl/rev/pareto_type_2_lccdf_test.cpp +++ b/test/unit/math/opencl/rev/pareto_type_2_lccdf_test.cpp @@ -86,7 +86,6 @@ auto pareto_type_2_lccdf_functor TEST(ProbDistributionsParetoType2Lccdf, opencl_matches_cpu_small) { int N = 3; - int M = 2; Eigen::VectorXd y(N); y << 0.5, 1.8, 1.4; diff --git a/test/unit/math/opencl/rev/pareto_type_2_lcdf_test.cpp b/test/unit/math/opencl/rev/pareto_type_2_lcdf_test.cpp index 2242c01a8bc..a6ee89e5097 100644 --- a/test/unit/math/opencl/rev/pareto_type_2_lcdf_test.cpp +++ b/test/unit/math/opencl/rev/pareto_type_2_lcdf_test.cpp @@ -86,7 +86,6 @@ auto pareto_type_2_lcdf_functor TEST(ProbDistributionsParetoType2Lcdf, opencl_matches_cpu_small) { int N = 3; - int M = 2; Eigen::VectorXd y(N); y << 0.5, 1.8, 1.4; diff --git a/test/unit/math/opencl/rev/poisson_log_lpmf_test.cpp b/test/unit/math/opencl/rev/poisson_log_lpmf_test.cpp index bc7dcfc3171..98ba889142e 100644 --- a/test/unit/math/opencl/rev/poisson_log_lpmf_test.cpp +++ b/test/unit/math/opencl/rev/poisson_log_lpmf_test.cpp @@ -47,7 +47,6 @@ auto poisson_log_lpmf_functor_propto = [](const auto& n, const auto& alpha) { TEST(ProbDistributionsPoissonLog, opencl_matches_cpu_small) { int N = 3; - int M = 2; std::vector n{0, 1, 6}; Eigen::VectorXd alpha(N); @@ -77,8 +76,6 @@ TEST(ProbDistributionsPoissonLog, opencl_broadcast_n) { } TEST(ProbDistributionsPoissonLog, opencl_broadcast_alpha) { - int N = 3; - std::vector n{0, 1, 5}; double alpha_scal = 0.4; diff --git a/test/unit/math/opencl/rev/poisson_lpmf_test.cpp b/test/unit/math/opencl/rev/poisson_lpmf_test.cpp index 0da588c6ab7..2176126def3 100644 --- a/test/unit/math/opencl/rev/poisson_lpmf_test.cpp +++ b/test/unit/math/opencl/rev/poisson_lpmf_test.cpp @@ -47,7 +47,6 @@ auto poisson_lpmf_functor_propto = [](const auto& n, const auto& alpha) { TEST(ProbDistributionsPoisson, opencl_matches_cpu_small) { int N = 3; - int M = 2; std::vector n{0, 1, 6}; Eigen::VectorXd alpha(N); @@ -75,8 +74,6 @@ TEST(ProbDistributionsPoisson, opencl_broadcast_n) { } TEST(ProbDistributionsPoisson, opencl_broadcast_alpha) { - int N = 3; - std::vector n{0, 1, 5}; double alpha_scal = 0.4; diff --git a/test/unit/math/opencl/rev/rayleigh_cdf_test.cpp b/test/unit/math/opencl/rev/rayleigh_cdf_test.cpp index 7db4882d0b8..ea8619bf53e 100644 --- a/test/unit/math/opencl/rev/rayleigh_cdf_test.cpp +++ b/test/unit/math/opencl/rev/rayleigh_cdf_test.cpp @@ -46,7 +46,6 @@ auto rayleigh_cdf_functor = [](const auto& y, const auto& mu) { TEST(ProbDistributionsRayleighCdf, opencl_matches_cpu_small) { int N = 3; - int M = 2; Eigen::VectorXd y(N); y << 0.3, 0.8, 1.0; diff --git a/test/unit/math/opencl/rev/rayleigh_lccdf_test.cpp b/test/unit/math/opencl/rev/rayleigh_lccdf_test.cpp index 4ab1ea7384d..b9c5eadea45 100644 --- a/test/unit/math/opencl/rev/rayleigh_lccdf_test.cpp +++ b/test/unit/math/opencl/rev/rayleigh_lccdf_test.cpp @@ -48,7 +48,6 @@ auto rayleigh_lccdf_functor = [](const auto& y, const auto& mu) { TEST(ProbDistributionsRayleighLccdf, opencl_matches_cpu_small) { int N = 3; - int M = 2; Eigen::VectorXd y(N); y << 0.3, 0.8, 1.0; diff --git a/test/unit/math/opencl/rev/rayleigh_lcdf_test.cpp b/test/unit/math/opencl/rev/rayleigh_lcdf_test.cpp index 713b5639fb4..c89f97394f3 100644 --- a/test/unit/math/opencl/rev/rayleigh_lcdf_test.cpp +++ b/test/unit/math/opencl/rev/rayleigh_lcdf_test.cpp @@ -46,7 +46,6 @@ auto rayleigh_lcdf_functor = [](const auto& y, const auto& mu) { TEST(ProbDistributionsRayleighLcdf, opencl_matches_cpu_small) { int N = 3; - int M = 2; Eigen::VectorXd y(N); y << 0.3, 0.8, 1.0; diff --git a/test/unit/math/opencl/rev/rayleigh_lpdf_test.cpp b/test/unit/math/opencl/rev/rayleigh_lpdf_test.cpp index 93460840c2f..1c81a0b1f84 100644 --- a/test/unit/math/opencl/rev/rayleigh_lpdf_test.cpp +++ b/test/unit/math/opencl/rev/rayleigh_lpdf_test.cpp @@ -52,7 +52,6 @@ auto rayleigh_lpdf_functor_propto = [](const auto& y, const auto& sigma) { TEST(ProbDistributionsRayleigh, opencl_matches_cpu_small) { int N = 3; - int M = 2; Eigen::VectorXd y(N); y << 0.1, 0.5, 12.3; diff --git a/test/unit/math/opencl/rev/segment_test.cpp b/test/unit/math/opencl/rev/segment_test.cpp index 8f78952a071..c87a7fb47a2 100644 --- a/test/unit/math/opencl/rev/segment_test.cpp +++ b/test/unit/math/opencl/rev/segment_test.cpp @@ -19,15 +19,15 @@ TEST(MathMatrixCL, segment_exception) { EXPECT_THROW(segment(m3_cl, 1, 5), std::invalid_argument); stan::math::var_value> m4_cl = m1_cl; - EXPECT_THROW(segment(m1_cl, 1, 5), std::invalid_argument); + EXPECT_THROW(segment(m4_cl, 1, 5), std::invalid_argument); stan::math::var_value> m5_cl = m2_cl; - EXPECT_THROW(segment(m2_cl, 0, 2), std::invalid_argument); - EXPECT_THROW(segment(m2_cl, 1, 5), std::invalid_argument); + EXPECT_THROW(segment(m5_cl, 0, 2), std::invalid_argument); + EXPECT_THROW(segment(m5_cl, 1, 5), std::invalid_argument); stan::math::var_value> m6_cl = m3_cl; - EXPECT_THROW(segment(m3_cl, 0, 2), std::invalid_argument); - EXPECT_THROW(segment(m3_cl, 1, 5), std::invalid_argument); + EXPECT_THROW(segment(m6_cl, 0, 2), std::invalid_argument); + EXPECT_THROW(segment(m6_cl, 1, 5), std::invalid_argument); } auto segment_functor = [](const auto& a, size_t i, size_t n) { diff --git a/test/unit/math/opencl/rev/skew_double_exponential_cdf_test.cpp b/test/unit/math/opencl/rev/skew_double_exponential_cdf_test.cpp index 7d82bffb838..397f97673ba 100644 --- a/test/unit/math/opencl/rev/skew_double_exponential_cdf_test.cpp +++ b/test/unit/math/opencl/rev/skew_double_exponential_cdf_test.cpp @@ -88,7 +88,6 @@ auto skew_double_exponential_cdf_functor TEST(ProbDistributionsSkewDoubleExponentialCdf, opencl_matches_cpu_small) { int N = 3; - int M = 2; Eigen::VectorXd y(N); y << -0.3, 1.8, 1.4; @@ -109,7 +108,6 @@ TEST(ProbDistributionsSkewDoubleExponentialCdf, opencl_matches_cpu_small) { TEST(ProbDistributionsSkewDoubleExponentialCdf, opencl_matches_cpu_small_y_neg_inf) { int N = 3; - int M = 2; Eigen::VectorXd y(N); y << -INFINITY, 1.8, 1.4; diff --git a/test/unit/math/opencl/rev/skew_double_exponential_lccdf_test.cpp b/test/unit/math/opencl/rev/skew_double_exponential_lccdf_test.cpp index 0628af47960..79092f6a583 100644 --- a/test/unit/math/opencl/rev/skew_double_exponential_lccdf_test.cpp +++ b/test/unit/math/opencl/rev/skew_double_exponential_lccdf_test.cpp @@ -88,7 +88,6 @@ auto skew_double_exponential_lccdf_functor TEST(ProbDistributionsSkewDoubleExponentialLccdf, opencl_matches_cpu_small) { int N = 3; - int M = 2; Eigen::VectorXd y(N); y << -0.3, 1.8, 1.4; @@ -109,7 +108,6 @@ TEST(ProbDistributionsSkewDoubleExponentialLccdf, opencl_matches_cpu_small) { TEST(ProbDistributionsSkewDoubleExponentialLccdf, opencl_matches_cpu_small_y_neg_inf) { int N = 3; - int M = 2; Eigen::VectorXd y(N); y << -INFINITY, 1.8, 1.4; diff --git a/test/unit/math/opencl/rev/skew_double_exponential_lcdf_test.cpp b/test/unit/math/opencl/rev/skew_double_exponential_lcdf_test.cpp index c8b5a250856..03ad9cbf643 100644 --- a/test/unit/math/opencl/rev/skew_double_exponential_lcdf_test.cpp +++ b/test/unit/math/opencl/rev/skew_double_exponential_lcdf_test.cpp @@ -88,7 +88,6 @@ auto skew_double_exponential_lcdf_functor TEST(ProbDistributionsSkewDoubleExponentialLcdf, opencl_matches_cpu_small) { int N = 3; - int M = 2; Eigen::VectorXd y(N); y << -0.3, 1.8, 1.4; @@ -109,7 +108,6 @@ TEST(ProbDistributionsSkewDoubleExponentialLcdf, opencl_matches_cpu_small) { TEST(ProbDistributionsSkewDoubleExponentialLcdf, opencl_matches_cpu_small_y_neg_inf) { int N = 3; - int M = 2; Eigen::VectorXd y(N); y << -INFINITY, 1.8, 1.4; diff --git a/test/unit/math/opencl/rev/skew_normal_lpdf_test.cpp b/test/unit/math/opencl/rev/skew_normal_lpdf_test.cpp index 4e60315ee71..ad5220e8557 100644 --- a/test/unit/math/opencl/rev/skew_normal_lpdf_test.cpp +++ b/test/unit/math/opencl/rev/skew_normal_lpdf_test.cpp @@ -90,7 +90,6 @@ auto skew_normal_lpdf_functor_propto TEST(ProbDistributionsSkewNormal, opencl_matches_cpu_small) { int N = 3; - int M = 2; Eigen::VectorXd y(N); y << 0.3, 0.8, 1.0; diff --git a/test/unit/math/opencl/rev/std_normal_cdf_test.cpp b/test/unit/math/opencl/rev/std_normal_cdf_test.cpp index 1bf3edff524..dea8b16e9f4 100644 --- a/test/unit/math/opencl/rev/std_normal_cdf_test.cpp +++ b/test/unit/math/opencl/rev/std_normal_cdf_test.cpp @@ -26,7 +26,6 @@ auto std_normal_cdf_functor TEST(ProbDistributionsStdNormalCdf, opencl_matches_cpu_small) { int N = 3; - int M = 2; Eigen::VectorXd y(N); y << 0.3, 0.8, 1.0; diff --git a/test/unit/math/opencl/rev/std_normal_lccdf_test.cpp b/test/unit/math/opencl/rev/std_normal_lccdf_test.cpp index b261a062258..6f4b1e1f866 100644 --- a/test/unit/math/opencl/rev/std_normal_lccdf_test.cpp +++ b/test/unit/math/opencl/rev/std_normal_lccdf_test.cpp @@ -26,7 +26,6 @@ auto std_normal_lccdf_functor TEST(ProbDistributionsStdNormalLccdf, opencl_matches_cpu_small) { int N = 3; - int M = 2; Eigen::VectorXd y(N); y << 0.3, 0.8, 1.0; diff --git a/test/unit/math/opencl/rev/std_normal_lcdf_test.cpp b/test/unit/math/opencl/rev/std_normal_lcdf_test.cpp index 52f3562c6fe..97fdbb38225 100644 --- a/test/unit/math/opencl/rev/std_normal_lcdf_test.cpp +++ b/test/unit/math/opencl/rev/std_normal_lcdf_test.cpp @@ -26,7 +26,6 @@ auto std_normal_lcdf_functor TEST(ProbDistributionsStdNormalLcdf, opencl_matches_cpu_small) { int N = 3; - int M = 2; Eigen::VectorXd y(N); y << 0.3, 0.8, 1.0; diff --git a/test/unit/math/opencl/rev/std_normal_lpdf_test.cpp b/test/unit/math/opencl/rev/std_normal_lpdf_test.cpp index 7f8fcea56bd..ed4556ba09c 100644 --- a/test/unit/math/opencl/rev/std_normal_lpdf_test.cpp +++ b/test/unit/math/opencl/rev/std_normal_lpdf_test.cpp @@ -27,7 +27,6 @@ auto std_normal_lpdf_functor_propto TEST(ProbDistributionsStdNormal, opencl_matches_cpu_small) { int N = 3; - int M = 2; Eigen::VectorXd y(N); y << 0.3, 0.8, 1.0; diff --git a/test/unit/math/opencl/rev/uniform_cdf_test.cpp b/test/unit/math/opencl/rev/uniform_cdf_test.cpp index 262e6985897..5ed2189f1fe 100644 --- a/test/unit/math/opencl/rev/uniform_cdf_test.cpp +++ b/test/unit/math/opencl/rev/uniform_cdf_test.cpp @@ -63,7 +63,6 @@ auto uniform_cdf_functor TEST(ProbDistributionsUniformCdf, opencl_matches_cpu_small) { int N = 3; - int M = 2; Eigen::VectorXd y(N); y << 0.3, 0.8, 1.0; @@ -81,7 +80,6 @@ TEST(ProbDistributionsUniformCdf, opencl_matches_cpu_small) { TEST(ProbDistributionsUniformCdf, opencl_matches_cpu_small_y_neg_inf) { int N = 3; - int M = 2; Eigen::VectorXd y(N); y << 0.3, -INFINITY, 1.0; diff --git a/test/unit/math/opencl/rev/uniform_lccdf_test.cpp b/test/unit/math/opencl/rev/uniform_lccdf_test.cpp index bed3d490b85..05b8d00a41e 100644 --- a/test/unit/math/opencl/rev/uniform_lccdf_test.cpp +++ b/test/unit/math/opencl/rev/uniform_lccdf_test.cpp @@ -63,7 +63,6 @@ auto uniform_lccdf_functor TEST(ProbDistributionsUniformLccdf, opencl_matches_cpu_small) { int N = 3; - int M = 2; Eigen::VectorXd y(N); y << 0.3, 0.8, 1.0; @@ -81,7 +80,6 @@ TEST(ProbDistributionsUniformLccdf, opencl_matches_cpu_small) { TEST(ProbDistributionsUniformLccdf, opencl_matches_cpu_small_y_neg_inf) { int N = 3; - int M = 2; Eigen::VectorXd y(N); y << 0.3, -INFINITY, 1.0; diff --git a/test/unit/math/opencl/rev/uniform_lcdf_test.cpp b/test/unit/math/opencl/rev/uniform_lcdf_test.cpp index 5e028cb777e..cec558ada3f 100644 --- a/test/unit/math/opencl/rev/uniform_lcdf_test.cpp +++ b/test/unit/math/opencl/rev/uniform_lcdf_test.cpp @@ -63,7 +63,6 @@ auto uniform_lcdf_functor TEST(ProbDistributionsUniformLcdf, opencl_matches_cpu_small) { int N = 3; - int M = 2; Eigen::VectorXd y(N); y << 0.3, 0.8, 1.0; @@ -81,7 +80,6 @@ TEST(ProbDistributionsUniformLcdf, opencl_matches_cpu_small) { TEST(ProbDistributionsUniformLcdf, opencl_matches_cpu_small_y_neg_inf) { int N = 3; - int M = 2; Eigen::VectorXd y(N); y << 0.3, -INFINITY, 1.0; diff --git a/test/unit/math/opencl/rev/uniform_lpdf_test.cpp b/test/unit/math/opencl/rev/uniform_lpdf_test.cpp index 8f58bf84d32..6a1546d3bd1 100644 --- a/test/unit/math/opencl/rev/uniform_lpdf_test.cpp +++ b/test/unit/math/opencl/rev/uniform_lpdf_test.cpp @@ -94,7 +94,6 @@ TEST(ProbDistributionsUniform, opencl_matches_cpu_small) { TEST(ProbDistributionsUniform, opencl_matches_cpu_small_y_out_of_bounds) { int N = 3; - int M = 2; Eigen::VectorXd y(N); y << 0.3, 0.8, 14.0; diff --git a/test/unit/math/opencl/rev/weibull_cdf_test.cpp b/test/unit/math/opencl/rev/weibull_cdf_test.cpp index c8c6fe620c4..3fac364865e 100644 --- a/test/unit/math/opencl/rev/weibull_cdf_test.cpp +++ b/test/unit/math/opencl/rev/weibull_cdf_test.cpp @@ -63,7 +63,6 @@ auto weibull_cdf_functor TEST(ProbDistributionsWeibullCdf, opencl_matches_cpu_small) { int N = 3; - int M = 2; Eigen::VectorXd y(N); y << 0.3, 0.8, 1.0; diff --git a/test/unit/math/opencl/rev/weibull_lccdf_test.cpp b/test/unit/math/opencl/rev/weibull_lccdf_test.cpp index bf845190153..91b82eda794 100644 --- a/test/unit/math/opencl/rev/weibull_lccdf_test.cpp +++ b/test/unit/math/opencl/rev/weibull_lccdf_test.cpp @@ -63,7 +63,6 @@ auto weibull_lccdf_functor TEST(ProbDistributionsWeibullLccdf, opencl_matches_cpu_small) { int N = 3; - int M = 2; Eigen::VectorXd y(N); y << 0.3, 0.8, 1.0; diff --git a/test/unit/math/opencl/rev/weibull_lcdf_test.cpp b/test/unit/math/opencl/rev/weibull_lcdf_test.cpp index 4f0b1b89b63..a81c190e45a 100644 --- a/test/unit/math/opencl/rev/weibull_lcdf_test.cpp +++ b/test/unit/math/opencl/rev/weibull_lcdf_test.cpp @@ -63,7 +63,6 @@ auto weibull_lcdf_functor TEST(ProbDistributionsWeibullLcdf, opencl_matches_cpu_small) { int N = 3; - int M = 2; Eigen::VectorXd y(N); y << 0.3, 0.8, 1.0; diff --git a/test/unit/math/opencl/rev/weibull_lpdf_test.cpp b/test/unit/math/opencl/rev/weibull_lpdf_test.cpp index c6c4e13ab69..dbea51cb619 100644 --- a/test/unit/math/opencl/rev/weibull_lpdf_test.cpp +++ b/test/unit/math/opencl/rev/weibull_lpdf_test.cpp @@ -77,7 +77,6 @@ auto weibull_lpdf_functor_propto TEST(ProbDistributionsWeibull, opencl_matches_cpu_small) { int N = 3; - int M = 2; Eigen::VectorXd y(N); y << 0.3, 0.8, 1.0; diff --git a/test/unit/math/prim/constraint/unit_vector_transform_test.cpp b/test/unit/math/prim/constraint/unit_vector_transform_test.cpp index 4bf5a3957bf..2622aaae874 100644 --- a/test/unit/math/prim/constraint/unit_vector_transform_test.cpp +++ b/test/unit/math/prim/constraint/unit_vector_transform_test.cpp @@ -3,6 +3,20 @@ #include #include +TEST(prob_transform, unit_vector_free_owns_evaluated_result) { + Eigen::VectorXd x(2); + x << 0.6, 0.8; + const Eigen::VectorXd expected = x; + + auto from_lvalue = stan::math::unit_vector_free(x); + EXPECT_MATRIX_EQ(expected, x); + auto from_expression + = stan::math::unit_vector_free(x + Eigen::VectorXd::Zero(2)); + x.setZero(); + EXPECT_MATRIX_EQ(expected, from_lvalue); + EXPECT_MATRIX_EQ(expected, from_expression); +} + TEST(prob_transform, unit_vector_rt0) { using Eigen::Dynamic; using Eigen::Matrix; diff --git a/test/unit/math/prim/fun/eval_test.cpp b/test/unit/math/prim/fun/eval_test.cpp index 148cc2f1e12..5b6605bd7f3 100644 --- a/test/unit/math/prim/fun/eval_test.cpp +++ b/test/unit/math/prim/fun/eval_test.cpp @@ -196,7 +196,7 @@ TEST(MathFunctions, eval_return_type_expression) { TEST(MathFunctions, eval_return_type_short_circuit_static_sized_matrix) { Eigen::Matrix a; - const Eigen::Matrix b; + const Eigen::Matrix b{}; EXPECT_TRUE((std::is_same&>::value)); EXPECT_TRUE((std::is_same a; - const Eigen::Matrix b; + const Eigen::Matrix b{}; EXPECT_TRUE((std::is_same&>::value)); EXPECT_TRUE((std::is_same a; - const Eigen::Matrix b; + const Eigen::Matrix b{}; EXPECT_TRUE((std::is_same&>::value)); EXPECT_TRUE((std::is_same::min(); const double inf = std::numeric_limits::infinity(); EXPECT_EQ(student_t_qf(0, 2, 0, 1), -inf); EXPECT_EQ(student_t_qf(1, 2, 0, 1), inf); diff --git a/test/unit/math/rev/core/profiling_threading_test.cpp b/test/unit/math/rev/core/profiling_threading_test.cpp index b3c2c78fa2b..2e15bbf9779 100644 --- a/test/unit/math/rev/core/profiling_threading_test.cpp +++ b/test/unit/math/rev/core/profiling_threading_test.cpp @@ -30,7 +30,6 @@ struct grouped_count_lpdf { TEST_F(AgradRev, Profiling_profile_threading) { using stan::math::var; using stan::math::test::get_new_msg; - double lambda_d = 10.0; const std::size_t groups = 10; const std::size_t elems_per_group = 1000; const std::size_t elems = groups * elems_per_group; @@ -47,7 +46,6 @@ TEST_F(AgradRev, Profiling_profile_threading) { for (std::size_t i = 0; i != groups; ++i) vlambda_v[i] = i + 0.2; - var lambda_v = vlambda_v[0]; var poisson_lpdf = stan::math::reduce_sum>(