22namespace Autoscheduler {
113 return !((*this) <= x);
120 return !((*this) < x);
135 std::vector<OptionalRational> coeffs;
144 coeffs.resize(rows * cols);
148 for (
const auto &coeff : coeffs) {
149 if (!coeff.exists()) {
169 for (
const auto &c : coeffs) {
170 if (!c.exists() || !(c == 0)) {
183 return coeffs[producer_storage_dim * cols + consumer_loop_dim];
187 return coeffs[producer_storage_dim * cols + consumer_loop_dim];
200 if (other.rows != rows || other.cols != cols) {
203 for (
size_t i = 0; i < rows * cols; i++) {
204 if (!(other.coeffs[i] == coeffs[i])) {
217 result(i, j) = (*this)(i, j) * factors[j];
231 result(i, j) += (*this)(i, k) * other(k, j);
238 void dump(
const char *prefix)
const;
257 bool constant_extent_;
267 return max_ - min_ + 1;
270 return constant_extent_;
274 min_ = std::min(min_, other.
min());
275 max_ = std::max(max_, other.
max());
291 constant_extent_(c) {
296 return Span(INT64_MAX, INT64_MIN,
true);
356 mutable std::vector<BoundContents *> pool;
359 mutable std::vector<void *> blocks;
361 mutable size_t num_live = 0;
363 void allocate_some_more()
const;
516 :
stage(std::move(s)) {
521 for (
const auto &l :
loop) {
586 vector<pair<BoundInfo, BoundInfo>>
bounds;
624 std::ostream &
dump(std::ostream &os)
const;
634 template<
typename OS>
635 void dump_internal(OS &os)
const;
void release(const BoundContents *b) const
void operator=(Layout &&)=delete
Layout(const Layout &)=delete
std::vector< int > loop_offset
BoundContents * make() const
void operator=(const Layout &)=delete
int visit(const VectorReduce *op)
int visit(const StringImm *op)
int visit_binary(const Expr &a, const Expr &b)
ExprBranching(const NodeMap< int64_t > &inlined)
int visit(const IntImm *op)
int visit(const Select *op)
int visit(const Shuffle *op)
int visit(const Load *op)
int visit(const Cast *op)
int visit(const Broadcast *op)
int visit(const Reinterpret *op)
int visit(const Call *op)
int visit(const UIntImm *op)
int visit(const Ramp *op)
int visit_nary(const std::vector< Expr > &exprs)
int visit(const Variable *op)
int compute(const Function &f)
int visit(const FloatImm *op)
OptionalRational operator()(int producer_storage_dim, int consumer_loop_dim) const
LoadJacobian operator*(const LoadJacobian &other) const
size_t consumer_loop_dims() const
LoadJacobian(size_t producer_storage_dims, size_t consumer_loop_dims, int64_t count)
OptionalRational & operator()(int producer_storage_dim, int consumer_loop_dim)
bool merge(const LoadJacobian &other)
void dump(const char *prefix) const
size_t producer_storage_dims() const
bool all_coeffs_exist() const
LoadJacobian operator*(const std::vector< int64_t > &factors) 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 visitor/mutator capable of passing arbitrary arguments to the visit methods using CRTP and returnin...
A single definition of a Func.
A Halide variable, to be used when defining functions.
void sanitize_names(std::string &str)
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.
signed __INT64_TYPE__ int64_t
signed __INT32_TYPE__ int32_t
void * memcpy(void *s1, const void *s2, size_t n)
A fragment of Halide syntax.
The sum of two expressions.
Logical and - are both expressions true.
Span & region_computed(int i)
Span & region_required(int i)
Span & loops(int i, int j)
BoundContents * make_copy() const
const Span & region_required(int i) const
const Span & region_computed(int i) const
const Span & loops(int i, int j) const
BoundInfo(const Expr &e, const Node::Stage &consumer)
FunctionDAG::Node * producer
vector< LoadJacobian > load_jacobians
void expand_footprint(const Span *consumer_loop, Span *producer_required) const
void add_load_jacobian(LoadJacobian j1)
FunctionDAG::Node::Stage * consumer
vector< pair< BoundInfo, BoundInfo > > bounds
bool all_load_jacobian_coeffs_exist() const
bool equals_region_computed
bool equals_union_of_required_with_constants
PipelineFeatures features
std::unique_ptr< LoadJacobian > store_jacobian
bool loop_nest_all_common_cases
bool downstream_of(const Node &n) const
vector< bool > dependencies
int get_loop_index_from_var(const std::string &var) const
vector< Edge * > incoming_edges
vector< Edge * > outgoing_edges
BoundContents * make_bound() const
vector< SymbolicInterval > region_required
void loop_nest_for_region(int stage_idx, const Span *computed, Span *loop) const
bool is_boundary_condition
vector< RegionComputedInfo > region_computed
bool region_computed_all_common_cases
vector< Span > estimated_region_required
std::unique_ptr< BoundContents::Layout > bounds_memory_layout
void required_to_computed(const Span *required, Span *computed) const
void operator=(const FunctionDAG &other)=delete
FunctionDAG(const FunctionDAG &other)=delete
map< int, const Node * > stage_id_to_node_map
std::ostream & dump(std::ostream &os) const
FunctionDAG(const vector< Function > &outputs, const Target &target)
void operator+=(const OptionalRational &other)
bool operator>=(int x) const
bool operator==(const OptionalRational &other) const
bool operator>(int x) const
OptionalRational()=default
OptionalRational operator*(int64_t factor) const
OptionalRational(int64_t n, int64_t d)
OptionalRational operator*(const OptionalRational &other) const
bool operator==(int x) const
bool operator<(int x) const
bool operator<=(int x) const
A vector with 'lanes' elements, in which every element is 'value'.
The actual IR nodes begin here.
The ratio of two expressions.
Is the first expression equal to the second.
Floating point constants.
Is the first expression greater than or equal to the second.
Is the first expression greater than the second.
A class to represent ranges of Exprs.
Intrusive shared pointers have a reference count (a RefCount object) stored in the class itself.
Is the first expression less than or equal to the second.
Is the first expression less than the second.
A let expression, like you might find in a functional language.
Load a value from a named symbol if predicate is true.
The greater of two values.
The lesser of two values.
The product of two expressions.
Is the first expression not equal to the second.
Logical not - true if the expression false.
Logical or - is at least one of the expression true.
A linear ramp vector node.
Reinterpret value as another type, without affecting any of the bits (on little-endian systems).
Construct a new vector by taking elements from another sequence of vectors.
The difference of two expressions.
Unsigned integer constants.
Horizontally reduce a vector to a scalar or narrower vector using the given commutative and associati...
A struct representing a target machine and os to generate code for.