mirror of
https://github.com/ROCm/ROCm.git
synced 2026-04-05 03:01:17 -04:00
[BUILD] Fix build issues of triton-translate tool (#1068)
This commit is contained in:
@@ -26,35 +26,36 @@ target_link_libraries(triton-opt PRIVATE
|
||||
mlir_check_all_link_libraries(triton-opt)
|
||||
|
||||
|
||||
# add_llvm_executable(triton-translate triton-translate.cpp PARTIAL_SOURCES_INTENDED)
|
||||
#llvm_update_compile_flags(triton-translate)
|
||||
# target_link_libraries(triton-translate PRIVATE
|
||||
# TritonAnalysis
|
||||
# TritonTransforms
|
||||
# TritonGPUTransforms
|
||||
# TritonLLVMIR
|
||||
# TritonDriver
|
||||
# ${dialect_libs}
|
||||
# ${conversion_libs}
|
||||
# # tests
|
||||
# TritonTestAnalysis
|
||||
add_llvm_executable(triton-translate triton-translate.cpp PARTIAL_SOURCES_INTENDED)
|
||||
llvm_update_compile_flags(triton-translate)
|
||||
target_link_libraries(triton-translate PRIVATE
|
||||
TritonAnalysis
|
||||
TritonTransforms
|
||||
TritonGPUTransforms
|
||||
TritonLLVMIR
|
||||
TritonPTX
|
||||
${dialect_libs}
|
||||
${conversion_libs}
|
||||
# tests
|
||||
TritonTestAnalysis
|
||||
|
||||
# LLVMCore
|
||||
# LLVMSupport
|
||||
# LLVMOption
|
||||
# LLVMCodeGen
|
||||
# LLVMAsmParser
|
||||
LLVMCore
|
||||
LLVMSupport
|
||||
LLVMOption
|
||||
LLVMCodeGen
|
||||
LLVMAsmParser
|
||||
|
||||
# # MLIR core
|
||||
# MLIROptLib
|
||||
# MLIRIR
|
||||
# MLIRPass
|
||||
# MLIRSupport
|
||||
# MLIRTransforms
|
||||
# MLIRExecutionEngine
|
||||
# MLIRMathToLLVM
|
||||
# MLIRTransformUtils
|
||||
# MLIRLLVMToLLVMIRTranslation
|
||||
# MLIRNVVMToLLVMIRTranslation
|
||||
# )
|
||||
# mlir_check_all_link_libraries(triton-translate)
|
||||
# MLIR core
|
||||
MLIROptLib
|
||||
MLIRIR
|
||||
MLIRLLVMIR
|
||||
MLIRPass
|
||||
MLIRSupport
|
||||
MLIRTransforms
|
||||
MLIRExecutionEngine
|
||||
MLIRMathToLLVM
|
||||
MLIRTransformUtils
|
||||
MLIRLLVMToLLVMIRTranslation
|
||||
MLIRNVVMToLLVMIRTranslation
|
||||
)
|
||||
mlir_check_all_link_libraries(triton-translate)
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
#include "triton/Dialect/Triton/IR/Dialect.h"
|
||||
#include "triton/Dialect/TritonGPU/IR/Dialect.h"
|
||||
#include "triton/Target/LLVMIR/LLVMIRTranslation.h"
|
||||
#include "triton/driver/llvm.h"
|
||||
#include "triton/Target/PTX/PTXTranslation.h"
|
||||
#include "llvm/IR/LLVMContext.h"
|
||||
#include "llvm/Support/CommandLine.h"
|
||||
#include "llvm/Support/InitLLVM.h"
|
||||
@@ -116,8 +116,8 @@ LogicalResult tritonTranslateMain(int argc, char **argv,
|
||||
if (targetKind == "llvmir")
|
||||
llvm::outs() << *llvmir << '\n';
|
||||
else if (targetKind == "ptx")
|
||||
llvm::outs() << ::triton::driver::llir_to_ptx(
|
||||
llvmir.get(), SMArch.getValue(), ptxVersion.getValue());
|
||||
llvm::outs() << ::triton::translateLLVMIRToPTX(*llvmir, SMArch.getValue(),
|
||||
ptxVersion.getValue());
|
||||
|
||||
return success();
|
||||
}
|
||||
|
||||
@@ -7,6 +7,7 @@ add_mlir_translation_library(TritonLLVMIR
|
||||
LINK_LIBS PUBLIC
|
||||
MLIRIR
|
||||
MLIRLLVMIR
|
||||
MLIRSCFToStandard
|
||||
MLIRSupport
|
||||
MLIRTargetLLVMIRExport
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user