Repository navigation
Clang and icpx: TaylorState compiles, no warnings - #11
Merged
Merged
Conversation
`OffSurfaceOp op_grad(helm.FxdU(), comm), op_potn(helm.FxU(), comm);` declared two objects whose class template arguments are deduced from different kernels, as different types. C++17 requires one deduced type for all the objects of a declaration: Clang 18, 19 and icpx 2025 reject it, so test/bie-solvers and doc/examples/taylor-state-shell did not compile with them. GCC accepts it. With one declaration for each object both files compile with Clang 18, 19 and icpx 2025. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…th Clang and icpx With -Wall -Wfloat-conversion, Clang 19 and icpx 2025 gave 54 warnings for the tests and examples, GCC none: - SingularCorrection::SetupTarget: interp captures INTERP_ORDER and NV, which are compile-time constants for IORD = 16 and run-time values, that need the capture, for IORD = 0. SCTL_UNUSED marks the captures as used, and the body still reads the compile-time constants. An init-capture (INTERP_ORDER = INTERP_ORDER) also silences the warning, but makes them run-time values in the body: GCC 13.3 and Clang 19 then generate different code for the interpolation. - TaylorState::ComputeHelper: print_imag_norm uses real_imag_part only with BIEST_VERBOSE. - test/bie-solvers, test/boundary-integ-op, test/vacuum-field: captures of constants and of a variable that is not used are removed, and a double used as a condition is compared with 0. The tests and examples compile without warnings with GCC 11.5, 13.3, 14.2, Clang 18, 19 and icpx 2025, and so do virtual-casing and the fbtools bindings with this BIEST. With the source line numbers made equal, the examples compile (-O2) to the same object files as at 95dafcf: all 7 with GCC 13.3, and with Clang 19 and icpx 2025 the 6 that compile at 95dafcf. The tests pass with GCC 13.3, with output identical to that of 95dafcf. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
BIEST compiles as C++17 with Clang and Intel icpx, without warnings. Before, Clang 18, 19 and icpx 2025 rejected the
TaylorStatecode, and gave 54 warnings with-Wall -Wfloat-conversionfor the tests and examples. GCC accepted the code and gave no warnings.Changes
TaylorState::ComputeFarField: one declaration for eachOffSurfaceOp(9212ded).OffSurfaceOp op_grad(helm.FxdU(), comm), op_potn(helm.FxU(), comm);declared two objects whose class template arguments are deduced as different types, which C++17 does not allow in one declaration.test/bie-solversanddoc/examples/taylor-state-shelldid not compile with Clang or icpx.SingularCorrection::SetupTarget:interpcapturesINTERP_ORDERandNV, which are compile-time constants forIORD = 16and run-time values, which need the capture, forIORD = 0.SCTL_UNUSEDmarks the captures as used, and the body still reads the compile-time constants. An init-capture (INTERP_ORDER = INTERP_ORDER) also silences the warning, but GCC 13.3 and Clang 19 then generate different code for the interpolation.TaylorState::ComputeHelper:print_imag_normusesreal_imag_partonly withBIEST_VERBOSE;SCTL_UNUSED.doubleused as a condition is compared with 0.Tests
On a 128-core AMD Rome node of the Flatiron cluster:
-std=c++17 -Wall -Wfloat-conversionwithout warnings with GCC 11.5, 13.3, 14.2, Clang 18.1, 19.1 and icpx 2025.0. So do virtual-casing (its tests, library and Python module, with its own unused captures removed) and the fbtools bindings, with this BIEST.-O2) to the same object files as master: all 7 with GCC 13.3, and with Clang 19 and icpx 2025 the 6 that compile on master.-O3), with output identical to master's.-O3) compile without warnings and pass.🤖 Generated with Claude Code