FreeTensor
Loading...
Searching...
No Matches
lower_parallel_reduction.h
Go to the documentation of this file.
1#ifndef FREE_TENSOR_CPU_LOWER_PARALLEL_REDUCTION_H
2#define FREE_TENSOR_CPU_LOWER_PARALLEL_REDUCTION_H
3
4#include <unordered_map>
5#include <unordered_set>
6
8#include <func.h>
9#include <mutator.h>
10
11namespace freetensor {
12
13namespace cpu {
14
15class LowerParallelReduction : public SymbolTable<Mutator> {
17
18 std::vector<For> loopStack_;
19 std::unordered_set<std::string> needRedirect_;
20
21 private:
22 std::vector<std::pair<For, int>> reducedBy(const ReduceTo &op);
23
24 protected:
25 using BaseClass::visit;
26 Stmt visit(const For &op) override;
27 Stmt visit(const ReduceTo &op) override;
28};
29
36
38
39} // namespace cpu
40
41} // namespace freetensor
42
43#endif // FREE_TENSOR_CPU_LOWER_PARALLEL_REDUCTION_H
Definition: symbol_table.h:122
BaseClass::StmtRetType visit(const VarDef &op) override
Definition: symbol_table.h:167
Definition: lower_parallel_reduction.h:15
Stmt visit(const For &op) override
Definition: lower_parallel_reduction.cc:53
#define DEFINE_PASS_FOR_FUNC(pass)
Definition: func.h:88
Stmt lowerParallelReduction(const Stmt &op)
Definition: lower_parallel_reduction.cc:206
Definition: allocator.h:9