78 Teuchos::FancyOStream& out) {
79 typedef ViewType view_type;
80 typedef typename view_type::size_type size_type;
81 typedef typename view_type::HostMirror host_view_type;
82 typedef typename host_view_type::array_type host_array_type;
83 typedef typename host_array_type::value_type scalar_type;
88 host_array_type h_a = h_v;
90 size_type num_rows, num_cols;
94 bool is_right = std::is_same<
typename ViewType::array_layout,
95 Kokkos::LayoutRight >::value;
96 if (is_right || !view_type::is_contiguous) {
97 num_rows = h_a.extent(0);
98 num_cols = h_a.extent(1);
101 num_rows = h_a.extent(1);
102 num_cols = h_a.extent(0);
105 if (is_right || !view_type::is_contiguous) {
106 for (size_type i=0; i<num_rows; ++i) {
107 for (size_type
j=0;
j<num_cols; ++
j) {
108 scalar_type
val = h_a(i,
j);
109 scalar_type val_expected =
110 generate_vector_coefficient<scalar_type>(
111 num_rows, num_cols, i,
j);
112 TEUCHOS_TEST_EQUALITY(
val, val_expected, out, success);
117 for (size_type i=0; i<num_rows; ++i) {
118 for (size_type
j=0;
j<num_cols; ++
j) {
119 scalar_type
val = h_a(
j,i);
120 scalar_type val_expected =
121 generate_vector_coefficient<scalar_type>(
122 num_rows, num_cols, i,
j);
123 TEUCHOS_TEST_EQUALITY(
val, val_expected, out, success);
134 const typename ViewType::value_type& v,
135 Teuchos::FancyOStream& out) {
136 typedef ViewType view_type;
137 typedef typename view_type::value_type fad_vector_type;
138 typedef typename fad_vector_type::value_type vector_type;
139 typedef typename vector_type::storage_type
storage_type;
140 typedef typename view_type::size_type size_type;
141 typedef typename view_type::HostMirror host_view_type;
147 const size_type num_rows = h_view.extent(0);
149 const size_type num_ensemble = storage_type::static_size;
151 for (size_type i=0; i<num_rows; ++i) {
152 for (size_type k=0; k<num_ensemble; ++k) {
153 TEUCHOS_TEST_EQUALITY(h_view(i).
val().coeff(k), v.val().coeff(k), out, success);
154 for (size_type
j=0;
j<num_fad; ++
j) {
155 TEUCHOS_TEST_EQUALITY(h_view(i).
dx(
j).coeff(k), v.dx(
j).coeff(k), out, success);
166 const typename ViewType::value_type& v,
167 Teuchos::FancyOStream& out) {
168 typedef ViewType view_type;
169 typedef typename view_type::value_type fad_vector_type;
170 typedef typename fad_vector_type::value_type vector_type;
171 typedef typename vector_type::storage_type
storage_type;
172 typedef typename view_type::size_type size_type;
173 typedef typename view_type::HostMirror host_view_type;
181 const size_type num_ensemble = storage_type::static_size;
182 for (size_type i0=0; i0<h_view.extent(0); ++i0) {
183 for (size_type i1=0; i1<h_view.extent(1); ++i1) {
184 for (size_type i2=0; i2<h_view.extent(2); ++i2) {
185 for (size_type i3=0; i3<h_view.extent(3); ++i3) {
186 for (size_type i4=0; i4<h_view.extent(4); ++i4) {
187 for (size_type i5=0; i5<h_view.extent(5); ++i5) {
188 for (size_type i6=0; i6<h_view.extent(6); ++i6) {
189 for (size_type k=0; k<num_ensemble; ++k)
190 TEUCHOS_TEST_EQUALITY(h_view.access(i0,i1,i2,i3,i4,i5,i6,0).val().coeff(k),
191 v.val().coeff(k), out, success);
192 for (size_type
j=0;
j<num_fad; ++
j) {
193 for (size_type k=0; k<num_ensemble; ++k)
194 TEUCHOS_TEST_EQUALITY(h_view.access(i0,i1,i2,i3,i4,i5,i6,0).dx(
j).coeff(k),
195 v.dx(
j).coeff(k), out, success);
223 typedef typename Scalar::value_type Vector;
224 typedef typename Vector::execution_space Device;
226 typedef typename ViewType::size_type size_type;
230 ViewType v(
"view", num_rows, num_cols);
231 TEUCHOS_TEST_EQUALITY(v.size(), num_rows, out, success);
void deep_copy(const Stokhos::CrsMatrix< ValueType, DstDevice, Layout > &dst, const Stokhos::CrsMatrix< ValueType, SrcDevice, Layout > &src)