Из следующего примера кода видно, что параметр PenaltyBreakBeforeFirstCallParameter работает хаотично и немонотонно. Какие настройки я могу использовать, чтобы действительно не было прерывания перед первым параметром вызова. И что здесь происходит?
Обратите внимание, что в тесте четыре строки кода. У каждого из них есть вложенные вызовы функций. Но с взломом перед первым параметром сходит с ума. Не существует возможного значения, при котором все четыре строки не прерываются перед первым параметром вызова (для 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
* 1018Call * * 1019 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");
Вот полный файл в формате .clang:
---
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
...