Skip to content

Commit

Permalink
Merge pull request #15185 from kronbichler/avoid_load
Browse files Browse the repository at this point in the history
  • Loading branch information
masterleinad committed May 8, 2023
2 parents 48d7406 + 839a34b commit 74b8ea7
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions include/deal.II/matrix_free/tensor_product_kernels.h
Original file line number Diff line number Diff line change
Expand Up @@ -3693,8 +3693,9 @@ namespace internal
data[0] *= weights[shift];
// loop bound as int avoids compiler warnings in case n_points_1d
// == 1 (polynomial degree 0)
const Number weight = weights[shift + 1];
for (int i = 1; i < n_points_1d - 1; ++i)
data[i] *= weights[shift + 1];
data[i] *= weight;
data[n_points_1d - 1] *= weights[shift + 2];
data += n_points_1d;
}
Expand Down Expand Up @@ -3735,12 +3736,14 @@ namespace internal
const unsigned int shift =
9 * compressed_index[k] + 3 * compressed_index[j];

unsigned int c = 0;
unsigned int c = 0;
const Number weight1 = weights[shift];
for (int i = 0; i < n_inside_1d; ++i)
data[c++] *= weights[shift];
data[c++] *= weight1;
data[c++] *= weights[shift + 1];
const Number weight2 = weights[shift + 2];
for (int i = 0; i < n_inside_1d; ++i)
data[c++] *= weights[shift + 2];
data[c++] *= weight2;
data += n_points_1d;
}
}
Expand Down

0 comments on commit 74b8ea7

Please sign in to comment.