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 hipPointerAttribute_t.type as HIP is removing hipPointerAttribute_t.memoryType #3610

Merged
merged 1 commit into from
Nov 1, 2023

Conversation

rakesroy
Copy link
Contributor

Summary

This replaces hipPointerAttribute_t.memoryType with hipPointerAttribute_t.type.

Additional background

In ROCm6.0 hipPointerAttribute_t.memoryType will be removed from HIP.
Instead hipPointerAttribute_t.type to be used.
This is causing build failure in https://github.com/Exawind/amr-wind.git.
hipPointerAttribute_t.type has been existing since ROCm5.5, so this change will be backward compatible till ROCm5.5.

Checklist

The proposed changes:

  • fix a bug or incorrect behavior in AMReX
  • add new capabilities to AMReX
  • changes answers in the test suite to more than roundoff level
  • are likely to significantly affect the results of downstream AMReX users
  • include documentation in the code and/or rst files, if appropriate

@WeiqunZhang
Copy link
Member

Could we use the HIP_VERSION_MAJOR macro to maintain backward compatibility?

@rakesroy
Copy link
Contributor Author

Yes, HIP_VERSION_MAJOR can be used to maintain backward compatibility.
I see existing AMREX code uses like #if defined(AMREX_USE_HIP) && defined(HIP_VERSION_MAJOR) && (HIP_VERSION_MAJOR < 5).
Do you want me to add in similar way?

@WeiqunZhang
Copy link
Member

Yes, something like that. In this case it's already in HIP specific code, so we don't need to test AMREX_USE_HIp..

@rakesroy
Copy link
Contributor Author

I have updated this PR to to use .type when (HIP_VERSION_MAJOR >= 6), otherwise to use .memoryType for backwards compatibility.

@WeiqunZhang WeiqunZhang enabled auto-merge (squash) November 1, 2023 17:37
@WeiqunZhang WeiqunZhang merged commit 1269a5b into AMReX-Codes:development Nov 1, 2023
guj pushed a commit to guj/amrex that referenced this pull request Dec 13, 2023
…_t.memoryType (AMReX-Codes#3610)

## Summary
This replaces hipPointerAttribute_t.memoryType with
hipPointerAttribute_t.type.

## Additional background
In ROCm6.0 hipPointerAttribute_t.memoryType will be removed from HIP.
Instead hipPointerAttribute_t.type to be used.
This is causing build failure in
https://github.com/Exawind/amr-wind.git.
hipPointerAttribute_t.type has been existing since ROCm5.5, so this
change will be backward compatible till ROCm5.5.

## Checklist

The proposed changes:
- [x] fix a bug or incorrect behavior in AMReX
- [ ] add new capabilities to AMReX
- [ ] changes answers in the test suite to more than roundoff level
- [ ] are likely to significantly affect the results of downstream AMReX
users
- [ ] include documentation in the code and/or rst files, if appropriate

Co-authored-by: Rakesh Roy <[email protected]>
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