From 35ce325f05eb5b417e4f08d4f7a72d329676336b Mon Sep 17 00:00:00 2001 From: Aditya Atluri Date: Wed, 26 Sep 2018 09:48:34 -0500 Subject: [PATCH] made documentation consistent --- src/rccl.cpp | 24 ++++++++++++------------ src/rcclAllReduce.cpp | 2 +- src/rcclBcast.cpp | 2 +- src/rcclHelper.h | 14 +++++++++++--- src/rcclScalarBroadcastKernels.h | 4 ++-- src/rcclScalarBroadcastRuntime.h | 2 +- src/rcclScalarReduceKernels.h | 2 +- src/rcclTracker.h | 6 +++--- 8 files changed, 32 insertions(+), 24 deletions(-) diff --git a/src/rccl.cpp b/src/rccl.cpp index 4a002e0aa..67174c914 100644 --- a/src/rccl.cpp +++ b/src/rccl.cpp @@ -47,12 +47,12 @@ struct RcclUniqueId { ~RcclUniqueId() { delete pool; } }; -//! Get value of environment variable RCCL_TRACE_RT +//! @brief Get value of environment variable RCCL_TRACE_RT const char *get_env_val = getenv("RCCL_TRACE_RT"); -//! Get debug trace level from environment variable +//! @brief Get debug trace level from environment variable int RCCL_TRACE_RT = get_env_val != nullptr ? atoi(get_env_val) : 0; -//! Implementation of rcclGetErrorString +//! @brief Implementation of rcclGetErrorString const char *rcclGetErrorString(rcclResult_t result) { switch (result) { case rcclSuccess: @@ -90,7 +90,7 @@ const char *rcclGetErrorString(rcclResult_t result) { } } -//! Definition of rcclGetUniqueId +//! @brief Definition of rcclGetUniqueId rcclResult_t rcclGetUniqueId(rcclUniqueId *uniqueId) { if ((RCCL_TRACE_RT & krccl_print_api) == krccl_print_api) { fprintf(stderr, "%s<stream_) { hipEventRecord(pcomm->event_, stream); } } -//! Declaration of PreEnqueueEventRecord +//! @brief Declaration of PreEnqueueEventRecord void PreEnqueueEventRecord(RcclComm_t *pcomm, hipStream_t stream) { if (stream != pcomm->stream_) { hipStreamWaitEvent(stream, pcomm->event_, 0); diff --git a/src/rcclAllReduce.cpp b/src/rcclAllReduce.cpp index 5ba163397..b369a8e38 100644 --- a/src/rcclAllReduce.cpp +++ b/src/rcclAllReduce.cpp @@ -27,7 +27,7 @@ extern std::unordered_map umap_datatype; extern int RCCL_TRACE_RT; -//! Definition of rcclAllReduce +//! @brief Definition of rcclAllReduce rcclResult_t rcclAllReduce(const void *sendbuff, void *recvbuff, int count, rcclDataType_t datatype, rcclRedOp_t op, rcclComm_t comm, hipStream_t stream) { diff --git a/src/rcclBcast.cpp b/src/rcclBcast.cpp index 9f5b29a30..900fd58cc 100644 --- a/src/rcclBcast.cpp +++ b/src/rcclBcast.cpp @@ -27,7 +27,7 @@ extern std::unordered_map umap_datatype; extern int RCCL_TRACE_RT; -//! Definition of rcclBcast +//! @brief Definition of rcclBcast rcclResult_t rcclBcast(void *buff, int count, rcclDataType_t datatype, int root, rcclComm_t comm, hipStream_t stream) { if ((RCCL_TRACE_RT & krccl_print_api) == krccl_print_api) { diff --git a/src/rcclHelper.h b/src/rcclHelper.h index b95d9c8b1..bab32aeae 100644 --- a/src/rcclHelper.h +++ b/src/rcclHelper.h @@ -16,8 +16,16 @@ All rights reserved. #include #include "rcclTracker.h" -//! Record event on the stream before launching kernels related to op -void PreEnqueueEventRecord(RcclComm_t*, hipStream_t); +//! Synchronize current stream with stream used before with the same +//! communicator. If previous stream is same as current stream, don't do +//! anything + +//! \param [in] comm Memory location to internal Rccl communicator +//! \param [in] stream Stream with which the op will be synchronized with +void PreEnqueueEventRecord(RcclComm_t* comm, hipStream_t stream); //! Record event on the stream after launching kernels related to op -void PostEnqueueEventRecord(RcclComm_t*, hipStream_t); + +//! \param [in] comm Memory location to internal Rccl communicator +//! \param [in] stream Stream with which the op will be synchronized with +void PostEnqueueEventRecord(RcclComm_t* comm, hipStream_t stream); diff --git a/src/rcclScalarBroadcastKernels.h b/src/rcclScalarBroadcastKernels.h index 19ee8c24c..21689de46 100644 --- a/src/rcclScalarBroadcastKernels.h +++ b/src/rcclScalarBroadcastKernels.h @@ -4,7 +4,7 @@ All rights reserved. */ /** - * @file rcclScalarBcastKernels.h + * @file rcclScalarBroadcastKernels.h * @brief Implementation of root copy kernel * * This file contains a kernel which reads data from root gpu @@ -13,7 +13,7 @@ All rights reserved. */ #pragma once -//! Definition of RcclKernelScalarCopyFromRoot +//! @brief Definition of RcclKernelScalarCopyFromRoot template __global__ void RcclKernelScalarCopyFromRoot(RingNode_t* proot_track, void* recv_buff, int count) { diff --git a/src/rcclScalarBroadcastRuntime.h b/src/rcclScalarBroadcastRuntime.h index 2cae5f4b7..16115b35e 100644 --- a/src/rcclScalarBroadcastRuntime.h +++ b/src/rcclScalarBroadcastRuntime.h @@ -4,7 +4,7 @@ All rights reserved. */ /** - * @file rcclScalarBcastRuntime.h + * @file rcclScalarBroadcastRuntime.h * @brief Implemenation of rcclBcast internally * * This file contains internal implementation of rcclBcast diff --git a/src/rcclScalarReduceKernels.h b/src/rcclScalarReduceKernels.h index 0efe189be..ba0b9d36f 100644 --- a/src/rcclScalarReduceKernels.h +++ b/src/rcclScalarReduceKernels.h @@ -15,7 +15,7 @@ All rights reserved. */ //! @brief Definition of RcclKernelScalarReduce -//! +//! Gather data from non-root gpus and do reduction op on it template __global__ void RcclKernelScalarReduce(RingNode_t* pcurr_track, void* send_buff, void* recv_buff, int count) { diff --git a/src/rcclTracker.h b/src/rcclTracker.h index 19978b375..d2ab80157 100644 --- a/src/rcclTracker.h +++ b/src/rcclTracker.h @@ -86,7 +86,7 @@ struct RingNode_t { struct RcclComm_t; -//! @brief +//! @brief Definition of RingNodePool_t //! Pool data structure used to store all RingNode_t data structures and track //! rcclComm_t accordingly class RingNodePool_t { @@ -126,8 +126,8 @@ class RingNodePool_t { RingNode_t* GetPoolByDeviceIndex(int device_index); }; -//! Internal representation of rcclComm_t structure, which is allocated for each -//! gpu. +//! @brief Internal representation of rcclComm_t structure, which is allocated +//! for each gpu. struct RcclComm_t { public: //! Pool of gpus rcclComm_t is created with