|
| | FastDivmodU64 (std::uint64_t divisor_) |
| |
| | FastDivmodU64 ()=default |
| | Default construct an invalid FastDivmodU64.
|
| |
| __host__ __device__ std::uint64_t | divide (std::uint64_t dividend) const |
| | Returns the quotient of floor(dividend / divisor)
|
| |
| __host__ __device__ std::uint64_t | modulus (std::uint64_t quotient, std::uint64_t dividend) const |
| | Computes the remainder given a computed quotient and dividend.
|
| |
| __host__ __device__ std::uint64_t | divmod (std::uint64_t &remainder, std::uint64_t dividend) const |
| | Returns the quotient of floor(dividend / divisor) and computes the remainder.
|
| |
| __host__ __device__ void | operator() (std::uint64_t "ient, std::uint64_t &remainder, std::uint64_t dividend) const |
| |
Object to encapsulate the fast division+modulus operation for 64b integer division.
Example:
uint64_t quotient, remainder, dividend, divisor;
FastDivmodU64 divmod(divisor);
divmod(quotient, remainder, dividend);
// quotient = (dividend / divisor) // remainder = (dividend % divisor)