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

Rename GPUXToSPIRV Pass to GPUToSPIRVExt #436

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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
2 changes: 1 addition & 1 deletion include/imex/Conversion/GPUToSPIRV/GPUToSPIRVPass.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ template <typename T> class OperationPass;
namespace imex {
/// Create a pass
std::unique_ptr<::mlir::OperationPass<::mlir::ModuleOp>>
createConvertGPUXToSPIRVPass(bool mapMemorySpace = true);
createConvertGPUToSPIRVExtPass(bool mapMemorySpace = true);

} // namespace imex

Expand Down
4 changes: 2 additions & 2 deletions include/imex/Conversion/Passes.td
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ def ConvertDistToStandard: Pass<"convert-dist-to-standard", "::mlir::ModuleOp">
// GPUToSPIRV
//===----------------------------------------------------------------------===//

def ConvertGPUXToSPIRV : Pass<"imex-convert-gpu-to-spirv", "::mlir::ModuleOp"> {
def ConvertGPUToSPIRVExt : Pass<"imex-convert-gpu-to-spirv", "::mlir::ModuleOp"> {
let summary = "Convert GPU dialect to SPIR-V dialect";
let description = [{
This pass extends upstream GPU dialect to SPIR-V dialect pass by adding more
Expand Down Expand Up @@ -247,7 +247,7 @@ memref, arith and math.
}
```
}];
let constructor = "imex::createConvertGPUXToSPIRVPass()";
let constructor = "imex::createConvertGPUToSPIRVExtPass()";
let dependentDialects = ["::mlir::spirv::SPIRVDialect"];
}

Expand Down
13 changes: 8 additions & 5 deletions lib/Conversion/GPUToSPIRV/GPUToSPIRVPass.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,17 +40,20 @@ namespace imex {
/// replace it).
///
/// 2) Lower the body of the spirv::ModuleOp.
class GPUXToSPIRVPass : public ::imex::ConvertGPUXToSPIRVBase<GPUXToSPIRVPass> {
/// This pass extends upstream GPU dialect to SPIR-V dialect pass by adding more
/// conversion patterns like SCF, math and control flow.
class GPUToSPIRVExtPass
: public ::imex::ConvertGPUToSPIRVExtBase<GPUToSPIRVExtPass> {
public:
explicit GPUXToSPIRVPass(bool mapMemorySpace)
explicit GPUToSPIRVExtPass(bool mapMemorySpace)
: mapMemorySpace(mapMemorySpace) {}
void runOnOperation() override;

private:
bool mapMemorySpace;
};

void GPUXToSPIRVPass::runOnOperation() {
void GPUToSPIRVExtPass::runOnOperation() {
mlir::MLIRContext *context = &getContext();
mlir::ModuleOp module = getOperation();

Expand Down Expand Up @@ -108,7 +111,7 @@ void GPUXToSPIRVPass::runOnOperation() {
}

std::unique_ptr<::mlir::OperationPass<::mlir::ModuleOp>>
createConvertGPUXToSPIRVPass(bool mapMemorySpace) {
return std::make_unique<GPUXToSPIRVPass>(mapMemorySpace);
createConvertGPUToSPIRVExtPass(bool mapMemorySpace) {
return std::make_unique<GPUToSPIRVExtPass>(mapMemorySpace);
}
} // namespace imex