feat: fast
This commit is contained in:
parent
b6aaf20a3f
commit
4304baebbb
@ -320,7 +320,6 @@ find_row_mask(std::vector<set_t> &sets,
|
|||||||
|
|
||||||
std::atomic_bool found{false};
|
std::atomic_bool found{false};
|
||||||
std::mutex lock;
|
std::mutex lock;
|
||||||
const uint64_t step = 10000;
|
|
||||||
|
|
||||||
// while (row_mask < last_mask) {
|
// while (row_mask < last_mask) {
|
||||||
// row_mask = next_bit_permutation(row_mask);
|
// row_mask = next_bit_permutation(row_mask);
|
||||||
@ -329,6 +328,8 @@ find_row_mask(std::vector<set_t> &sets,
|
|||||||
std::vector<std::thread> workers;
|
std::vector<std::thread> workers;
|
||||||
auto thread_num = std::thread::hardware_concurrency();
|
auto thread_num = std::thread::hardware_concurrency();
|
||||||
if (thread_num > 2) { thread_num -= 2; }
|
if (thread_num > 2) { thread_num -= 2; }
|
||||||
|
const uint64_t step = (last_mask - row_mask) / thread_num;
|
||||||
|
|
||||||
for (int i = 0; i < thread_num; ++i) {
|
for (int i = 0; i < thread_num; ++i) {
|
||||||
workers.emplace_back([&] {
|
workers.emplace_back([&] {
|
||||||
while (!found) {
|
while (!found) {
|
||||||
|
Loading…
Reference in New Issue
Block a user