Increment elements of array by index

I am having a lot of trouble understanding what you mean here:

Could you clarify?

Perhaps you can show your version that iterates over indices that will make it easier to help find a solution that is GPU friendly. Your current ‘partial solution’ errors, so I don’t really get what you’re trying to do.

Further questions:

  • Does I need to be a mutable array? Can it be a CartesianIndex?