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

Introduce Value as a generic storage in a leaf node #871

Merged
merged 2 commits into from
May 18, 2023

Conversation

aprokop
Copy link
Contributor

@aprokop aprokop commented May 18, 2023

No description provided.

@aprokop aprokop added the refactoring Code reorganization label May 18, 2023
@aprokop aprokop mentioned this pull request May 18, 2023
@aprokop
Copy link
Contributor Author

aprokop commented May 18, 2023

The performance seems to be OKish, with about 8% slowdown in the construction on Serial on Power9.

@@ -70,15 +70,15 @@ struct HappyTreeFriends
{
static_assert(
std::is_same_v<decltype(bvh._internal_nodes(0).bounding_volume),
decltype(bvh._leaf_nodes(0).bounding_volume)>);
return bvh._leaf_nodes(i).bounding_volume;
decltype(bvh._leaf_nodes(0).value.bounding_volume)>);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we still want the static assert here?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For now. Do you have a better idea or place for it?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would have dropped it since this is not something that user input can break but I don't feel too strongly about it.

src/details/ArborX_DetailsTreeConstruction.hpp Outdated Show resolved Hide resolved
BoundingVolume bounding_volume) noexcept
template <class Value>
KOKKOS_INLINE_FUNCTION constexpr LeafNode<Value>
makeLeafNode(Value value) noexcept
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't like so much spelling the template parameter at the call site but I suppose this way you won't have to change the definition later.

@@ -54,8 +55,7 @@ struct HalfTraversal
{
auto const predicate =
_get_predicate(HappyTreeFriends::getLeafBoundingVolume(_bvh, i));
auto const leaf_permutation_i =
HappyTreeFriends::getLeafPermutationIndex(_bvh, i);
auto const leaf_permutation_i = HappyTreeFriends::getValue(_bvh, i).index;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yuk. I don't have a better idea though.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree, would be nice to just have getValue() here. If we ever figure out how to move away from storing (index, volume) together in the future, this would be possible. But right now, it comes with severe penalties.

@dalg24
Copy link
Contributor

dalg24 commented May 18, 2023

Please comment on what changed? Did you just amend the suggested changes into your first commit?

@aprokop
Copy link
Contributor Author

aprokop commented May 18, 2023

Please comment on what changed? Did you just amend the suggested changes into your first commit?

Yes, sorry.

@aprokop
Copy link
Contributor Author

aprokop commented May 18, 2023

SYCL build out of space, otherwise good.

@aprokop aprokop merged commit f2e69c9 into arborx:master May 18, 2023
@aprokop aprokop deleted the introduce_value branch May 18, 2023 14:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
refactoring Code reorganization
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants