Skip to content

Remove use of std functions in dynamicsparsenumberbase.h#62

Merged
lindsayad merged 7 commits intolibMesh:masterfrom
lindsayad:remove-use-of-std
Apr 9, 2026
Merged

Remove use of std functions in dynamicsparsenumberbase.h#62
lindsayad merged 7 commits intolibMesh:masterfrom
lindsayad:remove-use-of-std

Conversation

@lindsayad
Copy link
Copy Markdown
Member

Closes roystgnr#86

My prediction is that @roystgnr will riot haha. fyi @NamjaeChoi

This is for device portability. The implementations are based on
the "posssible implementations" suggestions on the c++ reference
wikipedia pages

Refs roystgnr#86
This communicates to the compiler that we should use c++ even for
this "odd" .K extension
@NamjaeChoi
Copy link
Copy Markdown

Lol

Co-authored-by: Codex <codex@openai.com>
@NamjaeChoi
Copy link
Copy Markdown

How do these compare with std functions in terms of performance?

@lindsayad
Copy link
Copy Markdown
Member Author

lindsayad commented Apr 5, 2026

They should have the same complexity. I need to see whether kokkos offers these algorithms and if so whether for more than just Views

Copy link
Copy Markdown
Member

@roystgnr roystgnr left a comment

Choose a reason for hiding this comment

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

Would it be possible to stick the hand-coded algorithms inside #ifdef METAPHYSICL_KOKKOS_COMPILATION and just call the std:: versions in the #else block? If so, I'd prefer to do that; you never know when the std lib authors have done something like adding fancy SIMD options that are equivalent to but faster than the reference code. If not? I do want to riot about the fact that we need to work around our device compiler not yet supporting 30-year-old standards, but given that we need that, I'm pretty happy about the way this PR accomplishes it.

@lindsayad
Copy link
Copy Markdown
Member Author

Not a part of this PR but what would you think about adding kokkos as an optional git submodule?

@lindsayad
Copy link
Copy Markdown
Member Author

I need to see whether kokkos offers these algorithms and if so whether for more than just Views

They do, but it would not be the same API shape. Would need an execution policy. So I'm going to keep things as I originally had things in this PR when using Kokkos

@lindsayad lindsayad merged commit d3bfb59 into libMesh:master Apr 9, 2026
7 checks passed
@lindsayad lindsayad deleted the remove-use-of-std branch April 9, 2026 21:19
@roystgnr
Copy link
Copy Markdown
Member

roystgnr commented Apr 9, 2026

Not a part of this PR but what would you think about adding kokkos as an optional git submodule?

I'm generally in favor of just relying on autoconf detection for anything that's popular enough to likely be available via apt install libkokkos-dev or some other sort of module load kokkos option, but I also definitely wouldn't object.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Multiple std functions in DynamicSparseNumberBase

3 participants