Halide 19.0.0
Halide compiler and libraries
Loading...
Searching...
No Matches
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. */
19Expr 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). */
24Expr 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. */
29Expr lower_random(const Expr &e, const std::vector<VarOrRVar> &free_vars, int tag);
30
31} // namespace Internal
32} // namespace Halide
33
34#endif
Base classes for Halide expressions (Halide::Expr) and statements (Halide::Internal::Stmt)
Defines Func - the front-end handle on a halide function, and related classes.
Expr random_float(const std::vector< Expr > &)
Return a random floating-point number between zero and one that varies deterministically based on the...
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...
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.
This file defines the class FunctionDAG, which is our representation of a Halide pipeline,...
@ Internal
Not visible externally, similar to 'static' linkage in C.
A fragment of Halide syntax.
Definition Expr.h:258