diff --git a/hipamd/include/hcc_detail/hip_hcc.h b/hipamd/include/hcc_detail/hip_hcc.h index 0d24862764..b7d57ed317 100644 --- a/hipamd/include/hcc_detail/hip_hcc.h +++ b/hipamd/include/hcc_detail/hip_hcc.h @@ -38,7 +38,10 @@ THE SOFTWARE. // Compile peer-to-peer support. // >= 2 : use HCC hc:accelerator::get_is_peer // >= 3 : use hc::am_memtracker_update_peers(...) -#define USE_PEER_TO_PEER 3 +#define USE_PEER_TO_PEER 1 + +// Use new lock API in HCC: +#define USE_HCC_LOCK 0 //#define INLINE static inline diff --git a/hipamd/src/hip_hcc.cpp b/hipamd/src/hip_hcc.cpp index aa4912dc22..6c86cde747 100644 --- a/hipamd/src/hip_hcc.cpp +++ b/hipamd/src/hip_hcc.cpp @@ -454,13 +454,9 @@ void ihipDevice_t::locked_reset() crit->streams().clear(); - -#if USE_PEER_TO_PEER>=2 // This resest peer list to just me: crit->resetPeers(this); -#endif - // Reset and release all memory stored in the tracker: // Reset will remove peer mapping so don't need to do this explicitly. am_memtracker_reset(_acc); diff --git a/hipamd/src/hip_memory.cpp b/hipamd/src/hip_memory.cpp index 497c832242..46704f6277 100644 --- a/hipamd/src/hip_memory.cpp +++ b/hipamd/src/hip_memory.cpp @@ -246,7 +246,11 @@ hipError_t hipHostRegister(void *hostPtr, size_t sizeBytes, unsigned int flags) } if(device){ if(flags == hipHostRegisterDefault){ +#if USE_HCC_LOCK am_status_t am_status = hc::am_memtracker_host_memory_lock(device->_acc, hostPtr, sizeBytes); +#else + am_status_t am_status = AM_ERROR_MISC; +#endif // hsa_status_t hsa_status = hsa_amd_memory_lock(hostPtr, sizeBytes, &device->_hsa_agent, 1, &srcPtr); if(am_status == AM_SUCCESS){ hip_status = hipSuccess; diff --git a/hipamd/src/hip_peer.cpp b/hipamd/src/hip_peer.cpp index 612cd6e309..d45f95dc6c 100644 --- a/hipamd/src/hip_peer.cpp +++ b/hipamd/src/hip_peer.cpp @@ -63,7 +63,6 @@ hipError_t hipDeviceDisablePeerAccess (int peerDeviceId) HIP_INIT_API(peerDeviceId); hipError_t err = hipSuccess; -#if USE_PEER_TO_PEER auto thisDevice = ihipGetTlsDefaultDevice(); auto peerDevice = ihipGetDevice(peerDeviceId); @@ -92,7 +91,6 @@ hipError_t hipDeviceDisablePeerAccess (int peerDeviceId) } else { err = hipErrorInvalidDevice; } -#endif return ihipLogStatus(err); }; @@ -105,7 +103,6 @@ hipError_t hipDeviceEnablePeerAccess (int peerDeviceId, unsigned int flags) HIP_INIT_API(peerDeviceId, flags); hipError_t err = hipSuccess; -#if USE_PEER_TO_PEER if (flags != 0) { err = hipErrorInvalidValue; } else { @@ -125,7 +122,6 @@ hipError_t hipDeviceEnablePeerAccess (int peerDeviceId, unsigned int flags) err = hipErrorInvalidDevice; } } -#endif return ihipLogStatus(err); } diff --git a/hipamd/tests/src/CMakeLists.txt b/hipamd/tests/src/CMakeLists.txt index 9037027654..a6a4472d18 100644 --- a/hipamd/tests/src/CMakeLists.txt +++ b/hipamd/tests/src/CMakeLists.txt @@ -160,14 +160,14 @@ make_hip_executable (hipSimpleAtomicsTest hipSimpleAtomicsTest.cpp) make_hip_executable (hipMathFunctionsHost hipMathFunctions.cpp hipSinglePrecisionMathHost.cpp hipDoublePrecisionMathHost.cpp) make_hip_executable (hipMathFunctionsDevice hipMathFunctions.cpp hipSinglePrecisionMathDevice.cpp hipDoublePrecisionMathDevice.cpp) make_hip_executable (hipIntrinsics hipMathFunctions.cpp hipSinglePrecisionIntrinsics.cpp hipDoublePrecisionIntrinsics.cpp hipIntegerIntrinsics.cpp) -#TODO - re-enable. This uses the pointer add feature. make_hip_executable (hipPointerAttrib hipPointerAttrib.cpp) make_hip_executable (hipMultiThreadStreams1 hipMultiThreadStreams1.cpp) make_hip_executable (hipMultiThreadStreams2 hipMultiThreadStreams2.cpp) make_hip_executable (hipHostAlloc hipHostAlloc.cpp) make_hip_executable (hipStreamL5 hipStreamL5.cpp) make_hip_executable (hipHostGetFlags hipHostGetFlags.cpp) -make_hip_executable (hipHostRegister hipHostRegister.cpp) +#TODO - re-enable. This requires working hipHostRegister call, waiting on HCC feature. +#make_hip_executable (hipHostRegister hipHostRegister.cpp) make_hip_executable (hipRandomMemcpyAsync hipRandomMemcpyAsync.cpp) make_hip_executable (hipMemoryAllocate hipMemoryAllocate.cpp) make_hip_executable (hipFuncSetDeviceFlags hipFuncSetDeviceFlags.cpp)