2021-05-13 10:42:18 +08:00
|
|
|
#ifndef TRITON_INCLUDE_TRITON_CODEGEN_TRANSFORM_PREFETCH_H
|
|
|
|
#define TRITON_INCLUDE_TRITON_CODEGEN_TRANSFORM_PREFETCH_H
|
|
|
|
|
2021-06-21 14:25:13 +08:00
|
|
|
#include <set>
|
|
|
|
|
2021-05-13 10:42:18 +08:00
|
|
|
// forward dclaration
|
|
|
|
namespace triton::ir{
|
|
|
|
class module;
|
2021-06-21 14:25:13 +08:00
|
|
|
class value;
|
2021-05-13 10:42:18 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
namespace triton::codegen {
|
|
|
|
class target;
|
|
|
|
}
|
|
|
|
|
|
|
|
namespace triton::codegen::transform {
|
|
|
|
class prefetch {
|
|
|
|
target* tgt_;
|
2021-06-21 14:25:13 +08:00
|
|
|
std::set<ir::value*> prefetched_vals_;
|
2021-05-13 10:42:18 +08:00
|
|
|
public:
|
|
|
|
prefetch(target *tgt) : tgt_(tgt) {}
|
|
|
|
void run(ir::module &module);
|
2021-06-21 14:25:13 +08:00
|
|
|
bool is_prefetched(ir::value* v) { return prefetched_vals_.find(v) != prefetched_vals_.end(); }
|
2021-05-13 10:42:18 +08:00
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|