-
Notifications
You must be signed in to change notification settings - Fork 152
Open
Description
Consider the following minimal reproducible example:
using CUDA, ForwardDiff
x = cu(ones(3))
f(x) = x.^2
ForwardDiff.jacobian(f, x)
Result on ForwardDiff 1.0.0:
julia> ForwardDiff.jacobian(f, x)
3×3 CuArray{Float32, 2, CUDA.DeviceMemory}:
2.0 0.0 0.0
0.0 2.0 0.0
0.0 0.0 2.0
which is obviously correct.
On ForwardDiff 1.0.1:
ERROR: Scalar indexing is disallowed.
Invocation of getindex resulted in scalar indexing of a GPU array.
This is typically caused by calling an iterating implementation of a method.
Such implementations *do not* execute on the GPU, but very slowly on the CPU,
and therefore should be avoided.
If you want to allow scalar iteration, use `allowscalar` or `@allowscalar`
to enable scalar iteration globally or for the operations in question.
Issue introduced in: #739
Metadata
Metadata
Assignees
Labels
No labels