Halide
EmulateFloat16Math.h
Go to the documentation of this file.
1 #ifndef HALIDE_EMULATE_FLOAT16_MATH_H
2 #define HALIDE_EMULATE_FLOAT16_MATH_H
3 
4 /** \file
5  * Methods for dealing with float16 arithmetic using float32 math, by
6  * casting back and forth with bit tricks.
7  */
8 
9 #include "IR.h"
10 
11 namespace Halide {
12 namespace Internal {
13 
14 /** Check if a call is a float16 transcendental (e.g. sqrt_f16) */
15 bool is_float16_transcendental(const Call *);
16 
17 /** Implement a float16 transcendental using the float32 equivalent. */
19 
20 /** Cast to/from float and bfloat using bitwise math. */
21 //@{
22 Expr float32_to_bfloat16(Expr e);
23 Expr float32_to_float16(Expr e);
24 Expr float16_to_float32(Expr e);
25 Expr bfloat16_to_float32(Expr e);
26 Expr lower_float16_cast(const Cast *op);
27 //@}
28 
29 } // namespace Internal
30 } // namespace Halide
31 
32 #endif
Halide::Internal::float32_to_bfloat16
Expr float32_to_bfloat16(Expr e)
Cast to/from float and bfloat using bitwise math.
IR.h
Halide::Internal::lower_float16_cast
Expr lower_float16_cast(const Cast *op)
Halide
This file defines the class FunctionDAG, which is our representation of a Halide pipeline,...
Definition: AbstractGenerator.h:19
Halide::LinkageType::Internal
@ Internal
Not visible externally, similar to 'static' linkage in C.
Halide::Internal::lower_float16_transcendental_to_float32_equivalent
Expr lower_float16_transcendental_to_float32_equivalent(const Call *)
Implement a float16 transcendental using the float32 equivalent.
Halide::Internal::bfloat16_to_float32
Expr bfloat16_to_float32(Expr e)
Halide::Internal::float32_to_float16
Expr float32_to_float16(Expr e)
Halide::Internal::float16_to_float32
Expr float16_to_float32(Expr e)
Halide::Internal::is_float16_transcendental
bool is_float16_transcendental(const Call *)
Check if a call is a float16 transcendental (e.g.