Skip to content

Commit

Permalink
Merge pull request #1418 from dmcdougall/fix_memorytype
Browse files Browse the repository at this point in the history
Prepare for hipMemoryType changes in ROCm 6
  • Loading branch information
maddyscientist authored Nov 30, 2023
2 parents c3781bc + 6a924d3 commit 3d78e70
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions lib/targets/hip/malloc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -528,12 +528,15 @@ namespace quda
errorQuda("hipPointerGetAttributes returned error: %s\n", hipGetErrorString(error));
}

switch (attr.memoryType) {
switch (attr.type) {
#if HIP_VERSION_MAJOR >= 6
case hipMemoryTypeUnregistered: return QUDA_CPU_FIELD_LOCATION;
#endif // HIP_VERSION_MAJOR >= 6
case hipMemoryTypeHost: return QUDA_CPU_FIELD_LOCATION;
case hipMemoryTypeDevice: return QUDA_CUDA_FIELD_LOCATION;
case hipMemoryTypeArray: return QUDA_CUDA_FIELD_LOCATION;
case hipMemoryTypeUnified: return QUDA_CUDA_FIELD_LOCATION; ///< Not used currently
default: errorQuda("Unknown memory type %d\n", attr.memoryType); return QUDA_INVALID_FIELD_LOCATION;
default: errorQuda("Unknown memory type %d\n", attr.type); return QUDA_INVALID_FIELD_LOCATION;
}
}

Expand Down

0 comments on commit 3d78e70

Please sign in to comment.