Skip to content

Commit

Permalink
bitset: Remove dependency to cstdlib
Browse files Browse the repository at this point in the history
  • Loading branch information
stotko committed Apr 28, 2020
1 parent 89f962c commit 25896b5
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
12 changes: 7 additions & 5 deletions src/stdgpu/impl/bitset_detail.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
#define STDGPU_BITSET_DETAIL_H

#include <stdgpu/atomic.cuh>
#include <stdgpu/bit.h>
#include <stdgpu/contract.h>
#include <stdgpu/cstdlib.h>



Expand Down Expand Up @@ -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<std::size_t>(n), static_cast<std::size_t>(_bits_per_block));
index_t block_n = n / _bits_per_block;
index_t bit_n = static_cast<index_t>(bit_mod<std::size_t>(static_cast<std::size_t>(n), static_cast<std::size_t>(_bits_per_block)));

return reference(_bit_blocks + positions.quot, static_cast<index_t>(positions.rem));
return reference(_bit_blocks + block_n, bit_n);
}


Expand All @@ -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<std::size_t>(n), static_cast<std::size_t>(_bits_per_block));
index_t block_n = n / _bits_per_block;
index_t bit_n = static_cast<index_t>(bit_mod<std::size_t>(static_cast<std::size_t>(n), static_cast<std::size_t>(_bits_per_block)));

return reference(_bit_blocks + positions.quot, static_cast<index_t>(positions.rem));
return reference(_bit_blocks + block_n, bit_n);
}


Expand Down
1 change: 0 additions & 1 deletion src/stdgpu/impl/unordered_base_detail.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@
#include <stdgpu/bit.h>
#include <stdgpu/config.h>
#include <stdgpu/contract.h>
#include <stdgpu/cstdlib.h>
#include <stdgpu/functional.h>
#include <stdgpu/iterator.h>
#include <stdgpu/memory.h>
Expand Down

0 comments on commit 25896b5

Please sign in to comment.