Skip to content

lmul! fails with Component Array on GPU #232

Open
@vpuri3

Description

@vpuri3
julia> lmul!(false, ComponentArray((; x=CUDA.ones(2))))
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 are only permitted from the REPL for prototyping purposes.                                                                                 
If you did intend to index this array, annotate the caller with @allowscalar.
Stacktrace:                                                                                                                                              
 [1] error(s::String)  
   @ Base ./error.jl:35                                                     
 [2] assertscalar(op::String)                                                                                                                            
   @ GPUArraysCore ~/.julia/packages/GPUArraysCore/uOYfN/src/GPUArraysCore.jl:103                                                                        
 [3] getindex                                                                                                                                            
   @ LinearAlgebra ~/.julia/packages/GPUArrays/dAUOE/src/host/indexing.jl:48 [inlined]
 [4] getindex                                                                                                                                            
   @ LinearAlgebra ~/.julia/dev/ComponentArrays/src/array_interface.jl:94 [inlined]
 [5] macro expansion                                                                                                                                     
   @ LinearAlgebra ~/.julia/juliaup/julia-1.10.0-beta3+0.x64.linux.gnu/share/julia/stdlib/v1.10/LinearAlgebra/src/generic.jl:221 [inlined]
 [6] macro expansion
   @ LinearAlgebra ./simdloop.jl:77 [inlined]
 [7] lmul!(s::Bool, X::ComponentVector{Float32, CuArray{Float32, 1, CUDA.Mem.DeviceBuffer}, Tuple{Axis{(x = 1:2,)}}})
   @ LinearAlgebra ~/.julia/juliaup/julia-1.10.0-beta3+0.x64.linux.gnu/share/julia/stdlib/v1.10/LinearAlgebra/src/generic.jl:220
 [8] top-level scope
   @ REPL[16]:1
 [9] top-level scope
   @ ~/.julia/packages/CUDA/nbRJk/src/initialization.jl:205

Metadata

Metadata

Assignees

No one assigned

    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