Orrery
A GPU-accelerated N-body gravitational simulator
Loading...
Searching...
No Matches
build_info.hpp File Reference

What the running binary was built from and built for. More...

#include <string_view>

Go to the source code of this file.

Functions

std::string_view orrery::core::version () noexcept
 The project version, as declared in the top-level CMakeLists.txt.
bool orrery::core::uses_single_precision () noexcept
 True when the build was configured with ORRERY_SINGLE_PRECISION, and the scalar type is therefore float rather than double.

Detailed Description

What the running binary was built from and built for.

Two facts about a build have to be recoverable from the binary itself rather than from the command that produced it. The first is the version, because a result filed against the wrong revision is worse than an unlabelled one. The second is the scalar precision, because from Phase 2 onwards a single-precision build and a double-precision build of the same source disagree about accuracy and about how much memory bandwidth every kernel consumes, and Phase 7 reports measurements against the build that produced them.

These are functions rather than compile-time constants deliberately. A header-only answer would be baked into each translation unit that asks, which is exactly the arrangement that lets a library and its consumer disagree without anyone noticing.