Skip to content

Commit

Permalink
made documentation consistent
Browse files Browse the repository at this point in the history
  • Loading branch information
Aditya Atluri authored and Aditya Atluri committed Sep 26, 2018
1 parent 12ec1d3 commit 35ce325
Show file tree
Hide file tree
Showing 8 changed files with 32 additions and 24 deletions.
24 changes: 12 additions & 12 deletions src/rccl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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<<rccl-api: %s uniqueId:%p%s\n", API_COLOR, __func__,
Expand All @@ -107,7 +107,7 @@ rcclResult_t rcclGetUniqueId(rcclUniqueId *uniqueId) {
return rcclSuccess;
}

//! Definition of rcclCommInitRank
//! @brief Definition of rcclCommInitRank
rcclResult_t rcclCommInitRank(rcclComm_t *comm, int ndev, rcclUniqueId commId,
int rank) {
if ((RCCL_TRACE_RT & krccl_print_api) == krccl_print_api) {
Expand Down Expand Up @@ -151,7 +151,7 @@ rcclResult_t rcclCommInitRank(rcclComm_t *comm, int ndev, rcclUniqueId commId,
return rcclSuccess;
}

//! Definition of rcclCommInitAll
//! @brief Definition of rcclCommInitAll
rcclResult_t rcclCommInitAll(rcclComm_t *comm, int ndev, int *devlist) {
if ((RCCL_TRACE_RT & krccl_print_api) == krccl_print_api) {
fprintf(stderr, "%s<<rccl-api: %s comm:%p ndev:%d devlist:%p%s\n",
Expand Down Expand Up @@ -225,7 +225,7 @@ rcclResult_t rcclCommInitAll(rcclComm_t *comm, int ndev, int *devlist) {
return rcclSuccess;
}

//! Declaration of rcclCommCuDevice
//! @brief Declaration of rcclCommCuDevice
rcclResult_t rcclCommCuDevice(rcclComm_t comm, int *dev) {
if ((RCCL_TRACE_RT & krccl_print_api) == krccl_print_api) {
fprintf(stderr, "%s<<rccl-api: %s comm:%p *dev:%d dev:%p%s\n",
Expand All @@ -238,7 +238,7 @@ rcclResult_t rcclCommCuDevice(rcclComm_t comm, int *dev) {
return rcclSuccess;
}

//! Declaration of rcclCommUserRank
//! @brief Declaration of rcclCommUserRank
rcclResult_t rcclCommUserRank(rcclComm_t comm, int *rank) {
if ((RCCL_TRACE_RT & krccl_print_api) == krccl_print_api) {
fprintf(stderr, "%s<<rccl-api: %s comm:%p *rank:%d rank:%p%s\n",
Expand All @@ -251,7 +251,7 @@ rcclResult_t rcclCommUserRank(rcclComm_t comm, int *rank) {
return rcclSuccess;
}

//! Declaration of rcclCommCount
//! @brief Declaration of rcclCommCount
rcclResult_t rcclCommCount(rcclComm_t comm, int *count) {
if ((RCCL_TRACE_RT & krccl_print_api) == krccl_print_api) {
fprintf(stderr, "%s<<rccl-api: %s comm:%p *count:%d count:%p%s\n",
Expand All @@ -264,7 +264,7 @@ rcclResult_t rcclCommCount(rcclComm_t comm, int *count) {
return rcclSuccess;
}

//! Declaration of rcclCommDestroy
//! @brief Declaration of rcclCommDestroy
rcclResult_t rcclCommDestroy(rcclComm_t comm) {
if ((RCCL_TRACE_RT & krccl_print_api) == krccl_print_api) {
fprintf(stderr, "%s<<rccl-api: %s comm:%p%s\n", API_COLOR, __func__,
Expand All @@ -279,14 +279,14 @@ rcclResult_t rcclCommDestroy(rcclComm_t comm) {
return rcclSuccess;
}

//! Declaration of PostEnqueueEventRecord
//! @brief Declaration of PostEnqueueEventRecord
void PostEnqueueEventRecord(RcclComm_t *pcomm, hipStream_t stream) {
if (stream != pcomm->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);
Expand Down
2 changes: 1 addition & 1 deletion src/rcclAllReduce.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ extern std::unordered_map<int, std::string> 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) {
Expand Down
2 changes: 1 addition & 1 deletion src/rcclBcast.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ extern std::unordered_map<int, std::string> 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) {
Expand Down
14 changes: 11 additions & 3 deletions src/rcclHelper.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,16 @@ All rights reserved.
#include <hip/hip_runtime_api.h>
#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);
4 changes: 2 additions & 2 deletions src/rcclScalarBroadcastKernels.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -13,7 +13,7 @@ All rights reserved.
*/
#pragma once

//! Definition of RcclKernelScalarCopyFromRoot
//! @brief Definition of RcclKernelScalarCopyFromRoot
template <typename DataType_t>
__global__ void RcclKernelScalarCopyFromRoot(RingNode_t* proot_track,
void* recv_buff, int count) {
Expand Down
2 changes: 1 addition & 1 deletion src/rcclScalarBroadcastRuntime.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/rcclScalarReduceKernels.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ All rights reserved.
*/

//! @brief Definition of RcclKernelScalarReduce
//!
//! Gather data from non-root gpus and do reduction op on it
template <typename DataType_t, rcclRedOp_t Op>
__global__ void RcclKernelScalarReduce(RingNode_t* pcurr_track, void* send_buff,
void* recv_buff, int count) {
Expand Down
6 changes: 3 additions & 3 deletions src/rcclTracker.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 35ce325

Please sign in to comment.