[FRONTEND] Expose end-to-end compile to python frontend (#58)
This commit is contained in:
@@ -14,9 +14,14 @@ class ModuleOp;
|
||||
namespace mlir {
|
||||
namespace triton {
|
||||
|
||||
// Translate TritonGPU dialect to LLVMIR, return null if failed.
|
||||
std::unique_ptr<llvm::Module>
|
||||
translateTritonGPUToLLVMIR(llvm::LLVMContext *llvmContext,
|
||||
mlir::ModuleOp module);
|
||||
|
||||
// Translate mlir LLVM dialect to LLVMIR, return null if failed.
|
||||
std::unique_ptr<llvm::Module>
|
||||
TranslateLLVMToLLVMIR(llvm::LLVMContext *llvmContext, mlir::ModuleOp module);
|
||||
translateLLVMToLLVMIR(llvm::LLVMContext *llvmContext, mlir::ModuleOp module);
|
||||
|
||||
} // namespace triton
|
||||
} // namespace mlir
|
||||
|
35
include/triton/Target/PTX/PTXTranslation.h
Normal file
35
include/triton/Target/PTX/PTXTranslation.h
Normal file
@@ -0,0 +1,35 @@
|
||||
#ifndef TRITON_TARGET_PTXTRANSLATION_H
|
||||
#define TRITON_TARGET_PTXTRANSLATION_H
|
||||
|
||||
#include "triton/driver/dispatch.h"
|
||||
|
||||
#include <string>
|
||||
|
||||
namespace mlir {
|
||||
|
||||
class ModuleOp;
|
||||
|
||||
} // namespace mlir
|
||||
|
||||
namespace triton {
|
||||
|
||||
template <CUdevice_attribute attr> int cuGetInfo(CUdevice device) {
|
||||
int res;
|
||||
driver::dispatch::cuDeviceGetAttribute(&res, attr, device);
|
||||
return res;
|
||||
}
|
||||
|
||||
void getCuCCAndVersionFromDevice(uint64_t device, int *cc, int *version,
|
||||
std::string *ptxasPath);
|
||||
|
||||
// Translate TritonGPU IR to PTX code.
|
||||
std::tuple<std::string, // ptx code
|
||||
size_t, // PTX cc
|
||||
int, // PTX version
|
||||
std::string // ptxas path
|
||||
>
|
||||
translateTritonGPUToPTX(mlir::ModuleOp module, uint64_t device);
|
||||
|
||||
} // namespace triton
|
||||
|
||||
#endif
|
Reference in New Issue
Block a user