diff --git a/arbor/backends/gpu/forest.cpp b/arbor/backends/gpu/forest.cpp index 09a200a658d43e964144ccecb0fb1590d4f4f845..6fe4de8544ff376176487186fa055f33f1516a16 100644 --- a/arbor/backends/gpu/forest.cpp +++ b/arbor/backends/gpu/forest.cpp @@ -19,7 +19,7 @@ forest::forest(const std::vector<size_type>& p, const std::vector<size_type>& ce util::assign_from( util::transform_view( util::subrange_view(p, cell_cv_divs[c], cell_cv_divs[c+1]), - [cell_start](unsigned i) {return i-cell_start;})); + [cell_start](unsigned i) {return i == -1 ? i : i - cell_start;})); auto fine_tree = tree(cell_p);