AutoPreallocation.jl
AutoPreallocation.jl copied to clipboard
add CuArray support
Fixes #10 #24
With this, e.g.:
julia> using CUDA, AutoPreallocation
julia> _,f = preallocate() do
x = CUDA.zeros(10)
2 * x .+ 3
end;
julia> CUDA.@allocated f()
0
This works but I want to play around with more CUDA functionality to make sure enough stuff works. Any early feedback you may have is welcome too.
A decent bit of things work (broadcast, matmul, etc...), although we currently have:
_,f = preallocate() do
x = CUDA.zeros(10)
fft(x)
end
CUDA.@allocated f() # ERROR: CUDA error: invalid argument (code 1, ERROR_INVALID_VALUE)
and
_,f = preallocate() do
x = CUDA.zeros(10)
map(sin, x)
end # segfault
Also there might possibly be some regressions given the test failures, although its hard to tell, tests pass locally for my machine. I'll continue to hack on this where I can. If you get tired of waiting for me to do so, feel free to also merge the functionality the currently exists and whatever I add I'll do in a followup.
I'll continue to hack on this where I can. If you get tired of waiting for me to do so, feel free to also merge the functionality the currently exists and whatever I add I'll do in a followup.
I am happy to wait.
Meanwhile: @maleadt how hard would it be to get this repo setup to do testing with JuliaGPU?
@maleadt how hard would it be to get this repo setup to do testing with JuliaGPU?
It's slightly cumbersome nowadays; I documented it here: https://github.com/JuliaGPU/buildkite#adding-a-repository. I'm not entirely sure how it'll work for repositories that are not part of an organization, but we can try.