From 00d01154fec1176519d64a129d2daf6821b69619 Mon Sep 17 00:00:00 2001 From: Stephane Del Pino <stephane.delpino44@gmail.com> Date: Mon, 9 Jul 2018 17:55:58 +0200 Subject: [PATCH] Use GraphRowViewConst::length instead of number of cells table --- src/scheme/AcousticSolver.hpp | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/scheme/AcousticSolver.hpp b/src/scheme/AcousticSolver.hpp index b12da32ed..3ed9eaa3a 100644 --- a/src/scheme/AcousticSolver.hpp +++ b/src/scheme/AcousticSolver.hpp @@ -99,13 +99,11 @@ private: KOKKOS_INLINE_FUNCTION const Kokkos::View<const Rdd*> computeAr(const Kokkos::View<const Rdd**>& Ajr) { - const Kokkos::View<const unsigned short*> node_nb_cells = m_connectivity.nodeNbCells(); - Kokkos::parallel_for(m_mesh.numberOfNodes(), KOKKOS_LAMBDA(const int& r) { Rdd sum = zero; const auto& node_to_cell = m_connectivity.m_node_to_cell_matrix.rowConst(r); const auto& node_to_cell_local_node = m_connectivity.m_node_to_cell_local_node_matrix.rowConst(r); - for (int j=0; j<node_nb_cells(r); ++j) { + for (size_t j=0; j<node_to_cell.length; ++j) { const unsigned int J = node_to_cell(j); const unsigned int R = node_to_cell_local_node(j); sum += Ajr(J,R); @@ -122,14 +120,12 @@ private: const Kokkos::View<const Rd**>& Cjr, const Kokkos::View<const Rd*>& uj, const Kokkos::View<const double*>& pj) { - const Kokkos::View<const unsigned short*>& node_nb_cells = m_connectivity.nodeNbCells(); - Kokkos::parallel_for(m_mesh.numberOfNodes(), KOKKOS_LAMBDA(const int& r) { Rd& br = m_br(r); br = zero; const auto& node_to_cell = m_connectivity.m_node_to_cell_matrix.rowConst(r); const auto& node_to_cell_local_node = m_connectivity.m_node_to_cell_local_node_matrix.rowConst(r); - for (int j=0; j<node_nb_cells(r); ++j) { + for (size_t j=0; j<node_to_cell.length; ++j) { const unsigned int J = node_to_cell(j); const unsigned int R = node_to_cell_local_node(j); br += Ajr(J,R)*uj(J) + pj(J)*Cjr(J,R); -- GitLab