@@ -4,11 +4,11 @@ using Test
4
4
5
5
function nditeration_testsuite ()
6
6
@testset " iteration" begin
7
- let ndrange = NDRange {2, DynamicSize, DynamicSize} (CartesianIndices ((256 , 256 )), CartesianIndices ((32 , 32 )));
7
+ let ndrange = NDRange {2, DynamicSize, DynamicSize} (CartesianIndices ((256 , 256 )), CartesianIndices ((32 , 32 )))
8
8
@test length (ndrange) == 256 * 256
9
9
@test all (p -> p[1 ] == p[2 ], zip (ndrange, CartesianIndices ((256 , 256 ))))
10
10
end
11
- let ndrange = NDRange {2, StaticSize{(256, 256)}, DynamicSize} (nothing , CartesianIndices ((32 , 32 )));
11
+ let ndrange = NDRange {2, StaticSize{(256, 256)}, DynamicSize} (nothing , CartesianIndices ((32 , 32 )))
12
12
@test length (ndrange) == 256 * 256
13
13
@test all (p -> p[1 ] == p[2 ], zip (ndrange, CartesianIndices ((256 , 256 ))))
14
14
end
@@ -34,14 +34,14 @@ function nditeration_testsuite()
34
34
@testset " linear_iteration" begin
35
35
Dim_x = 32
36
36
Dim_y = 32
37
- let ndrange = NDRange {2, StaticSize{(4, 4)}, StaticSize{(Dim_x, Dim_y)}} ();
37
+ let ndrange = NDRange {2, StaticSize{(4, 4)}, StaticSize{(Dim_x, Dim_y)}} ()
38
38
idx = linear_iteration (ndrange)
39
39
for (i, I) in zip (1 : length (blocks (ndrange)), blocks (ndrange))
40
40
I = Tuple (I)
41
41
@test check (idx, i - 1 , ntuple (i -> I[i] - 1 , length (I))... , Dim_x, Dim_y)
42
42
end
43
43
end
44
- let ndrange = NDRange {2, DynamicSize, DynamicSize} (CartesianIndices ((4 , 4 )), CartesianIndices ((Dim_x, Dim_y)));
44
+ let ndrange = NDRange {2, DynamicSize, DynamicSize} (CartesianIndices ((4 , 4 )), CartesianIndices ((Dim_x, Dim_y)))
45
45
idx = linear_iteration (ndrange)
46
46
for (i, I) in zip (1 : length (blocks (ndrange)), blocks (ndrange))
47
47
I = Tuple (I)
@@ -51,15 +51,15 @@ function nditeration_testsuite()
51
51
52
52
Dim_x = 32
53
53
Dim_y = 1
54
- let ndrange = NDRange {2, StaticSize{(4, 4 * 32)}, StaticSize{(Dim_x, Dim_y)}} ();
54
+ let ndrange = NDRange {2, StaticSize{(4, 4 * 32)}, StaticSize{(Dim_x, Dim_y)}} ()
55
55
idx = linear_iteration (ndrange)
56
56
N = length (workitems (ndrange))
57
57
for (i, I) in zip (1 : length (blocks (ndrange)), blocks (ndrange))
58
58
I = Tuple (I)
59
59
@test check (idx, i - 1 , ntuple (i -> I[i] - 1 , length (I))... , Dim_x, Dim_y)
60
60
end
61
61
end
62
- let ndrange = NDRange {2, DynamicSize, DynamicSize} (CartesianIndices ((4 , 4 * 32 )), CartesianIndices ((Dim_x, Dim_y)));
62
+ let ndrange = NDRange {2, DynamicSize, DynamicSize} (CartesianIndices ((4 , 4 * 32 )), CartesianIndices ((Dim_x, Dim_y)))
63
63
idx = linear_iteration (ndrange)
64
64
for (i, I) in zip (1 : length (blocks (ndrange)), blocks (ndrange))
65
65
I = Tuple (I)
@@ -69,15 +69,15 @@ function nditeration_testsuite()
69
69
70
70
Dim_x = 1
71
71
Dim_y = 32
72
- let ndrange = NDRange {2, StaticSize{(4 * 32, 4)}, StaticSize{(Dim_x, Dim_y)}} ();
72
+ let ndrange = NDRange {2, StaticSize{(4 * 32, 4)}, StaticSize{(Dim_x, Dim_y)}} ()
73
73
idx = linear_iteration (ndrange)
74
74
N = length (workitems (ndrange))
75
75
for (i, I) in zip (1 : length (blocks (ndrange)), blocks (ndrange))
76
76
I = Tuple (I)
77
77
@test check (idx, i - 1 , ntuple (i -> I[i] - 1 , length (I))... , Dim_x, Dim_y)
78
78
end
79
79
end
80
- let ndrange = NDRange {2, DynamicSize, DynamicSize} (CartesianIndices ((4 * 32 , 4 )), CartesianIndices ((Dim_x, Dim_y)));
80
+ let ndrange = NDRange {2, DynamicSize, DynamicSize} (CartesianIndices ((4 * 32 , 4 )), CartesianIndices ((Dim_x, Dim_y)))
81
81
idx = linear_iteration (ndrange)
82
82
for (i, I) in zip (1 : length (blocks (ndrange)), blocks (ndrange))
83
83
I = Tuple (I)
0 commit comments