[Mlir-commits] [mlir] Skip address space checks for memrefs between launchFuncOp and kernel func (PR #102925)

Petr Kurapov llvmlistbot at llvm.org
Wed Aug 14 05:58:48 PDT 2024


kurapov-peter wrote:

> Why don't you pass the correct address space from the beginning? For example:
> 
> ```mlir
> func.func @foo(%mem : memref<5xf32, #gpu.address_space<global>>) {
>     gpu.launch_func @gpu_kernels::@kernel args(%mem : memref<5xf32, #gpu.address_space<global>>)
>     return
>   }
>   gpu.module @gpu_kernels {
>     gpu.func @kernel(%arg0 : memref<5xf32, #gpu.address_space<global>>) kernel {
>       gpu.return
>     }
>   }
> ```

I tried to explain that in the description: basically, for memory that is shared between host and device (the runtime controls the necessary transfers) the host memref should have address space zero as a regular memory buffer. It's not a gpu buffer, so the attribute doesn't make any sense.

> Also, you need to change the description and title, this is not `LaunchOp`, but `LaunchFuncOp`

Yup, fixed.

https://github.com/llvm/llvm-project/pull/102925


More information about the Mlir-commits mailing list