From a671758882fac52cc43aa5def1a7b6ae8ccf53e1 Mon Sep 17 00:00:00 2001 From: Ben Sander Date: Mon, 8 Aug 2016 13:12:22 -0500 Subject: [PATCH] Coding guidelines update Change-Id: Ib8d8da4c3897d157aeb26eb2e99718d66fd260b1 [ROCm/hip commit: b1d8f9d00d1451980cb9e48ce5a004eb5cbe87b0] --- projects/hip/CONTRIBUTING.md | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/projects/hip/CONTRIBUTING.md b/projects/hip/CONTRIBUTING.md index adc93f57d4..cd785fe336 100644 --- a/projects/hip/CONTRIBUTING.md +++ b/projects/hip/CONTRIBUTING.md @@ -94,10 +94,13 @@ Differences or limitations of HIP APIs as compared to CUDA APIs should be clearl - Code Indentation: - Tabs should be expanded to spaces. - Use 4 spaces indendation. -- Capitilziation and Separators: +- Capitaliziation and Naming - Prefer camelCase for HIP interfaces and internal symbols. Note HCC uses _ for separator. This guideline is not yet consistently followed in HIP code - eventual compliance is aspirational. -- { placement + - Member variables should begin with a leading "_". This allows them to be easily distinguished from other variables or functions. + + +- {} placement - For functions, the opening { should be placed on a new line. - For if/else blocks, the opening { is placed on same line as the if/else. Use a space to separate {/" from if/else. Example ''' @@ -109,10 +112,10 @@ Differences or limitations of HIP APIs as compared to CUDA APIs should be clearl ''' - Single-line if statement should still use {/} pair (even though C++ does not require). - Miscellaneous -- All references in function parameter lists should be const. -- "ihip" = internal hip structures. These should not be exposed through the HIP API. -- Keyword TODO refers to a note that should be addressed in long-term. Could be style issue, software architecture, or known bugs. -- FIXME refers to a short-term bug that needs to be addressed. + - All references in function parameter lists should be const. + - "ihip" = internal hip structures. These should not be exposed through the HIP API. + - Keyword TODO refers to a note that should be addressed in long-term. Could be style issue, software architecture, or known bugs. + - FIXME refers to a short-term bug that needs to be addressed. #### Presubmit Testing: