FreeTensor
Loading...
Searching...
No Matches
normalize_var_in_kernel.h
Go to the documentation of this file.
1#ifndef FREE_TENSOR_GPU_NORMALIZE_VAR_IN_KERNEL_H
2#define FREE_TENSOR_GPU_NORMALIZE_VAR_IN_KERNEL_H
3
4#include <unordered_map>
5#include <unordered_set>
6
9#include <func.h>
10#include <memory>
11#include <mutator.h>
12
13namespace freetensor {
14
15namespace gpu {
16
17class NormalizeVarInKernel : public CompTransientBounds<SymbolTable<Mutator>> {
19
20 std::unordered_set<std::string> legalNames_;
21
22 std::vector<VarDef> varsToHoist_;
23 std::unordered_set<std::string> usedNamesInKernel_;
24 std::unordered_map<std::string, int> nameCntInKernel_;
25 bool inKernel_ = false;
26
27 protected:
28 using BaseClass::visit;
29 Stmt visit(const VarDef &op) override;
30 Stmt visit(const For &op) override;
31};
32
38
40
41} // namespace gpu
42
43} // namespace freetensor
44
45#endif // FREE_TENSOR_GPU_NORMALIZE_VAR_IN_KERNEL_H
Definition: comp_transient_bounds.h:50
BaseClass::StmtRetType visit(const For &op) override
Definition: comp_transient_bounds.h:128
Definition: normalize_var_in_kernel.h:17
Stmt visit(const VarDef &op) override
Definition: normalize_var_in_kernel.cc:41
#define DEFINE_PASS_FOR_FUNC(pass)
Definition: func.h:88
Stmt normalizeVarInKernel(const Stmt &s)
Definition: normalize_var_in_kernel.cc:121
Definition: allocator.h:9