-
Notifications
You must be signed in to change notification settings - Fork 79
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
Support for CUDA #218
Comments
Could you supply an example? |
using LsqFit
@. model(x, p) = p[1]*exp(-x*p[2])
xdata = collect(range(0, stop=10, length=20))
ydata = model(xdata, [1.0 2.0]) + 0.01*randn(length(xdata))
p0 = [0.5, 0.5]
fit = curve_fit(model, xdata, ydata, p0) and for the CUDA GPU using CUDA
xdata_gpu = cu(xdata)
ydata_gpu = cu(ydata)
fit = curve_fit(model, xdata_gpu, ydata_gpu, p0) but fails GPU compilation of kernel #broadcast_kernel#17(CUDA.CuKernelContext, CuDeviceMatrix{Float64, 1}, Base.Broadcast.Broadcasted{CUDA.CuArrayStyle{2}, Tuple{Base.OneTo{Int64}, Base.OneTo{Int64}}, typeof(*), Tuple{Base.Broadcast.Broadcasted{CUDA.CuArrayStyle{1}, Nothing, typeof(*), Tuple{Float64, Base.Broadcast.Extruded{CuDeviceVector{Float64, 1}, Tuple{Bool}, Tuple{Int64}}}}, Base.Broadcast.Extruded{LinearAlgebra.Adjoint{Float64, Vector{Float64}}, Tuple{Bool, Bool}, Tuple{Int64, Int64}}}}, Int64) failed
KernelError: passing and using non-bitstype argument
Argument 4 to your kernel function is of type Base.Broadcast.Broadcasted{CUDA.CuArrayStyle{2}, Tuple{Base.OneTo{Int64}, Base.OneTo{Int64}}, typeof(*), Tuple{Base.Broadcast.Broadcasted{CUDA.CuArrayStyle{1}, Nothing, typeof(*), Tuple{Float64, Base.Broadcast.Extruded{CuDeviceVector{Float64, 1}, Tuple{Bool}, Tuple{Int64}}}}, Base.Broadcast.Extruded{LinearAlgebra.Adjoint{Float64, Vector{Float64}}, Tuple{Bool, Bool}, Tuple{Int64, Int64}}}}, which is not isbits:
.args is of type Tuple{Base.Broadcast.Broadcasted{CUDA.CuArrayStyle{1}, Nothing, typeof(*), Tuple{Float64, Base.Broadcast.Extruded{CuDeviceVector{Float64, 1}, Tuple{Bool}, Tuple{Int64}}}}, Base.Broadcast.Extruded{LinearAlgebra.Adjoint{Float64, Vector{Float64}}, Tuple{Bool, Bool}, Tuple{Int64, Int64}}} which is not isbits.
.2 is of type Base.Broadcast.Extruded{LinearAlgebra.Adjoint{Float64, Vector{Float64}}, Tuple{Bool, Bool}, Tuple{Int64, Int64}} which is not isbits.
.x is of type LinearAlgebra.Adjoint{Float64, Vector{Float64}} which is not isbits.
.parent is of type Vector{Float64} which is not isbits. |
Okay, I can have a look. |
Hi @pkofod I created a pull request that makes this package compatible with CUDA arrays. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hello,
I tried to use CuArrays to fit some data. The
model(x, p)
function works great if p is a CPU Array. However the fitting procedure doesn't work.I could be a great extension, increasing the performances.
The text was updated successfully, but these errors were encountered: