Skip to content

Commit

Permalink
Rerun runic and lock to specific commit (#511)
Browse files Browse the repository at this point in the history
  • Loading branch information
fredrikekre authored Aug 22, 2024
1 parent ae038d8 commit 9b86c00
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 10 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/runic.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
- uses: julia-actions/cache@v2
- name: Install Runic
run: |
julia --color=yes --project=@runic -e 'using Pkg; Pkg.add(url = "https://github.com/fredrikekre/Runic.jl")'
julia --color=yes --project=@runic -e 'using Pkg; Pkg.add(url = "https://github.com/fredrikekre/Runic.jl", rev = "e128bc9b77ea44b8fe23a0c3afe741a19c71a7b2")'
- name: Run Runic
run: |
git ls-files -z -- '*.jl' | xargs -0 julia --project=@runic -m Runic --check --diff
7 changes: 6 additions & 1 deletion src/extras/loopinfo.jl
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,12 @@ module MD
end

function loopinfo(expr, nodes...)
if @capture(expr, for i_ in iter_ body__ end)
if @capture(
expr,
for i_ in iter_
body__
end,
)
return quote
for $i in $iter
$(body...)
Expand Down
16 changes: 8 additions & 8 deletions test/nditeration.jl
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ using Test

function nditeration_testsuite()
@testset "iteration" begin
let ndrange = NDRange{2, DynamicSize, DynamicSize}(CartesianIndices((256, 256)), CartesianIndices((32, 32)));
let ndrange = NDRange{2, DynamicSize, DynamicSize}(CartesianIndices((256, 256)), CartesianIndices((32, 32)))
@test length(ndrange) == 256 * 256
@test all(p -> p[1] == p[2], zip(ndrange, CartesianIndices((256, 256))))
end
let ndrange = NDRange{2, StaticSize{(256, 256)}, DynamicSize}(nothing, CartesianIndices((32, 32)));
let ndrange = NDRange{2, StaticSize{(256, 256)}, DynamicSize}(nothing, CartesianIndices((32, 32)))
@test length(ndrange) == 256 * 256
@test all(p -> p[1] == p[2], zip(ndrange, CartesianIndices((256, 256))))
end
Expand All @@ -34,14 +34,14 @@ function nditeration_testsuite()
@testset "linear_iteration" begin
Dim_x = 32
Dim_y = 32
let ndrange = NDRange{2, StaticSize{(4, 4)}, StaticSize{(Dim_x, Dim_y)}}();
let ndrange = NDRange{2, StaticSize{(4, 4)}, StaticSize{(Dim_x, Dim_y)}}()
idx = linear_iteration(ndrange)
for (i, I) in zip(1:length(blocks(ndrange)), blocks(ndrange))
I = Tuple(I)
@test check(idx, i - 1, ntuple(i -> I[i] - 1, length(I))..., Dim_x, Dim_y)
end
end
let ndrange = NDRange{2, DynamicSize, DynamicSize}(CartesianIndices((4, 4)), CartesianIndices((Dim_x, Dim_y)));
let ndrange = NDRange{2, DynamicSize, DynamicSize}(CartesianIndices((4, 4)), CartesianIndices((Dim_x, Dim_y)))
idx = linear_iteration(ndrange)
for (i, I) in zip(1:length(blocks(ndrange)), blocks(ndrange))
I = Tuple(I)
Expand All @@ -51,15 +51,15 @@ function nditeration_testsuite()

Dim_x = 32
Dim_y = 1
let ndrange = NDRange{2, StaticSize{(4, 4 * 32)}, StaticSize{(Dim_x, Dim_y)}}();
let ndrange = NDRange{2, StaticSize{(4, 4 * 32)}, StaticSize{(Dim_x, Dim_y)}}()
idx = linear_iteration(ndrange)
N = length(workitems(ndrange))
for (i, I) in zip(1:length(blocks(ndrange)), blocks(ndrange))
I = Tuple(I)
@test check(idx, i - 1, ntuple(i -> I[i] - 1, length(I))..., Dim_x, Dim_y)
end
end
let ndrange = NDRange{2, DynamicSize, DynamicSize}(CartesianIndices((4, 4 * 32)), CartesianIndices((Dim_x, Dim_y)));
let ndrange = NDRange{2, DynamicSize, DynamicSize}(CartesianIndices((4, 4 * 32)), CartesianIndices((Dim_x, Dim_y)))
idx = linear_iteration(ndrange)
for (i, I) in zip(1:length(blocks(ndrange)), blocks(ndrange))
I = Tuple(I)
Expand All @@ -69,15 +69,15 @@ function nditeration_testsuite()

Dim_x = 1
Dim_y = 32
let ndrange = NDRange{2, StaticSize{(4 * 32, 4)}, StaticSize{(Dim_x, Dim_y)}}();
let ndrange = NDRange{2, StaticSize{(4 * 32, 4)}, StaticSize{(Dim_x, Dim_y)}}()
idx = linear_iteration(ndrange)
N = length(workitems(ndrange))
for (i, I) in zip(1:length(blocks(ndrange)), blocks(ndrange))
I = Tuple(I)
@test check(idx, i - 1, ntuple(i -> I[i] - 1, length(I))..., Dim_x, Dim_y)
end
end
let ndrange = NDRange{2, DynamicSize, DynamicSize}(CartesianIndices((4 * 32, 4)), CartesianIndices((Dim_x, Dim_y)));
let ndrange = NDRange{2, DynamicSize, DynamicSize}(CartesianIndices((4 * 32, 4)), CartesianIndices((Dim_x, Dim_y)))
idx = linear_iteration(ndrange)
for (i, I) in zip(1:length(blocks(ndrange)), blocks(ndrange))
I = Tuple(I)
Expand Down

0 comments on commit 9b86c00

Please sign in to comment.