Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

lmul! fails with Component Array on GPU #232

Open
vpuri3 opened this issue Nov 1, 2023 · 0 comments · May be fixed by #233
Open

lmul! fails with Component Array on GPU #232

vpuri3 opened this issue Nov 1, 2023 · 0 comments · May be fixed by #233

Comments

@vpuri3
Copy link
Member

vpuri3 commented Nov 1, 2023

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
@vpuri3 vpuri3 linked a pull request Nov 1, 2023 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant