[BACKEND] add triton-translate to translate mlir to llvmir or PTX code (#37)
This commit is contained in:
@@ -20,6 +20,15 @@ public:
|
||||
|
||||
namespace triton {
|
||||
|
||||
// Names for identifying different NVVM annotations. It is used as attribute
|
||||
// names in MLIR modules. Refer to
|
||||
// https://docs.nvidia.com/cuda/nvvm-ir-spec/index.html#supported-properties for
|
||||
// the full list.
|
||||
struct NVVMMetadataField {
|
||||
static constexpr char MaxNTid[] = "nvvm.maxntid";
|
||||
static constexpr char Kernel[] = "nvvm.kernel";
|
||||
};
|
||||
|
||||
std::unique_ptr<OperationPass<ModuleOp>> createConvertTritonGPUToLLVMPass();
|
||||
|
||||
} // namespace triton
|
||||
|
24
include/triton/Target/LLVMIR/LLVMIRTranslation.h
Normal file
24
include/triton/Target/LLVMIR/LLVMIRTranslation.h
Normal file
@@ -0,0 +1,24 @@
|
||||
#ifndef TRITON_TARGET_LLVMIRTRANSLATION_H
|
||||
#define TRITON_TARGET_LLVMIRTRANSLATION_H
|
||||
#include <memory>
|
||||
|
||||
namespace llvm {
|
||||
class Module;
|
||||
class LLVMContext;
|
||||
} // namespace llvm
|
||||
|
||||
namespace mlir {
|
||||
class ModuleOp;
|
||||
} // namespace mlir
|
||||
|
||||
namespace mlir {
|
||||
namespace triton {
|
||||
|
||||
// Translate mlir LLVM dialect to LLVMIR, return null if failed.
|
||||
std::unique_ptr<llvm::Module>
|
||||
TranslateLLVMToLLVMIR(llvm::LLVMContext *llvmContext, mlir::ModuleOp module);
|
||||
|
||||
} // namespace triton
|
||||
} // namespace mlir
|
||||
|
||||
#endif // TRITON_TARGET_LLVMIRTRANSLATION_H
|
Reference in New Issue
Block a user