Go to the documentation of this file.
22 namespace Autoscheduler {
27 using std::unique_ptr;
30 struct Adams2019Params;
106 return !((*this) <= x);
113 return !((*this) < x);
128 vector<vector<OptionalRational>> coeffs;
133 : coeffs(matrix), c(c) {
137 return coeffs.size();
141 if (coeffs.empty() || coeffs[0].empty()) {
146 return coeffs[0].size();
150 if (coeffs.empty()) {
155 const auto &p = coeffs[producer_storage_dim];
161 return p[consumer_loop_dim];
174 if (other.coeffs.size() != coeffs.size()) {
177 for (
size_t i = 0; i < coeffs.size(); i++) {
178 if (other.coeffs[i].size() != coeffs[i].size()) {
181 for (
size_t j = 0; j < coeffs[i].size(); j++) {
182 if (!(other.coeffs[i][j] == coeffs[i][j])) {
194 vector<vector<OptionalRational>> matrix;
202 matrix[i][j] += (*this)(i, k) * other(k, j);
210 void dump(std::ostream &os,
const char *prefix)
const;
229 bool constant_extent_;
239 return max_ - min_ + 1;
242 return constant_extent_;
261 : min_(a), max_(b), constant_extent_(c) {
266 return Span(INT64_MAX, INT64_MIN,
true);
326 mutable std::vector<BoundContents *> pool;
329 mutable std::vector<void *> blocks;
331 mutable size_t num_live = 0;
333 void allocate_some_more()
const;
485 :
stage(std::move(s)) {
542 vector<pair<BoundInfo, BoundInfo>>
bounds;
570 void dump(std::ostream &os)
const;
588 #endif // FUNCTION_DAG_H
LoadJacobian(vector< vector< OptionalRational >> &&matrix, int64_t c=1)
bool operator>(int x) const
#define internal_assert(c)
A Halide variable, to be used when defining functions.
bool region_computed_all_common_cases
vector< bool > dependencies
PipelineFeatures features
BoundContents * make_copy() const
Expr min(const FuncRef &a, const FuncRef &b)
Explicit overloads of min and max for FuncRef.
vector< Edge * > outgoing_edges
void operator+=(const OptionalRational &other)
size_t consumer_loop_dims() const
void loop_nest_for_region(int stage_idx, const Span *computed, Span *loop) const
bool equals_union_of_required_with_constants
Span & region_computed(int i)
BoundContents * make() const
FunctionDAG(const vector< Function > &outputs, const Target &target)
FunctionDAG::Node * producer
Intrusive shared pointers have a reference count (a RefCount object) stored in the class itself.
void translate(int64_t x)
int64_t gcd(int64_t, int64_t)
The greatest common divisor of two integers.
This file defines the class FunctionDAG, which is our representation of a Halide pipeline,...
FunctionDAG & operator=(const FunctionDAG &other)=delete
bool operator<=(int x) const
@ Internal
Not visible externally, similar to 'static' linkage in C.
OptionalRational operator()(int producer_storage_dim, int consumer_loop_dim) const
Span & region_required(int i)
void operator=(const Layout &)=delete
size_t producer_storage_dims() const
BoundContents * make_bound() const
bool operator>=(int x) const
OptionalRational(bool e, int64_t n, int64_t d)
LoadJacobian operator*(const LoadJacobian &other) const
signed __INT64_TYPE__ int64_t
FunctionDAG::Node::Stage * consumer
void expand_footprint(const Span *consumer_loop, Span *producer_required) const
const Span & region_computed(int i) const
vector< Span > estimated_region_required
bool operator==(const OptionalRational &other) const
BoundInfo(const Expr &e, const Node::Stage &consumer, bool dependent)
A class to represent ranges of Exprs.
bool equals_region_computed
void add_load_jacobian(LoadJacobian j1)
bool constant_extent() const
vector< pair< BoundInfo, BoundInfo > > bounds
A reference-counted handle to Halide's internal representation of a function.
OptionalRational operator*(const OptionalRational &other) const
int64_t lcm(int64_t, int64_t)
The least common multiple of two integers.
bool loop_nest_all_common_cases
Span(int64_t a, int64_t b, bool c)
std::unique_ptr< BoundContents::Layout > bounds_memory_layout
void * memcpy(void *s1, const void *s2, size_t n)
vector< Edge * > incoming_edges
bool is_boundary_condition
bool operator<(int x) const
A class representing a reference count to be used with IntrusivePtr.
A fragment of Halide syntax.
vector< RegionComputedInfo > region_computed
const Span & region_required(int i) const
vector< LoadJacobian > load_jacobians
vector< SymbolicInterval > region_required
Span & loops(int i, int j)
void required_to_computed(const Span *required, Span *computed) const
void set_extent(int64_t e)
std::vector< int > loop_offset
Expr max(const FuncRef &a, const FuncRef &b)
A single definition of a Func.
bool merge(const LoadJacobian &other)
bool operator==(int x) const
void union_with(const Span &other)
A struct representing a target machine and os to generate code for.
OptionalRational()=default
bool downstream_of(const Node &n) const
const Span & loops(int i, int j) const
void release(const BoundContents *b) const
void dump(std::ostream &os, const char *prefix) const