diff --git a/src/stdgpu/impl/bitset_detail.cuh b/src/stdgpu/impl/bitset_detail.cuh index 2372ca971..b4efc7103 100644 --- a/src/stdgpu/impl/bitset_detail.cuh +++ b/src/stdgpu/impl/bitset_detail.cuh @@ -17,8 +17,8 @@ #define STDGPU_BITSET_DETAIL_H #include +#include #include -#include @@ -147,9 +147,10 @@ bitset::operator[](const index_t n) const STDGPU_EXPECTS(0 <= n); STDGPU_EXPECTS(n < size()); - const sizediv_t positions = sizedivPow2(static_cast(n), static_cast(_bits_per_block)); + index_t block_n = n / _bits_per_block; + index_t bit_n = static_cast(bit_mod(static_cast(n), static_cast(_bits_per_block))); - return reference(_bit_blocks + positions.quot, static_cast(positions.rem)); + return reference(_bit_blocks + block_n, bit_n); } @@ -159,9 +160,10 @@ bitset::operator[](const index_t n) STDGPU_EXPECTS(0 <= n); STDGPU_EXPECTS(n < size()); - const sizediv_t positions = sizedivPow2(static_cast(n), static_cast(_bits_per_block)); + index_t block_n = n / _bits_per_block; + index_t bit_n = static_cast(bit_mod(static_cast(n), static_cast(_bits_per_block))); - return reference(_bit_blocks + positions.quot, static_cast(positions.rem)); + return reference(_bit_blocks + block_n, bit_n); } diff --git a/src/stdgpu/impl/unordered_base_detail.cuh b/src/stdgpu/impl/unordered_base_detail.cuh index 2f6bd1640..a76894a5c 100644 --- a/src/stdgpu/impl/unordered_base_detail.cuh +++ b/src/stdgpu/impl/unordered_base_detail.cuh @@ -29,7 +29,6 @@ #include #include #include -#include #include #include #include