Skip to content

Matmul changes order of loops #351

Locked Answered by abduld
gautam-e asked this question in Q&A
Discussion options

You must be logged in to vote

The order

    for m in range(C.rows):
        for k in range(A.cols):
            for n in range(C.cols):
                C[m, n] += A[m, k] * B[k, n]

is more efficient and was changed in https://docs.modular.com/mojo/changelog.html#changed-2 , but it looks like we missed a few cases. Thanks for the sharp eye. Can you please file an issue so that this will be updated in the next rollout

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@gautam-e
Comment options

Answer selected by gautam-e
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants