Remove `allowed_getindex` when possible, for faster GPU operations
Hello,
I'm able to use this package with CUDA Arrays, since the allowed_getindex (for example used here) does not handle the indexing error of the CuArrays. However this slow down the computation, since this process would be transfered and than executed on the CPU.
Is it possible, for example in that for loop I linked, to avoid using the allowed_getindex function? It would be a very good improvement, not only for GPU calculations.
I mean, it would make it faster to remove it, but it would also make it incorrect. Do you have an idea for how to do it with also keeping the correctness? You do have to somehow change the value by epsilon and put it back, and that will require a kernel call each time.
Also for the allowed_getindex handling, did you follow https://github.com/JuliaDiff/FiniteDiff.jl#note-about-sparse-differentiation-of-gpuarrays-bandedmatrices-and-blockbandedmatrices ?