Skip to content

Commit

Permalink
Merge pull request #12042 from nileshnegi/topic/rocm/hipPtr-attr-type
Browse files Browse the repository at this point in the history
opal/mca/accelerator: ROCm 6.0 incompatibility fix
  • Loading branch information
edgargabriel authored Nov 3, 2023
2 parents cc4f992 + 7dd6bfa commit f2d10ef
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions opal/mca/accelerator/rocm/accelerator_rocm_module.c
Original file line number Diff line number Diff line change
Expand Up @@ -85,14 +85,22 @@ static int mca_accelerator_rocm_check_addr (const void *addr, int *dev_id, uint6
*flags = 0;
err = hipPointerGetAttributes(&srcAttr, addr);
if (hipSuccess == err) {
#if HIP_VERSION >= 50731921
if (hipMemoryTypeDevice == srcAttr.type) {
#else
if (hipMemoryTypeDevice == srcAttr.memoryType) {
#endif
//We might want to set additional flags in a later iteration.
//*flags |= MCA_ACCELERATOR_FLAGS_HOST_LDSTR;
//*flags |= MCA_ACCELERATOR_FLAGS_HOST_ATOMICS;
/* First access on a device pointer triggers ROCM support lazy initialization. */
opal_accelerator_rocm_lazy_init();
ret = 1;
#if HIP_VERSION >= 50731921
} else if (hipMemoryTypeUnified == srcAttr.type) {
#else
} else if (hipMemoryTypeUnified == srcAttr.memoryType) {
#endif
*flags |= MCA_ACCELERATOR_FLAGS_UNIFIED_MEMORY;
//*flags |= MCA_ACCELERATOR_FLAGS_HOST_LDSTR;
//*flags |= MCA_ACCELERATOR_FLAGS_HOST_ATOMICS;
Expand Down

0 comments on commit f2d10ef

Please sign in to comment.