Skip to content

Commit 8b27ba6

Browse files
authored
Merge branch 'main' into vitis_port
2 parents 9dcf2f3 + 1c2acbb commit 8b27ba6

File tree

141 files changed

+4866
-3635
lines changed

Some content is hidden

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

141 files changed

+4866
-3635
lines changed

.clang-format

Lines changed: 191 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,191 @@
1+
---
2+
Language: Cpp
3+
# BasedOnStyle: LLVM
4+
AccessModifierOffset: -2
5+
AlignAfterOpenBracket: Align
6+
AlignArrayOfStructures: None
7+
AlignConsecutiveMacros: None
8+
AlignConsecutiveAssignments: None
9+
AlignConsecutiveBitFields: None
10+
AlignConsecutiveDeclarations: None
11+
AlignEscapedNewlines: Right
12+
AlignOperands: Align
13+
AlignTrailingComments: true
14+
AllowAllArgumentsOnNextLine: true
15+
AllowAllParametersOfDeclarationOnNextLine: true
16+
AllowShortEnumsOnASingleLine: true
17+
AllowShortBlocksOnASingleLine: Never
18+
AllowShortCaseLabelsOnASingleLine: false
19+
AllowShortFunctionsOnASingleLine: All
20+
AllowShortLambdasOnASingleLine: All
21+
AllowShortIfStatementsOnASingleLine: Never
22+
AllowShortLoopsOnASingleLine: false
23+
AlwaysBreakAfterDefinitionReturnType: None
24+
AlwaysBreakAfterReturnType: None
25+
AlwaysBreakBeforeMultilineStrings: false
26+
AlwaysBreakTemplateDeclarations: MultiLine
27+
AttributeMacros:
28+
- __capability
29+
BinPackArguments: true
30+
BinPackParameters: true
31+
BraceWrapping:
32+
AfterCaseLabel: false
33+
AfterClass: false
34+
AfterControlStatement: Never
35+
AfterEnum: false
36+
AfterFunction: false
37+
AfterNamespace: false
38+
AfterObjCDeclaration: false
39+
AfterStruct: false
40+
AfterUnion: false
41+
AfterExternBlock: false
42+
BeforeCatch: false
43+
BeforeElse: false
44+
BeforeLambdaBody: false
45+
BeforeWhile: false
46+
IndentBraces: false
47+
SplitEmptyFunction: true
48+
SplitEmptyRecord: true
49+
SplitEmptyNamespace: true
50+
BreakBeforeBinaryOperators: None
51+
BreakBeforeConceptDeclarations: true
52+
BreakBeforeBraces: Attach
53+
BreakBeforeInheritanceComma: false
54+
BreakInheritanceList: BeforeColon
55+
BreakBeforeTernaryOperators: true
56+
BreakConstructorInitializersBeforeComma: false
57+
BreakConstructorInitializers: BeforeColon
58+
BreakAfterJavaFieldAnnotations: false
59+
BreakStringLiterals: true
60+
ColumnLimit: 125
61+
CommentPragmas: '^ IWYU pragma:'
62+
QualifierAlignment: Leave
63+
CompactNamespaces: false
64+
ConstructorInitializerIndentWidth: 4
65+
ContinuationIndentWidth: 4
66+
Cpp11BracedListStyle: true
67+
DeriveLineEnding: true
68+
DerivePointerAlignment: false
69+
DisableFormat: false
70+
EmptyLineAfterAccessModifier: Never
71+
EmptyLineBeforeAccessModifier: LogicalBlock
72+
ExperimentalAutoDetectBinPacking: false
73+
PackConstructorInitializers: BinPack
74+
BasedOnStyle: ''
75+
ConstructorInitializerAllOnOneLineOrOnePerLine: false
76+
AllowAllConstructorInitializersOnNextLine: true
77+
FixNamespaceComments: true
78+
ForEachMacros:
79+
- foreach
80+
- Q_FOREACH
81+
- BOOST_FOREACH
82+
IfMacros:
83+
- KJ_IF_MAYBE
84+
IncludeBlocks: Preserve
85+
IncludeCategories:
86+
- Regex: '^"(llvm|llvm-c|clang|clang-c)/'
87+
Priority: 2
88+
SortPriority: 0
89+
CaseSensitive: false
90+
- Regex: '^(<|"(gtest|gmock|isl|json)/)'
91+
Priority: 3
92+
SortPriority: 0
93+
CaseSensitive: false
94+
- Regex: '.*'
95+
Priority: 1
96+
SortPriority: 0
97+
CaseSensitive: false
98+
IncludeIsMainRegex: '(Test)?$'
99+
IncludeIsMainSourceRegex: ''
100+
IndentAccessModifiers: false
101+
IndentCaseLabels: false
102+
IndentCaseBlocks: false
103+
IndentGotoLabels: true
104+
IndentPPDirectives: None
105+
IndentExternBlock: AfterExternBlock
106+
IndentRequires: false
107+
IndentWidth: 4
108+
IndentWrappedFunctionNames: false
109+
InsertTrailingCommas: None
110+
JavaScriptQuotes: Leave
111+
JavaScriptWrapImports: true
112+
KeepEmptyLinesAtTheStartOfBlocks: true
113+
LambdaBodyIndentation: Signature
114+
MacroBlockBegin: ''
115+
MacroBlockEnd: ''
116+
MaxEmptyLinesToKeep: 1
117+
NamespaceIndentation: None
118+
ObjCBinPackProtocolList: Auto
119+
ObjCBlockIndentWidth: 2
120+
ObjCBreakBeforeNestedBlockParam: true
121+
ObjCSpaceAfterProperty: false
122+
ObjCSpaceBeforeProtocolList: true
123+
PenaltyBreakAssignment: 2
124+
PenaltyBreakBeforeFirstCallParameter: 19
125+
PenaltyBreakComment: 300
126+
PenaltyBreakFirstLessLess: 120
127+
PenaltyBreakOpenParenthesis: 0
128+
PenaltyBreakString: 1000
129+
PenaltyBreakTemplateDeclaration: 10
130+
PenaltyExcessCharacter: 1000000
131+
PenaltyReturnTypeOnItsOwnLine: 60
132+
PenaltyIndentedWhitespace: 0
133+
PointerAlignment: Right
134+
PPIndentWidth: -1
135+
ReferenceAlignment: Pointer
136+
ReflowComments: true
137+
RemoveBracesLLVM: false
138+
SeparateDefinitionBlocks: Leave
139+
ShortNamespaceLines: 1
140+
SortIncludes: CaseSensitive
141+
SortJavaStaticImport: Before
142+
SortUsingDeclarations: true
143+
SpaceAfterCStyleCast: false
144+
SpaceAfterLogicalNot: false
145+
SpaceAfterTemplateKeyword: true
146+
SpaceBeforeAssignmentOperators: true
147+
SpaceBeforeCaseColon: false
148+
SpaceBeforeCpp11BracedList: false
149+
SpaceBeforeCtorInitializerColon: true
150+
SpaceBeforeInheritanceColon: true
151+
SpaceBeforeParens: ControlStatements
152+
SpaceBeforeParensOptions:
153+
AfterControlStatements: true
154+
AfterForeachMacros: true
155+
AfterFunctionDefinitionName: false
156+
AfterFunctionDeclarationName: false
157+
AfterIfMacros: true
158+
AfterOverloadedOperator: false
159+
BeforeNonEmptyParentheses: false
160+
SpaceAroundPointerQualifiers: Default
161+
SpaceBeforeRangeBasedForLoopColon: true
162+
SpaceInEmptyBlock: false
163+
SpaceInEmptyParentheses: false
164+
SpacesBeforeTrailingComments: 1
165+
SpacesInAngles: Never
166+
SpacesInConditionalStatement: false
167+
SpacesInContainerLiterals: true
168+
SpacesInCStyleCastParentheses: false
169+
SpacesInLineCommentPrefix:
170+
Minimum: 1
171+
Maximum: -1
172+
SpacesInParentheses: false
173+
SpacesInSquareBrackets: false
174+
SpaceBeforeSquareBrackets: false
175+
BitFieldColonSpacing: Both
176+
Standard: Latest
177+
StatementAttributeLikeMacros:
178+
- Q_EMIT
179+
StatementMacros:
180+
- Q_UNUSED
181+
- QT_REQUIRE_VERSION
182+
TabWidth: 8
183+
UseCRLF: false
184+
UseTab: Never
185+
WhitespaceSensitiveMacros:
186+
- STRINGIZE
187+
- PP_STRINGIZE
188+
- BOOST_PP_STRINGIZE
189+
- NS_SWIFT_NAME
190+
- CF_SWIFT_NAME
191+
...

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
A# Description
22

3-
> :memo: Please include a summary of the change.
4-
>
5-
> * Please also include relevant motivation and context.
6-
> * List any dependencies that are required for this change.
3+
> :memo: Please include a summary of the change.
4+
>
5+
> * Please also include relevant motivation and context.
6+
> * List any dependencies that are required for this change.
77
88
## Type of change
99

@@ -22,9 +22,9 @@ Note: Please delete options that are not relevant.
2222
## Tests
2323

2424
> :memo: Please describe the tests that you ran to verify your changes.
25-
>
26-
> * Provide instructions so we can reproduce.
27-
> * Please also list any relevant details for your test configuration.
25+
>
26+
> * Provide instructions so we can reproduce.
27+
> * Please also list any relevant details for your test configuration.
2828
2929
**Test Configuration**:
3030

@@ -34,4 +34,5 @@ Note: Please delete options that are not relevant.
3434
- [ ] I have commented my code, particularly in hard-to-understand areas.
3535
- [ ] I have made corresponding changes to the documentation.
3636
- [ ] My changes generate no new warnings.
37-
- [ ] I have added tests that prove my fix is effective or that my feature works.B
37+
- [ ] I have installed and run `pre-commit` on the files I edited or added.
38+
- [ ] I have added tests that prove my fix is effective or that my feature works.

.github/workflows/build-sphinx.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,9 @@ jobs:
1111

1212
steps:
1313
- uses: actions/checkout@v1
14-
- uses: ammaraskar/sphinx-action@master
14+
- uses: jmduarte/sphinx-action@main
1515
with:
1616
docs-folder: "docs/"
17-
pre-build-command: "pip install sphinx-rtd-theme numpy six pyyaml h5py 'onnx>=1.4.0' pandas seaborn matplotlib"
1817
- name: Commit Documentation Changes
1918
run: |
2019
git clone https://github.com/fastmachinelearning/hls4ml.git --branch gh-pages --single-branch gh-pages

.github/workflows/pre-commit.yml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: Run pre-commit
2+
3+
on:
4+
pull_request:
5+
branches: [ main ]
6+
push:
7+
branches: [ main ]
8+
9+
jobs:
10+
pre-commit:
11+
name: Format
12+
runs-on: ubuntu-latest
13+
strategy:
14+
matrix:
15+
python-version: [3.7]
16+
17+
steps:
18+
- name: Checkout
19+
uses: actions/checkout@v3
20+
with:
21+
submodules: recursive
22+
23+
- name: Set up Python ${{ matrix.python-version }}
24+
uses: actions/setup-python@v4
25+
with:
26+
python-version: ${{ matrix.python-version }}
27+
28+
- id: file_changes
29+
uses: trilom/[email protected]
30+
with:
31+
prNumber: ${{ github.event.number }}
32+
output: ' '
33+
34+
- name: Pre-commit
35+
uses: pre-commit/[email protected]
36+
with:
37+
extra_args: --files ${{ steps.file_changes.outputs.files }}

.github/workflows/test-sphinx.yml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
name: test-sphinx
2+
on:
3+
pull_request:
4+
branches:
5+
- main
6+
7+
jobs:
8+
build:
9+
10+
runs-on: ubuntu-latest
11+
12+
steps:
13+
- uses: actions/checkout@v1
14+
- uses: jmduarte/sphinx-action@main
15+
with:
16+
docs-folder: "docs/"
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
on:
2+
pull_request_target:
3+
types: [labeled]
4+
branches: [main]
5+
6+
name: Update branch on PR from fork
7+
jobs:
8+
test:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- name: Checkout repo
12+
uses: actions/checkout@v3
13+
if: ${{ github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name && github.event.label.name == 'please test' }}
14+
with:
15+
ref: ${{ github.event.pull_request.head.sha }}
16+
- name: Push changes
17+
if: ${{ github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name && github.event.label.name == 'please test' }}
18+
run: |
19+
git checkout -b pr/${{ github.event.pull_request.number }}
20+
git push --force origin pr/${{ github.event.pull_request.number }}

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
*.pyc
2+
_version.py
23
__pycache__
34
build/
45
dist/

.pre-commit-config.yaml

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
exclude: ^hls4ml\/templates\/(vivado|quartus)\/(ap_types|ac_types)\/
2+
3+
repos:
4+
- repo: https://github.com/psf/black
5+
rev: 22.12.0
6+
hooks:
7+
- id: black
8+
language_version: python3
9+
args: ['--line-length=125',
10+
'--skip-string-normalization']
11+
12+
- repo: https://github.com/pre-commit/pre-commit-hooks
13+
rev: v4.4.0
14+
hooks:
15+
- id: check-added-large-files
16+
- id: check-case-conflict
17+
- id: check-merge-conflict
18+
- id: check-symlinks
19+
- id: check-yaml
20+
- id: debug-statements
21+
- id: end-of-file-fixer
22+
- id: mixed-line-ending
23+
- id: requirements-txt-fixer
24+
- id: trailing-whitespace
25+
26+
- repo: https://github.com/PyCQA/isort
27+
rev: 5.11.4
28+
hooks:
29+
- id: isort
30+
args: ["--profile", "black", --line-length=125]
31+
32+
- repo: https://github.com/asottile/pyupgrade
33+
rev: v3.3.1
34+
hooks:
35+
- id: pyupgrade
36+
args: ["--py36-plus"]
37+
38+
- repo: https://github.com/asottile/setup-cfg-fmt
39+
rev: v2.2.0
40+
hooks:
41+
- id: setup-cfg-fmt
42+
43+
- repo: https://github.com/pycqa/flake8
44+
rev: 5.0.4
45+
hooks:
46+
- id: flake8
47+
exclude: docs/conf.py
48+
additional_dependencies: [flake8-bugbear, flake8-print]
49+
args: ['--max-line-length=125', # github viewer width
50+
'--extend-ignore=E203,T201'] # E203 is not PEP8 compliant
51+
52+
- repo: https://github.com/mgedmin/check-manifest
53+
rev: "0.49"
54+
hooks:
55+
- id: check-manifest
56+
stages: [manual]
57+
58+
- repo: https://github.com/jmduarte/p-clang-format
59+
rev: "v1.0.4"
60+
hooks:
61+
- id: p-clang-format
62+
types_or: [c++, c, cuda]

0 commit comments

Comments
 (0)