Skip to content

Commit d1a8cc2

Browse files
committed
Remove redundant @testset
ParallelTestRunner generates one so having a global testset for all file tests is unecessary
1 parent 4b8cce9 commit d1a8cc2

16 files changed

Lines changed: 200 additions & 255 deletions

File tree

test/array.jl

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
STORAGEMODES = [Metal.PrivateStorage, Metal.SharedStorage]
22

3-
@testset "array" begin
4-
53
let arr = MtlVector{Int}(undef, 1)
64
@test sizeof(arr) == 8
75
@test length(arr) == 1
@@ -573,9 +571,6 @@ end
573571
end
574572
end
575573

576-
577-
end
578-
579574
@testset "large map reduce" begin
580575
dev = device()
581576

Lines changed: 161 additions & 163 deletions
Original file line numberDiff line numberDiff line change
@@ -1,163 +1,161 @@
1-
@testset "arguments" begin
2-
@on_device dispatch_quadgroups_per_threadgroup()
3-
@on_device dispatch_simdgroups_per_threadgroup()
4-
@on_device quadgroup_index_in_threadgroup()
5-
@on_device quadgroups_per_threadgroup()
6-
@on_device simdgroup_index_in_threadgroup()
7-
@on_device simdgroups_per_threadgroup()
8-
@on_device thread_index_in_quadgroup()
9-
@on_device thread_index_in_simdgroup()
10-
@on_device thread_index_in_threadgroup()
11-
@on_device thread_execution_width()
12-
@on_device threads_per_simdgroup()
13-
14-
@on_device dispatch_threads_per_threadgroup()
15-
@on_device dispatch_threads_per_threadgroup_1d()
16-
@on_device dispatch_threads_per_threadgroup_2d()
17-
@on_device dispatch_threads_per_threadgroup_3d()
18-
19-
@on_device grid_origin()
20-
@on_device grid_origin_1d()
21-
@on_device grid_origin_2d()
22-
@on_device grid_origin_3d()
23-
24-
@on_device grid_size()
25-
@on_device grid_size_1d()
26-
@on_device grid_size_2d()
27-
@on_device grid_size_3d()
28-
29-
@on_device thread_position_in_grid()
30-
@on_device thread_position_in_grid_1d()
31-
@on_device thread_position_in_grid_2d()
32-
@on_device thread_position_in_grid_3d()
33-
34-
@on_device thread_position_in_threadgroup()
35-
@on_device thread_position_in_threadgroup_1d()
36-
@on_device thread_position_in_threadgroup_2d()
37-
@on_device thread_position_in_threadgroup_3d()
38-
39-
@on_device threadgroup_position_in_grid()
40-
@on_device threadgroup_position_in_grid_1d()
41-
@on_device threadgroup_position_in_grid_2d()
42-
@on_device threadgroup_position_in_grid_3d()
43-
44-
@on_device threadgroups_per_grid()
45-
@on_device threadgroups_per_grid_1d()
46-
@on_device threadgroups_per_grid_2d()
47-
@on_device threadgroups_per_grid_3d()
48-
49-
@on_device threads_per_grid()
50-
@on_device threads_per_grid_1d()
51-
@on_device threads_per_grid_2d()
52-
@on_device threads_per_grid_3d()
53-
54-
@on_device threads_per_threadgroup()
55-
@on_device threads_per_threadgroup_1d()
56-
@on_device threads_per_threadgroup_2d()
57-
@on_device threads_per_threadgroup_3d()
58-
59-
# UInt16
60-
@on_device dispatch_quadgroups_per_threadgroup_i16()
61-
@on_device dispatch_simdgroups_per_threadgroup_i16()
62-
@on_device quadgroup_index_in_threadgroup_i16()
63-
@on_device quadgroups_per_threadgroup_i16()
64-
@on_device simdgroup_index_in_threadgroup_i16()
65-
@on_device simdgroups_per_threadgroup_i16()
66-
@on_device thread_index_in_quadgroup_i16()
67-
@on_device thread_index_in_simdgroup_i16()
68-
@on_device thread_index_in_threadgroup_i16()
69-
@on_device thread_execution_width_i16()
70-
@on_device threads_per_simdgroup_i16()
71-
72-
@on_device dispatch_threads_per_threadgroup_i16()
73-
@on_device grid_origin_i16()
74-
@on_device grid_size_i16()
75-
@on_device thread_position_in_grid_i16()
76-
@on_device thread_position_in_threadgroup_i16()
77-
@on_device threadgroup_position_in_grid_i16()
78-
@on_device threadgroups_per_grid_i16()
79-
@on_device threads_per_grid_i16()
80-
@on_device threads_per_threadgroup_i16()
81-
82-
global const CPU_ONLY_ERR = "This function is not intended for use on the CPU"
83-
84-
@test_throws CPU_ONLY_ERR dispatch_quadgroups_per_threadgroup()
85-
@test_throws CPU_ONLY_ERR dispatch_simdgroups_per_threadgroup()
86-
@test_throws CPU_ONLY_ERR quadgroup_index_in_threadgroup()
87-
@test_throws CPU_ONLY_ERR quadgroups_per_threadgroup()
88-
@test_throws CPU_ONLY_ERR simdgroup_index_in_threadgroup()
89-
@test_throws CPU_ONLY_ERR simdgroups_per_threadgroup()
90-
@test_throws CPU_ONLY_ERR thread_index_in_quadgroup()
91-
@test_throws CPU_ONLY_ERR thread_index_in_simdgroup()
92-
@test_throws CPU_ONLY_ERR thread_index_in_threadgroup()
93-
@test_throws CPU_ONLY_ERR thread_execution_width()
94-
@test_throws CPU_ONLY_ERR threads_per_simdgroup()
95-
96-
@test_throws CPU_ONLY_ERR dispatch_threads_per_threadgroup()
97-
@test_throws CPU_ONLY_ERR dispatch_threads_per_threadgroup_1d()
98-
@test_throws CPU_ONLY_ERR dispatch_threads_per_threadgroup_2d()
99-
@test_throws CPU_ONLY_ERR dispatch_threads_per_threadgroup_3d()
100-
101-
@test_throws CPU_ONLY_ERR grid_origin()
102-
@test_throws CPU_ONLY_ERR grid_origin_1d()
103-
@test_throws CPU_ONLY_ERR grid_origin_2d()
104-
@test_throws CPU_ONLY_ERR grid_origin_3d()
105-
106-
@test_throws CPU_ONLY_ERR grid_size()
107-
@test_throws CPU_ONLY_ERR grid_size_1d()
108-
@test_throws CPU_ONLY_ERR grid_size_2d()
109-
@test_throws CPU_ONLY_ERR grid_size_3d()
110-
111-
@test_throws CPU_ONLY_ERR thread_position_in_grid()
112-
@test_throws CPU_ONLY_ERR thread_position_in_grid_1d()
113-
@test_throws CPU_ONLY_ERR thread_position_in_grid_2d()
114-
@test_throws CPU_ONLY_ERR thread_position_in_grid_3d()
115-
116-
@test_throws CPU_ONLY_ERR thread_position_in_threadgroup()
117-
@test_throws CPU_ONLY_ERR thread_position_in_threadgroup_1d()
118-
@test_throws CPU_ONLY_ERR thread_position_in_threadgroup_2d()
119-
@test_throws CPU_ONLY_ERR thread_position_in_threadgroup_3d()
120-
121-
@test_throws CPU_ONLY_ERR threadgroup_position_in_grid()
122-
@test_throws CPU_ONLY_ERR threadgroup_position_in_grid_1d()
123-
@test_throws CPU_ONLY_ERR threadgroup_position_in_grid_2d()
124-
@test_throws CPU_ONLY_ERR threadgroup_position_in_grid_3d()
125-
126-
@test_throws CPU_ONLY_ERR threadgroups_per_grid()
127-
@test_throws CPU_ONLY_ERR threadgroups_per_grid_1d()
128-
@test_throws CPU_ONLY_ERR threadgroups_per_grid_2d()
129-
@test_throws CPU_ONLY_ERR threadgroups_per_grid_3d()
130-
131-
@test_throws CPU_ONLY_ERR threads_per_grid()
132-
@test_throws CPU_ONLY_ERR threads_per_grid_1d()
133-
@test_throws CPU_ONLY_ERR threads_per_grid_2d()
134-
@test_throws CPU_ONLY_ERR threads_per_grid_3d()
135-
136-
@test_throws CPU_ONLY_ERR threads_per_threadgroup()
137-
@test_throws CPU_ONLY_ERR threads_per_threadgroup_1d()
138-
@test_throws CPU_ONLY_ERR threads_per_threadgroup_2d()
139-
@test_throws CPU_ONLY_ERR threads_per_threadgroup_3d()
140-
141-
# UInt16
142-
@test_throws CPU_ONLY_ERR dispatch_quadgroups_per_threadgroup_i16()
143-
@test_throws CPU_ONLY_ERR dispatch_simdgroups_per_threadgroup_i16()
144-
@test_throws CPU_ONLY_ERR quadgroup_index_in_threadgroup_i16()
145-
@test_throws CPU_ONLY_ERR quadgroups_per_threadgroup_i16()
146-
@test_throws CPU_ONLY_ERR simdgroup_index_in_threadgroup_i16()
147-
@test_throws CPU_ONLY_ERR simdgroups_per_threadgroup_i16()
148-
@test_throws CPU_ONLY_ERR thread_index_in_quadgroup()
149-
@test_throws CPU_ONLY_ERR thread_index_in_simdgroup_i16()
150-
@test_throws CPU_ONLY_ERR thread_index_in_threadgroup_i16()
151-
@test_throws CPU_ONLY_ERR thread_execution_width_i16()
152-
@test_throws CPU_ONLY_ERR threads_per_simdgroup_i16()
153-
154-
@test_throws CPU_ONLY_ERR dispatch_threads_per_threadgroup_i16()
155-
@test_throws CPU_ONLY_ERR grid_origin_i16()
156-
@test_throws CPU_ONLY_ERR grid_size_i16()
157-
@test_throws CPU_ONLY_ERR thread_position_in_grid_i16()
158-
@test_throws CPU_ONLY_ERR thread_position_in_threadgroup_i16()
159-
@test_throws CPU_ONLY_ERR threadgroup_position_in_grid_i16()
160-
@test_throws CPU_ONLY_ERR threadgroups_per_grid_i16()
161-
@test_throws CPU_ONLY_ERR threads_per_grid_i16()
162-
@test_throws CPU_ONLY_ERR threads_per_threadgroup_i16()
163-
end
1+
@on_device dispatch_quadgroups_per_threadgroup()
2+
@on_device dispatch_simdgroups_per_threadgroup()
3+
@on_device quadgroup_index_in_threadgroup()
4+
@on_device quadgroups_per_threadgroup()
5+
@on_device simdgroup_index_in_threadgroup()
6+
@on_device simdgroups_per_threadgroup()
7+
@on_device thread_index_in_quadgroup()
8+
@on_device thread_index_in_simdgroup()
9+
@on_device thread_index_in_threadgroup()
10+
@on_device thread_execution_width()
11+
@on_device threads_per_simdgroup()
12+
13+
@on_device dispatch_threads_per_threadgroup()
14+
@on_device dispatch_threads_per_threadgroup_1d()
15+
@on_device dispatch_threads_per_threadgroup_2d()
16+
@on_device dispatch_threads_per_threadgroup_3d()
17+
18+
@on_device grid_origin()
19+
@on_device grid_origin_1d()
20+
@on_device grid_origin_2d()
21+
@on_device grid_origin_3d()
22+
23+
@on_device grid_size()
24+
@on_device grid_size_1d()
25+
@on_device grid_size_2d()
26+
@on_device grid_size_3d()
27+
28+
@on_device thread_position_in_grid()
29+
@on_device thread_position_in_grid_1d()
30+
@on_device thread_position_in_grid_2d()
31+
@on_device thread_position_in_grid_3d()
32+
33+
@on_device thread_position_in_threadgroup()
34+
@on_device thread_position_in_threadgroup_1d()
35+
@on_device thread_position_in_threadgroup_2d()
36+
@on_device thread_position_in_threadgroup_3d()
37+
38+
@on_device threadgroup_position_in_grid()
39+
@on_device threadgroup_position_in_grid_1d()
40+
@on_device threadgroup_position_in_grid_2d()
41+
@on_device threadgroup_position_in_grid_3d()
42+
43+
@on_device threadgroups_per_grid()
44+
@on_device threadgroups_per_grid_1d()
45+
@on_device threadgroups_per_grid_2d()
46+
@on_device threadgroups_per_grid_3d()
47+
48+
@on_device threads_per_grid()
49+
@on_device threads_per_grid_1d()
50+
@on_device threads_per_grid_2d()
51+
@on_device threads_per_grid_3d()
52+
53+
@on_device threads_per_threadgroup()
54+
@on_device threads_per_threadgroup_1d()
55+
@on_device threads_per_threadgroup_2d()
56+
@on_device threads_per_threadgroup_3d()
57+
58+
# UInt16
59+
@on_device dispatch_quadgroups_per_threadgroup_i16()
60+
@on_device dispatch_simdgroups_per_threadgroup_i16()
61+
@on_device quadgroup_index_in_threadgroup_i16()
62+
@on_device quadgroups_per_threadgroup_i16()
63+
@on_device simdgroup_index_in_threadgroup_i16()
64+
@on_device simdgroups_per_threadgroup_i16()
65+
@on_device thread_index_in_quadgroup_i16()
66+
@on_device thread_index_in_simdgroup_i16()
67+
@on_device thread_index_in_threadgroup_i16()
68+
@on_device thread_execution_width_i16()
69+
@on_device threads_per_simdgroup_i16()
70+
71+
@on_device dispatch_threads_per_threadgroup_i16()
72+
@on_device grid_origin_i16()
73+
@on_device grid_size_i16()
74+
@on_device thread_position_in_grid_i16()
75+
@on_device thread_position_in_threadgroup_i16()
76+
@on_device threadgroup_position_in_grid_i16()
77+
@on_device threadgroups_per_grid_i16()
78+
@on_device threads_per_grid_i16()
79+
@on_device threads_per_threadgroup_i16()
80+
81+
global const CPU_ONLY_ERR = "This function is not intended for use on the CPU"
82+
83+
@test_throws CPU_ONLY_ERR dispatch_quadgroups_per_threadgroup()
84+
@test_throws CPU_ONLY_ERR dispatch_simdgroups_per_threadgroup()
85+
@test_throws CPU_ONLY_ERR quadgroup_index_in_threadgroup()
86+
@test_throws CPU_ONLY_ERR quadgroups_per_threadgroup()
87+
@test_throws CPU_ONLY_ERR simdgroup_index_in_threadgroup()
88+
@test_throws CPU_ONLY_ERR simdgroups_per_threadgroup()
89+
@test_throws CPU_ONLY_ERR thread_index_in_quadgroup()
90+
@test_throws CPU_ONLY_ERR thread_index_in_simdgroup()
91+
@test_throws CPU_ONLY_ERR thread_index_in_threadgroup()
92+
@test_throws CPU_ONLY_ERR thread_execution_width()
93+
@test_throws CPU_ONLY_ERR threads_per_simdgroup()
94+
95+
@test_throws CPU_ONLY_ERR dispatch_threads_per_threadgroup()
96+
@test_throws CPU_ONLY_ERR dispatch_threads_per_threadgroup_1d()
97+
@test_throws CPU_ONLY_ERR dispatch_threads_per_threadgroup_2d()
98+
@test_throws CPU_ONLY_ERR dispatch_threads_per_threadgroup_3d()
99+
100+
@test_throws CPU_ONLY_ERR grid_origin()
101+
@test_throws CPU_ONLY_ERR grid_origin_1d()
102+
@test_throws CPU_ONLY_ERR grid_origin_2d()
103+
@test_throws CPU_ONLY_ERR grid_origin_3d()
104+
105+
@test_throws CPU_ONLY_ERR grid_size()
106+
@test_throws CPU_ONLY_ERR grid_size_1d()
107+
@test_throws CPU_ONLY_ERR grid_size_2d()
108+
@test_throws CPU_ONLY_ERR grid_size_3d()
109+
110+
@test_throws CPU_ONLY_ERR thread_position_in_grid()
111+
@test_throws CPU_ONLY_ERR thread_position_in_grid_1d()
112+
@test_throws CPU_ONLY_ERR thread_position_in_grid_2d()
113+
@test_throws CPU_ONLY_ERR thread_position_in_grid_3d()
114+
115+
@test_throws CPU_ONLY_ERR thread_position_in_threadgroup()
116+
@test_throws CPU_ONLY_ERR thread_position_in_threadgroup_1d()
117+
@test_throws CPU_ONLY_ERR thread_position_in_threadgroup_2d()
118+
@test_throws CPU_ONLY_ERR thread_position_in_threadgroup_3d()
119+
120+
@test_throws CPU_ONLY_ERR threadgroup_position_in_grid()
121+
@test_throws CPU_ONLY_ERR threadgroup_position_in_grid_1d()
122+
@test_throws CPU_ONLY_ERR threadgroup_position_in_grid_2d()
123+
@test_throws CPU_ONLY_ERR threadgroup_position_in_grid_3d()
124+
125+
@test_throws CPU_ONLY_ERR threadgroups_per_grid()
126+
@test_throws CPU_ONLY_ERR threadgroups_per_grid_1d()
127+
@test_throws CPU_ONLY_ERR threadgroups_per_grid_2d()
128+
@test_throws CPU_ONLY_ERR threadgroups_per_grid_3d()
129+
130+
@test_throws CPU_ONLY_ERR threads_per_grid()
131+
@test_throws CPU_ONLY_ERR threads_per_grid_1d()
132+
@test_throws CPU_ONLY_ERR threads_per_grid_2d()
133+
@test_throws CPU_ONLY_ERR threads_per_grid_3d()
134+
135+
@test_throws CPU_ONLY_ERR threads_per_threadgroup()
136+
@test_throws CPU_ONLY_ERR threads_per_threadgroup_1d()
137+
@test_throws CPU_ONLY_ERR threads_per_threadgroup_2d()
138+
@test_throws CPU_ONLY_ERR threads_per_threadgroup_3d()
139+
140+
# UInt16
141+
@test_throws CPU_ONLY_ERR dispatch_quadgroups_per_threadgroup_i16()
142+
@test_throws CPU_ONLY_ERR dispatch_simdgroups_per_threadgroup_i16()
143+
@test_throws CPU_ONLY_ERR quadgroup_index_in_threadgroup_i16()
144+
@test_throws CPU_ONLY_ERR quadgroups_per_threadgroup_i16()
145+
@test_throws CPU_ONLY_ERR simdgroup_index_in_threadgroup_i16()
146+
@test_throws CPU_ONLY_ERR simdgroups_per_threadgroup_i16()
147+
@test_throws CPU_ONLY_ERR thread_index_in_quadgroup()
148+
@test_throws CPU_ONLY_ERR thread_index_in_simdgroup_i16()
149+
@test_throws CPU_ONLY_ERR thread_index_in_threadgroup_i16()
150+
@test_throws CPU_ONLY_ERR thread_execution_width_i16()
151+
@test_throws CPU_ONLY_ERR threads_per_simdgroup_i16()
152+
153+
@test_throws CPU_ONLY_ERR dispatch_threads_per_threadgroup_i16()
154+
@test_throws CPU_ONLY_ERR grid_origin_i16()
155+
@test_throws CPU_ONLY_ERR grid_size_i16()
156+
@test_throws CPU_ONLY_ERR thread_position_in_grid_i16()
157+
@test_throws CPU_ONLY_ERR thread_position_in_threadgroup_i16()
158+
@test_throws CPU_ONLY_ERR threadgroup_position_in_grid_i16()
159+
@test_throws CPU_ONLY_ERR threadgroups_per_grid_i16()
160+
@test_throws CPU_ONLY_ERR threads_per_grid_i16()
161+
@test_throws CPU_ONLY_ERR threads_per_threadgroup_i16()

test/device/intrinsics/atomics.jl

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
@testset "atomics" begin
2-
31
n = 128 # NOTE: also hard-coded in MtlThreadGroupArray constructors
42

53
# JuliaGPU/Metal.jl#217: threadgroup atomics seem to requires all-atomic operations
@@ -287,5 +285,3 @@ end
287285
@test Array(a)[1] == 0
288286
end
289287
end
290-
291-
end

test/device/intrinsics/simd.jl

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
@testset "simd intrinsics" begin
2-
31
@testset "shuffle idx" begin
42
function shuffle_kernel(d)
53
i = thread_index_in_simdgroup()
@@ -200,5 +198,3 @@ end
200198
@test Array(a) * Array(b) + Array(c) Array(d)
201199
end
202200
end # End Matrix Functions
203-
204-
end # End SIMD Intrinsics

test/device/intrinsics/synchronization.jl

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -130,10 +130,8 @@ end
130130
end
131131
end
132132

133-
end
133+
end # static
134134

135-
end
135+
end # threadgroup memory
136136

137-
end
138-
139-
############################################################################################
137+
end # memory

test/examples.jl

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
@testset "examples" begin
2-
31
function find_sources(path::String, sources=String[])
42
if isdir(path)
53
for entry in readdir(path)
@@ -26,5 +24,3 @@ cd(examples_dir) do
2624
end
2725
end
2826
end
29-
30-
end

0 commit comments

Comments
 (0)