Halide 22.0.0 Halide compiler and libraries

Random.h
Go to the documentation of this file.
1#ifndef HALIDE_RANDOM_H
2#define HALIDE_RANDOM_H
3
4/** \file
5 *
6 * Defines deterministic random functions, and methods to redirect
7 * front-end calls to random_float and random_int to use them. */
8
9#include <vector>
10
11#include "Expr.h"
12#include "Func.h"
13
14namespace Halide {
15namespace Internal {
16
17/** Return a random floating-point number between zero and one that
18 * varies deterministically based on the input expressions. */
19 Expr random_float(const std::vector<Expr> &);
20
21/** Return a random unsigned integer between zero and 2^32-1 that
22 * varies deterministically based on the input expressions (which must
23 * be integers or unsigned integers). */
24 Expr random_int(const std::vector<Expr> &);
25
26/** Convert calls to random() to IR generated by random_float and
27 * random_int. Tags all calls with the variables in free_vars, and the
28 * integer given as the last argument. */
29 Expr lower_random(const Expr &e, const std::vector<VarOrRVar> &free_vars, int tag);
30
31} // namespace Internal
32} // namespace Halide
33
34#endif
Expr.h
Base classes for Halide expressions (Halide::Expr) and statements (Halide::Internal::Stmt)
Func.h
Defines Func - the front-end handle on a halide function, and related classes.
Halide::Internal::random_float
Expr random_float(const std::vector< Expr > &)
Return a random floating-point number between zero and one that varies deterministically based on the...
Halide::Internal::random_int
Expr random_int(const std::vector< Expr > &)
Return a random unsigned integer between zero and 2^32-1 that varies deterministically based on the i...
Halide::Internal::lower_random
Expr lower_random(const Expr &e, const std::vector< VarOrRVar > &free_vars, int tag)
Convert calls to random() to IR generated by random_float and random_int.
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