diff --git a/include/hcc_detail/hip_hcc.h b/include/hcc_detail/hip_hcc.h index 794b099a7a..58b58e2c99 100644 --- a/include/hcc_detail/hip_hcc.h +++ b/include/hcc_detail/hip_hcc.h @@ -39,10 +39,10 @@ THE SOFTWARE. // >= 3 : use hc::am_memtracker_update_peers(...) #define USE_PEER_TO_PEER 2 -// Use new lock API in HCC: -#define USE_HCC_LOCK 0 -//#define INLINE static inline +// Use new am_memory_host_lock APIs: +#define USE_HCC_LOCK_API 0 + //--- // Environment variables: diff --git a/src/hip_memory.cpp b/src/hip_memory.cpp index 01b24a9e13..055bf3f733 100644 --- a/src/hip_memory.cpp +++ b/src/hip_memory.cpp @@ -253,7 +253,11 @@ hipError_t hipHostRegister(void *hostPtr, size_t sizeBytes, unsigned int flags) for(int i=0;i_acc, hostPtr, sizeBytes, &vecAcc[0], vecAcc.size()); +#else + am_status = AM_ERROR_MISC; +#endif if(am_status == AM_SUCCESS){ hip_status = hipSuccess; }else{ @@ -276,7 +280,11 @@ hipError_t hipHostUnregister(void *hostPtr) if(hostPtr == NULL){ hip_status = hipErrorInvalidValue; }else{ +#if USE_HCC_LOCK_API am_status_t am_status = hc::am_memory_host_unlock(device->_acc, hostPtr); +#else + am_status_t am_status = AM_ERROR_MISC; +#endif if(am_status != AM_SUCCESS){ hip_status = hipErrorHostMemoryNotRegistered; }