-
Notifications
You must be signed in to change notification settings - Fork 45
Update CUDAnative to CUDA in documentation #343
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
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Member
|
Does all the code in that example works with CUDA.jl as-is? |
Contributor
Author
|
yes, it does in 1.10, it doesn't in 1.12 but it is a bug in julia |
Contributor
Author
|
in 1.12 it doesn't because a show method throws |
Contributor
Author
julia> # move to GPU
dd = replace_storage(CuArray, d)
100-element StructArray(::CuArray{Float64, 1, CUDA.DeviceMemory}, ::CuArray{Float64, 1, CUDA.DeviceMemory}) with eltype @NamedTuple{a::Float64, b::Float64}:
Error showing value of type StructVector{@NamedTuple{a::Float64, b::Float64}, @NamedTuple{a::CuArray{Float64, 1, CUDA.DeviceMemory}, b::CuArray{Float64, 1, CUDA.DeviceMemory}}, Int64}:
SYSTEM (REPL): showing an error caused an error
ERROR: 1-element ExceptionStack:
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.
Stacktrace:
[1] error(s::String)
@ Base ./error.jl:44
[2] errorscalar(op::String)
@ GPUArraysCore ~/.julia/packages/GPUArraysCore/aNaXo/src/GPUArraysCore.jl:151
[3] _assertscalar(op::String, behavior::GPUArraysCore.ScalarIndexing)
@ GPUArraysCore ~/.julia/packages/GPUArraysCore/aNaXo/src/GPUArraysCore.jl:124
[4] assertscalar(op::String)
@ GPUArraysCore ~/.julia/packages/GPUArraysCore/aNaXo/src/GPUArraysCore.jl:112
[5] getindex
@ ~/.julia/packages/GPUArrays/ouBUA/src/host/indexing.jl:50 [inlined]
[6] macro expansion
@ ./none:-1 [inlined]
[7] get_ith
@ ./none:0 [inlined]
[8] _getindex
@ ~/.julia/dev/StructArrays/src/structarray.jl:350 [inlined]
[9] getindex
@ ~/.julia/dev/StructArrays/src/structarray.jl:345 [inlined]
[10] isassigned
@ ./multidimensional.jl:1653 [inlined]
[11] isassigned(::StructVector{@NamedTuple{…}, @NamedTuple{…}, Int64}, ::Int64, ::Int64)
@ Base ./multidimensional.jl:1648
[12] alignment(io::IOContext{…}, X::AbstractVecOrMat, rows::Vector{…}, cols::Vector{…}, cols_if_complete::Int64, cols_otherwise::Int64, sep::Int64, ncols::Int64)
@ Base ./arrayshow.jl:68
[13] _print_matrix(io::IOContext{…}, X::AbstractVecOrMat, pre::String, sep::String, post::String, hdots::String, vdots::String, ddots::String, hmod::Int64, vmod::Int64, rowsA::UnitRange{…}, colsA::UnitRange{…})
@ Base ./arrayshow.jl:207
[14] print_matrix(io::IOContext{…}, X::StructVector{…}, pre::String, sep::String, post::String, hdots::String, vdots::String, ddots::String, hmod::Int64, vmod::Int64)
@ Base ./arrayshow.jl:171
[15] print_matrix
@ ./arrayshow.jl:171 [inlined]
[16] print_array
@ ./arrayshow.jl:358 [inlined]
[17] show(io::IOContext{…}, ::MIME{…}, X::StructVector{…})
@ Base ./arrayshow.jl:399
[18] show_repl(io::IO, mime::MIME{Symbol("text/plain")}, x::Any)
@ REPL ~/.julia/juliaup/julia-1.12.3+0.x64.linux.gnu/share/julia/stdlib/v1.12/REPL/src/REPL.jl:548
[19] show_limited(io::IO, mime::MIME, x::Any)
@ REPL ~/.julia/juliaup/julia-1.12.3+0.x64.linux.gnu/share/julia/stdlib/v1.12/REPL/src/REPL.jl:517
[20] (::REPL.var"#display##0#display##1"{REPL.REPLDisplay{…}, MIME{…}, Base.RefValue{…}})(io::Any)
@ REPL ~/.julia/juliaup/julia-1.12.3+0.x64.linux.gnu/share/julia/stdlib/v1.12/REPL/src/REPL.jl:540
[21] with_repl_linfo(f::Any, repl::REPL.LineEditREPL)
@ REPL ~/.julia/juliaup/julia-1.12.3+0.x64.linux.gnu/share/julia/stdlib/v1.12/REPL/src/REPL.jl:833
[22] display(d::REPL.REPLDisplay, mime::MIME{Symbol("text/plain")}, x::Any)
@ REPL ~/.julia/juliaup/julia-1.12.3+0.x64.linux.gnu/share/julia/stdlib/v1.12/REPL/src/REPL.jl:526
[23] display
@ ~/.julia/juliaup/julia-1.12.3+0.x64.linux.gnu/share/julia/stdlib/v1.12/REPL/src/REPL.jl:546 [inlined]
[24] display(x::Any)
@ Base.Multimedia ./multimedia.jl:340
[25] (::REPL.var"#print_response##2#print_response##3")()
@ REPL ~/.julia/juliaup/julia-1.12.3+0.x64.linux.gnu/share/julia/stdlib/v1.12/REPL/src/REPL.jl:590
[26] repl_backend_loop(backend::REPL.REPLBackend, get_module::Function)
@ REPL ~/.julia/juliaup/julia-1.12.3+0.x64.linux.gnu/share/julia/stdlib/v1.12/REPL/src/REPL.jl:445
[27] start_repl_backend(backend::REPL.REPLBackend, consumer::Any; get_module::Function)
@ REPL ~/.julia/juliaup/julia-1.12.3+0.x64.linux.gnu/share/julia/stdlib/v1.12/REPL/src/REPL.jl:427
[28] start_repl_backend
@ ~/.julia/juliaup/julia-1.12.3+0.x64.linux.gnu/share/julia/stdlib/v1.12/REPL/src/REPL.jl:424 [inlined]
[29] run_repl(repl::REPL.AbstractREPL, consumer::Any; backend_on_current_task::Bool, backend::Any)
@ REPL ~/.julia/juliaup/julia-1.12.3+0.x64.linux.gnu/share/julia/stdlib/v1.12/REPL/src/REPL.jl:653
[30] run_repl(repl::REPL.AbstractREPL, consumer::Any)
@ REPL ~/.julia/juliaup/julia-1.12.3+0.x64.linux.gnu/share/julia/stdlib/v1.12/REPL/src/REPL.jl:639
[31] run_std_repl(REPL::Module, quiet::Bool, banner::Symbol, history_file::Bool)
@ Base ./client.jl:478
[32] run_main_repl(interactive::Bool, quiet::Bool, banner::Symbol, history_file::Bool)
@ Base ./client.jl:499
[33] repl_main
@ ./client.jl:586 [inlined]
[34] _start()
@ Base ./client.jl:561
Stacktrace:
[1] print_response(errio::IO, response::Any, backend::Union{…}, show_value::Bool, have_color::Bool, specialdisplay::Union{…})
@ REPL ~/.julia/juliaup/julia-1.12.3+0.x64.linux.gnu/share/julia/stdlib/v1.12/REPL/src/REPL.jl:599
[2] (::REPL.var"#print_response##0#print_response##1"{REPL.LineEditREPL, Pair{Any, Bool}, Bool, Bool})(io::Any)
@ REPL ~/.julia/juliaup/julia-1.12.3+0.x64.linux.gnu/share/julia/stdlib/v1.12/REPL/src/REPL.jl:558
[3] with_repl_linfo(f::Any, repl::REPL.LineEditREPL)
@ REPL ~/.julia/juliaup/julia-1.12.3+0.x64.linux.gnu/share/julia/stdlib/v1.12/REPL/src/REPL.jl:833
[4] print_response(repl::REPL.AbstractREPL, response::Any, show_value::Bool, have_color::Bool)
@ REPL ~/.julia/juliaup/julia-1.12.3+0.x64.linux.gnu/share/julia/stdlib/v1.12/REPL/src/REPL.jl:556
[5] (::REPL.var"#do_respond#73"{…})(s::REPL.LineEdit.MIState, buf::Any, ok::Bool)
@ REPL ~/.julia/juliaup/julia-1.12.3+0.x64.linux.gnu/share/julia/stdlib/v1.12/REPL/src/REPL.jl:1192
[6] run_interface(terminal::Base.Terminals.TextTerminal, m::REPL.LineEdit.ModalInterface, s::REPL.LineEdit.MIState)
@ REPL.LineEdit ~/.julia/juliaup/julia-1.12.3+0.x64.linux.gnu/share/julia/stdlib/v1.12/REPL/src/LineEdit.jl:2854
[7] run_frontend(repl::REPL.LineEditREPL, backend::REPL.REPLBackendRef)
@ REPL ~/.julia/juliaup/julia-1.12.3+0.x64.linux.gnu/share/julia/stdlib/v1.12/REPL/src/REPL.jl:1663
[8] (::REPL.var"#61#62"{REPL.LineEditREPL, REPL.REPLBackendRef})()
@ REPL ~/.julia/juliaup/julia-1.12.3+0.x64.linux.gnu/share/julia/stdlib/v1.12/REPL/src/REPL.jl:650
Some type information was truncated. Use `show(err)` to see complete types.
|
Member
|
Thanks! Makes total sense then. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
No description provided.