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

Use bigint in HypreSolver test #4297

Merged
merged 2 commits into from
Jan 18, 2025
Merged

Conversation

WeiqunZhang
Copy link
Member

@WeiqunZhang WeiqunZhang commented Jan 17, 2025

Also fix a bug when HYPRE_Int is long long. The issue was in the previous code the discard branch of if constexpr was still checked by the compiler, because it's not in a function template, even though it's in a member function of a class template. We now turn the function into a template.

// To generate global ids for Hypre, we need to remove duplicates on
// nodes shared by multiple Boxes with OverrideSync. So we need to use
// a type that supports atomicAdd. HYPRE_Int is either int or long
// long. The latter does not have native atomicAdd support in CUDA/HIP.
Copy link
Member

Choose a reason for hiding this comment

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

Maybe a last sentence, that unsigned long long is supported on CUDA/HIP, would describe the new logic fully.

Copy link
Member

@ax3l ax3l left a comment

Choose a reason for hiding this comment

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

LGTM, small comment how to add the final thought on the inline comment.

@ax3l ax3l enabled auto-merge (squash) January 18, 2025 18:32
@ax3l ax3l merged commit 92d35c2 into AMReX-Codes:development Jan 18, 2025
74 checks passed
@WeiqunZhang WeiqunZhang deleted the hypre_bigint branch January 18, 2025 20:32
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.

2 participants