-
Notifications
You must be signed in to change notification settings - Fork 244
Closed
Labels
bugSomething isn't workingSomething isn't working
Description
Cf. https://discourse.julialang.org/t/isbits-union-support-in-cuda-jl/72219
julia> map(x->1, CuVector([1,missing,nothing]));
ERROR: InvalidIRError: compiling kernel broadcast_kernel(CUDA.CuKernelContext, CuDeviceVector{Int64, 1}, Base.Broadcast.Broadcasted{Nothing, Tuple{Base.OneTo{Int64}}, var"#1#2", Tuple{Base.Broadcast.Extruded{CuDeviceVector{Union{Missing, Nothing, Int64}, 1}, Tuple{Bool}, Tuple{Int64}}}}, Int64) resulted in invalid LLVM IR
Reason: unsupported dynamic function invocation (call to arrayref_union(A::CuDeviceArray{T, AS, A} where A, index::Integer) where {T, AS} in CUDA)
Stacktrace:
[1] arrayref
@ ~/.julia/packages/CUDA/YpW0k/src/device/array.jl:113
[2] getindex
@ ~/.julia/packages/CUDA/YpW0k/src/device/array.jl:192
[3] getindex
@ ~/.julia/packages/CUDA/YpW0k/src/device/array.jl:204
[4] _broadcast_getindex
@ ./broadcast.jl:614
[5] _getindex
@ ./broadcast.jl:645
[6] _broadcast_getindex
@ ./broadcast.jl:620
[7] getindex
@ ./broadcast.jl:575
[8] broadcast_kernel
@ ~/.julia/packages/GPUArrays/3sW6s/src/host/broadcast.jl:59
Stacktrace:
[1] check_ir(job::GPUCompiler.CompilerJob{GPUCompiler.PTXCompilerTarget, CUDA.CUDACompilerParams, GPUCompiler.FunctionSpec{GPUArrays.var"#broadcast_kernel#17", Tuple{CUDA.CuKernelContext, CuDeviceVector{Int64, 1}, Base.Broadcast.Broadcasted{Nothing, Tuple{Base.OneTo{Int64}}, var"#1#2", Tuple{Base.Broadcast.Extruded{CuDeviceVector{Union{Missing, Nothing, Int64}, 1}, Tuple{Bool}, Tuple{Int64}}}}, Int64}}}, args::LLVM.Module)
@ GPUCompiler ~/.julia/packages/GPUCompiler/jXIvo/src/validation.jl:111
[2] macro expansion
@ ~/.julia/packages/GPUCompiler/jXIvo/src/driver.jl:333 [inlined]
[3] macro expansion
@ ~/.julia/packages/TimerOutputs/SSeq1/src/TimerOutput.jl:252 [inlined]
[4] macro expansion
@ ~/.julia/packages/GPUCompiler/jXIvo/src/driver.jl:331 [inlined]
[5] emit_asm(job::GPUCompiler.CompilerJob, ir::LLVM.Module; strip::Bool, validate::Bool, format::LLVM.API.LLVMCodeGenFileType)
@ GPUCompiler ~/.julia/packages/GPUCompiler/jXIvo/src/utils.jl:62
[6] cufunction_compile(job::GPUCompiler.CompilerJob)
@ CUDA ~/.julia/packages/CUDA/YpW0k/src/compiler/execution.jl:326
[7] cached_compilation(cache::Dict{UInt64, Any}, job::GPUCompiler.CompilerJob, compiler::typeof(CUDA.cufunction_compile), linker::typeof(CUDA.cufunction_link))
@ GPUCompiler ~/.julia/packages/GPUCompiler/jXIvo/src/cache.jl:89
[8] cufunction(f::GPUArrays.var"#broadcast_kernel#17", tt::Type{Tuple{CUDA.CuKernelContext, CuDeviceVector{Int64, 1}, Base.Broadcast.Broadcasted{Nothing, Tuple{Base.OneTo{Int64}}, var"#1#2", Tuple{Base.Broadcast.Extruded{CuDeviceVector{Union{Missing, Nothing, Int64}, 1}, Tuple{Bool}, Tuple{Int64}}}}, Int64}}; name::Nothing, kwargs::Base.Iterators.Pairs{Union{}, Union{}, Tuple{}, NamedTuple{(), Tuple{}}})
@ CUDA ~/.julia/packages/CUDA/YpW0k/src/compiler/execution.jl:297
[9] cufunction
@ ~/.julia/packages/CUDA/YpW0k/src/compiler/execution.jl:291 [inlined]
[10] macro expansion
@ ~/.julia/packages/CUDA/YpW0k/src/compiler/execution.jl:102 [inlined]
[11] #launch_heuristic#234
@ ~/.julia/packages/CUDA/YpW0k/src/gpuarrays.jl:17 [inlined]
[12] copyto!
@ ~/.julia/packages/GPUArrays/3sW6s/src/host/broadcast.jl:65 [inlined]
[13] copyto!
@ ./broadcast.jl:936 [inlined]
[14] copy
@ ~/.julia/packages/GPUArrays/3sW6s/src/host/broadcast.jl:47 [inlined]
[15] materialize(bc::Base.Broadcast.Broadcasted{CUDA.CuArrayStyle{1}, Nothing, var"#1#2", Tuple{CuArray{Union{Missing, Nothing, Int64}, 1, CUDA.Mem.DeviceBuffer}}})
@ Base.Broadcast ./broadcast.jl:883
[16] map(::Function, ::CuArray{Union{Missing, Nothing, Int64}, 1, CUDA.Mem.DeviceBuffer})
@ GPUArrays ~/.julia/packages/GPUArrays/3sW6s/src/host/broadcast.jl:90
[17] top-level scope
@ REPL[2]:1
[18] top-level scope
@ ~/.julia/packages/CUDA/YpW0k/src/initialization.jl:52
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working