Skip to content

Matrix Multiplication for large SizedArray #734

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

Closed
bjack205 opened this issue Feb 18, 2020 · 4 comments
Closed

Matrix Multiplication for large SizedArray #734

bjack205 opened this issue Feb 18, 2020 · 4 comments
Labels

Comments

@bjack205
Copy link
Contributor

I get the following error when multiplying two SizedArrays
conversion to pointer not defined for SizedArray{Tuple{20,20},Float64,2,2}

This occurs when the the _mul method passes the arrays to BLAS, and the error happens on the ccal in mul_blas!.

@c42f
Copy link
Member

c42f commented Feb 18, 2020

I haven't been able to reproduce this yet. The following works for me:

julia> a = rand(SizedMatrix{20,20});

julia> a*a
20×20 SArray{Tuple{20,20},Float64,2,400} with indices SOneTo(20)×SOneTo(20):
...

(You'll notice it produces an SArray, however that is changed in the latest master branch.)

Could you provide a complete self contained example of the failure?

@c42f c42f added the bug label Feb 18, 2020
@bjack205
Copy link
Contributor Author

Sorry, my bad, I forgot to mention I'm using the in-place matrix multiply

julia> a = rand(SizedMatrix{20,20});
julia> b = rand(SizedMatrix{20,20});
julia> c = zeros(SizedMatrix{20,20});
julia> mul!(c,a,b)
ERROR: conversion to pointer not defined for SizedArray{Tuple{20,20},Float64,2,2}
Stacktrace:
 [1] error(::String) at ./error.jl:33
 [2] unsafe_convert(::Type{Ptr{Float64}}, ::SizedArray{Tuple{20,20},Float64,2,2}) at ./pointer.jl:67
 [3] macro expansion at /home/brian/.julia/packages/StaticArrays/1g9bq/src/matrix_multiply.jl:307 [inlined]
 [4] mul_blas!(::Size{(20, 20)}, ::SizedArray{Tuple{20,20},Float64,2,2}, ::Size{(20, 20)}, ::Size{(20, 20)}, ::SizedArray{Tuple{20,20},Float64,2,2}, ::SizedArray{Tuple{20,20},Float64,2,2}) at /home/brian/.julia/packages/StaticArrays/1g9bq/src/matrix_multiply.jl:289
 [5] macro expansion at /home/brian/.julia/packages/StaticArrays/1g9bq/src/matrix_multiply.jl:266 [inlined]
 [6] _mul! at /home/brian/.julia/packages/StaticArrays/1g9bq/src/matrix_multiply.jl:248 [inlined]
 [7] mul!(::SizedArray{Tuple{20,20},Float64,2,2}, ::SizedArray{Tuple{20,20},Float64,2,2}, ::SizedArray{Tuple{20,20},Float64,2,2}) at /home/brian/.julia/packages/StaticArrays/1g9bq/src/matrix_multiply.jl:17
 [8] top-level scope at REPL[8]:1

@c42f
Copy link
Member

c42f commented Feb 19, 2020

Indeed that's a bug, thanks for the report!

@c42f
Copy link
Member

c42f commented Apr 17, 2020

Fixed in #738

@c42f c42f closed this as completed Apr 17, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants