I would like to pass a pointer to CuArray (or one of its sections) as a parameter for DifferentialEquations right-hand-side function which is defined as a GPU kernel function.

Why do I need it? I have a differential equation whose driving function is defined on a fixed grid (see DIfferentialEquations with the driving function defined on a fixed grid). The corresponding problem can be defined as

```
function func(u, p, t)
tt, ff = p
f = linterp(t, tt, ff) # some linear interpolation
return f
end
t = range(0.0, 10.0, length=101)
f = cos.(t)
tspan = (t[1], t[end])
u0 = 0.0
p = (t, f)
prob = ODEProblem(func, u0, tspan, p)
```

Since array `f`

in parameters tuple `p`

is passed by reference I can redefine it at any later stage and the function `func`

will know about this change without need to remake the `prob`

. The same will work if `f`

is a multidimensional array and I pass to `p`

one of its 1d sections using `@view`

macro.

Now I would like to solve this kind of equation on GPU with `f`

being a CuArray. In this situation `func`

will be converted to a GPU kernel function (though I do not know how it actually done in DifferentialEquations, but I try to write my own implementation where it happens). The first problem is the fact that CuArray `f`

is not isbits and therefore it can not be accessed inside `func`

. I can solve this issue by converting `f`

into StaticArray. However, in this case I will loose the advantage of changing `f`

without remaking the `prob`

.

Thus, I need some kind of pointer to CuArray `f`

(or one of its sections if it has multiple dimensions). As far as I understand, in CUDA package this functionality is somehow realized through CuDeviceArray type. Therefore, I guess, I have to manually convert my CuArray into CudeviceArray. How can I do it? Or can you please suggest me any other solutions. Thank you.