Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

optimize matrix multiplicaton for C and F matrix #58

Open
dastrobu opened this issue Apr 3, 2022 · 0 comments
Open

optimize matrix multiplicaton for C and F matrix #58

dastrobu opened this issue Apr 3, 2022 · 0 comments
Assignees
Labels
enhancement New feature or request

Comments

@dastrobu
Copy link
Owner

dastrobu commented Apr 3, 2022

currently both matrices are always transformed to the same memory layout before multiplying. C and F contiguous matrices could be handled as is:

    if A.isFContiguous {
        order = CblasColMajor
        a = Matrix(A, order: .F)
        b = Matrix(B, order: .F)
        c = Matrix<Float>(empty: [Int(m), Int(n)], order: .F)
        lda = Int32(a.strides[1])
        ldb = Int32(b.strides[1])
        ldc = Int32(c.strides[1])
    } else {
        order = CblasRowMajor
        a = Matrix(A, order: .C)
        b = Matrix(B, order: .C)
        c = Matrix<Float>(empty: [Int(m), Int(n)], order: .C)
        lda = Int32(a.strides[0])
        ldb = Int32(b.strides[0])
        ldc = Int32(c.strides[0])
    }
@dastrobu dastrobu self-assigned this Apr 3, 2022
@dastrobu dastrobu added the enhancement New feature or request label Apr 3, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant