20template<
typename T,
int Dims>
35 const auto &d = _domain.
domain();
43 : _name(
Internal::unique_name(
'r')) {
47 explicit RVar(
const std::string &n)
54 : _domain(std::move(
domain)), _index(index) {
70 const std::string &
name()
const;
196 void init_vars(
const std::string &name);
198 void validate_min_extent(
const Expr &min,
const Expr &extent);
199 void initialize_from_region(
const Region ®ion, std::string name =
"");
201 template<
typename... Args>
203 validate_min_extent(min, extent);
204 region.emplace_back(min, extent);
205 initialize_from_region(region, std::forward<Args>(args)...);
216 initialize_from_region(region, std::move(name));
219 template<
typename... Args>
224 initialize_from_region(region, min, extent, std::forward<Args>(args)...);
234 template<
typename T,
int Dims>
#define internal_assert(c)
Base classes for Halide expressions (Halide::Expr) and statements (Halide::Internal::Stmt)
Defines internal classes related to Reduction Domains.
Various utility functions used internally Halide.
#define HALIDE_NO_USER_CODE_INLINE
A Halide::Buffer is a named shared reference to a Halide::Runtime::Buffer.
A reference-counted handle on a reduction domain, which is just a vector of ReductionVariable.
bool defined() const
Is this handle non-nullptr.
const std::vector< ReductionVariable > & domain() const
Immutable access to the reduction variables.
bool same_as(const ReductionDomain &other) const
Tests for equality of reference.
A handle on the output buffer of a pipeline.
A multi-dimensional domain over which to iterate.
bool same_as(const RDom &other) const
Compare two reduction domains for equality of reference.
bool defined() const
Check if this reduction domain is non-null.
int dimensions() const
Get the dimensionality of a reduction domain.
RDom(const Internal::ReductionDomain &d)
Construct a reduction domain that wraps an Internal ReductionDomain object.
RDom()=default
Construct an undefined reduction domain.
HALIDE_NO_USER_CODE_INLINE RDom(const Region ®ion, std::string name="")
Construct a multi-dimensional reduction domain with the given name.
RVar x
Direct access to the first four dimensions of the reduction domain.
void where(Expr predicate)
Add a predicate to the RDom.
RDom(const Buffer< void, -1 > &)
Construct a reduction domain that iterates over all points in a given Buffer or ImageParam.
RVar operator[](int) const
Get at one of the dimensions of the reduction domain.
RDom(const OutputImageParam &)
HALIDE_NO_USER_CODE_INLINE RDom(Expr min, Expr extent, Args &&...args)
HALIDE_NO_USER_CODE_INLINE RDom(const Buffer< T, Dims > &im)
Internal::ReductionDomain domain() const
Get at the internal reduction domain object that this wraps.
A reduction variable represents a single dimension of a reduction domain (RDom).
RVar(Internal::ReductionDomain domain, int index)
Construct a reduction variable with the given name and bounds.
const std::string & name() const
The name of this reduction variable.
RVar()
An empty reduction variable.
Internal::ReductionDomain domain() const
The reduction domain this is associated with.
RVar(const std::string &n)
Construct an RVar with the given name.
Expr extent() const
The number that this variable will take on.
Expr min() const
The minimum value that this variable will take on.
This file defines the class FunctionDAG, which is our representation of a Halide pipeline,...
@ Internal
Not visible externally, similar to 'static' linkage in C.
std::ostream & operator<<(std::ostream &stream, const Expr &)
Emit an expression on an output stream (such as std::cout) in human-readable form.
std::vector< Range > Region
A multi-dimensional box.
A fragment of Halide syntax.
A single named dimension of a reduction domain.