[Triton-MLIR][Testing]Fix tests warning, with small code clean-up (#894)
1.Code clean-up to remove superfluous #includes. 2.Fix two python test warnings, in which one relates to ["#" formats](https://jira.mongodb.org/browse/PYTHON-2343), the other relates to regular expression string usage.
This commit is contained in:
@@ -2,6 +2,7 @@
|
|||||||
#define TRITON_TARGET_LLVMIRTRANSLATION_H
|
#define TRITON_TARGET_LLVMIRTRANSLATION_H
|
||||||
#include "llvm/ADT/StringRef.h"
|
#include "llvm/ADT/StringRef.h"
|
||||||
#include <memory>
|
#include <memory>
|
||||||
|
#include <string>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
namespace llvm {
|
namespace llvm {
|
||||||
|
@@ -1,7 +1,6 @@
|
|||||||
#ifndef TRITON_TARGET_PTXTRANSLATION_H
|
#ifndef TRITON_TARGET_PTXTRANSLATION_H
|
||||||
#define TRITON_TARGET_PTXTRANSLATION_H
|
#define TRITON_TARGET_PTXTRANSLATION_H
|
||||||
|
|
||||||
#include <memory>
|
|
||||||
#include <string>
|
#include <string>
|
||||||
|
|
||||||
namespace llvm {
|
namespace llvm {
|
||||||
|
@@ -3,11 +3,9 @@
|
|||||||
#include "mlir/Dialect/LLVMIR/LLVMDialect.h"
|
#include "mlir/Dialect/LLVMIR/LLVMDialect.h"
|
||||||
#include "mlir/ExecutionEngine/ExecutionEngine.h"
|
#include "mlir/ExecutionEngine/ExecutionEngine.h"
|
||||||
#include "mlir/ExecutionEngine/OptUtils.h"
|
#include "mlir/ExecutionEngine/OptUtils.h"
|
||||||
#include "mlir/IR/BuiltinOps.h"
|
|
||||||
#include "mlir/IR/Dialect.h"
|
#include "mlir/IR/Dialect.h"
|
||||||
#include "mlir/Pass/Pass.h"
|
#include "mlir/Pass/Pass.h"
|
||||||
#include "mlir/Pass/PassManager.h"
|
#include "mlir/Pass/PassManager.h"
|
||||||
#include "mlir/Support/LogicalResult.h"
|
|
||||||
#include "mlir/Target/LLVMIR/Dialect/LLVMIR/LLVMToLLVMIRTranslation.h"
|
#include "mlir/Target/LLVMIR/Dialect/LLVMIR/LLVMToLLVMIRTranslation.h"
|
||||||
#include "mlir/Target/LLVMIR/Dialect/NVVM/NVVMToLLVMIRTranslation.h"
|
#include "mlir/Target/LLVMIR/Dialect/NVVM/NVVMToLLVMIRTranslation.h"
|
||||||
#include "mlir/Target/LLVMIR/Export.h"
|
#include "mlir/Target/LLVMIR/Export.h"
|
||||||
|
@@ -1,46 +1,17 @@
|
|||||||
#include "triton/Target/PTX/PTXTranslation.h"
|
#include "triton/Target/PTX/PTXTranslation.h"
|
||||||
#include "mlir/Dialect/LLVMIR/LLVMDialect.h"
|
|
||||||
#include "mlir/ExecutionEngine/ExecutionEngine.h"
|
|
||||||
#include "mlir/ExecutionEngine/OptUtils.h"
|
|
||||||
#include "mlir/IR/BuiltinOps.h"
|
|
||||||
#include "mlir/IR/Dialect.h"
|
|
||||||
#include "mlir/Pass/Pass.h"
|
|
||||||
#include "mlir/Pass/PassManager.h"
|
|
||||||
#include "mlir/Support/LogicalResult.h"
|
|
||||||
#include "mlir/Target/LLVMIR/Dialect/LLVMIR/LLVMToLLVMIRTranslation.h"
|
|
||||||
#include "mlir/Target/LLVMIR/Export.h"
|
|
||||||
#include "mlir/Target/LLVMIR/LLVMTranslationInterface.h"
|
|
||||||
#include "triton/Target/LLVMIR/LLVMIRTranslation.h"
|
#include "triton/Target/LLVMIR/LLVMIRTranslation.h"
|
||||||
|
|
||||||
#include "llvm/ExecutionEngine/ExecutionEngine.h"
|
|
||||||
#include "llvm/ExecutionEngine/SectionMemoryManager.h"
|
|
||||||
#include "llvm/IR/IRBuilder.h"
|
#include "llvm/IR/IRBuilder.h"
|
||||||
#include "llvm/IR/IRPrintingPasses.h"
|
|
||||||
#include "llvm/IR/LegacyPassManager.h"
|
#include "llvm/IR/LegacyPassManager.h"
|
||||||
#include "llvm/IR/Module.h"
|
#include "llvm/IR/Module.h"
|
||||||
#include "llvm/IR/Verifier.h"
|
#include "llvm/IR/Verifier.h"
|
||||||
#include "llvm/MC/TargetRegistry.h"
|
#include "llvm/MC/TargetRegistry.h"
|
||||||
#include "llvm/Support/CodeGen.h"
|
|
||||||
#include "llvm/Support/CommandLine.h"
|
|
||||||
#include "llvm/Support/SourceMgr.h"
|
|
||||||
#include "llvm/Support/TargetSelect.h"
|
#include "llvm/Support/TargetSelect.h"
|
||||||
#include "llvm/Support/raw_ostream.h"
|
|
||||||
#include "llvm/Target/TargetMachine.h"
|
#include "llvm/Target/TargetMachine.h"
|
||||||
#include "llvm/Target/TargetOptions.h"
|
|
||||||
#include "llvm/Transforms/Scalar.h"
|
|
||||||
#include "llvm/Transforms/Utils/Cloning.h"
|
|
||||||
#include <filesystem>
|
#include <filesystem>
|
||||||
#include <regex>
|
|
||||||
|
|
||||||
namespace triton {
|
namespace triton {
|
||||||
|
|
||||||
extern "C" {
|
|
||||||
int set_curterm(char *nterm) { return 0; }
|
|
||||||
int del_curterm(char *nterm) { return 0; }
|
|
||||||
int tigetnum(char *capname) { return 0; }
|
|
||||||
int setupterm(char *term, int fildes, int *errret) { return 0; }
|
|
||||||
}
|
|
||||||
|
|
||||||
static void init_llvm() {
|
static void init_llvm() {
|
||||||
LLVMInitializeNVPTXTargetInfo();
|
LLVMInitializeNVPTXTargetInfo();
|
||||||
LLVMInitializeNVPTXTarget();
|
LLVMInitializeNVPTXTarget();
|
||||||
|
@@ -1319,7 +1319,7 @@ def make_stub(name, signature, constants):
|
|||||||
|
|
||||||
|
|
||||||
def convert_type_repr(x):
|
def convert_type_repr(x):
|
||||||
match = re.search('!tt\.ptr<(.*)>', x)
|
match = re.search(r'!tt\.ptr<(.*)>', x)
|
||||||
if match is not None:
|
if match is not None:
|
||||||
return '*' + convert_type_repr(match.group(1))
|
return '*' + convert_type_repr(match.group(1))
|
||||||
return x
|
return x
|
||||||
@@ -1490,6 +1490,7 @@ class CudaUtils(object):
|
|||||||
#include <cuda.h>
|
#include <cuda.h>
|
||||||
|
|
||||||
#include \"cuda.h\"
|
#include \"cuda.h\"
|
||||||
|
#define PY_SSIZE_T_CLEAN
|
||||||
#include <Python.h>
|
#include <Python.h>
|
||||||
|
|
||||||
static inline void gpuAssert(CUresult code, const char *file, int line)
|
static inline void gpuAssert(CUresult code, const char *file, int line)
|
||||||
|
Reference in New Issue
Block a user