1 #ifndef HALIDE_MODULUS_REMAINDER_H
2 #define HALIDE_MODULUS_REMAINDER_H
A common pattern when traversing Halide IR is that you need to keep track of stuff when you find a Le...
ModulusRemainder modulus_remainder(const Expr &e)
For things like alignment analysis, often it's helpful to know if an integer expression is some multi...
int64_t gcd(int64_t, int64_t)
The greatest common divisor of two integers.
ModulusRemainder operator+(const ModulusRemainder &a, const ModulusRemainder &b)
ModulusRemainder operator%(const ModulusRemainder &a, const ModulusRemainder &b)
ModulusRemainder operator*(const ModulusRemainder &a, const ModulusRemainder &b)
bool reduce_expr_modulo(const Expr &e, int64_t modulus, int64_t *remainder)
Reduce an expression modulo some integer.
void modulus_remainder_test()
ModulusRemainder operator-(const ModulusRemainder &a, const ModulusRemainder &b)
ModulusRemainder operator/(const ModulusRemainder &a, const ModulusRemainder &b)
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
A fragment of Halide syntax.
The result of modulus_remainder analysis.
ModulusRemainder()=default
static ModulusRemainder unify(const ModulusRemainder &a, const ModulusRemainder &b)
ModulusRemainder(int64_t m, int64_t r)
bool operator==(const ModulusRemainder &other) const
static ModulusRemainder intersect(const ModulusRemainder &a, const ModulusRemainder &b)