-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add clang-format and gitignore * Move celeritas load to a subdirectory * Set up default celeritas options * Add implementation * Add targets for unit test debugging * Implement test * Add CI * Use incoming celeritas PR * Fix GHA branch target * Update celeritas URL
- Loading branch information
Showing
18 changed files
with
1,585 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,161 @@ | ||
--- | ||
Language: Cpp | ||
AccessModifierOffset: -2 | ||
AlignAfterOpenBracket: Align | ||
AlignConsecutiveAssignments: false | ||
AlignConsecutiveDeclarations: false | ||
AlignEscapedNewlines: Left | ||
AlignOperands: true | ||
AlignTrailingComments: false | ||
AllowAllParametersOfDeclarationOnNextLine: true | ||
AllowShortBlocksOnASingleLine: true | ||
AllowShortCaseLabelsOnASingleLine: false | ||
AllowShortFunctionsOnASingleLine: Inline | ||
AllowShortIfStatementsOnASingleLine: false | ||
AllowShortLoopsOnASingleLine: false | ||
AlwaysBreakAfterDefinitionReturnType: None | ||
AlwaysBreakAfterReturnType: None | ||
AlwaysBreakBeforeMultilineStrings: true | ||
AlwaysBreakTemplateDeclarations: Yes | ||
BinPackArguments: false | ||
BinPackParameters: false | ||
BraceWrapping: | ||
AfterClass: true | ||
AfterControlStatement: true | ||
AfterEnum: true | ||
AfterFunction: true | ||
AfterNamespace: true | ||
AfterObjCDeclaration: true | ||
AfterStruct: true | ||
AfterUnion: true | ||
AfterExternBlock: false | ||
BeforeCatch: true | ||
BeforeElse: true | ||
IndentBraces: false | ||
SplitEmptyFunction: true | ||
SplitEmptyRecord: true | ||
SplitEmptyNamespace: true | ||
BreakBeforeBinaryOperators: All | ||
BreakBeforeBraces: Custom | ||
BreakBeforeInheritanceComma: false | ||
BreakInheritanceList: BeforeColon | ||
BreakBeforeTernaryOperators: true | ||
BreakConstructorInitializersBeforeComma: false | ||
BreakConstructorInitializers: BeforeComma | ||
BreakAfterJavaFieldAnnotations: false | ||
BreakStringLiterals: true | ||
ColumnLimit: 79 | ||
CommentPragmas: '^ IWYU pragma:' | ||
CompactNamespaces: false | ||
ConstructorInitializerAllOnOneLineOrOnePerLine: true | ||
ConstructorInitializerIndentWidth: 4 | ||
ContinuationIndentWidth: 4 | ||
Cpp11BracedListStyle: true | ||
DerivePointerAlignment: false | ||
DisableFormat: false | ||
FixNamespaceComments: true | ||
ForEachMacros: | ||
- foreach | ||
- Q_FOREACH | ||
- BOOST_FOREACH | ||
IncludeBlocks: Regroup | ||
# Category 0: main include | ||
# Category 1: system includes | ||
# Category 2: celeritas absolute includes | ||
# Category 5: relative includes | ||
# Category 7: test includes | ||
IncludeCategories: | ||
- Regex: '^<[^/.]+>$' | ||
Priority: 1 | ||
SortPriority: 1 | ||
- Regex: '^<.+>$' | ||
Priority: 1 | ||
SortPriority: 2 | ||
- Regex: '^"celeritas_[a-z_]+\.h"' | ||
Priority: 2 | ||
SortPriority: 3 | ||
- Regex: '^"corecel/device_runtime_api\.h"$' | ||
Priority: 2 | ||
SortPriority: 3 | ||
- Regex: '^"corecel/' | ||
Priority: 2 | ||
SortPriority: 5 | ||
CaseSensitive: true | ||
- Regex: '^"orange/' | ||
Priority: 2 | ||
SortPriority: 6 | ||
CaseSensitive: true | ||
- Regex: '^"celeritas/' | ||
Priority: 2 | ||
SortPriority: 7 | ||
CaseSensitive: true | ||
- Regex: '^"accel/' | ||
Priority: 2 | ||
SortPriority: 8 | ||
CaseSensitive: true | ||
- Regex: '^"[^/]+"' | ||
Priority: 5 | ||
SortPriority: 9 | ||
- Regex: '^"detail/"' | ||
Priority: 5 | ||
SortPriority: 10 | ||
- Regex: '"(^gtest/|TestBase|\.test\.hh|celeritas_test\.hh)' | ||
Priority: 7 | ||
CaseSensitive: true | ||
SortPriority: 11 | ||
- Regex: '.*' | ||
Priority: 5 | ||
SortPriority: 9 | ||
IncludeIsMainRegex: '(\.[^.]+)?$' | ||
IncludeIsMainSourceRegex: '(\.cu|\.t\.hh)$' # Allow CU/template files as main | ||
IndentCaseLabels: true | ||
IndentPPDirectives: AfterHash | ||
IndentWidth: 4 | ||
IndentWrappedFunctionNames: false | ||
JavaScriptQuotes: Leave | ||
JavaScriptWrapImports: true | ||
KeepEmptyLinesAtTheStartOfBlocks: false | ||
MacroBlockBegin: '' | ||
MacroBlockEnd: '' | ||
MaxEmptyLinesToKeep: 1 | ||
NamespaceIndentation: None | ||
ObjCBinPackProtocolList: Auto | ||
ObjCBlockIndentWidth: 2 | ||
ObjCSpaceAfterProperty: false | ||
ObjCSpaceBeforeProtocolList: true | ||
PenaltyBreakAssignment: 20 | ||
PenaltyBreakBeforeFirstCallParameter: 5 | ||
PenaltyBreakComment: 10 | ||
PenaltyBreakFirstLessLess: 1 | ||
PenaltyBreakString: 25 | ||
PenaltyBreakTemplateDeclaration: 10 | ||
PenaltyExcessCharacter: 25 | ||
PenaltyReturnTypeOnItsOwnLine: 10 | ||
PointerAlignment: Left | ||
QualifierAlignment: Right | ||
ReflowComments: true | ||
SortIncludes: true | ||
SortUsingDeclarations: true | ||
SpaceAfterCStyleCast: false | ||
SpaceAfterTemplateKeyword: false | ||
SpaceBeforeAssignmentOperators: true | ||
SpaceBeforeCpp11BracedList: false | ||
SpaceBeforeCtorInitializerColon: true | ||
SpaceBeforeInheritanceColon: true | ||
SpaceBeforeParens: ControlStatements | ||
SpaceBeforeRangeBasedForLoopColon: true | ||
SpaceInEmptyParentheses: false | ||
SpacesBeforeTrailingComments: 2 | ||
SpacesInAngles: false | ||
SpacesInContainerLiterals: false | ||
SpacesInCStyleCastParentheses: false | ||
SpacesInParentheses: false | ||
SpacesInSquareBrackets: false | ||
Standard: Cpp11 | ||
StatementMacros: | ||
- Q_UNUSED | ||
- QT_REQUIRE_VERSION | ||
TabWidth: 8 | ||
UseTab: Never | ||
... | ||
# vim: set ft=yaml ts=2 sw=2 : |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
name: build-full | ||
on: | ||
workflow_dispatch: | ||
workflow_call: | ||
|
||
concurrency: | ||
group: build-${{github.ref}}-${{github.event.pull_request.number || github.run_number}}-${{github.workflow}} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
# TODO: this currently includes non-GPU builds as well | ||
# and won't actually run on device | ||
gpu: | ||
name: gpu | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
special: [null] | ||
geometry: ['vecgeom'] | ||
buildtype: ['debug', 'ndebug'] | ||
image: ['ubuntu-cuda'] | ||
env: | ||
CELER_DISABLE_DEVICE: 1 # IMPORTANT | ||
CMAKE_PRESET: >- | ||
${{matrix.buildtype}}-${{matrix.geometry}}${{matrix.special && '-' || ''}}${{matrix.special}} | ||
runs-on: ubuntu-latest | ||
container: | ||
image: >- | ||
docker.io/celeritas/${{ | ||
matrix.image == 'ubuntu-cuda' && 'ci-jammy-cuda11:2023-08-02' | ||
|| null | ||
}} | ||
# See https://github.com/actions/checkout/issues/956 | ||
options: --user root | ||
steps: | ||
- name: Set up environment | ||
run: | | ||
. /etc/profile | ||
echo "/opt/view/bin" >> $GITHUB_PATH | ||
echo "CMAKE_PREFIX_PATH=${CMAKE_PREFIX_PATH}" >> $GITHUB_ENV | ||
# NOTE: checkout must occur *after* setting up environment for git tags to work | ||
# NOTE: checkout v4 fails: https://github.com/actions/checkout/issues/1487 | ||
# NOTE: depth must be enough to include the previous tag | ||
- name: Check out | ||
uses: actions/checkout@v3 | ||
- name: Configure | ||
run: | | ||
git config --global --add safe.directory ${PWD} | ||
ln -fs scripts/cmake-presets/ci-${{matrix.image}}.json CMakeUserPresets.json | ||
cmake --preset=${CMAKE_PRESET} | ||
- name: Build | ||
working-directory: build | ||
run: | | ||
ninja | ||
- name: Test | ||
working-directory: build | ||
run: | | ||
ctest --parallel 2 --timeout 180 --output-on-failure \ | ||
--test-output-size-passed=65536 --test-output-size-failed=1048576 | ||
- name: Install | ||
working-directory: build | ||
run: | | ||
cmake --install . | ||
# vim: set nowrap tw=100: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
name: pr | ||
run-name: >- | ||
${{github.event.pull_request.title}} | ||
(#${{github.event.number}}) | ||
on: | ||
pull_request: | ||
branches: | ||
- main | ||
paths-ignore: | ||
- '**.rst' | ||
- '**.md' | ||
- 'scripts/dev' | ||
|
||
concurrency: | ||
group: pr-${{github.ref}}-${{github.event.number}}-${{github.workflow}} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
build: | ||
uses: ./.github/workflows/build-full.yml | ||
|
||
# Specifying a dependent job allows us to select a single "requires" check in the project GitHub settings | ||
all: | ||
if: ${{ always() }} | ||
needs: | ||
- build | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Decide whether the needed jobs succeeded or failed | ||
uses: re-actors/alls-green@release/v1 | ||
with: | ||
jobs: ${{ toJSON(needs) }} | ||
|
||
# vim: set nowrap tw=100: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
name: push | ||
# TODO: improve run name using commit title (`message` includes details as well) | ||
# run-name: >- | ||
# ${{github.ref_name}}: | ||
# ${{github.event.head_commit.message}} | ||
# (${{github.event.pusher.name}}) | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
|
||
concurrency: | ||
group: push-${{github.ref}}-${{github.run_number}}-${{github.workflow}} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
build-full: | ||
uses: ./.github/workflows/build-full.yml | ||
all: | ||
needs: [build-full] | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Success | ||
run: "true" | ||
|
||
# vim: set nowrap tw=100: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.