Skip to content

Commit

Permalink
Merge pull request mockingbirdnest#3944 from eggrobin/clang-fma-preve…
Browse files Browse the repository at this point in the history
…nter

Try to fix the clang build
  • Loading branch information
eggrobin authored Mar 30, 2024
2 parents 0ac0911 + 87ab5a6 commit 6647809
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 2 additions & 0 deletions ksp_plugin_test/plugin_compatibility_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,8 @@ TEST_P(PluginCompatibilityTest, Reach) {
std::optional<FMAPreventer> fma_preventer;
if (!GetParam()) {
fma_preventer.emplace();
} else if (!UseHardwareFMA) {
GTEST_SKIP() << "FMA not used by default";
}
StringLogSink log_warning(google::WARNING);
not_null<std::unique_ptr<Plugin const>> plugin = ReadPluginFromFile(
Expand Down
5 changes: 4 additions & 1 deletion numerics/fma.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,10 @@ inline bool const& UseHardwareFMA = FMAPreventer::use_hardware_fma;
// The functions in this file unconditionally wrap the appropriate intrinsics.
// The caller may only use them if |UseHardwareFMA| is true.
inline bool const UseHardwareFMA = PRINCIPIA_USE_HARDWARE_FMA_DEFAULT;
class FMAPreventer; // Undefined.
struct TrivialFMAPreventer {};
using FMAPreventer = std::conditional_t<CanEmitFMAInstructions,
struct UndefinedFMAPreventer,
TrivialFMAPreventer>;
#endif

#undef PRINCIPIA_USE_HARDWARE_FMA_DEFAULT
Expand Down

0 comments on commit 6647809

Please sign in to comment.