From the following sample code we can see that the parameter PenaltyBreakBeforeFirstCallParameter behaves erratically and nonmonotonically. What settings can I use to really force no break before the first call parameter. And what's going on here?
Notice that there are four lines of code in the test. They each have nested function calls. But it goes insane with breaking before the first parameter. There is no possible value that causes all four lines to not break before the first call parameter (to the CL_CHECK_E()).
PenaltyBreakBeforeFirstCallParameter: 0 -> 5
CL_CHECK_E(
clGetProgramBuildInfo(m_program, m_device, CL_PROGRAM_bigbassxBLY_ABCD, bigbassxbly_length, tempDissassembly, NULL));
CL_CHECK_E(clGetProgramBuildInfo(m_program, m_device, CL_PROGRAM_bigbassxBLY_ABCD, bigbassxbly_length, tempDissassembly,
"Unable query hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh"));
CL_CHECK_E(clGetKernelSubGroupInfoKHR(m_kernel, m_device, hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh, sizeof(m_workGroupSize),
&m_workGroupSize, sizeof(m_numSubGroups), &m_numSubGroups, NULL),
"Unable query hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh");
CL_CHECK_E(
clGetKernelSubGroupInfoKHR(m_kernel, m_device, CL_KERNEL_MAX_SUB_GROUP_SIZE_FOR_NDRANGE_KHR, sizeof(m_workGroupSize),
&m_workGroupSize, sizeof(m_subGroupSize), &m_subGroupSize, NULL),
"hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh");
PenaltyBreakBeforeFirstCallParameter: 6 -> 4294967146
CL_CHECK_E(
clGetProgramBuildInfo(m_program, m_device, CL_PROGRAM_bigbassxBLY_ABCD, bigbassxbly_length, tempDissassembly, NULL));
CL_CHECK_E(clGetProgramBuildInfo(m_program, m_device, CL_PROGRAM_bigbassxBLY_ABCD, bigbassxbly_length, tempDissassembly,
"Unable query hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh"));
CL_CHECK_E(clGetKernelSubGroupInfoKHR(m_kernel, m_device, hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh, sizeof(m_workGroupSize),
&m_workGroupSize, sizeof(m_numSubGroups), &m_numSubGroups, NULL),
"Unable query hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh");
CL_CHECK_E(clGetKernelSubGroupInfoKHR(m_kernel, m_device, hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh,
sizeof(m_workGroupSize), &m_workGroupSize, sizeof(m_subGroupSize), &m_subGroupSize,
NULL),
"hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh");
PenaltyBreakBeforeFirstCallParameter: 4294967147 -> 4294967220
CL_CHECK_E(
clGetProgramBuildInfo(
m_program, m_device, CL_PROGRAM_bigbassxBLY_ABCD, bigbassxbly_length, tempDissassembly, NULL));
CL_CHECK_E(clGetProgramBuildInfo(m_program, m_device, CL_PROGRAM_bigbassxBLY_ABCD, bigbassxbly_length, tempDissassembly,
"Unable query hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh"));
CL_CHECK_E(clGetKernelSubGroupInfoKHR(m_kernel, m_device, hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh, sizeof(m_workGroupSize),
&m_workGroupSize, sizeof(m_numSubGroups), &m_numSubGroups, NULL),
"Unable query hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh");
CL_CHECK_E(clGetKernelSubGroupInfoKHR(m_kernel, m_device, hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh,
sizeof(m_workGroupSize), &m_workGroupSize, sizeof(m_subGroupSize), &m_subGroupSize,
NULL),
"hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh");
PenaltyBreakBeforeFirstCallParameter: 4294967222 -> 4294967295
CL_CHECK_E(clGetProgramBuildInfo(
m_program, m_device, CL_PROGRAM_bigbassxBLY_ABCD, bigbassxbly_length, tempDissassembly, NULL));
CL_CHECK_E(clGetProgramBuildInfo(m_program, m_device, CL_PROGRAM_bigbassxBLY_ABCD, bigbassxbly_length, tempDissassembly,
"Unable query hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh"));
CL_CHECK_E(clGetKernelSubGroupInfoKHR(m_kernel, m_device, hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh, sizeof(m_workGroupSize),
&m_workGroupSize, sizeof(m_numSubGroups), &m_numSubGroups, NULL),
"Unable query hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh");
CL_CHECK_E(
clGetKernelSubGroupInfoKHR(m_kernel, m_device, CL_KERNEL_MAX_SUB_GROUP_SIZE_FOR_NDRANGE_KHR, sizeof(m_workGroupSize),
&m_workGroupSize, sizeof(m_subGroupSize), &m_subGroupSize, NULL),
"hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh");
Here is the complete .clang-format file:
---
Language: Cpp
AccessModifierOffset: -4
AlignAfterOpenBracket: Align
AlignConsecutiveAssignments: false
AlignConsecutiveDeclarations: false
AlignEscapedNewlines: Left
AlignOperands: true
AlignTrailingComments: true
AllowAllParametersOfDeclarationOnNextLine: false
AllowShortBlocksOnASingleLine: true
AllowShortCaseLabelsOnASingleLine: true
AllowShortFunctionsOnASingleLine: All
AllowShortIfStatementsOnASingleLine: true
AllowShortLoopsOnASingleLine: true
AlwaysBreakAfterDefinitionReturnType: None
AlwaysBreakAfterReturnType: None
AlwaysBreakBeforeMultilineStrings: false
AlwaysBreakTemplateDeclarations: MultiLine
BinPackArguments: true
BinPackParameters: true
BraceWrapping:
AfterClass: false
AfterControlStatement: false
AfterEnum: false
AfterFunction: true
AfterNamespace: false
AfterObjCDeclaration: false
AfterStruct: false
AfterUnion: false
AfterExternBlock: false
BeforeCatch: true
BeforeElse: false
IndentBraces: false
SplitEmptyFunction: true
SplitEmptyRecord: true
SplitEmptyNamespace: true
BreakBeforeBinaryOperators: None
BreakBeforeBraces: Custom
BreakBeforeInheritanceComma: false
BreakInheritanceList: BeforeColon
BreakBeforeTernaryOperators: true
BreakConstructorInitializersBeforeComma: false
BreakConstructorInitializers: AfterColon
BreakAfterJavaFieldAnnotations: false
BreakStringLiterals: true
ColumnLimit: 130
CommentPragmas: '^ IWYU pragma:'
CompactNamespaces: false
ConstructorInitializerAllOnOneLineOrOnePerLine: false
ConstructorInitializerIndentWidth: 4
ContinuationIndentWidth: 4
Cpp11BracedListStyle: true
DerivePointerAlignment: false
DisableFormat: false
ExperimentalAutoDetectBinPacking: false
FixNamespaceComments: true
ForEachMacros:
- foreach
- Q_FOREACH
- BOOST_FOREACH
IncludeBlocks: Regroup
IncludeCategories:
- Regex: '^"(llvm|llvm-c|clang|clang-c)/'
Priority: 2
- Regex: '^(<|"(gtest|gmock|isl|json)/)'
Priority: 3
- Regex: '.*'
Priority: 1
IncludeIsMainRegex: '(Test)?$'
IndentCaseLabels: false
IndentPPDirectives: None
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: 2
PenaltyBreakBeforeFirstCallParameter: 4294967295
PenaltyBreakComment: 300
PenaltyBreakFirstLessLess: 120
PenaltyBreakString: 1000
PenaltyBreakTemplateDeclaration: 10
PenaltyExcessCharacter: 1000000
PenaltyReturnTypeOnItsOwnLine: 60
PointerAlignment: Left
ReflowComments: true
SortIncludes: true
SortUsingDeclarations: true
SpaceAfterCStyleCast: false
SpaceAfterTemplateKeyword: true
SpaceBeforeAssignmentOperators: true
SpaceBeforeCpp11BracedList: true
SpaceBeforeCtorInitializerColon: true
SpaceBeforeInheritanceColon: true
SpaceBeforeParens: ControlStatements
SpaceBeforeRangeBasedForLoopColon: true
SpaceInEmptyParentheses: false
SpacesBeforeTrailingComments: 1
SpacesInAngles: false
SpacesInContainerLiterals: true
SpacesInCStyleCastParentheses: false
SpacesInParentheses: false
SpacesInSquareBrackets: false
Standard: Cpp11
StatementMacros:
- Q_UNUSED
- QT_REQUIRE_VERSION
TabWidth: 8
UseTab: Never
...