Skip to content

Better stacktraces #44

Closed

Description

@vchuravy

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

Activity

  1. added
    help wanted
    on Feb 29, 2020
  2. vchuravy commented on Apr 25, 2023

    @vchuravy
    MemberAuthor

    Doing something like JuliaLang/julia#49488 would help.

  3. added
    kernels
    on Oct 19, 2026
  4. maleadt commented on Oct 19, 2026

    @maleadt
    Member

    Fixed since Cassette was removed (#288) and the CPU back end compiles kernels like a GPU back end (#556): compile errors and, with julia -g2, kernel exceptions now point at the line in the @kernel body.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    help wantedkernels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions