[TRITONGPU] Added template for Triton -> TritonGPU conversion

This commit is contained in:
Phil Tillet
2022-04-30 14:31:18 -07:00
parent 2239ac1998
commit 2c6a213131
16 changed files with 146 additions and 2 deletions

View File

@@ -1 +1 @@
add_subdirectory(triton/Dialect)
add_subdirectory(triton)

View File

@@ -0,0 +1,2 @@
add_subdirectory(Conversion)
add_subdirectory(Dialect)

View File

@@ -0,0 +1,4 @@
set(LLVM_TARGET_DEFINITIONS Passes.td)
mlir_tablegen(Passes.h.inc -gen-pass-decls)
add_public_tablegen_target(TritonConversionPassIncGen)

View File

@@ -0,0 +1,19 @@
#ifndef TRITON_CONVERSION_PASSES_H
#define TRITON_CONVERSION_PASSES_H
#include "triton/Conversion/TritonToTritonGPU/TritonToTritonGPU.h"
namespace mlir
{
namespace triton
{
#define GEN_PASS_REGISTRATION
#include "triton/Conversion/Passes.h.inc"
} // namespace triton
} // namespace mlir
#endif

View File

@@ -0,0 +1,14 @@
#ifndef TRITON_CONVERSION_PASSES
#define TRITON_CONVERSION_PASSES
include "mlir/Pass/PassBase.td"
def ConvertTritonToTritonGPU: Pass<"convert-triton-to-tritongpu", "mlir::ModuleOp"> {
let summary = "Convert Triton to TritonGPU";
let description = [{
}];
let constructor = "mlir::triton::createConvertTritonToTritonGPUPass()";
}
#endif

View File

@@ -0,0 +1,20 @@
#ifndef TRITON_CONVERSION_TRITONTOTRITONGPU_TRITONTOTRITONGPUPASS_H_
#define TRITON_CONVERSION_TRITONTOTRITONGPU_TRITONTOTRITONGPUPASS_H_
#include <memory>
namespace mlir{
class ModuleOp;
template <typename T> class OperationPass;
namespace triton{
std::unique_ptr<OperationPass<ModuleOp>>
createConvertTritonToTritonGPUPass();
}
} // namespace mlir
#endif