E7002
E7002 — Matmul element type mismatch
What the compiler reports
Error[E7002] at {{.*}}matmul_of_an_f32_and_an_f64_tensor.vx:16:14: Tensor multiplication requires matching element types, got f32 and f64
The fragments the test suite holds the compiler to. An ellipsis marks text the test does not constrain; the emitted message also carries a source location.
A program that triggers it
//
// Part of the Vx Project, under the Apache License v2.0 with LLVM Exceptions.
// See LICENSE for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//
//
// `@` needs both tensors to have the same element type. Here one is f32 and the other f64.
fn main() -> i32 {
let a = Tensor<f32, [2, 2]>::fill(1.0f32);
let b = Tensor<f64, [2, 2]>::fill(1.0f64);
let _c = a @ b;
return 0;
}
From tests/frontend/fail/matmul_of_an_f32_and_an_f64_tensor.vx, which asserts this diagnostic on every commit.