Halide 21.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
11namespace Halide {
12
13struct Target;
14struct Expr;
15
16namespace Internal {
17
18class Function;
19struct 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. */
24
25/** Replace a strict float intrinsic with its non-strict equivalent. Non-recursive. */
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). */
34bool strictify_float(std::map<std::string, Function> &env, const Target &t);
35
36} // namespace Internal
37} // namespace Halide
38
39#endif
A reference-counted handle to Halide's internal representation of a function.
Definition Function.h:39
Expr unstrictify_float(const Call *op)
Replace a strict float intrinsic with its non-strict equivalent.
Expr strictify_float(const Expr &e)
Replace all rounding floating point ops and floating point ops that need to handle nan and inf differ...
This file defines the class FunctionDAG, which is our representation of a Halide pipeline,...
A fragment of Halide syntax.
Definition Expr.h:258
A function call.
Definition IR.h:490
A struct representing a target machine and os to generate code for.
Definition Target.h:19