diff --git a/mlir/docs/Dialects/SPIR-V.md b/mlir/docs/Dialects/SPIR-V.md --- a/mlir/docs/Dialects/SPIR-V.md +++ b/mlir/docs/Dialects/SPIR-V.md @@ -1072,9 +1072,8 @@ * [Standard Dialect][MlirStandardDialect] : Only arithmetic and logical operations conversions are implemented. -* [GPU Dialect][MlirGpuDialect] : A module with the attribute - `gpu.kernel_module` is converted to a `spv.module`. A function within this - module with the attribute `gpu.kernel` is lowered as an entry function. +* [GPU Dialect][MlirGpuDialect] : A gpu.module is converted to a `spv.module`. + A gpu.function within this module is lowered as an entry function. ## Code organization diff --git a/mlir/include/mlir/Dialect/GPU/GPUOps.td b/mlir/include/mlir/Dialect/GPU/GPUOps.td --- a/mlir/include/mlir/Dialect/GPU/GPUOps.td +++ b/mlir/include/mlir/Dialect/GPU/GPUOps.td @@ -260,13 +260,11 @@ outlining the kernel body into a function in a dedicated module, which reflects the separate compilation process. The kernel function is required to have the `gpu.kernel` attribute. The module containing the kernel - function is required to have the `gpu.kernel_module` attribute and must be - named. And finally, the module containing the kernel module (which thus - cannot be the top-level module) is required to have the - `gpu.container_module` attribute. The `gpu.launch_func` operation has a - string attribute named `kernel` to specify the name of the kernel function - to launch and an attribute named `kernel_module` to specify the name of the - module containing that kernel function. + function is required to be a gpu.module. And finally, the module containing + the kernel module (which thus cannot be the top-level module) is required + to have the `gpu.container_module` attribute. The `gpu.launch_func` + operation has a symbol attribute named `kernel` to identify the fully specified + kernel function to launch (both the gpu.module and func). The operation takes at least six operands, with the first three operands being grid sizes along x,y,z dimensions and the following three being block @@ -282,7 +280,7 @@ module attributes {gpu.container_module} { // This module creates a separate compilation unit for the GPU compiler. - module @kernels attributes {gpu.kernel_module} { + gpu.module @kernels { func @kernel_1(%arg0 : f32, %arg1 : !llvm<"float*">) attributes { nvvm.kernel = true } {