Skip to content

Commit 771e78d

Browse files
committed
sync llama.cpp
Signed-off-by: caitianchi <caitianchi@modelbest.cn>
1 parent 97398b9 commit 771e78d

File tree

1,699 files changed

+806004
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,699 files changed

+806004
-0
lines changed

.clang-format

Lines changed: 171 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,171 @@
1+
---
2+
Language: Cpp
3+
AlignAfterOpenBracket: Align
4+
AlignArrayOfStructures: Left
5+
AlignConsecutiveAssignments: AcrossComments
6+
AlignConsecutiveBitFields: AcrossComments
7+
AlignConsecutiveDeclarations: AcrossComments
8+
AlignConsecutiveMacros: AcrossComments
9+
# AlignConsecutiveShortCaseStatements: AcrossComments
10+
AlignEscapedNewlines: Left # LeftWithLastLine
11+
AlignOperands: Align
12+
AlignTrailingComments:
13+
Kind: Always
14+
OverEmptyLines: 1
15+
AllowAllArgumentsOnNextLine: true
16+
AllowAllParametersOfDeclarationOnNextLine: false
17+
# AllowBreakBeforeNoexceptSpecifier: OnlyWithParen
18+
AllowShortBlocksOnASingleLine: Never
19+
AllowShortCaseLabelsOnASingleLine: false
20+
AllowShortFunctionsOnASingleLine: Inline
21+
AllowShortIfStatementsOnASingleLine: Never
22+
AllowShortLambdasOnASingleLine: Inline
23+
AllowShortLoopsOnASingleLine: false
24+
AlwaysBreakBeforeMultilineStrings: true
25+
# Treat CUDA keywords/attributes as "attribute macros" and avoid breaking lines inside them
26+
AttributeMacros:
27+
- __host__
28+
- __device__
29+
- __global__
30+
- __forceinline__
31+
- __launch_bounds__
32+
BinPackArguments: true
33+
BinPackParameters: false # OnePerLine
34+
BitFieldColonSpacing: Both
35+
BreakBeforeBraces: Custom # Attach
36+
BraceWrapping:
37+
AfterCaseLabel: true
38+
AfterClass: false
39+
AfterControlStatement: false
40+
AfterEnum: false
41+
AfterFunction: false
42+
AfterNamespace: false
43+
AfterObjCDeclaration: false
44+
AfterStruct: false
45+
AfterUnion: false
46+
AfterExternBlock: false
47+
BeforeCatch: false
48+
BeforeElse: false
49+
BeforeLambdaBody: false
50+
BeforeWhile: false
51+
IndentBraces: false
52+
SplitEmptyFunction: false
53+
SplitEmptyRecord: false
54+
SplitEmptyNamespace: false
55+
# BreakAdjacentStringLiterals: true
56+
BreakAfterAttributes: Never
57+
BreakBeforeBinaryOperators: None
58+
BreakBeforeInlineASMColon: OnlyMultiline
59+
BreakBeforeTernaryOperators: false
60+
# BreakBinaryOperations: Never
61+
BreakConstructorInitializers: AfterColon
62+
# BreakFunctionDefinitionParameters: false
63+
BreakInheritanceList: AfterComma
64+
BreakStringLiterals: true
65+
# BreakTemplateDeclarations: Yes
66+
ColumnLimit: 120
67+
CommentPragmas: '^ IWYU pragma:'
68+
CompactNamespaces: false
69+
ConstructorInitializerIndentWidth: 4
70+
ContinuationIndentWidth: 4
71+
Cpp11BracedListStyle: false
72+
DerivePointerAlignment: false
73+
DisableFormat: false
74+
EmptyLineBeforeAccessModifier: Leave
75+
EmptyLineAfterAccessModifier: Never
76+
ExperimentalAutoDetectBinPacking: false
77+
FixNamespaceComments: true
78+
IncludeBlocks: Regroup
79+
IncludeCategories:
80+
- Regex: '".*"'
81+
Priority: 1
82+
SortPriority: 0
83+
- Regex: '^<.*\.h>'
84+
Priority: 2
85+
SortPriority: 0
86+
- Regex: '^<.*'
87+
Priority: 3
88+
SortPriority: 0
89+
- Regex: '.*'
90+
Priority: 4
91+
SortPriority: 0
92+
IncludeIsMainRegex: '([-_](test|unittest))?$'
93+
IncludeIsMainSourceRegex: ''
94+
IndentAccessModifiers: false
95+
IndentCaseBlocks: true
96+
IndentCaseLabels: true
97+
IndentExternBlock: NoIndent
98+
IndentGotoLabels: false
99+
IndentPPDirectives: AfterHash
100+
IndentWidth: 4
101+
IndentWrappedFunctionNames: false
102+
InsertBraces: true # NOTE: may lead to incorrect formatting
103+
InsertNewlineAtEOF: true
104+
JavaScriptQuotes: Leave
105+
JavaScriptWrapImports: true
106+
KeepEmptyLinesAtTheStartOfBlocks: false
107+
LambdaBodyIndentation: Signature
108+
LineEnding: LF
109+
MacroBlockBegin: ''
110+
MacroBlockEnd: ''
111+
MaxEmptyLinesToKeep: 1
112+
NamespaceIndentation: None
113+
ObjCBinPackProtocolList: Auto
114+
ObjCBlockIndentWidth: 4
115+
ObjCSpaceAfterProperty: true
116+
ObjCSpaceBeforeProtocolList: true
117+
PPIndentWidth: -1
118+
PackConstructorInitializers: CurrentLine
119+
PenaltyBreakAssignment: 2
120+
PenaltyBreakBeforeFirstCallParameter: 1
121+
PenaltyBreakComment: 300
122+
PenaltyBreakFirstLessLess: 120
123+
PenaltyBreakString: 1000
124+
PenaltyBreakTemplateDeclaration: 10
125+
PenaltyExcessCharacter: 1000000
126+
PenaltyReturnTypeOnItsOwnLine: 200
127+
PointerAlignment: Middle
128+
QualifierAlignment: Left
129+
#QualifierOrder: ['static', 'inline', 'friend', 'constexpr', 'const', 'volatile', 'type', 'restrict']
130+
RawStringFormats:
131+
- Language: Cpp
132+
Delimiters:
133+
- cc
134+
- CC
135+
- cpp
136+
- Cpp
137+
- CPP
138+
- 'c++'
139+
- 'C++'
140+
CanonicalDelimiter: ''
141+
ReferenceAlignment: Middle
142+
ReflowComments: false # IndentOnly
143+
SeparateDefinitionBlocks: Always
144+
SortIncludes: CaseInsensitive
145+
SortUsingDeclarations: LexicographicNumeric
146+
SpaceAfterCStyleCast: true
147+
SpaceAfterLogicalNot: false
148+
SpaceAfterTemplateKeyword: true
149+
SpaceBeforeAssignmentOperators: true
150+
SpaceBeforeCpp11BracedList: false
151+
SpaceBeforeCtorInitializerColon: true
152+
SpaceBeforeInheritanceColon: true
153+
SpaceBeforeParens: ControlStatements
154+
SpaceBeforeRangeBasedForLoopColon: true
155+
SpaceInEmptyBlock: false
156+
SpaceInEmptyParentheses: false
157+
SpacesBeforeTrailingComments: 2
158+
SpacesInAngles: Never
159+
SpacesInContainerLiterals: true
160+
SpacesInLineCommentPrefix:
161+
Minimum: 1
162+
Maximum: -1
163+
SpacesInParentheses: false
164+
SpacesInSquareBrackets: false
165+
SpaceBeforeSquareBrackets: false
166+
Standard: c++17
167+
TabWidth: 4
168+
UseTab: Never
169+
WhitespaceSensitiveMacros: ['STRINGIZE']
170+
...
171+

.clang-format copy

Lines changed: 171 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,171 @@
1+
---
2+
Language: Cpp
3+
AlignAfterOpenBracket: Align
4+
AlignArrayOfStructures: Left
5+
AlignConsecutiveAssignments: AcrossComments
6+
AlignConsecutiveBitFields: AcrossComments
7+
AlignConsecutiveDeclarations: AcrossComments
8+
AlignConsecutiveMacros: AcrossComments
9+
# AlignConsecutiveShortCaseStatements: AcrossComments
10+
AlignEscapedNewlines: Left # LeftWithLastLine
11+
AlignOperands: Align
12+
AlignTrailingComments:
13+
Kind: Always
14+
OverEmptyLines: 1
15+
AllowAllArgumentsOnNextLine: true
16+
AllowAllParametersOfDeclarationOnNextLine: false
17+
# AllowBreakBeforeNoexceptSpecifier: OnlyWithParen
18+
AllowShortBlocksOnASingleLine: Never
19+
AllowShortCaseLabelsOnASingleLine: false
20+
AllowShortFunctionsOnASingleLine: Inline
21+
AllowShortIfStatementsOnASingleLine: Never
22+
AllowShortLambdasOnASingleLine: Inline
23+
AllowShortLoopsOnASingleLine: false
24+
AlwaysBreakBeforeMultilineStrings: true
25+
# Treat CUDA keywords/attributes as "attribute macros" and avoid breaking lines inside them
26+
AttributeMacros:
27+
- __host__
28+
- __device__
29+
- __global__
30+
- __forceinline__
31+
- __launch_bounds__
32+
BinPackArguments: true
33+
BinPackParameters: false # OnePerLine
34+
BitFieldColonSpacing: Both
35+
BreakBeforeBraces: Custom # Attach
36+
BraceWrapping:
37+
AfterCaseLabel: true
38+
AfterClass: false
39+
AfterControlStatement: false
40+
AfterEnum: false
41+
AfterFunction: false
42+
AfterNamespace: false
43+
AfterObjCDeclaration: false
44+
AfterStruct: false
45+
AfterUnion: false
46+
AfterExternBlock: false
47+
BeforeCatch: false
48+
BeforeElse: false
49+
BeforeLambdaBody: false
50+
BeforeWhile: false
51+
IndentBraces: false
52+
SplitEmptyFunction: false
53+
SplitEmptyRecord: false
54+
SplitEmptyNamespace: false
55+
# BreakAdjacentStringLiterals: true
56+
BreakAfterAttributes: Never
57+
BreakBeforeBinaryOperators: None
58+
BreakBeforeInlineASMColon: OnlyMultiline
59+
BreakBeforeTernaryOperators: false
60+
# BreakBinaryOperations: Never
61+
BreakConstructorInitializers: AfterColon
62+
# BreakFunctionDefinitionParameters: false
63+
BreakInheritanceList: AfterComma
64+
BreakStringLiterals: true
65+
# BreakTemplateDeclarations: Yes
66+
ColumnLimit: 120
67+
CommentPragmas: '^ IWYU pragma:'
68+
CompactNamespaces: false
69+
ConstructorInitializerIndentWidth: 4
70+
ContinuationIndentWidth: 4
71+
Cpp11BracedListStyle: false
72+
DerivePointerAlignment: false
73+
DisableFormat: false
74+
EmptyLineBeforeAccessModifier: Leave
75+
EmptyLineAfterAccessModifier: Never
76+
ExperimentalAutoDetectBinPacking: false
77+
FixNamespaceComments: true
78+
IncludeBlocks: Regroup
79+
IncludeCategories:
80+
- Regex: '".*"'
81+
Priority: 1
82+
SortPriority: 0
83+
- Regex: '^<.*\.h>'
84+
Priority: 2
85+
SortPriority: 0
86+
- Regex: '^<.*'
87+
Priority: 3
88+
SortPriority: 0
89+
- Regex: '.*'
90+
Priority: 4
91+
SortPriority: 0
92+
IncludeIsMainRegex: '([-_](test|unittest))?$'
93+
IncludeIsMainSourceRegex: ''
94+
IndentAccessModifiers: false
95+
IndentCaseBlocks: true
96+
IndentCaseLabels: true
97+
IndentExternBlock: NoIndent
98+
IndentGotoLabels: false
99+
IndentPPDirectives: AfterHash
100+
IndentWidth: 4
101+
IndentWrappedFunctionNames: false
102+
InsertBraces: true # NOTE: may lead to incorrect formatting
103+
InsertNewlineAtEOF: true
104+
JavaScriptQuotes: Leave
105+
JavaScriptWrapImports: true
106+
KeepEmptyLinesAtTheStartOfBlocks: false
107+
LambdaBodyIndentation: Signature
108+
LineEnding: LF
109+
MacroBlockBegin: ''
110+
MacroBlockEnd: ''
111+
MaxEmptyLinesToKeep: 1
112+
NamespaceIndentation: None
113+
ObjCBinPackProtocolList: Auto
114+
ObjCBlockIndentWidth: 4
115+
ObjCSpaceAfterProperty: true
116+
ObjCSpaceBeforeProtocolList: true
117+
PPIndentWidth: -1
118+
PackConstructorInitializers: CurrentLine
119+
PenaltyBreakAssignment: 2
120+
PenaltyBreakBeforeFirstCallParameter: 1
121+
PenaltyBreakComment: 300
122+
PenaltyBreakFirstLessLess: 120
123+
PenaltyBreakString: 1000
124+
PenaltyBreakTemplateDeclaration: 10
125+
PenaltyExcessCharacter: 1000000
126+
PenaltyReturnTypeOnItsOwnLine: 200
127+
PointerAlignment: Middle
128+
QualifierAlignment: Left
129+
#QualifierOrder: ['static', 'inline', 'friend', 'constexpr', 'const', 'volatile', 'type', 'restrict']
130+
RawStringFormats:
131+
- Language: Cpp
132+
Delimiters:
133+
- cc
134+
- CC
135+
- cpp
136+
- Cpp
137+
- CPP
138+
- 'c++'
139+
- 'C++'
140+
CanonicalDelimiter: ''
141+
ReferenceAlignment: Middle
142+
ReflowComments: false # IndentOnly
143+
SeparateDefinitionBlocks: Always
144+
SortIncludes: CaseInsensitive
145+
SortUsingDeclarations: LexicographicNumeric
146+
SpaceAfterCStyleCast: true
147+
SpaceAfterLogicalNot: false
148+
SpaceAfterTemplateKeyword: true
149+
SpaceBeforeAssignmentOperators: true
150+
SpaceBeforeCpp11BracedList: false
151+
SpaceBeforeCtorInitializerColon: true
152+
SpaceBeforeInheritanceColon: true
153+
SpaceBeforeParens: ControlStatements
154+
SpaceBeforeRangeBasedForLoopColon: true
155+
SpaceInEmptyBlock: false
156+
SpaceInEmptyParentheses: false
157+
SpacesBeforeTrailingComments: 2
158+
SpacesInAngles: Never
159+
SpacesInContainerLiterals: true
160+
SpacesInLineCommentPrefix:
161+
Minimum: 1
162+
Maximum: -1
163+
SpacesInParentheses: false
164+
SpacesInSquareBrackets: false
165+
SpaceBeforeSquareBrackets: false
166+
Standard: c++17
167+
TabWidth: 4
168+
UseTab: Never
169+
WhitespaceSensitiveMacros: ['STRINGIZE']
170+
...
171+

.clang-tidy

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
---
2+
Checks: >
3+
bugprone-*,
4+
-bugprone-easily-swappable-parameters,
5+
-bugprone-implicit-widening-of-multiplication-result,
6+
-bugprone-misplaced-widening-cast,
7+
-bugprone-narrowing-conversions,
8+
readability-*,
9+
-readability-avoid-unconditional-preprocessor-if,
10+
-readability-function-cognitive-complexity,
11+
-readability-identifier-length,
12+
-readability-implicit-bool-conversion,
13+
-readability-magic-numbers,
14+
-readability-uppercase-literal-suffix,
15+
-readability-simplify-boolean-expr,
16+
-readability-math-missing-parentheses,
17+
clang-analyzer-*,
18+
-clang-analyzer-security.insecureAPI.DeprecatedOrUnsafeBufferHandling,
19+
performance-*,
20+
-performance-enum-size,
21+
portability-*,
22+
-portability-simd-intrinsics,
23+
misc-*,
24+
-misc-const-correctness,
25+
-misc-non-private-member-variables-in-classes,
26+
-misc-no-recursion,
27+
-misc-use-anonymous-namespace,
28+
FormatStyle: none

0 commit comments

Comments
 (0)