Skip to content

L2_NORM resorts to scalar indexing on GPU ComponentArray #524

Closed
@vpuri3

Description

@vpuri3
julia> using CUDA, NonlinearSolve; CUDA.allowscalar(false)                                         
                                                 
julia> x = ComponentArray(; x = ones(2), y = ones(2)) |> cu              
ComponentVector{Float32, CuArray{Float32, 1, CUDA.DeviceMemory}, Tuple{Axis{(x = 1:2, y = 3:4)}}}(x = Float32[1.0, 1.0], y = Float32[1.0, 1.0])                                                       
                                                                                                   
julia> NonlinearSolveBase.L2_NORM(x)                                                               
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.

Need a ComponentArray extension with L2_NORM(x::CA) = L2_NORM(getdata(x)).

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions