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

Petr Kurapov llvmlistbot at llvm.org
Wed Aug 14 06:42:30 PDT 2024


kurapov-peter wrote:

> To me the correct solution is having a new operation for your runtime.

Do you mean something like `gpu.launch_opencl_func`? It's not like it is specific to opencl runtime though; sycl has unified shared memory (see for example here: https://registry.khronos.org/SYCL/specs/sycl-2020/html/sycl-2020.html#sec:memory.model) - would have the same problem. The semantics is the same too with the address space exception, so the operation would essentially be a copy of the `gpu.launch_func` with the changed validation.

There was also an idea to leave the memrefs intact (no attributes) and then attach address spaces during the lowering to llvm. The problem is that it is unclear what should happen to a kernel that has two pointers as arguments: one with an attribute and one without.

> My issue here is that you're changing the semantics of the op for a very particular case.

Yeah, I thought, maybe making it very specific to the use case would be tolerable. To keep all the other cases intact.

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


More information about the Mlir-commits mailing list