# Copyto! in DiffeqGPU EnsembleProblem

**URL:** <https://discourse.julialang.org/t/copyto-in-diffeqgpu-ensembleproblem/48530>\
**Category:** New to Julia\
**Tags:** diffeq, gpu\
**Created:** [October 17, 2020, 3:47am UTC](https://discourse.julialang.org/t/copyto-in-diffeqgpu-ensembleproblem/48530 "2020-10-17T03:47:52Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Vash94](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/vash94/32/13739_2.png) [@Vash94](https://discourse.julialang.org/u/Vash94)\
**Post date:** [October 17, 2020, 3:47am UTC](https://discourse.julialang.org/t/copyto-in-diffeqgpu-ensembleproblem/48530/1 "2020-10-17T03:47:52Z")

</div>

How to copy slices in EnsembleGPUArray?  
**code:**

```julia
function f_du(du,u,p,t)
 @inbounds begin
     copyto!(du,p)
 end
 nothing
end
tspan = (0.0f0,1.0f0)
u0 = [1.0,2.0,3.0]
p0=[-1.,-2.,-3.]
prob = ODEProblem(f_du,u0,tspan,p0)
prob_func = (prob,i,repeat) -> remake(prob,p=p0)
monteprob = EnsembleProblem(prob, prob_func = prob_func, safetycopy=false)
sol = solve(monteprob,Tsit5(),EnsembleGPUArray(),trajectories=10,saveat=LinRange(0,1,101))

```

as a result i get a GPUCompiler error  
**result:**

```julia
Error displaying Atom.EvalError{GPUCompiler.InternalCompilerError}: UndefVarError: versioninfo not defined
showerror(::IOContext{Base.GenericIOBuffer{Array{UInt8,1}}}, ::GPUCompiler.InternalCompilerError) at error.jl:56
(::Juno.var"#17#18"{GPUCompiler.InternalCompilerError})(::Base.GenericIOBuffer{Array{UInt8,1}}) at utils.jl:28
sprint(::Function; context::Nothing, sizehint::Int64) at io.jl:105
sprint at io.jl:101 [inlined]
errmsg at utils.jl:28 [inlined]
render(::Juno.Editor, ::Atom.EvalError{GPUCompiler.InternalCompilerError}) at errors.jl:87

```

I am new in using GPU, and have no idea how to proceed.

---

<div class="post-metadata">

**Author:** ![ChrisRackauckas](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/chrisrackauckas/32/77_2.png) [@ChrisRackauckas](https://discourse.julialang.org/u/ChrisRackauckas)\
**Post date:** [October 17, 2020, 9:05pm UTC](https://discourse.julialang.org/t/copyto-in-diffeqgpu-ensembleproblem/48530/2 "2020-10-17T21:05:01Z")

</div>

I don’t think vector functions like broadcast work inside of KernelAbstractions.jl kernels. @vchuravy what would you recommend here?
