Unverified Commit 9bbd389d authored by trilinos-autotester's avatar trilinos-autotester Committed by GitHub
Browse files

Merge Pull Request #5068 from alanw0/Trilinos/fix_topo_gpu

Automatically Merged using Trilinos Pull Request AutoTester
PR Title: fix a stk-topology unit-test failure on gpu.
PR Author: alanw0
parents ec7ddad2 463f4c9e
......@@ -322,11 +322,15 @@ inline void check_permutation_nodes(stk::topology topology, std::vector<std::vec
}
}
constexpr unsigned MAX_NODES_PER_ELEM = 100;
template <unsigned MAX_NODES>
STK_INLINE_FUNCTION
void check_side_nodes_ngp(stk::topology topology, unsigned gold_side_node_ordinals[][MAX_NODES])
{
stk::mesh::Entity * allElemNodes = new stk::mesh::Entity[topology.num_nodes()];
stk::mesh::Entity allElemNodes[MAX_NODES_PER_ELEM];
NGP_EXPECT_TRUE(topology.num_nodes() < MAX_NODES_PER_ELEM);
for (unsigned nodeOrdinal = 0; nodeOrdinal < topology.num_nodes(); ++nodeOrdinal) {
allElemNodes[nodeOrdinal] = nodeOrdinal + 100;
}
......@@ -341,15 +345,15 @@ void check_side_nodes_ngp(stk::topology topology, unsigned gold_side_node_ordina
NGP_EXPECT_EQ(gold_side_node_ordinals[side][sideNodeOrdinal] + 100, sideNodes[sideNodeOrdinal].local_offset());
}
}
delete[] allElemNodes;
}
template <unsigned MAX_NODES>
STK_INLINE_FUNCTION
void check_edge_nodes_ngp(stk::topology topology, unsigned gold_edge_node_ordinals[][MAX_NODES])
{
stk::mesh::Entity * allElemNodes = new stk::mesh::Entity[topology.num_nodes()];
stk::mesh::Entity allElemNodes[MAX_NODES_PER_ELEM];
NGP_EXPECT_TRUE(topology.num_nodes() < MAX_NODES_PER_ELEM);
for (unsigned nodeOrdinal = 0; nodeOrdinal < topology.num_nodes(); ++nodeOrdinal) {
allElemNodes[nodeOrdinal] = nodeOrdinal + 100;
}
......@@ -363,15 +367,15 @@ void check_edge_nodes_ngp(stk::topology topology, unsigned gold_edge_node_ordina
NGP_EXPECT_EQ(gold_edge_node_ordinals[edge][edgeNodeOrdinal] + 100, edgeNodes[edgeNodeOrdinal].local_offset());
}
}
delete[] allElemNodes;
}
template <unsigned MAX_NODES>
STK_INLINE_FUNCTION
void check_face_nodes_ngp(stk::topology topology, unsigned gold_face_node_ordinals[][MAX_NODES])
{
stk::mesh::Entity * allElemNodes = new stk::mesh::Entity[topology.num_nodes()];
stk::mesh::Entity allElemNodes[MAX_NODES_PER_ELEM];
NGP_EXPECT_TRUE(topology.num_nodes() < MAX_NODES_PER_ELEM);
for (unsigned nodeOrdinal = 0; nodeOrdinal < topology.num_nodes(); ++nodeOrdinal) {
allElemNodes[nodeOrdinal] = nodeOrdinal + 100;
}
......@@ -386,8 +390,6 @@ void check_face_nodes_ngp(stk::topology topology, unsigned gold_face_node_ordina
NGP_EXPECT_EQ(gold_face_node_ordinals[face][faceNodeOrdinal] + 100, faceNodes[faceNodeOrdinal].local_offset());
}
}
delete[] allElemNodes;
}
template <unsigned NUM_NODES>
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment