defmodule Manx.Lowering.Vulkan.PutSPVAttrPass do alias Beaver.MLIR import MLIR.Sigils alias Beaver.MLIR.Dialect.GPU use Beaver.MLIR.Pass, on: GPU.Func def run(op) do [ "gpu.kernel": Beaver.MLIR.Attribute.unit(), "spv.entry_point_abi": ~a{#spv.entry_point_abi : vector<3xi32>>} ] |> Enum.each(fn {name, attr} -> ctx = MLIR.CAPI.mlirOperationGetContext(op) attr = Beaver.Deferred.create(attr, ctx) MLIR.CAPI.mlirOperationSetAttributeByName(op, MLIR.StringRef.create(name), attr) end) :ok end end