# Moving ahead with CUDA support

**URL:** <https://discourse.julialang.org/t/moving-ahead-with-cuda-support/126208>\
**Category:** GPU\
**Tags:** images, cuda, paddedviews, juliaimages\
**Created:** [February 23, 2025, 10:44am UTC](https://discourse.julialang.org/t/moving-ahead-with-cuda-support/126208 "2025-02-23T10:44:18Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![RainerHeintzmann](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/rainerheintzmann/32/19726_2.png) [@RainerHeintzmann](https://discourse.julialang.org/u/RainerHeintzmann)\
**Post date:** [February 23, 2025, 10:44am UTC](https://discourse.julialang.org/t/moving-ahead-with-cuda-support/126208/1 "2025-02-23T10:44:18Z")

</div>

For a number of applications CUDA (and AD) support of various packages (e.g. `FourierTools.jl`) would be great. One road-block is the support of a form of shifted and padded images.  
Sometimes a requirement is a shifted and padded (writable) view, which one gets by either nesting `OffsetArray` and `PaddedView` with a mutable extension (see `select_region_view()` in `NDTools.jl`) or use a mutable version of `ShiftedArray`. To this aim, I filed a [pull request](https://github.com/JuliaArrays/ShiftedArrays.jl/pull/67) more than a years ago with `ShiftedArray` adding `CUDA.jl` support via the `Adapt.jl` mechanism.  
However, this is unfortunately not moving ahead and currently there is no feedback from @piever .  
What is the best way to move on? Register a new package with a new name from a fork and base future work on this?

I saw related efforts (CUDA and AD support) on the 2021 roadmap for `Images.jl`. They seem to be using `PaddedViews.jl`. Is there a preference of `PaddedViews` combined with `OffsetArrays` over `ShiftedArrays`? I guess using `ShiftedArrays` could remove one level of type nesting.

---

<div class="post-metadata">

**Author:** ![RainerHeintzmann](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/rainerheintzmann/32/19726_2.png) [@RainerHeintzmann](https://discourse.julialang.org/u/RainerHeintzmann)\
**Post date:** [March 9, 2025, 3:56pm UTC](https://discourse.julialang.org/t/moving-ahead-with-cuda-support/126208/2 "2025-03-09T15:56:15Z")

</div>

… decided to add the type `MutableShiftedArray` and make another [PR](https://github.com/JuliaArrays/ShiftedArrays.jl/pull/69). What is the best way to proceed here?

---

<div class="post-metadata">

**Author:** ![RainerHeintzmann](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/rainerheintzmann/32/19726_2.png) [@RainerHeintzmann](https://discourse.julialang.org/u/RainerHeintzmann)\
**Post date:** [March 17, 2025, 4:13pm UTC](https://discourse.julialang.org/t/moving-ahead-with-cuda-support/126208/3 "2025-03-17T16:13:48Z")

</div>

… the `MutableShiftedArray` is different enough to warrant releasing a new package, which is what I finally ended up doing:

> **[GitHub - RainerHeintzmann/MutableShiftedArrays.jl: A lightweight toolbox representing a ShiftedArray...](https://github.com/RainerHeintzmann/MutableShiftedArrays.jl)**
>
> A lightweight toolbox representing a ShiftedArray which is mutable. The code was based on ShiftedArrays.jl

However, regarding the `ShiftedArrays.jl` there is still the question, how to proceed. In my view it would really benefit from `CUDA.jl` support as suggested by the PR. E.g. the `CircshiftedArray` and the `fftshift` are somewhat commonly used and important.
