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

Broadcasting in Kernels #71

Open
ChrisRackauckas opened this issue Aug 19, 2020 · 0 comments
Open

Broadcasting in Kernels #71

ChrisRackauckas opened this issue Aug 19, 2020 · 0 comments
Labels

Comments

@ChrisRackauckas
Copy link
Member

using DiffEqGPU, OrdinaryDiffEq
pa = [1.0]
u0 = [3.0]

function f(du,u,p,t)
    du[1] = 1.01 * u[1] * p[1]
end

function f2(du,u,p,t)
    du .= 1.01 .* u .* p
end

prob = ODEProblem(f2, u0, (0.0, 1.0), pa)

function prob_func(prob, i, repeat)
  remake(prob, u0 = 0.5 .+ i/100 .* prob.u0)
end

ensemble_prob = EnsembleProblem(prob, prob_func = prob_func)
sim = solve(ensemble_prob, Tsit5(), EnsembleGPUArray(), saveat = 0.1, trajectories = 100)
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

1 participant