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

  • Use camel case for all Classes, member function, Template argument. NameForClass
  • Use void function_name()
  • class_member_
  • local_variable

  • compiler time constant: ???
  • pointer: p_pointer
  • class member variable: ``class_member_variable_```

Misc

  • Must add bracket for all if and else

Clone this wiki locally