Dynamic gemm/conv

This commit is contained in:
ilgeco
2026-05-28 18:00:14 +02:00
parent cbf7b235f1
commit 1ab489fe0a
17 changed files with 704 additions and 69 deletions
@@ -249,6 +249,32 @@ LogicalResult SpatVMMOp::verify() {
return success();
}
LogicalResult SpatVVDMulOp::verify() {
auto lhsType = dyn_cast<ShapedType>(getLhs().getType());
auto rhsType = dyn_cast<ShapedType>(getRhs().getType());
auto outputType = dyn_cast<ShapedType>(getOutput().getType());
if (!lhsType || !rhsType || !outputType)
return emitError("lhs, rhs, and output must be shaped values");
if (!lhsType.hasRank() || !rhsType.hasRank() || !outputType.hasRank())
return emitError("lhs, rhs, and output must have ranked types");
ArrayRef<int64_t> lhsShape = lhsType.getShape();
ArrayRef<int64_t> rhsShape = rhsType.getShape();
ArrayRef<int64_t> outputShape = outputType.getShape();
if (lhsShape.size() != 2 || rhsShape.size() != 2 || outputShape.size() != 2)
return emitError("lhs, rhs, and output must have rank 2");
if (lhsType.getElementType() != rhsType.getElementType() || lhsType.getElementType() != outputType.getElementType())
return emitError("lhs, rhs, and output must have the same element type");
if (lhsShape != rhsShape)
return emitError("lhs and rhs vector shapes must match");
if (lhsShape[0] != 1 || lhsShape[1] <= 0)
return emitError("lhs and rhs vector shape must be (1, N) with N > 0");
if (outputShape[0] != 1 || outputShape[1] != 1)
return emitError("output shape must be (1, 1)");
return success();
}
LogicalResult SpatVAddOp::verify() {
if (failed(OpTrait::impl::verifyAtLeastNOperands(*this, 2)))
return failure();