Skip to content
New issue

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

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

Already on GitHub? # to your account

Implement APIv2 BruteForce #962

Merged
merged 2 commits into from
Oct 30, 2023
Merged

Conversation

aprokop
Copy link
Contributor

@aprokop aprokop commented Oct 23, 2023

Change the BruteForce interface to follow the changes in BVH.

@aprokop aprokop added enhancement New feature or request refactoring Code reorganization labels Oct 23, 2023
@aprokop aprokop force-pushed the brute_force_value_reb branch from 2ef333e to 88401ad Compare October 26, 2023 15:27
@aprokop aprokop marked this pull request as ready for review October 26, 2023 15:27
@aprokop aprokop mentioned this pull request Oct 26, 2023
Copy link
Contributor

@dalg24 dalg24 left a comment

Choose a reason for hiding this comment

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

Did you look at performance?

template <class ExecutionSpace, class Primitives, class BoundingVolumes,
class Bounds>
template <class ExecutionSpace, class Values, class IndexableGetter,
class Nodes, class Bounds>
Copy link
Contributor

Choose a reason for hiding this comment

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

I am not a big fan of that name "Nodes" but I understand we need to distinguish form the user-provided input and I don't have a better idea at that time.

@aprokop
Copy link
Contributor Author

aprokop commented Oct 27, 2023

Did you look at performance?

A100 results (OACISS/Saturn), brute_force_vs_bvh benchmark, 1,000,000 primitives, 30,000 predicates:

float

Dimension master (2abcb6c) branch (fab0039)
3 0.23 0.18
2 0.23 0.17
6 0.54 0.28

double

Dimension master (2abcb6c) branch (fab0039)
2 0.41 0.28
3 0.51 0.32
6 1.01 0.56

This is definitely a consequence of both storing less data for the benchmark (points instead of boxes) as well as the faster intersection routine (point/sphere vs box/sphere).

template <typename ExecutionSpace, typename Predicates, typename Callback,
typename Ignore = int>
void query(ExecutionSpace const &space, Predicates const &predicates,
Callback const &callback, Ignore = Ignore()) const
Copy link
Collaborator

Choose a reason for hiding this comment

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

I would just omit the last template parameter for now or if we want to have compatibility with BasicBoundingVolumeHierarchy actually allow passing in TraversalPolicy but enforce it being default-constructed.

Copy link
Contributor Author

@aprokop aprokop Oct 30, 2023

Choose a reason for hiding this comment

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

I'd be ok to do that in a different PR. Though, there is a question of backwards compatibility if one just removes the last argument.

Copy link
Collaborator

@masterleinad masterleinad left a comment

Choose a reason for hiding this comment

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

Fine with me.

"template <class MemorySpace>\n"
"using ArborX_BruteForce_Box = ArborX::BruteForce<MemorySpace, ArborX::Box>;\n"
"template <class MemorySpace>\n"
"using ArborX_Legacy_BasicBruteForce_Box =\n"
Copy link
Contributor

Choose a reason for hiding this comment

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

As I commented on the BVH PR I don't like too much the alias name.
I would prefer ArborX_Legacy_BruteForce[_Box]

@aprokop
Copy link
Contributor Author

aprokop commented Oct 30, 2023

All builds that started finished correctly. Some builds did not start (HIP, SYCL).

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
enhancement New feature or request refactoring Code reorganization
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants