Skip to content

Commit

Permalink
Add nodiscard
Browse files Browse the repository at this point in the history
  • Loading branch information
WeiqunZhang committed Feb 2, 2024
1 parent 41e9d05 commit 632ee5f
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions Src/Base/AMReX_Math.H
Original file line number Diff line number Diff line change
Expand Up @@ -324,7 +324,7 @@ struct FastDivmodU64
#endif

/// Returns the quotient of floor(dividend / divisor)
AMREX_GPU_HOST_DEVICE
[[nodiscard]] AMREX_GPU_HOST_DEVICE
std::uint64_t divide (std::uint64_t dividend) const
{
#if defined(AMREX_INT128_SUPPORTED)
Expand All @@ -342,14 +342,14 @@ struct FastDivmodU64
}

/// Computes the remainder given a computed quotient and dividend
AMREX_GPU_HOST_DEVICE
[[nodiscard]] AMREX_GPU_HOST_DEVICE
std::uint64_t modulus (std::uint64_t quotient, std::uint64_t dividend) const
{
return dividend - quotient * divisor;
}

/// Returns the quotient of floor(dividend / divisor) and computes the remainder
AMREX_GPU_HOST_DEVICE
[[nodiscard]] AMREX_GPU_HOST_DEVICE
std::uint64_t divmod (std::uint64_t &remainder, std::uint64_t dividend) const
{
auto quotient = divide(dividend);
Expand Down

0 comments on commit 632ee5f

Please sign in to comment.