# Specfem3d\_Cartesian AMD HIP Port Merge

**URL:** <https://community.geodynamics.org/t/specfem3d-cartesian-amd-hip-port-merge/1369>\
**Category:** SPECFEM\
**Tags:** new-feature\
**Created:** [July 31, 2020, 3:00pm UTC](https://community.geodynamics.org/t/specfem3d-cartesian-amd-hip-port-merge/1369 "2020-07-31T15:00:05Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![ChinchoreTejas](https://yyz2.discourse-cdn.com/flex036/user_avatar/community.geodynamics.org/chinchoretejas/32/573_2.png) [@ChinchoreTejas](https://community.geodynamics.org/u/ChinchoreTejas)\
**Post date:** [July 31, 2020, 3:00pm UTC](https://community.geodynamics.org/t/specfem3d-cartesian-amd-hip-port-merge/1369/1 "2020-07-31T15:00:05Z")

</div>

Dear all,

We have ported the **Specfem3d\_Cartesian** application to AMD platform. The application tested on AMD GPU’s (Single node Multi GPU Setup). Specfem3d ported code work on both NVIDIA and AMD platforms. We would like to contribute this ported code to Specfem3d\_Cartesian original repository.

Kindly let us know your viewpoint for the same.

Please find the code here: [https://github.com/ROCmSoftwarePlatform/SPECFEM3D](https://github.com/ROCmSoftwarePlatform/SPECFEM3D)

---

<div class="post-metadata">

**Author:** ![dpeter](https://yyz2.discourse-cdn.com/flex036/user_avatar/community.geodynamics.org/dpeter/32/227_2.png) [@dpeter](https://community.geodynamics.org/u/dpeter)\
**Post date:** [July 31, 2020, 9:54pm UTC](https://community.geodynamics.org/t/specfem3d-cartesian-amd-hip-port-merge/1369/2 "2020-07-31T21:54:47Z")

</div>

great, that’s fun work!

this could also become very helpful for the upcoming Frontier supercomputer. unfortunately, SPECFEM is not part of the Frontier CAAR projects ([https://www.olcf.ornl.gov/caar/frontier-caar/](https://www.olcf.ornl.gov/caar/frontier-caar/)), but providing AMD GPU support is excellent to have.

let me see how we could add this to the official version. in principle, it would be preferable to add HIP support rather than substitute CUDA:

- maybe a wrapper similar to what ESPResSo is doing ([https://github.com/espressomd/espresso/blob/8a8856a6f6cf86e706ed2734636c00ebb760975d/src/core/cuda\_wrapper.hpp](https://github.com/espressomd/espresso/blob/8a8856a6f6cf86e706ed2734636c00ebb760975d/src/core/cuda_wrapper.hpp)) could be a good starting point.
- your HIP/CUDA kernels look pretty much identical. the kernel launches and cuda-function names converted to HIP look mostly like a renaming exercise.
- is there any major design change required compared to how the CUDA kernels were setup? what about preferred kernel block sizes and performance tuning for Radeon GPUs?

many thanks!

---

<div class="post-metadata">

**Author:** ![ChinchoreTejas](https://yyz2.discourse-cdn.com/flex036/user_avatar/community.geodynamics.org/chinchoretejas/32/573_2.png) [@ChinchoreTejas](https://community.geodynamics.org/u/ChinchoreTejas)\
**Post date:** [August 3, 2020, 6:14am UTC](https://community.geodynamics.org/t/specfem3d-cartesian-amd-hip-port-merge/1369/3 "2020-08-03T06:14:04Z")

</div>

[AMD Official Use Only - Internal Distribution Only]

Hi Peter,

Thanks for your response, we will check and update to you on open points.

Regards,  
Tejas

---

<div class="post-metadata">

**Author:** ![lanucara](https://yyz2.discourse-cdn.com/flex036/user_avatar/community.geodynamics.org/lanucara/32/786_2.png) [@lanucara](https://community.geodynamics.org/u/lanucara)\
**Post date:** [October 30, 2020, 12:22pm UTC](https://community.geodynamics.org/t/specfem3d-cartesian-amd-hip-port-merge/1369/4 "2020-10-30T12:22:16Z")

</div>

Dear all  
is there some advancement?  
I think there is an actual interest for (near) future pre-exascale EU architectures  
Best regards  
Piero

---

<div class="post-metadata">

**Author:** ![dpeter](https://yyz2.discourse-cdn.com/flex036/user_avatar/community.geodynamics.org/dpeter/32/227_2.png) [@dpeter](https://community.geodynamics.org/u/dpeter)\
**Post date:** [November 2, 2020, 6:29pm UTC](https://community.geodynamics.org/t/specfem3d-cartesian-amd-hip-port-merge/1369/5 "2020-11-02T18:29:45Z")

</div>

no, not so far.

unfortunately i don’t have access to any Radeon cards, so can’t test the idea with a HIP wrapper mentioned above.

-daniel
