Skip to content

Commit

Permalink
PML: avoid stack frames in GPU kernel
Browse files Browse the repository at this point in the history
fix: one part of #3870

By using an break within a for loop we triggered using stack frame usage
in the GPU kernel.
  • Loading branch information
psychocoderHPC committed Oct 20, 2021
1 parent cb0173f commit cc91c07
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions include/picongpu/fields/absorber/pml/Field.tpp
Original file line number Diff line number Diff line change
Expand Up @@ -180,11 +180,11 @@ namespace picongpu
{
/* Note: here we could have returned the result directly,
* but chose to have a single return for potential
* performance gains on GPU. The break is not required,
* since each valid index belonds to exactly one layer.
* performance gains on GPU.
* 'break' can be used too because the if condition will evaluate only for one layer to
* true but this would create 'stack frame' usage within GPU kernel.
*/
result = currentLayerBeginIdx + layer.getLinearIdx(idx);
break;
}
else
currentLayerBeginIdx += layer.getVolume();
Expand Down

0 comments on commit cc91c07

Please sign in to comment.