How to use OffsetArray with CUDA

Yeah, Julia isn’t currently great wrt. wrapped arrays and preserving functionality from the contained array type where needed. I typically link to Use with multiple wrappers · Issue #21 · JuliaGPU/Adapt.jl · GitHub for this, and this would need some work in Base to resolve (e.g., AbstractWrappedArray, or another approach for wrapped array identification · Issue #51910 · JuliaLang/julia · GitHub). We try to support Base’s array wrappers as much as possible, and for other types like OffsetArray a package extension that fixes or overrides dispatch where needed could be added.

If you simply want compatibility (i.e., without triggering scalar indexing errors, but also without executing on the GPU) you can use unified memory, see CUDA.jl 5.4: Memory management mayhem ⋅ JuliaGPU