Skip to content

Commit 85c06c5

Browse files
authored
Initialize scratch view in unit test (#1380)
1 parent 7608c7d commit 85c06c5

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

unit_tests/UnitTestScratchViews.C

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ do_the_test(
103103
lhsSize, rhsSize, rhsSize, meta.spatial_dimension(), dataNGP) +
104104
(rhsSize + lhsSize) * sizeof(double) * sierra::nalu::simdLen);
105105

106-
int numResults = 5;
106+
int numResults = 7;
107107
IntViewType result("result", numResults);
108108

109109
Kokkos::deep_copy(result.h_view, 0);
@@ -133,6 +133,9 @@ do_the_test(
133133
sierra::nalu::SharedMemView<DoubleType*, ShmemType> simdrhs =
134134
sierra::nalu::get_shmem_view_1D<DoubleType, TeamType, ShmemType>(
135135
team, rhsSize);
136+
for (int i = 0; i < rhsSize; i++) {
137+
simdrhs(i) = 0.0;
138+
}
136139

137140
STK_NGP_ThrowAssert(scrviews.total_bytes() != 0);
138141
const size_t bucketLen = b.size();
@@ -157,6 +160,11 @@ do_the_test(
157160

158161
testKernel.execute(simdlhs, simdrhs, scrviews);
159162
});
163+
164+
result.d_view(5) =
165+
stk::simd::get_data((simdrhs(0) - 16.0), 0) < 1.e-9 ? 1 : 0;
166+
result.d_view(6) =
167+
stk::simd::get_data((simdrhs(1) - 0.0), 0) < 1.e-9 ? 1 : 0;
160168
});
161169

162170
result.modify<IntViewType::execution_space>();

0 commit comments

Comments
 (0)