22 namespace Autoscheduler {
27 using std::unique_ptr;
104 return !((*this) <= x);
111 return !((*this) < x);
126 vector<vector<OptionalRational>> coeffs;
131 : coeffs(matrix), c(c) {
135 return coeffs.size();
139 if (coeffs.empty() || coeffs[0].empty()) {
144 return coeffs[0].size();
148 if (coeffs.empty()) {
153 const auto &p = coeffs[producer_storage_dim];
159 return p[consumer_loop_dim];
172 if (other.coeffs.size() != coeffs.size()) {
175 for (
size_t i = 0; i < coeffs.size(); i++) {
176 if (other.coeffs[i].size() != coeffs[i].size()) {
179 for (
size_t j = 0; j < coeffs[i].size(); j++) {
180 if (!(other.coeffs[i][j] == coeffs[i][j])) {
192 vector<vector<OptionalRational>> matrix;
200 matrix[i][j] += (*this)(i, k) * other(k, j);
208 void dump(
const char *prefix)
const;
227 bool constant_extent_;
237 return max_ - min_ + 1;
240 return constant_extent_;
259 : min_(a), max_(b), constant_extent_(c) {
264 return Span(INT64_MAX, INT64_MIN,
true);
324 mutable std::vector<BoundContents *> pool;
327 mutable std::vector<void *> blocks;
329 mutable size_t num_live = 0;
331 void allocate_some_more()
const;
482 :
stage(std::move(s)) {
539 vector<pair<BoundInfo, BoundInfo>>
bounds;
568 std::ostream &
dump(std::ostream &os)
const;
574 template<
typename OS>
575 void dump_internal(OS &os)
const;
#define internal_assert(c)
void release(const BoundContents *b) const
BoundContents * make() const
void operator=(Layout &&)=delete
std::vector< int > loop_offset
Layout(const Layout &)=delete
void operator=(const Layout &)=delete
OptionalRational operator()(int producer_storage_dim, int consumer_loop_dim) const
LoadJacobian operator*(const LoadJacobian &other) const
LoadJacobian(vector< vector< OptionalRational >> &&matrix, int64_t c=1)
size_t consumer_loop_dims() const
bool merge(const LoadJacobian &other)
void dump(const char *prefix) const
size_t producer_storage_dims() const
bool constant_extent() const
void set_extent(int64_t e)
Span(int64_t a, int64_t b, bool c)
void translate(int64_t x)
Span(const Span &other)=default
void union_with(const Span &other)
A reference-counted handle to Halide's internal representation of a function.
A class representing a reference count to be used with IntrusivePtr.
A single definition of a Func.
A Halide variable, to be used when defining functions.
int64_t gcd(int64_t, int64_t)
The greatest common divisor of two integers.
int64_t lcm(int64_t, int64_t)
The least common multiple of two integers.
This file defines the class FunctionDAG, which is our representation of a Halide pipeline,...
@ Internal
Not visible externally, similar to 'static' linkage in C.
Expr min(const FuncRef &a, const FuncRef &b)
Explicit overloads of min and max for FuncRef.
Expr max(const FuncRef &a, const FuncRef &b)
signed __INT64_TYPE__ int64_t
void * memcpy(void *s1, const void *s2, size_t n)
A fragment of Halide syntax.
Span & region_computed(int i)
Span & loops(int i, int j)
const Span & loops(int i, int j) const
Span & region_required(int i)
BoundContents * make_copy() const
const Span & region_computed(int i) const
const Span & region_required(int i) const
BoundInfo(const Expr &e, const Node::Stage &consumer)
FunctionDAG::Node::Stage * consumer
void expand_footprint(const Span *consumer_loop, Span *producer_required) const
void add_load_jacobian(LoadJacobian j1)
FunctionDAG::Node * producer
vector< LoadJacobian > load_jacobians
vector< pair< BoundInfo, BoundInfo > > bounds
bool equals_region_computed
bool equals_union_of_required_with_constants
PipelineFeatures features
bool loop_nest_all_common_cases
bool downstream_of(const Node &n) const
vector< Edge * > incoming_edges
vector< bool > dependencies
std::unique_ptr< BoundContents::Layout > bounds_memory_layout
vector< SymbolicInterval > region_required
void loop_nest_for_region(int stage_idx, const Span *computed, Span *loop) const
vector< Span > estimated_region_required
vector< Edge * > outgoing_edges
BoundContents * make_bound() const
vector< RegionComputedInfo > region_computed
bool is_boundary_condition
bool region_computed_all_common_cases
void required_to_computed(const Span *required, Span *computed) const
FunctionDAG & operator=(FunctionDAG &&other)=delete
FunctionDAG & operator=(const FunctionDAG &other)=delete
std::ostream & dump(std::ostream &os) const
FunctionDAG(const vector< Function > &outputs, const MachineParams ¶ms, const Target &target)
FunctionDAG(FunctionDAG &&other)=delete
FunctionDAG(const FunctionDAG &other)=delete
void operator+=(const OptionalRational &other)
bool operator>=(int x) const
OptionalRational(bool e, int64_t n, int64_t d)
bool operator==(const OptionalRational &other) const
bool operator>(int x) const
OptionalRational()=default
OptionalRational operator*(const OptionalRational &other) const
bool operator==(int x) const
bool operator<(int x) const
bool operator<=(int x) const
A class to represent ranges of Exprs.
Intrusive shared pointers have a reference count (a RefCount object) stored in the class itself.
A struct representing the machine parameters to generate the auto-scheduled code for.
A struct representing a target machine and os to generate code for.