Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bitset: Remove dependency to cstdlib #145

Merged
merged 1 commit into from
Apr 28, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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