Skip to content

Question about how to use on gpu #195

@yolhan83

Description

@yolhan83

Hello, I wonder why this is not working on gpu :

julia> using CUDA,FiniteDiff
julia> f(x) = sum(abs2,x)
f (generic function with 1 method)

julia> x = rand(100,100) |> CuArray;

julia> f(x)
3298.8592709432687

julia> FiniteDiff.finite_difference_gradient(f,x);
ERROR: MethodError: no method matching compute_epsilon(::Val{:central}, ::CuArray{Float64, 2, CUDA.DeviceMemory}, ::Float64, ::Float64, ::Bool)
The function `compute_epsilon` exists, but no method is defined for this combination of argument types.

julia> FiniteDiff.finite_difference_gradient(f,collect(x)); # works

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions