You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Only @noinline error path in matmul_size_check (#1310)
Instead of `@noinline` on the entire size-check function, we now
separate the error-throwing part into a separate function and mark it as
`@noinline`. This way, the size check may still be evaluated inline, and
only the error path will not be inlined.
This improves performance for small matmul.
```julia
julia> A = [1 2; 3 4];
julia> @Btime $A * $A;
53.361 ns (2 allocations: 112 bytes) # v"1.13.0-DEV.438"
47.504 ns (2 allocations: 112 bytes) # this PR
```
size_or_len_str_dest = destsize isa Integer ?"length":"size"
450
-
throw(DimensionMismatch(
451
-
LazyString(
452
-
"incompatible destination size: ",
453
-
lazy"the destination $strC of $size_or_len_str_C $C_size_len is incomatible with the product of a $strA of size $sizeA and a $strB of $size_or_len_str_B $B_size_len. ",
454
-
lazy"The destination must be of $size_or_len_str_dest $destsize."
size_or_len_str_dest = destsize isa Integer ?"length":"size"
460
+
throw(DimensionMismatch(
461
+
LazyString(
462
+
"incompatible destination size: ",
463
+
lazy"the destination $strC of $size_or_len_str_C $C_size_len is incomatible with the product of a $strA of size $sizeA and a $strB of $size_or_len_str_B $B_size_len. ",
464
+
lazy"The destination must be of $size_or_len_str_dest $destsize."
465
+
)
466
+
)
467
+
)
468
+
end
461
469
462
470
# We may inline the matmul2x2! and matmul3x3! calls for `α == true`
0 commit comments