JuliaGPU / JuliaGPU/KernelAbstractions.jl
Better stacktraces
- Dominant language
- Julia
- Stars
- 523
- Forks
- 88
- Avg merge
- 1d 11h
- Merged PRs (30d)
- 25
Description
In the example below the stacktrace is `src/macros.jl:212` but it should have rather been the kernel function itself.
In general due to the code motion we are doing the line info nodes are rather messed up.
```
MethodError: no method matching __index_Global_Cartesian(::CartesianIndex{2})
Stacktrace:
[1] __index_Global_NTuple at /home/travis/build/JuliaGPU/KernelAbstractions.jl/src/KernelAbstractions.jl:214 [inlined]
[2] cpu_matmul_kernel! at /home/travis/build/JuliaGPU/KernelAbstractions.jl/src/macros.jl:212 [inlined]
[3] (::KernelAbstractions.var"#25#28"{Cassette.Context{nametype(CPUCtx),KernelAbstractions.CompilerMetadata{KernelAbstractions.NDIteration.DynamicSize,true,CartesianIndex{2},CartesianIndices{2,Tuple{Base.OneTo{Int64},Base.OneTo{Int64}}},KernelAbstractions.NDIteration.NDRange{2,KernelAbstractions.NDIteration.DynamicSize,KernelAbstractions.NDIteration.StaticSize{(4, 1)},CartesianIndices{2,Tuple{Base.OneTo{Int64},Base.OneTo{Int64}}},Nothing}},Nothing,KernelAbstractions.var"##PassType#253",Nothing,Cassette.DisableHooks},KernelAbstractions.Kernel{CPU,KernelAbstractions.NDIteration.StaticSize{(4,)},KernelAbstractions.NDIteration.DynamicSize,typeof(cpu_matmul_kernel!)},Tuple{Array{Float64,2},Array{Float64,2},Array{Float64,2}}})() at ./threadingconstructs.jl:126
```
Contributor guide
No contributing guide indexed for this repository
Research direction
Reproduce the example showing the MethodError and inspect the code-motion and line-information handling around src/macros.jl:212. Compare the reported stacktrace with the kernel function location. Done means the stacktrace points to the kernel function rather than the macro location, without the current misleading inlined frame.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- julia
- Domain
- compilers
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 25/100