Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[AMD] NFC: Cleanup namespace hierachy #5246

Merged
merged 2 commits into from
Nov 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 0 additions & 6 deletions third_party/amd/include/Dialect/TritonAMDGPU/IR/Dialect.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,4 @@
#define GET_OP_CLASSES
#include "amd/include/Dialect/TritonAMDGPU/IR/Ops.h.inc"

namespace mlir {
namespace triton {
namespace amdgpu {} // namespace amdgpu
} // namespace triton
} // namespace mlir

#endif // TRITON_THIRD_PARTY_AMD_INCLUDE_DIALECT_TRITONAMDGPU_IR_DIALECT_H_
8 changes: 5 additions & 3 deletions third_party/amd/include/TritonAMDGPUToLLVM/GCNAsmFormat.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,13 @@
#include <string>

namespace mlir {

class ConversionPatternRewriter;
class Location;

namespace triton {
} // namespace mlir

namespace mlir::triton {
using llvm::StringRef;

class GCNInstr;
Expand Down Expand Up @@ -397,7 +400,6 @@ struct GCNMemInstr : public GCNInstrBase<GCNMemInstr> {
}
};

} // namespace triton
} // namespace mlir
} // namespace mlir::triton

#endif // TRITON_THIRD_PARTY_AMD_INCLUDE_TRITONAMDGPUTOLLVM_GCNASMFORMAT_H_
16 changes: 10 additions & 6 deletions third_party/amd/include/TritonAMDGPUToLLVM/Passes.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,16 @@ namespace mlir {
class ModuleOp;
template <typename T> class OperationPass;

namespace triton {
} // namespace mlir

namespace mlir::triton {

#define GEN_PASS_DECL
#include "TritonAMDGPUToLLVM/Passes.h.inc"

namespace AMD {
} // namespace mlir::triton

namespace mlir::triton::AMD {
std::unique_ptr<OperationPass<ModuleOp>>
createDecomposeUnsupportedConversionsPass(StringRef targetArch);

Expand All @@ -29,7 +33,9 @@ createDecomposeUnsupportedConversionsPass(StringRef targetArch);
/// @return created pass
std::unique_ptr<OperationPass<ModuleOp>>
createOptimizeLDSUsagePass(StringRef arch, int32_t customLDSLimit = 0);
} // namespace AMD
} // namespace mlir::triton::AMD

namespace mlir::triton {

std::unique_ptr<OperationPass<ModuleOp>>
createConvertTritonAMDGPUToLLVMPass(StringRef targetArch, bool ftz);
Expand All @@ -45,8 +51,6 @@ createTritonAMDGPULowerInstructionSchedHintsPass(StringRef arch,
#define GEN_PASS_REGISTRATION
#include "TritonAMDGPUToLLVM/Passes.h.inc"

} // namespace triton

} // namespace mlir
} // namespace mlir::triton

#endif // TRITON_THIRD_PARTY_AMD_INCLUDE_TRITONAMDGPUTOLLVM_PASSES_H_
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@ void populateExtractSliceOpToLLVMPatterns(
mlir::LLVMTypeConverter &typeConverter, mlir::RewritePatternSet &patterns,
mlir::PatternBenefit benefit);

}
} // namespace mlir::triton::AMD

#endif // TRITON_THIRD_PARTY_AMD_INCLUDE_TRITONAMDGPUTOLLVM_PATTERNTRITONAMDGPUTOLLVM_H_
14 changes: 5 additions & 9 deletions third_party/amd/lib/TritonAMDGPUToLLVM/BuiltinFuncToLLVM.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,10 @@
#include "mlir/Transforms/GreedyPatternRewriteDriver.h"
#include "triton/Conversion/TritonGPUToLLVM/Utility.h"

namespace mlir {
namespace triton {
namespace mlir::triton {
#define GEN_PASS_DEF_CONVERTBUILTINFUNCTOLLVM
#include "TritonAMDGPUToLLVM/Passes.h.inc"
} // namespace triton
} // namespace mlir
} // namespace mlir::triton

using namespace mlir;

Expand Down Expand Up @@ -242,15 +240,13 @@ struct ConvertBuiltinFuncToLLVM
}
};

} // anonymous namespace
} // namespace

namespace mlir {
namespace triton {
namespace mlir::triton {

std::unique_ptr<OperationPass<ModuleOp>>
createConvertBuiltinFuncToLLVMPass(bool ftz) {
return std::make_unique<ConvertBuiltinFuncToLLVM>(ftz);
}

} // namespace triton
} // namespace mlir
} // namespace mlir::triton
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,10 @@
#include <numeric>

using namespace mlir;
namespace mlir {
namespace triton {
namespace mlir::triton {
#define GEN_PASS_DEF_DECOMPOSEUNSUPPORTEDAMDCONVERSIONS
#include "TritonAMDGPUToLLVM/Passes.h.inc"
} // namespace triton
} // namespace mlir
} // namespace mlir::triton

namespace {

Expand Down
6 changes: 2 additions & 4 deletions third_party/amd/lib/TritonAMDGPUToLLVM/GCNAsmFormat.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@
#include "llvm/Support/raw_ostream.h"
#include <sstream> // unify to llvm::raw_string_ostream ?

namespace mlir {
namespace triton {
namespace mlir::triton {

GCNInstr::Operand *
GCNBuilder::newOperand(mlir::Value value, StringRef constraint,
Expand Down Expand Up @@ -187,5 +186,4 @@ GCNInstrExecution::getArgList() const {
return args;
}

} // namespace triton
} // namespace mlir
} // namespace mlir::triton
14 changes: 5 additions & 9 deletions third_party/amd/lib/TritonAMDGPUToLLVM/TritonGPUToLLVM.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,10 @@
#include "triton/Dialect/TritonGPU/IR/Dialect.h"
#include "triton/Dialect/TritonNvidiaGPU/IR/Dialect.h"

namespace mlir {
namespace triton {
namespace mlir::triton {
#define GEN_PASS_DEF_CONVERTTRITONAMDGPUTOLLVM
#include "TritonAMDGPUToLLVM/Passes.h.inc"
} // namespace triton
} // namespace mlir
} // namespace mlir::triton

using namespace mlir;

Expand Down Expand Up @@ -256,15 +254,13 @@ struct ConvertTritonAMDGPUToLLVM
}
};

} // anonymous namespace
} // namespace

namespace mlir {
namespace triton {
namespace mlir::triton {

std::unique_ptr<OperationPass<ModuleOp>>
createConvertTritonAMDGPUToLLVMPass(StringRef targetArch, bool ftz) {
return std::make_unique<ConvertTritonAMDGPUToLLVM>(targetArch, ftz);
}

} // namespace triton
} // namespace mlir
} // namespace mlir::triton
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ class UpcastMXFPOpPattern : public ConvertOpToLLVMPattern<UpcastMXFPOp> {
return success();
}
};
} // anonymous namespace
} // namespace

void mlir::triton::AMD::populateUpcastMXFPToLLVMPatterns(
LLVMTypeConverter &typeConverter, RewritePatternSet &patterns,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -891,7 +891,7 @@ struct PipelinePass : public TritonAMDGPUStreamPipelineBase<PipelinePass> {
return numStages;
}
};
} // anonymous namespace
} // namespace

std::unique_ptr<Pass> mlir::createTritonAMDGPUStreamPipelinePass(int numStages,
int prefetch) {
Expand Down
Loading