Skip to content

Commit

Permalink
Constexpr for length in kernel
Browse files Browse the repository at this point in the history
  • Loading branch information
ax3l authored Dec 19, 2023
1 parent 7dcaf8f commit 088edb7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/particles/distribution/Thermal.H
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,7 @@ namespace distribution
amrex::ParticleReal rmin = m_data.rmin;
amrex::ParticleReal rmax = m_data.rmax;
int const nbins = m_data.nbins;
int const length = 2001; //Ideally, int const length = nbins + 1;
constexpr int length = 2001; // Ideally, int const length = nbins + 1;

Check notice

Code scanning / CodeQL

Commented-out code Note

This comment appears to contain commented-out code.
amrex::ParticleReal cdf[length];
for (int n = 0; n < length; ++n) {
cdf[n] = (uhalo > m_data.w) ? m_data.cdf1[n] : m_data.cdf2[n]; //select core or halo CDF
Expand Down

0 comments on commit 088edb7

Please sign in to comment.