Skip to content

Commit

Permalink
opal/mca/accelerator: ROCm 6.0 incompatibility fix
Browse files Browse the repository at this point in the history
Signed-off-by: nileshnegi <[email protected]>
  • Loading branch information
nileshnegi committed Nov 2, 2023
1 parent 329f558 commit 7dd6bfa
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 7dd6bfa

Please sign in to comment.