Uni20
Asynchronous tensor and runtime library.
Loading...
Searching...
No Matches
Namespaces | Enumerations | Functions | Variables
scalar_precision.hpp File Reference

Runtime selection of configured Uni20 real scalar precisions. More...

#include "types.hpp"
#include <uni20/config.hpp>
#include <array>
#include <optional>
#include <span>
#include <stdexcept>
#include <string_view>
#include <utility>
Include dependency graph for scalar_precision.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Namespaces

namespace  uni20
 

Enumerations

enum class  uni20::ScalarPrecision { uni20::fp32 , uni20::fp64 , uni20::fp80 , uni20::fp128 }
 Runtime identifier for the real precision underlying a scalar type. More...
 

Functions

constexpr std::string_view uni20::configured_scalar_precision_choices ()
 Return a compact choice list suitable for command-line help.
 
constexpr std::span< ScalarPrecision const > uni20::configured_scalar_precisions ()
 Return the real scalar precisions configured in this build.
 
constexpr std::optional< ScalarPrecision > uni20::parse_scalar_precision (std::string_view name)
 Parse a canonical scalar precision name independently of build availability.
 
constexpr bool uni20::scalar_precision_is_available (ScalarPrecision precision)
 Report whether a runtime precision has a concrete scalar type in this build.
 
constexpr std::string_view uni20::scalar_precision_name (ScalarPrecision precision)
 Return the canonical command-line and diagnostic spelling of a precision.
 
template<class Function >
decltype(auto) uni20::visit_scalar_precision (ScalarPrecision precision, Function &&function)
 Invoke a templated callable with the concrete real scalar for a runtime precision.
 

Variables

constexpr bool uni20::has_float128 = UNI20_HAS_FLOAT128 != 0
 Whether this build provides a concrete uni20::float128 type.
 
constexpr bool uni20::has_float80 = UNI20_HAS_FLOAT80 != 0
 Whether this build provides native x87 extended precision as uni20::float80.
 

Detailed Description

Runtime selection of configured Uni20 real scalar precisions.