Skip to content

Commit d383bfc

Browse files
Implemented tiling and fusion path for GPU
1 parent 453f76f commit d383bfc

File tree

4 files changed

+407
-1
lines changed

4 files changed

+407
-1
lines changed

include/gc/Transforms/Passes.td

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,22 @@ def GpuToGpuOcl : Pass<"gpu-to-gpuocl", "ModuleOp"> {
112112
"Call finish() after each kernel launch.">
113113
];
114114
}
115+
116+
def GpuTilingAndFusion : Pass<"gpu-tiling", "func::FuncOp"> {
117+
let summary = "GPU tiling and fusion path.";
118+
let description = [{
119+
This path creates 2 nested loops for linalg operations, that are converted to gpu.launch.
120+
The outer loop is mapped to to the grid sizes and the inner loop is mapped to the block sizes.
121+
}];
122+
let options = [
123+
Option<"euMem", "eu-mem", "size_t",
124+
/*default=*/"131072",
125+
"Execution Unit cache size.">,
126+
Option<"euThreads", "eu-threads", "size_t",
127+
/*default=*/"8",
128+
"Number of threads per EU.">
129+
];
130+
}
115131
#endif // GC_USE_IMEX
116132

117133
def IterativeTilingAndFusion : Pass<"iterative-tiling-and-fusion",

lib/gc/Transforms/GPU/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ set_property(GLOBAL APPEND PROPERTY IMEX_LIBS ${IMEX_LIBS})
1212

1313
gc_add_mlir_library(GcGpuPasses
1414
AddContextArg.cpp
15+
GpuTilingAndFusion.cpp
1516
GpuToGpuOcl.cpp
1617
LinalgToXeGPU.cpp
1718
Pipeline.cpp

0 commit comments

Comments
 (0)