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

Fix #388, hcat allocations with Julia master #461

Merged
merged 2 commits into from
Jul 5, 2018

Conversation

tkoolen
Copy link
Contributor

@tkoolen tkoolen commented Jul 4, 2018

Apparently this is a bit easier on the compiler.

(also just use StaticVecOrMat instead of Union{StaticVector,StaticMatrix})

@tkoolen
Copy link
Contributor Author

tkoolen commented Jul 4, 2018

Note that tests only pass on nightly because of JuliaLang/julia#27398, but I think we were running into a different limit before this change, since even on nightly inference gives up after 5 arguments before this PR.

src/linalg.jl Outdated
@inline vcat(a::Union{StaticVector, StaticMatrix}, b::Union{StaticVector,StaticMatrix}) = _vcat(Size(a), Size(b), a, b)
@generated function _vcat(::Size{Sa}, ::Size{Sb}, a::Union{StaticVector, StaticMatrix}, b::Union{StaticVector,StaticMatrix}) where {Sa, Sb}
@inline vcat(a::StaticVecOrMat) = a
@inline vcat(a::Union{StaticVector, StaticMatrix}, b::StaticVecOrMat) = _vcat(Size(a), Size(b), a, b)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missed one Union minification here

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed.

@andyferris
Copy link
Member

I'm ok with merging this - but the METATDATA people mightn't be happy about the failing tests if we want to tag.

@tkoolen
Copy link
Contributor Author

tkoolen commented Jul 5, 2018

Made the number of arguments in the test version-dependent (v"0.7.0-beta.47" is the first version to include JuliaLang/julia#27398). Femtocleaner can clean that up later.

@tkoolen tkoolen merged commit 5087eca into JuliaArrays:master Jul 5, 2018
@tkoolen tkoolen deleted the tk/fix-hcat branch July 5, 2018 12:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants