diff --git a/source/adapters/hip/enqueue.cpp b/source/adapters/hip/enqueue.cpp index 95b3c2a58d..6fbda24aa5 100644 --- a/source/adapters/hip/enqueue.cpp +++ b/source/adapters/hip/enqueue.cpp @@ -89,12 +89,15 @@ ur_result_t setHipMemAdvise(const void *DevPtr, const size_t Size, ur_usm_advice_flags_t URAdviceFlags, hipDevice_t Device) { // Handle unmapped memory advice flags - // FIXME: Temporary use UR_USM_ADVICE_FLAG_SET_NON_ATOMIC_MOSTLY and - // UR_USM_ADVICE_FLAG_CLEAR_NON_ATOMIC_MOSTLY for controlling coarse-grain - // memory until we introduce a new flag more appropriately. Add them back to - // unsupported when that happens. if (URAdviceFlags & - (UR_USM_ADVICE_FLAG_BIAS_CACHED | UR_USM_ADVICE_FLAG_BIAS_UNCACHED)) { + (UR_USM_ADVICE_FLAG_SET_NON_ATOMIC_MOSTLY | + UR_USM_ADVICE_FLAG_CLEAR_NON_ATOMIC_MOSTLY | + UR_USM_ADVICE_FLAG_BIAS_CACHED | UR_USM_ADVICE_FLAG_BIAS_UNCACHED +#if !defined(__HIP_PLATFORM_AMD__) + | UR_USM_ADVICE_FLAG_SET_NON_COHERENT_MEMORY | + UR_USM_ADVICE_FLAG_CLEAR_NON_COHERENT_MEMORY +#endif + )) { return UR_RESULT_ERROR_INVALID_ENUMERATION; } @@ -120,9 +123,9 @@ ur_result_t setHipMemAdvise(const void *DevPtr, const size_t Size, std::make_pair(UR_USM_ADVICE_FLAG_CLEAR_ACCESSED_BY_DEVICE, hipMemAdviseUnsetAccessedBy), #if defined(__HIP_PLATFORM_AMD__) - std::make_pair(UR_USM_ADVICE_FLAG_SET_NON_ATOMIC_MOSTLY, + std::make_pair(UR_USM_ADVICE_FLAG_SET_NON_COHERENT_MEMORY, hipMemAdviseSetCoarseGrain), - std::make_pair(UR_USM_ADVICE_FLAG_CLEAR_NON_ATOMIC_MOSTLY, + std::make_pair(UR_USM_ADVICE_FLAG_CLEAR_NON_COHERENT_MEMORY, hipMemAdviseUnsetCoarseGrain), #endif };