From 503ec9ad24bf698be3b40eadd9129882741017ee Mon Sep 17 00:00:00 2001 From: Peng Sun Date: Tue, 2 Feb 2016 21:29:09 -0600 Subject: [PATCH] Fix all TODO-doc [ROCm/hip commit: c73996d04110c61d44c8c946f55b98955d5aa394] --- .../hip/include/hcc_detail/hip_runtime_api.h | 48 +++++++++++++++++-- 1 file changed, 44 insertions(+), 4 deletions(-) diff --git a/projects/hip/include/hcc_detail/hip_runtime_api.h b/projects/hip/include/hcc_detail/hip_runtime_api.h index 6aa021fa62..5eb1a48075 100644 --- a/projects/hip/include/hcc_detail/hip_runtime_api.h +++ b/projects/hip/include/hcc_detail/hip_runtime_api.h @@ -785,16 +785,56 @@ hipError_t hipMemGetInfo (size_t * free, size_t * total) ; */ hipError_t hipDeviceCanAccessPeer ( int* canAccessPeer, int device, int peerDevice ); -// TODO-DOC + + +/** + * @brief Disables registering memory on peerDevice for direct access from the current device. + * + * If there are any allocations on peerDevice which were registered in the current device using hipPeerRegister() then these allocations will be automatically unregistered. + * Returns hipErrorPeerAccessNotEnabled if direct access to memory on peerDevice has not yet been enabled from the current device. + * + * @param [in] peerDevice + * TODO:cudaErrorPeerAccessNotEnabled and cudaErrorInvalidDevice error not supported in HIP, return hipErrorUnknown + * Returns #hipSuccess, #hipErrorUnknown + */ hipError_t hipDeviceDisablePeerAccess ( int peerDevice ); -// TODO-DOC +/** + * @brief Enables registering memory on peerDevice for direct access from the current device. + * + * @param [in] peerDevice + * @param [in] flags + * + * TODO:cudaErrorInvalidDevice error not supported in HIP, return hipErrorUnknown + * Returns #hipSuccess, #hipErrorInvalidDevice, #hipErrorInvalidValue, #hipErrorUnknown + */ hipError_t hipDeviceEnablePeerAccess ( int peerDevice, unsigned int flags ); -// TODO-DOC +/** + * @brief Copies memory from one device to memory on another device. + * + * @param [out] dst - Destination device pointer. + * @param [in] dstDevice - Destination device + * @param [in] src - Source device pointer + * @param [in] srcDevice - Source device + * @param [in] count - Size of memory copy in bytes + * + * Returns #hipSuccess, #hipErrorInvalidValue, #hipErrorInvalidDevice + */ hipError_t hipMemcpyPeer ( void* dst, int dstDevice, const void* src, int srcDevice, size_t sizeBytes ); -// TODO-DOC +/** + * @brief Copies memory from one device to memory on another device. + * + * @param [out] dst - Destination device pointer. + * @param [in] dstDevice - Destination device + * @param [in] src - Source device pointer + * @param [in] srcDevice - Source device + * @param [in] count - Size of memory copy in bytes + * @param [in] stream - Stream identifier + * + * Returns #hipSuccess, #hipErrorInvalidValue, #hipErrorInvalidDevice + */ hipError_t hipMemcpyPeerAsync ( void* dst, int dstDevice, const void* src, int srcDevice, size_t sizeBytes, hipStream_t stream=0 ); // doxygen end PeerToPeer /**