Implemented Karatsuba's Algorithm for complex matmul and pre-commit them

This commit is contained in:
thesuryash
2025-05-23 08:30:47 -04:00
parent 1d9076c24b
commit f859e75f4f

View File

@@ -2880,13 +2880,13 @@ if (a.dtype() == complex64 && b.dtype() == complex64) {
auto c_real = subtract(m1, m2, s);
auto c_imag = subtract(m3, add(m1, m2, s), s);
return add(c_real, multiply(array(complex64_t{0, 1}, complex64), c_imag, s), s);
return add(
c_real, multiply(array(complex64_t{0, 1}, complex64), c_imag, s), s);
}
// Type promotion
auto out_type = promote_types(a.dtype(), b.dtype());
if (!issubdtype(out_type, floating)) {
std::ostringstream msg;
msg << "[matmul] Only real floating point types are supported but "