static void atomic_a_swap_b(int &a, int &b){int prew_a_state = a;while (true) {const int result = atomic_cas_int32(&a, prew_a_state, b);if (result == b) {break;}prew_a_state = result;}b = prew_a_state;}
9/15/2023static Array<int> reverse_indices_in_groups_old(const Span<int> group_indices, const OffsetIndices<int> offsets){SCOPED_TIMER_AVERAGED(func);if (group_indices.is_empty()) {return {};}BLI_assert(*std::max_element(group_indices.begin(), group_indices.end()) < offsets.size());BLI_assert(*std::min_element(group_indices.begin(), group_indices.end()) >= 0);Array<int> counts(offsets.size(), -1);Array<int> results(group_indices.size());threading::parallel_for(group_indices.index_range(), 1024, [&](const IndexRange range) {for (const int64_t i : range) {const int group_index = group_indices[i];const int index_in_group = atomic_add_and_fetch_int32(&counts[group_index], 1);results[offsets[group_index][index_in_group]] = int(i);}});sort_small_groups(offsets, 1024, results);return results;}
9/7/2023Problem:There point cloud. Each point have some vector to move.Now, each point should have way to say if it movement vector should be limited. And that limitation is based on other points and its vectors (limited in the same way).
9/2/2023static Array<int> gather_reverse(const Span<int> group_indices){SCOPED_TIMER_AVERAGED(func);
8/8/2023or
By clicking below, you agree to our terms of service.
New to HackMD? Sign up