CuArrays.jl icon indicating copy to clipboard operation
CuArrays.jl copied to clipboard

Upstream ldiv! overload

Open ChrisRackauckas opened this issue 4 years ago • 11 comments

DiffEqBase.jl has been carrying an ldiv! overload to make it work for awhile (https://github.com/JuliaDiffEq/DiffEqBase.jl/blob/master/src/init.jl#L148-L152), and I think it might be a good time to upstream it.

ChrisRackauckas avatar Jan 31 '20 15:01 ChrisRackauckas

Thanks! Want to add a test?

maleadt avatar Jan 31 '20 16:01 maleadt

test added

ChrisRackauckas avatar Feb 01 '20 03:02 ChrisRackauckas

bors r+

maleadt avatar Feb 04 '20 06:02 maleadt

Build failed

bors[bot] avatar Feb 04 '20 07:02 bors[bot]

@ChrisRackauckas The CI failure looks related?

maleadt avatar Feb 11 '20 06:02 maleadt

Would it make sense to make https://github.com/JuliaGPU/CuArrays.jl/blob/master/src/linalg.jl take use of this?

xukai92 avatar Feb 11 '20 21:02 xukai92

Emmm. Together with qr!, this implementation seems to be slower than what we have in https://github.com/JuliaGPU/CuArrays.jl/blob/master/src/linalg.jl#L9-L13

xukai92 avatar Feb 12 '20 01:02 xukai92

But that implementation cannot reuse factorizations, so this is a lot faster in practice.

ChrisRackauckas avatar Feb 12 '20 01:02 ChrisRackauckas

Good point!

xukai92 avatar Feb 12 '20 01:02 xukai92

I guess we should keep both then. I use \ in a case where no reuse could be taken.

xukai92 avatar Feb 12 '20 01:02 xukai92

It's also possible there's a better way to do this, but I haven't found it 🤷‍♂

ChrisRackauckas avatar Feb 12 '20 04:02 ChrisRackauckas