Halide 22.0.0 Halide compiler and libraries

Loading...
Searching...
No Matches
StrictifyFloat.h
Go to the documentation of this file.
1#ifndef HALIDE_STRICTIFY_FLOAT_H
2#define HALIDE_STRICTIFY_FLOAT_H
3
4/** \file
5 * Defines a lowering pass to make all floating-point strict for all top-level Exprs.
6 */
7
8#include <map>
9#include <string>
10
11 namespace Halide {
12
13 struct Target;
14 struct Expr;
15
16 namespace Internal {
17
18 class Function;
19 struct Call;
20
21/** Replace all rounding floating point ops and floating point ops that need to
22 * handle nan and inf differently with strict float intrinsics. */
23 Expr strictify_float(const Expr &e);
24
25/** Replace a strict float intrinsic with its non-strict equivalent. Non-recursive. */
26 Expr unstrictify_float(const Call *op);
27
28/** If the StrictFloat target feature is set, replace add, sub, mul, div, etc
29 * operations with strict float intrinsics for all Funcs in the environment. If
30 * StrictFloat is not set does nothing. Returns whether or not there's any usage
31 * of strict float intrinsics or if the target flag is set (i.e. returns whether
32 * or not the rest of lowering and codegen needs to worry about floating point
33 * strictness). */
34 bool strictify_float(std::map<std::string, Function> &env, const Target &t);
35
36} // namespace Internal
37} // namespace Halide
38
39#endif
Halide::Internal::ArgInfoKind::Function
@ Function
Halide::Internal::unstrictify_float
Expr unstrictify_float(const Call *op)
Replace a strict float intrinsic with its non-strict equivalent.
Halide::Internal::strictify_float
Expr strictify_float(const Expr &e)
Replace all rounding floating point ops and floating point ops that need to handle nan and inf differ...
Halide::Internal::IRNodeType::Call
@ Call
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::Expr
A fragment of Halide syntax.
Definition Expr.h:258
Halide::Internal::Call
A function call.
Definition IR.h:500
Halide::Target
A struct representing a target machine and os to generate code for.
Definition Target.h:19