[Mlir-commits] [mlir] [mlir][spirv] Add mgpu* wrappers for Vulkan runtime, migrate some tests (PR #123114)
Jakub Kuderski
llvmlistbot at llvm.org
Thu Jan 16 07:24:21 PST 2025
================
@@ -966,6 +969,26 @@ LogicalResult LegalizeLaunchFuncOpPattern::matchAndRewrite(
// stream must be created to pass to subsequent operations.
else if (launchOp.getAsyncToken())
stream = streamCreateCallBuilder.create(loc, rewriter, {}).getResult();
+
+ if (typeCheckKernelArgs) {
+ // The current non-bare-pointer ABI is a bad fit for `mgpuLaunchKernel`,
+ // which takes an untyped list of arguments. The type check here prevents
+ // accidentally violating the assumption made in vulkan-runtime-wrappers.cpp
+ // and creating a unchecked runtime ABI mismatch.
+ // TODO: Change the ABI here to remove the need for this type check.
+ for (Value arg : launchOp.getKernelOperands()) {
+ if (auto t = dyn_cast<MemRefType>(arg.getType())) {
----------------
kuhar wrote:
nit: milr tends to avoid one-letter variable, names, unlike llvm. I'd call this `memrefTy` or `type`.
https://github.com/llvm/llvm-project/pull/123114
More information about the Mlir-commits
mailing list