CUDAnative question: "recursion not currently supported error" when running reduce.jl example

I am trying to run your “reduce.jl” example with julia 0.7.0 on my PC laptop which has the 940MX card. I am getting the following “recursion not supported error:”

julia> include(“verify_reduce.jl”)
ERROR: LoadError: GPU compilation failed, try inspecting generated code with any of the @device_code_… macros
CompilerError: could not compile reduce_grid(typeof(+), CuDeviceArray{Int32,1,CUDAnative.AS.Global}, CuDeviceArray{Int32,1,CUDAnative.AS.Global}, Int32); recursion is currently not supported
Stacktrace:
[1] recurse_value_invocation at C:\Users\ismailb.julia\packages\CUDAnative\FzmMm\src\cgutils.jl:233
[2] shfl_down at C:\Users\ismailb.julia\packages\CUDAnative\FzmMm\src\device\intrinsics\warp_shuffle.jl:70
[3] split_value_invocation at C:\Users\ismailb.julia\packages\CUDAnative\FzmMm\src\cgutils.jl:203
[4] recurse_value_invocation at C:\Users\ismailb.julia\packages\CUDAnative\FzmMm\src\cgutils.jl:233
[5] reduce_block at C:\Users\ismailb\julia_code\reduce_cuda.jl:24
[6] reduce_grid at C:\Users\ismailb\julia_code\reduce_cuda.jl:59 (repeats 2 times)
Stacktrace:
[1] (::getfield(CUDAnative, Symbol(“#hook_emit_function#55”)){CUDAnative.CompilerContext,Array{Core.MethodInstance,1}})(::Core.MethodInstance, ::Core.CodeInfo, ::UInt64) at C:\Users\ismailb.julia\packages\CUDAnative\FzmMm\src\compiler.jl:154
[2] irgen(::CUDAnative.CompilerContext) at C:\Users\ismailb.julia\packages\CUDAnative\FzmMm\src\compiler.jl:189
[3] #compile_function#69(::Bool, ::Function, ::CUDAnative.CompilerContext) at .\logging.jl:308
[4] compile_function at C:\Users\ismailb.julia\packages\CUDAnative\FzmMm\src\compiler.jl:651 [inlined]
[5] #cufunction#70(::Base.Iterators.Pairs{Symbol,typeof(reduce_grid),Tuple{Symbol},NamedTuple{(:inner_f,),Tuple{typeof(reduce_grid)}}}, ::Function, ::CuDevice, ::Any, ::Any) at C:\Users\ismailb.julia\packages\CUDAnative\FzmMm\src\compiler.jl:714
[6] (::getfield(CUDAnative, Symbol(“#kw##cufunction”)))(::NamedTuple{(:inner_f,),Tuple{typeof(reduce_grid)}}, ::typeof(cufunction), ::CuDevice, ::Function, ::Type) at .\none:0
[7] _cuda(::CUDAnative.KernelWrapper{typeof(reduce_grid)}, ::typeof(reduce_grid), ::Tuple{}, ::NamedTuple{(:blocks, :threads),Tuple{Float64,Int64}}, ::typeof(+), ::CuDeviceArray{Int32,1,CUDAnative.AS.Global}, ::CuDeviceArray{Int32,1,CUDAnative.AS.Global}, ::Int32) at C:\Users\ismailb.julia\packages\CUDAnative\FzmMm\src\execution.jl:219
[8] macro expansion at .\gcutils.jl:87 [inlined]
[9] gpu_reduce(::typeof(+), ::CuArray{Int32,1}, ::CuArray{Int32,1}) at C:\Users\ismailb\julia_code\reduce_cuda.jl:95
[10] top-level scope at C:\Users\ismailb\julia_code\verify_reduce.jl:18
[11] include at .\boot.jl:317 [inlined]
[12] include_relative(::Module, ::String) at .\loading.jl:1038
[13] include(::Module, ::String) at .\sysimg.jl:29
[14] include(::String) at .\client.jl:398
[15] top-level scope at none:0
in expression starting at C:\Users\ismailb\julia_code\verify_reduce.jl:15

What am I doing wrong?

Regards,
Ismail

Please don’t double-post. Continuing at Question: Getting a "recursion not supported: error when compiling reduce.jl · Issue #247 · JuliaGPU/CUDAnative.jl · GitHub

1 Like