FreeTensor
Loading...
Searching...
No Matches
check_not_in_lib.h
Go to the documentation of this file.
1#ifndef FREE_TENSOR_CHECK_NOT_IN_LIB_H
2#define FREE_TENSOR_CHECK_NOT_IN_LIB_H
3
4#include <analyze/find_stmt.h>
5#include <except.h>
6
7namespace freetensor {
8
9inline void checkNotInLib(const Stmt &ast, const ID &stmt) {
10 if (!findAllStmt(ast, "<MatMul>->>" + toString(stmt)).empty()) {
11 throw InvalidSchedule(FT_MSG << "Scheduling " << stmt
12 << " inside a sub-program bound to an "
13 "external library call is meaningless");
14 }
15}
16
17} // namespace freetensor
18
19#endif // FREE_TENSOR_CHECK_NOT_IN_LIB_H
Definition: id.h:18
Definition: except.h:40
#define FT_MSG
Definition: except.h:23
Definition: allocator.h:9
std::string toString(const AST &op)
Definition: print_ast.cc:784
void checkNotInLib(const Stmt &ast, const ID &stmt)
Definition: check_not_in_lib.h:9
std::vector< Stmt > findAllStmt(const Stmt &ast, const ID &id)
Definition: find_stmt.cc:32