Skip to content

Coding Style

Chao Liu edited this page Feb 23, 2022 · 19 revisions

Integer type

  • only index_t and long_index_t should be used for index calculation in GPU code, int or long is not allowed
  • if integer is used as tensor data, then use int32_t oruint32_t instead of int or unsigned

Naming style

General

  • Class: ClassName
  • Class member function: MemberFunctionName()
  • Class member variable: class_member_
  • Template argument: TemplateArgument
  • Function: void function_name()
  • Local variable: local_variable
  • Compiler time constant: kConstant ???
  • pointer: p_pointer

Misc

  • Must add bracket for all if and else

Clone this wiki locally