Code indexing in gitaly is broken and leads to code not being visible to the user. We work on the issue with highest priority.

Skip to content
Snippets Groups Projects
Commit 674891d1 authored by Matthias Frey's avatar Matthias Frey
Browse files

more rigorous normInf test

parent 8dd1919e
No related branches found
No related tags found
1 merge request!88Resolve "Add MDRangePolicy generator for arbitrary dimensions"
...@@ -27,7 +27,7 @@ public: ...@@ -27,7 +27,7 @@ public:
typedef ippl::Field<double, dim> field_type; typedef ippl::Field<double, dim> field_type;
FieldTest() FieldTest()
: nPoints(4) : nPoints(8)
{ {
setup(); setup();
} }
...@@ -89,12 +89,30 @@ TEST_F(FieldTest, Norm2) { ...@@ -89,12 +89,30 @@ TEST_F(FieldTest, Norm2) {
} }
TEST_F(FieldTest, NormInf) { TEST_F(FieldTest, NormInf) {
double val = 1.5;
*field = val; const ippl::NDIndex<dim> lDom = field->getLayout().getLocalNDIndex();
auto view = field->getView();
auto policy = field->getRangePolicy(0);
Kokkos::parallel_for("Assign field",
policy,
KOKKOS_LAMBDA(const int i,
const int j,
const int k)
{
const size_t ig = i + lDom[0].first();
const size_t jg = j + lDom[1].first();
const size_t kg = k + lDom[2].first();
view(i, j, k) = -1.0 + (ig + jg + kg);
});
double normInf = ippl::normInf(*field); double normInf = ippl::normInf(*field);
double val = -1.0 + 3 * nPoints;
ASSERT_DOUBLE_EQ(val, normInf); ASSERT_DOUBLE_EQ(val, normInf);
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment