Skip to content

Commit

Permalink
Develop stream 20220509 (#328)
Browse files Browse the repository at this point in the history
* Revert "Revert "Merge branch '364-add-large-indices-support-to-device-select' into 'develop_stream'" (#334)"

This reverts commit 1dc3b58.

* [autotune] Add configurable size based fallback

* Fixes from codereview

* Use more extendible format suggested in review

* Use benchmark_manger to store the paths

* [autotune][skip ci] Don't use global state

* [autotune][skip ci] Renamed in json

datatype_size_fallback --> fallback_cases

* [autotune][skip ci] _create_fallback_case

Make the _craeate_fallback_case function more easy to read by extracting
the finding of the best entry by datatype into a separate function

* [autotune][skip ci]Add minor changes from codereview

* [autotune][skip ci]Use TextIOWrapper instead of strings for paths

* [autotune][skip ci] Correct erronous help message

* Resolve "Implement the block merge kernel using the merge paths"

* Use correct warp size in default scan config for gfx908

* Update .gitlab-ci.yml file

* Remove order only dependency of cmake-latest from cmake minimum

* Update .clang-format [CI skip]

* Add code format check script and git hook [CI skip]

The script by default checks diffs for code formatting violations
compared to the default branch (develop_stream).
The commit hook checks the current commit. It can be installed by running
the `install` script in .githooks.

* code format check: Use proper git config key when setting color mode [CI skip]

* use regular check-format script instead of special ci script

* Use rules instead of only/if in gitlab-ci.yml

* Set dependencies for remaining build jobs

* Resolve "Fix rocThrust#280"

* remove manual split, add cmake functions

* introduce semi-automatic split of longest test compilation units

* fix build issue when config tuning is enabled

* applied matrix generation to several device algorithm benchmarks

remove filter in benchmark config tuning

* move parameters as much as possible to cmake script

* Fix check-format output being truncated, increase robustness

The output of git-clang-format is now saved to a temporary file
to bypass maximum shell command limitations which resulted in truncating
the output.

Additionally the script has been made more robust to unexpected exits
by using a signal handler to perform clean-up (deleting the file, and
resetting the git settings)

* Added custom configs to tests of device segmented radix sort

* Updated configuration

* 3-way partitioning in device segmented radix sort

* Benchmark device segmented sort seg. length 256

* Reverse iterator [skip ci]

* Device segmented radix sort uses reverse iterator

* Updated changelog

* Applied formatting to changes

* Removed dangling semi-colon

* segmented radix sort: fall back to 2-way partitioning if redundant

* Resolve "Small performance improvement device_merge for small datatypes"

* add reverse iterator to changelog

* Fixing device partition / select / unique

* Fix out of bound access in test_reverse_iterator

The vector has 5 elements accessing index 5 is also out of bounds when
using a reverse iterator.

Co-authored-by: Lőrinc Serfőző <[email protected]>
Co-authored-by: Balint Soproni <[email protected]>
Co-authored-by: Vince van Heertum <[email protected]>
Co-authored-by: Istvan Kiss <[email protected]>
Co-authored-by: Robin Voetter <[email protected]>
Co-authored-by: Gergely Mészáros <[email protected]>
  • Loading branch information
7 people committed Jun 16, 2022
1 parent c04151e commit d319e9c
Show file tree
Hide file tree
Showing 63 changed files with 6,085 additions and 4,239 deletions.
128 changes: 74 additions & 54 deletions .clang-format
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ TabWidth: 4
IndentWidth: 4
UseTab: Never
ColumnLimit: 100
UseCRLF: false

# Other languages JavaScript, Proto

Expand All @@ -19,102 +20,121 @@ Language: Cpp
# // clang-format on
# void formatted_code_again;

DisableFormat: false
DisableFormat: false
Standard: Cpp11

AccessModifierOffset: -4
AlignAfterOpenBracket: true
AlignArrayOfStructures: Right
AlignConsecutiveAssignments: true
AlignConsecutiveDeclarations: true
AlignEscapedNewlinesLeft: true
AlignOperands: true
AlignEscapedNewlines: Left
AlignOperands: true
AlignTrailingComments: false
AllowAllArgumentsOnNextLine: false
AllowAllParametersOfDeclarationOnNextLine: true
AllowShortBlocksOnASingleLine: false
AllowShortCaseLabelsOnASingleLine: false
AllowShortBlocksOnASingleLine: Never
AllowShortCaseLabelsOnASingleLine: true
AllowShortFunctionsOnASingleLine: Empty
AllowShortIfStatementsOnASingleLine: false
AllowShortLoopsOnASingleLine: false
AlwaysBreakAfterDefinitionReturnType: false
AlwaysBreakAfterReturnType: None
AlwaysBreakBeforeMultilineStrings: false
AlwaysBreakTemplateDeclarations: true
AlwaysBreakTemplateDeclarations: Yes
AttributeMacros: ['ROCPRIM_DEVICE', 'ROCPRIM_HOST', 'ROCPRIM_HOST_DEVICE', 'ROCPRIM_SHARED_MEMORY', 'ROCPRIM_KERNEL', 'ROCPRIM_INLINE']
BinPackArguments: false
BinPackParameters: false
BitFieldColonSpacing: Both

# Configure each individual brace in BraceWrapping
BreakBeforeBraces: Custom
# Control of individual brace wrapping cases
BraceWrapping: {
AfterClass: 'true'
AfterControlStatement: 'true'
AfterEnum : 'true'
AfterFunction : 'true'
AfterNamespace : 'true'
AfterStruct : 'true'
AfterUnion : 'true'
BeforeCatch : 'true'
BeforeElse : 'true'
IndentBraces : 'false'
# AfterExternBlock : 'true'
}
BraceWrapping:
AfterCaseLabel: true
AfterClass: true
AfterControlStatement: Always
AfterEnum: true
AfterFunction: true
AfterNamespace: true
AfterStruct: true
AfterUnion: true
BeforeCatch: true
BeforeElse: true
AfterExternBlock: false
BeforeCatch: true
BeforeElse: true
BeforeLambdaBody: true
BeforeWhile: true
IndentBraces: false
SplitEmptyFunction: false
SplitEmptyRecord: false
SplitEmptyNamespace: false

#BreakAfterJavaFieldAnnotations: true
#BreakBeforeInheritanceComma: false
#BreakBeforeBinaryOperators: None
#BreakBeforeTernaryOperators: true
#BreakConstructorInitializersBeforeComma: true
#BreakStringLiterals: true

CommentPragmas: '^ IWYU pragma:'
#CompactNamespaces: false
ConstructorInitializerAllOnOneLineOrOnePerLine: false
BreakBeforeBinaryOperators: All
BreakBeforeTernaryOperators: true
BreakConstructorInitializers: BeforeComma
BreakInheritanceList: BeforeComma
BreakStringLiterals: true
CommentPragmas: '^ IWYU pragma:'
CompactNamespaces: false
ConstructorInitializerIndentWidth: 4
ContinuationIndentWidth: 4
Cpp11BracedListStyle: true
#SpaceBeforeCpp11BracedList: false
DeriveLineEnding: false
DerivePointerAlignment: false
EmptyLineAfterAccessModifier: Never
EmptyLineBeforeAccessModifier: Always
ExperimentalAutoDetectBinPacking: false
ForEachMacros: [ foreach, Q_FOREACH, BOOST_FOREACH ]
IndentCaseLabels: false
#FixNamespaceComments: true
FixNamespaceComments: true
ForEachMacros: [ foreach, Q_FOREACH, BOOST_FOREACH ]
IfMacros: []
IncludeBlocks: Preserve
IndentAccessModifiers: false
IndentCaseBlocks: true
IndentCaseLabels: true
IndentExternBlock: NoIndent
IndentPPDirectives: BeforeHash
IndentWrappedFunctionNames: true
KeepEmptyLinesAtTheStartOfBlocks: true
LambdaBodyIndentation: Signature
MacroBlockBegin: ''
MacroBlockEnd: ''
#JavaScriptQuotes: Double
MacroBlockEnd: ''
MaxEmptyLinesToKeep: 1
NamespaceIndentation: All
ObjCBlockIndentWidth: 4
#ObjCSpaceAfterProperty: true
#ObjCSpaceBeforeProtocolList: true
NamespaceIndentation: None
PPIndentWidth: -1
PackConstructorInitializers: NextLine
PenaltyBreakBeforeFirstCallParameter: 19
PenaltyBreakComment: 300
PenaltyBreakFirstLessLess: 120
PenaltyBreakString: 1000

PenaltyExcessCharacter: 1000000
PenaltyReturnTypeOnItsOwnLine: 60
PointerAlignment: Left
QualifierAlignment: Leave
ReferenceAlignment: Pointer
ReflowComments: false
ShortNamespaceLines: 0
SortIncludes: CaseSensitive
SortUsingDeclarations: true
SpaceAfterCStyleCast: false
SpaceAfterLogicalNot: false
SpaceAfterTemplateKeyword: false
SpaceAroundPointerQualifiers: Default
SpaceBeforeAssignmentOperators: true
SpaceBeforeCaseColon: false
SpaceBeforeCpp11BracedList: false
SpaceBeforeCtorInitializerColon: true
SpaceBeforeInheritanceColon: true
SpaceBeforeParens: Never
SpaceBeforeRangeBasedForLoopColon: true
SpaceBeforeSquareBrackets: false
SpaceInEmptyBlock: false
SpaceInEmptyParentheses: false
SpacesBeforeTrailingComments: 1
SpacesInAngles: false
SpacesInContainerLiterals: true
SpacesInAngles: Never
SpacesInCStyleCastParentheses: false
SpacesInConditionalStatement: false
SpacesInContainerLiterals: true
SpacesInParentheses: false
SpacesInSquareBrackets: false
#SpaceAfterTemplateKeyword: true
#SpaceBeforeInheritanceColon: true

#SortUsingDeclarations: true
SortIncludes: true

# Comments are for developers, they should arrange them
ReflowComments: false

#IncludeBlocks: Preserve
#IndentPPDirectives: AfterHash
---
4 changes: 2 additions & 2 deletions .githooks/install
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env bash
#!/bin/sh

cd $(git rev-parse --git-dir)
cd "$(git rev-parse --git-dir)"
cd hooks

echo "Installing hooks..."
Expand Down
56 changes: 5 additions & 51 deletions .githooks/pre-commit
Original file line number Diff line number Diff line change
@@ -1,58 +1,12 @@
#!/bin/sh
#
# This pre-commit hook checks if any versions of clang-format
# are installed, and if so, uses the installed version to format
# the staged changes.

base=clang-format-3.8
format=""

# Redirect output to stderr.
exec 1>&2

# check if clang-format is installed
type "$base" >/dev/null 2>&1 && format="$base"

# no versions of clang-format are installed
if [ -z "$format" ]
then
echo "$base is not installed. Commit is cancelled. Delete the hook to force commit."
# Do the code format check
if ! "$(git rev-parse --show-toplevel)/scripts/code-format/check-format.sh" HEAD --cached 1>&2; then
printf "
Pre-commit check failed, please fix the reported errors.
Note: Use '\033[33mgit commit --no-verify\033[0m' to bypass checks.\n"
exit 1
fi

# Do everything from top - level
cd $(git rev-parse --show-toplevel)

if git rev-parse --verify HEAD >/dev/null 2>&1
then
against=HEAD
else
# Initial commit: diff against an empty tree object
against=4b825dc642cb6eb9a060e54bf8d69288fbee4904
fi

exitCode=0

# do the formatting
for file in $(git diff-index --cached --name-only $against | grep -E '\.h$|\.hpp$|\.cpp$|\.cl$|\.h\.in$|\.hpp\.in$|\.cpp\.in$')
do
if [ -e "$file" ]
then
# echo "$format $file"
"$format" -style=file -output-replacements-xml "$file" | grep "\<replacement\>" >/dev/null
if [ $? -ne 1 ]; then
echo "$format" -i -style=file "$file"
exitCode=1
fi

fi
done

if [ $exitCode -eq 1 ]; then
echo "Please fix the errors by running the commands listed above."
echo "Commit is cancelled. You may force by deleting the hook in .githook"
else
echo "Clang format checks passed"
fi

exit $exitCode
Loading

0 comments on commit d319e9c

Please sign in to comment.