MimIR
MimIR is my Intermediate Representation
Loading...
Searching...
No Matches
split_off_kernels.h
Go to the documentation of this file.
1#pragma once
2
3#include <mim/phase.h>
4
5#include "mim/plug/gpu/gpu.h"
6
7namespace mim::plug::gpu::phase {
8
9/// Afterwards, old_world() is the host, which keeps each kernel as a declaration, and new_world() the device.
10class SplitOffKernels : public RWPhase {
11public:
12 using RWPhase::RWPhase;
13
14private:
15 void start() final;
16 bool analyze() final;
17 void analyze(const Def*);
18
19 const Def* rewrite_mut_Lam(Lam*) final;
20
21 DefSet analyzed_;
22 LamSet kernels_;
23};
24
25} // namespace mim::plug::gpu::phase
Base class for all Defs.
Definition def.h:289
A function.
Definition lam.h:91
RWPhase(World &world, std::string name, Analysis *analysis=nullptr)
Definition phase.h:334
Afterwards, old_world() is the host, which keeps each kernel as a declaration, and new_world() the de...
bool analyze() final
Runs the optional pre-analysis on old_world(), typically to a fixed point, before rewriting begins.
RWPhase(World &world, std::string name, Analysis *analysis=nullptr)
Definition phase.h:334
GIDSet< Lam * > LamSet
Definition lam.h:211
GIDSet< const Def * > DefSet
Definition def.h:94