Skip to content

Coding Style

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

Integer type

  • For index, only opaque type index_t and long_index_t should be used, concrete integer type like int, int32_t, long is not allowed
  • If tensor data that is integer type, only concrete type like int32_t, uint32_t, int64_t are allow. Also, use int32_t instead of int, use uint32_t instead of unsigned

Naming style

  • Class: ClassName
  • Class member function: void 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