Comments (11)
cc: @Izaron
from dynamic_bitset.
cc: @Izaron
from dynamic_bitset.
What is the plan if the user being CC'd doesn't respond by 1.70 deadlines? Is the change that was committed going to be reverted for 1.70?
from dynamic_bitset.
That's the easiest thing to do, unless someone else steps up to resolve it.
from dynamic_bitset.
James, since you committed the PR, it's your responsibility to deal with the regression/crash, one way or another. (The gcc __builtin_popcount path is fine, but the msvc-specific section isn't, so there are options, but something must be done.)
from dynamic_bitset.
Okay, thanks.
from dynamic_bitset.
@pdimov what would your preference be to resolve this:
- Disable the MSVC code (easiest).
- Add a definition such as
BOOST_DYNAMIC_BITSET_HAVE_SSE4
that folks must define in order to enable the code (also easy, requires documentation). Of course, this means they know their code will always run on a modern CPU so it's their choice. - Add static cpuid inspection (ideally C++11 only, so it is threadsafe) and fall back when not present (more difficult, may not have time to do...).
Right now I would opt for one of the first two, which makes the library no worse than it was in 1.68.0 for MSVC. It's unfortunate the original author @Izaron hasn't responded or taken action. For now we could do (1) and then open an issue for (3).
from dynamic_bitset.
I suggest #2 and document it accordingly: i.e. The opt-in macro would only affect MSVC; for GCC and Clang using __builtin_popcount unconditionally is fine. (#1 is also acceptable if you don't want to do #2).
from dynamic_bitset.
(1) is fine if we don't want to invest too much time into it.
On the surface silently doing the right thing, as in (3), is better than (2), but I'm not sure if the two tests - on the static guard variable and on the actual static variable - would not defeat the gains from using the popcnt instruction.
There is also the option of using an alternate popcount algorithm - the one used by gcc/clang for implementing the builtin when SSE4 isn't available, https://godbolt.org/z/VGP6Z_, https://en.wikipedia.org/wiki/Hamming_weight. This will need to be benchmarked if we choose to use it (on MSVC or in general).
from dynamic_bitset.
I was looking at https://github.com/kimwalisch/libpopcnt/ as there is an implementation in there as well, but I haven't done anything else but look. Benchmarks exist there for the decisions that were made to use different algorithms depending on the size of the bitset.
from dynamic_bitset.
FWIW, std::bitset
on MSVC uses the same 8 bit table-based implementation as dynamic_bitset
: https://godbolt.org/z/YuQqIj
This probably means that it was judged optimal there in the absence of hardware popcnt.
from dynamic_bitset.
Related Issues (20)
- Valgrind failures in test4 with wchar_t support enabled HOT 4
- Adding hardware supported popcount (and other functions) HOT 2
- Release notes for 1.69.0 HOT 2
- New range based set methods have caused ambiguity HOT 5
- need to use this as a key in an unordered_map HOT 8
- MSVC hardware-assisted popcount implementation
- Release Notes for 1.70.0 HOT 1
- gcc-4.8 on xenial fails unit test 4 (streaming)
- Coverity flagged issue (investigate) HOT 1
- Release Notes for 1.71.0 HOT 1
- std::vector<boost::dynamic_bitset<>>unable to free memory HOT 5
- dynamic_bitset cannot be used in a parallel program HOT 3
- boost/dynamic_bitset/dynamic_bitset.hpp:111:20: -Wdeprecated-copy warning
- Release notes for 1.80
- Hide internals (dispatch_init(), init_from_block_range(), m_append())
- Possible improvement for is_proper_subset_of
- It seems that the latest develop branch has 'stdext::hash_value' compile failure
- Make buffer_type changeable
- Missing change in Boost 1.80.0 Unix distributable as opposed to the Windows one
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from dynamic_bitset.