FreeTensor
Loading...
Searching...
No Matches
check_all_defined.h
Go to the documentation of this file.
1#ifndef FREE_TENSOR_CHECK_ALL_DEFINED_H
2#define FREE_TENSOR_CHECK_ALL_DEFINED_H
3
4#include <unordered_set>
5
6#include <analyze/all_uses.h>
7#include <ast.h>
8
9namespace freetensor {
10
11inline bool checkAllDefined(const std::unordered_set<std::string> &defs,
12 const std::unordered_set<std::string> &namesInOp) {
13 return isSubSetOf(namesInOp, defs);
14}
15
16inline bool checkAllDefined(const std::unordered_set<std::string> &defs,
17 const AST &op) {
18 return checkAllDefined(defs, allNames(op));
19}
20
21} // namespace freetensor
22
23#endif // FREE_TENSOR_CHECK_ALL_DEFINED_H
Definition: allocator.h:9
bool checkAllDefined(const std::unordered_set< std::string > &defs, const std::unordered_set< std::string > &namesInOp)
Definition: check_all_defined.h:11
bool isSubSetOf(const std::unordered_set< T, Hash, KeyEqual > &lhs, const std::unordered_set< T, Hash, KeyEqual > &rhs)
Definition: container_utils.h:74
std::unordered_set< std::string > allNames(const AST &op, bool noRecurseIdx=false, bool noRecurseSubStmt=false)
Definition: all_uses.h:134