Skip to content

Commit

Permalink
unroll critical loops
Browse files Browse the repository at this point in the history
vastly improves performance in SPEC benchmark
  • Loading branch information
bernhardmgruber committed Oct 8, 2021
1 parent 23a5aaf commit 794f6d1
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -68,12 +68,15 @@ namespace picongpu
using type = typename ::pmacc::result_of::Functor<AssignedTrilinearInterpolation, T_Cursor>::type;

auto result_z = type(0.0);
#pragma unroll
for(int z = T_begin; z <= T_end; ++z)
{
auto result_y = type(0.0);
#pragma unroll
for(int y = T_begin; y <= T_end; ++y)
{
auto result_x = type(0.0);
#pragma unroll
for(int x = T_begin; x <= T_end; ++x)
/* a form factor is the "amount of particle" that is affected by this cell
* so we have to sum over: cell_value * form_factor
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ namespace picongpu
using Supports = typename pmacc::math::CT::make_Int<simDim, supp>::type;

typename Cursor::ValueType result;
#pragma unroll
for(uint32_t i = 0; i < Cursor::ValueType::dim; i++)
{
auto fieldComponent
Expand Down

0 comments on commit 794f6d1

Please sign in to comment.