JuliaGPU/CUDA.jl

Color the output of `@device_code_sass`

Open

#1,144 创建于 2021年9月14日

在 GitHub 查看
 (4 评论) (0 反应) (0 负责人)Julia (274 fork)batch import
enhancementgood first issue

仓库指标

Star
 (1,408 star)
PR 合并指标
 (平均合并 5天 5小时) (30 天内合并 16 个 PR)

描述

Is your feature request related to a problem? Please describe.

Not a problem per se, but Julia itself does some nice highlighting with @code_native, e.g. image

I find the colouring makes it easier to see what's going on. As it currently is @device_code_sass, has no such colouring.

Describe the solution you'd like

I think it would be rather nice if @device_code_sass similarly colourised its output. Perhaps InteractiveUtils.print_native could be reused? Looking at what @code_native does, I see:

function code_native(io::IO, @nospecialize(f), @nospecialize(types=Tuple);
                     syntax::Symbol=:att, debuginfo::Symbol=:default)
    d = _dump_function(f, types, true, false, false, false, syntax, true, debuginfo)
    if highlighting[:native] && get(io, :color, false)
        print_native(io, d)
    else
        print(io, d)
    end
end

贡献者指南