From: Daniel Arndt Date: Thu, 25 Apr 2019 20:31:38 +0000 (+0200) Subject: Deal with empty ranges in CUDAWrappers::MatrixFree::internal_reinit X-Git-Tag: v9.1.0-rc1~166^2~2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c8d45e0df4bdfb0af82efcda4884733fea2c5a2b;p=dealii.git Deal with empty ranges in CUDAWrappers::MatrixFree::internal_reinit --- diff --git a/include/deal.II/matrix_free/cuda_matrix_free.templates.h b/include/deal.II/matrix_free/cuda_matrix_free.templates.h index 67720c10ed..64a399bb68 100644 --- a/include/deal.II/matrix_free/cuda_matrix_free.templates.h +++ b/include/deal.II/matrix_free/cuda_matrix_free.templates.h @@ -866,8 +866,9 @@ namespace CUDAWrappers return internal::get_conflict_indices(filter, constraints); }; - std::vector> graph = - GraphColoring::make_graph_coloring(begin, end, fun); + std::vector> graph; + if (begin != end) + graph = GraphColoring::make_graph_coloring(begin, end, fun); n_colors = graph.size(); helper.setup_color_arrays(n_colors); @@ -894,8 +895,8 @@ namespace CUDAWrappers // Setup row starts row_start[0] = 0; - for (unsigned int i = 0; i < n_colors - 1; ++i) - row_start[i + 1] = row_start[i] + n_cells[i] * get_padding_length(); + for (unsigned int i = 1; i < n_colors; ++i) + row_start[i] = row_start[i - 1] + n_cells[i - 1] * get_padding_length(); // Constrained indices n_constrained_dofs = constraints.n_constraints();