Skip to content

Commit

Permalink
Format.
Browse files Browse the repository at this point in the history
  • Loading branch information
maleadt committed Jan 20, 2025
1 parent 9a5a25a commit 404460c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
8 changes: 4 additions & 4 deletions src/reflection.jl
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ function pygmentize()
return _pygmentize[]
end

const _pygmentize_version = Ref{Union{VersionNumber,Nothing}}()
const _pygmentize_version = Ref{Union{VersionNumber, Nothing}}()
function pygmentize_version()
isassigned(_pygmentize_version) && return _pygmentize_version[]

Expand Down Expand Up @@ -53,21 +53,21 @@ function pygmentize_support(lexer)
highlighter_ver = pygmentize_version()
if isnothing(highlighter_ver)
@warn "Syntax highlighting of $lexer code relies on Pygments.\n\
Use `pip install pygments` to install the lastest version" maxlog=1
Use `pip install pygments` to install the lastest version" maxlog = 1
return false
elseif lexer == "ptx"
if highlighter_ver < v"2.16"
@warn "Pygments supports PTX highlighting starting from version 2.16\n\
Detected version $highlighter_ver\n\
Please update with `pip install pygments -U`" maxlog=1
Please update with `pip install pygments -U`" maxlog = 1
return false
end
return true
elseif lexer == "gcn"
if highlighter_ver < v"2.8"
@warn "Pygments supports GCN highlighting starting from version 2.8\n\
Detected version $highlighter_ver\n\
Please update with `pip install pygments -U`" maxlog=1
Please update with `pip install pygments -U`" maxlog = 1
return false
end
return true
Expand Down
8 changes: 4 additions & 4 deletions test/utils.jl
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,8 @@ end
@%p2 bra \$L__BB0_3;
"""
can_highlight = GPUCompiler.pygmentize_support("ptx")
highlighted = sprint(GPUCompiler.highlight, sample, "ptx"; context=(:color => true))
@test occursin(ansi_color, highlighted) skip=!can_highlight
highlighted = sprint(GPUCompiler.highlight, sample, "ptx"; context = (:color => true))
@test occursin(ansi_color, highlighted) skip = !can_highlight
end

@testset "GCN" begin
Expand All @@ -68,7 +68,7 @@ end
v_addc_u32 v4, vcc, v4, 0, vcc
"""
can_highlight = GPUCompiler.pygmentize_support("gcn")
highlighted = sprint(GPUCompiler.highlight, sample, "gcn"; context=(:color => true))
@test occursin(ansi_color, highlighted) skip=!can_highlight
highlighted = sprint(GPUCompiler.highlight, sample, "gcn"; context = (:color => true))
@test occursin(ansi_color, highlighted) skip = !can_highlight
end
end

0 comments on commit 404460c

Please sign in to comment.