FreeTensor
Loading...
Searching...
No Matches
parse_pb_expr.h
Go to the documentation of this file.
1#ifndef FREE_TENSOR_PARSE_PB_EXPR_H
2#define FREE_TENSOR_PARSE_PB_EXPR_H
3
4#include <iostream>
5
6#include <expr.h>
7#include <math/presburger.h>
8
9namespace freetensor {
10
15 std::vector<std::string> args_;
16 std::vector<Expr> values_;
17 Expr cond_; // Maybe null
18};
19
20std::ostream &operator<<(std::ostream &os, const SimplePBFuncAST &ast);
21
25typedef std::vector<SimplePBFuncAST> PBFuncAST;
26
51inline SimplePBFuncAST parseSimplePBFunc(const auto &f) {
52 auto ret = parsePBFunc(f);
53 if (ret.size() != 1) {
54 throw ParserError(FT_MSG << f << " is not a simple PBFunc");
55 }
56 return ret.front();
57}
59 auto ret = parsePBFuncReconstructMinMax(f);
60 if (ret.size() != 1) {
61 throw ParserError(FT_MSG << f << " is not a simple PBFunc");
62 }
63 return ret.front();
64}
67} // namespace freetensor
68
69#endif // FREE_TENSOR_PARSE_PB_EXPR_H
Definition: presburger.h:544
Definition: presburger.h:75
Definition: presburger.h:223
Definition: presburger.h:431
Definition: except.h:105
#define FT_MSG
Definition: except.h:23
Definition: allocator.h:9
std::vector< SimplePBFuncAST > PBFuncAST
Definition: parse_pb_expr.h:25
PBFuncAST parsePBFunc(const PBFunc::Serialized &f)
Definition: parse_pb_expr.cc:130
PBFuncAST parsePBFuncReconstructMinMax(const PBSet &set)
Definition: parse_pb_expr.cc:314
SimplePBFuncAST parseSimplePBFuncReconstructMinMax(const auto &f)
Definition: parse_pb_expr.h:58
std::ostream & operator<<(std::ostream &os, const Dependence &dep)
Definition: deps.cc:1404
SimplePBFuncAST parseSimplePBFunc(const auto &f)
Definition: parse_pb_expr.h:51
Definition: parse_pb_expr.h:14
Expr cond_
Definition: parse_pb_expr.h:17
std::vector< Expr > values_
Definition: parse_pb_expr.h:16
std::vector< std::string > args_
Definition: parse_pb_expr.h:15