一呼百應, "one call, a hundred responses"
Loading...
Searching...
No Matches
ein::fp16 Struct Reference

#include <fp16.hpp>

Public Types

using underlying_type = _Float16
 

Public Member Functions

constexpr fp16 () noexcept=default
 
constexpr fp16 (fp16 const &) noexcept=default
 
constexpr fp16 (fp16 &&) noexcept=default
 
constexpr fp16 (float content) noexcept
 
constexpr fp16 (_Float16 content) noexcept
 
constexpr operator float (this fp16 self) noexcept
 
constexpr operator _Float16 (this fp16 self) noexcept
 
ein_reinitializes constexpr fp16operator= (fp16 const &) noexcept=default
 
ein_reinitializes constexpr fp16operator= (fp16 &&) noexcept=default
 
constexpr uint16_t to_bits (this fp16 self) noexcept
 

Static Public Member Functions

static constexpr fp16 from_bits (uint16_t data) noexcept
 

Public Attributes

_Float16 content
 

Friends

constexpr bool operator== (fp16 x, fp16 y) noexcept
 
constexpr bool operator!= (fp16 x, fp16 y) noexcept
 
constexpr std::partial_ordering operator<=> (fp16 x, fp16 y) noexcept
 
constexpr bool operator< (fp16 x, fp16 y) noexcept
 
constexpr bool operator<= (fp16 x, fp16 y) noexcept
 
constexpr bool operator> (fp16 x, fp16 y) noexcept
 
constexpr bool operator>= (fp16 x, fp16 y) noexcept
 
constexpr void swap (fp16 &x, fp16 &y) noexcept
 

Detailed Description

Definition at line 19 of file fp16.hpp.

Member Typedef Documentation

◆ underlying_type

using ein::fp16::underlying_type = _Float16

Definition at line 20 of file fp16.hpp.

Constructor & Destructor Documentation

◆ fp16() [1/5]

ein::fp16::fp16 ( )
constexprdefaultnoexcept[[always_inline]][[artificial]]

◆ fp16() [2/5]

ein::fp16::fp16 ( fp16 const & )
constexprdefaultnoexcept[[always_inline]][[artificial]][[noescape]]

◆ fp16() [3/5]

ein::fp16::fp16 ( fp16 && )
constexprdefaultnoexcept[[always_inline]][[artificial]][[noescape]]

◆ fp16() [4/5]

ein::fp16::fp16 ( float content)
inlineconstexprnoexcept[[always_inline]][[artificial]]

Definition at line 34 of file fp16.hpp.

34: content(content) {}
_Float16 content
Definition fp16.hpp:22

◆ fp16() [5/5]

ein::fp16::fp16 ( _Float16 content)
inlineconstexprnoexcept[[always_inline]][[artificial]]

Definition at line 37 of file fp16.hpp.

37: content(content) {}

Member Function Documentation

◆ from_bits()

static constexpr fp16 ein::fp16::from_bits ( uint16_t data)
inlinestaticconstexprnoexcept[[always_inline]][[artificial]][[const]]

◆ operator _Float16()

ein::fp16::operator _Float16 ( this fp16 self)
inlineconstexprnoexcept[[nodiscard]][[always_inline]][[artificial]]

Definition at line 43 of file fp16.hpp.

43{ return self.content; }

◆ operator float()

ein::fp16::operator float ( this fp16 self)
inlineconstexprnoexcept[[nodiscard]][[always_inline]][[artificial]]

Definition at line 40 of file fp16.hpp.

40{ return self.content; }

◆ operator=() [1/2]

ein_reinitializes constexpr fp16 & ein::fp16::operator= ( fp16 && )
constexprdefaultnoexcept[[always_inline]][[artificial]][[noescape]][[lifetimebound]]

◆ operator=() [2/2]

ein_reinitializes constexpr fp16 & ein::fp16::operator= ( fp16 const & )
constexprdefaultnoexcept[[always_inline]][[artificial]][[noescape]][[lifetimebound]]

◆ to_bits()

uint16_t ein::fp16::to_bits ( this fp16 self)
inlineconstexprnoexcept[[nodiscard]][[always_inline]][[const]]

Definition at line 102 of file fp16.hpp.

102 {
103 return std::bit_cast<uint16_t>(self.content);
104 }

Friends And Related Symbol Documentation

◆ operator!=

bool operator!= ( fp16 x,
fp16 y )
friend[[nodiscard]][[always_inline]][[artificial]][[const]]

Definition at line 59 of file fp16.hpp.

59 {
60 return x.content != y.content;
61 }

◆ operator<

bool operator< ( fp16 x,
fp16 y )
friend[[nodiscard]][[always_inline]][[artificial]][[const]]

Definition at line 69 of file fp16.hpp.

69 {
70 return x.content < y.content;
71 }

◆ operator<=

bool operator<= ( fp16 x,
fp16 y )
friend[[nodiscard]][[always_inline]][[artificial]][[const]]

Definition at line 74 of file fp16.hpp.

74 {
75 return x.content <= y.content;
76 }

◆ operator<=>

std::partial_ordering operator<=> ( fp16 x,
fp16 y )
friend[[nodiscard]][[always_inline]][[artificial]][[const]]

Definition at line 64 of file fp16.hpp.

64 {
65 return x.content <=> y.content;
66 }

◆ operator==

bool operator== ( fp16 x,
fp16 y )
friend[[nodiscard]][[always_inline]][[artificial]][[const]]

Definition at line 54 of file fp16.hpp.

54 {
55 return x.content == y.content;
56 }

◆ operator>

bool operator> ( fp16 x,
fp16 y )
friend[[nodiscard]][[always_inline]][[artificial]][[const]]

Definition at line 78 of file fp16.hpp.

78 {
79 return x.content > y.content;
80 }

◆ operator>=

bool operator>= ( fp16 x,
fp16 y )
friend[[nodiscard]][[always_inline]][[artificial]][[const]]

Definition at line 83 of file fp16.hpp.

83 {
84 return x.content >= y.content;
85 }

◆ swap

void swap ( fp16 & x,
fp16 & y )
friend[[always_inline]][[artificial]][[noescape]]

Definition at line 88 of file fp16.hpp.

91 {
92 using std::swap;
93 swap(x.content,y.content);
94 }
friend constexpr void swap(fp16 &x, fp16 &y) noexcept
Definition fp16.hpp:88

Member Data Documentation

◆ content

_Float16 ein::fp16::content

Definition at line 22 of file fp16.hpp.


The documentation for this struct was generated from the following file: