Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
RFloat16.hxx File Reference
#include <cstdint>
#include <cstring>
Include dependency graph for RFloat16.hxx:
This graph shows which files directly or indirectly include this file:

Namespaces

namespace  ROOT
 tbb::task_arena is an alias of tbb::interface7::task_arena, which doesn't allow to forward declare tbb::task_arena without forward declaring tbb::interface7
 
namespace  ROOT::Experimental
 
namespace  ROOT::Experimental::Internal
 

Macros

#define HALF_ENABLE_F16C_INTRINSICS   __F16C__
 Conversion functions between full- and half-precision floats.
 

Functions

std::uint16_t ROOT::Experimental::Internal::FloatToHalf (float value)
 Convert an IEEE single-precision float to half-precision.
 
constexpr std::uint16_t ROOT::Experimental::Internal::GetOverflowedValue (std::uint16_t value=0)
 Get the half-precision overflow.
 
constexpr std::uint16_t ROOT::Experimental::Internal::GetRoundedValue (std::uint16_t value, int guardBit, int stickyBit)
 Round the given half-precision number to the nearest representable value.
 
float ROOT::Experimental::Internal::HalfToFloat (std::uint16_t value)
 Convert an IEEE half-precision float to single-precision.
 

Macro Definition Documentation

◆ HALF_ENABLE_F16C_INTRINSICS

#define HALF_ENABLE_F16C_INTRINSICS   __F16C__

Conversion functions between full- and half-precision floats.

The code used here is taken (with some modifications) from the half C++ library (https://half.sourceforge.net/index.html), distributed under the MIT license.

Original license:

The MIT License

Copyright (c) 2012-2021 Christian Rau

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. Enable F16C intruction set intrinsics. Defining this to 1 enables the use of F16C compiler intrinsics for converting between half-precision and single-precision values which may result in improved performance. This will not perform additional checks for support of the F16C instruction set, so an appropriate target platform is required when enabling this feature.

Unless predefined it will be enabled automatically when the __F16C__ symbol is defined, which some compilers do on supporting platforms.

Definition at line 55 of file RFloat16.hxx.