1 #ifdef STAN_OPENCL
2 #include <stan/math/opencl/rev.hpp>
3 #include <stan/math.hpp>
4 #include <gtest/gtest.h>
5 #include <test/unit/math/opencl/util.hpp>
6
7 auto rows_dot_self_functor
__anonfb29dd570102(const auto& a) 8 = [](const auto& a) { return stan::math::rows_dot_self(a); };
9
TEST(OpenCLRowsDotSelf,prim_rev_small_vector)10 TEST(OpenCLRowsDotSelf, prim_rev_small_vector) {
11 Eigen::MatrixXd a(2, 4);
12 a << -2.2, -0.8, 0.5, 1, 1.5, 3, 3.4, 4;
13 stan::math::test::compare_cpu_opencl_prim_rev(rows_dot_self_functor, a);
14 }
15
TEST(OpenCLRowsDotSelf,prim_rev_size_0)16 TEST(OpenCLRowsDotSelf, prim_rev_size_0) {
17 Eigen::MatrixXd a(0, 0);
18 stan::math::test::compare_cpu_opencl_prim_rev(rows_dot_self_functor, a);
19 }
20
TEST(OpenCLRowsDotSelf,prim_rev_values_large)21 TEST(OpenCLRowsDotSelf, prim_rev_values_large) {
22 int N = 71;
23 int M = 83;
24
25 Eigen::MatrixXd a = Eigen::MatrixXd::Random(N, M);
26 stan::math::test::compare_cpu_opencl_prim_rev(rows_dot_self_functor, a);
27 }
28
29 #endif
30