cutlass::half_t Struct Reference

IEEE half-precision floating-point type.

`#include <half.h>`

## Public Member Functions

CUTLASS_HOST_DEVICE | half_t ()
| Default constructor. More...
CUTLASS_HOST_DEVICE | half_t (half const &x)
| Reinterpret cast from CUDA's half type. More...
CUTLASS_HOST_DEVICE | half_t (float x)
| Floating point conversion. More...
CUTLASS_HOST_DEVICE | half_t (double x)
| Floating point conversion. More...
CUTLASS_HOST_DEVICE | half_t (int x)
| Integer conversion - round to nearest even. More...
CUTLASS_HOST_DEVICE | half_t (unsigned x)
| Integer conversion - round toward zero. More...
CUTLASS_HOST_DEVICE half_t & | operator= (half const &x)
| Assignment. More...
CUTLASS_HOST_DEVICE | operator float () const
| Converts to float. More...
CUTLASS_HOST_DEVICE | operator double () const
| Converts to float. More...
CUTLASS_HOST_DEVICE | operator int () const
| Converts to float. More...
CUTLASS_HOST_DEVICE | operator bool () const
| Casts to bool. More...
CUTLASS_HOST_DEVICE half | to_half () const
| Bitcasts to CUDA's half type. More...
CUTLASS_HOST_DEVICE uint16_t & | raw ()
| Accesses raw internal state. More...
CUTLASS_HOST_DEVICE uint16_t | raw () const
| Accesses raw internal state. More...
CUTLASS_HOST_DEVICE bool | signbit () const
| Returns the sign bit. More...
CUTLASS_HOST_DEVICE int | exponent_biased () const
| Returns the biased exponent. More...
CUTLASS_HOST_DEVICE int | exponent () const
| Returns the unbiased exponent. More...
CUTLASS_HOST_DEVICE int | mantissa () const
| Returns the mantissa. More...

## Static Public Member Functions

static CUTLASS_HOST_DEVICE half_t | bitcast (uint16_t x)
| Constructs from an unsigned short. More...
static CUTLASS_HOST_DEVICE half_t | convert (float const &flt)
| FP32 -> FP16 conversion - rounds to nearest even. More...
static CUTLASS_HOST_DEVICE half_t | convert (int const &n)
| FP32 -> FP16 conversion - rounds to nearest even. More...
static CUTLASS_HOST_DEVICE half_t | convert (unsigned const &n)
| FP32 -> FP16 conversion - rounds to nearest even. More...
static CUTLASS_HOST_DEVICE float | convert (half_t const &x)
| Converts a half-precision value stored as a uint16_t to a float. More...

## Public Attributes

uint16_t | storage
| Storage type. More...

## Constructor & Destructor Documentation

CUTLASS_HOST_DEVICE cutlass::half_t::half_t | ( |  | ) |

inline

CUTLASS_HOST_DEVICE cutlass::half_t::half_t | ( | half const & | x | ) |

inlineexplicit

CUTLASS_HOST_DEVICE cutlass::half_t::half_t | ( | float | x | ) |

inlineexplicit

CUTLASS_HOST_DEVICE cutlass::half_t::half_t | ( | double | x | ) |

inlineexplicit

CUTLASS_HOST_DEVICE cutlass::half_t::half_t | ( | int | x | ) |

inlineexplicit

CUTLASS_HOST_DEVICE cutlass::half_t::half_t | ( | unsigned | x | ) |

inlineexplicit

## Member Function Documentation

static CUTLASS_HOST_DEVICE half_t cutlass::half_t::bitcast | ( | uint16_t | x | ) |

inlinestatic

static CUTLASS_HOST_DEVICE half_t cutlass::half_t::convert | ( | float const & | flt | ) |

inlinestatic

static CUTLASS_HOST_DEVICE half_t cutlass::half_t::convert | ( | int const & | n | ) |

inlinestatic

static CUTLASS_HOST_DEVICE half_t cutlass::half_t::convert | ( | unsigned const & | n | ) |

inlinestatic

static CUTLASS_HOST_DEVICE float cutlass::half_t::convert | ( | half_t const & | x | ) |

inlinestatic

CUTLASS_HOST_DEVICE int cutlass::half_t::exponent | ( |  | ) | const

inline

CUTLASS_HOST_DEVICE int cutlass::half_t::exponent_biased | ( |  | ) | const

inline

CUTLASS_HOST_DEVICE int cutlass::half_t::mantissa | ( |  | ) | const

inline

CUTLASS_HOST_DEVICE cutlass::half_t::operator bool | ( |  | ) | const

inline

CUTLASS_HOST_DEVICE cutlass::half_t::operator double | ( |  | ) | const

inline

CUTLASS_HOST_DEVICE cutlass::half_t::operator float | ( |  | ) | const

inline

CUTLASS_HOST_DEVICE cutlass::half_t::operator int | ( |  | ) | const

inlineexplicit

CUTLASS_HOST_DEVICE half_t& cutlass::half_t::operator= | ( | half const & | x | ) |

inline

CUTLASS_HOST_DEVICE uint16_t& cutlass::half_t::raw | ( |  | ) |

inline

CUTLASS_HOST_DEVICE uint16_t cutlass::half_t::raw | ( |  | ) | const

inline

CUTLASS_HOST_DEVICE bool cutlass::half_t::signbit | ( |  | ) | const

inline

CUTLASS_HOST_DEVICE half cutlass::half_t::to_half | ( |  | ) | const

inline

## Member Data Documentation

uint16_t cutlass::half_t::storage

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

- half.h