Skip to content

Commit fd2048c

Browse files
committed
gtr
1 parent 87f754e commit fd2048c

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed

src/ROCKernels.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ function (obj::KI.Kernel{ROCBackend})(args...; numworkgroups = 1, workgroupsize
140140
KI.check_launch_args(numworkgroups, workgroupsize)
141141

142142
groupsize = workgroupsize
143-
gridsize = groupsize .* numworkgroups
143+
gridsize = numworkgroups
144144

145145
obj.kern(args...; groupsize, gridsize)
146146
return nothing

test/ka_tests.jl

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -159,13 +159,13 @@ function part_ki_testsuite(backend, AT)
159159
return
160160
end
161161
arr1d = AT(zeros(Float32, 4))
162-
@roc gridsize = 4 groupsize = 2 launch_kernel1d(arr1d)
162+
@roc gridsize = 2 groupsize = 2 launch_kernel1d(arr1d)
163163
KernelAbstractions.synchronize(backend())
164164
@test all(Array(arr1d) .== 1)
165165

166166
# 1d tuple
167167
arr1dt = AT(zeros(Float32, 4))
168-
@roc gridsize = (4,) groupsize = (2,) launch_kernel1d(arr1dt)
168+
@roc gridsize = (2,) groupsize = (2,) launch_kernel1d(arr1dt)
169169
KernelAbstractions.synchronize(backend())
170170
@test all(Array(arr1dt) .== 1)
171171

@@ -179,7 +179,7 @@ function part_ki_testsuite(backend, AT)
179179
return
180180
end
181181
arr2d = AT(zeros(Float32, 4, 4))
182-
@roc gridsize = (4, 4) groupsize = (2, 2) launch_kernel2d(arr2d)
182+
@roc gridsize = (2, 2) groupsize = (2, 2) launch_kernel2d(arr2d)
183183
KernelAbstractions.synchronize(backend())
184184
@test all(Array(arr2d) .== 1)
185185

@@ -193,7 +193,7 @@ function part_ki_testsuite(backend, AT)
193193
return
194194
end
195195
arr3d = AT(zeros(Float32, 4, 4, 4))
196-
@roc gridsize = (4, 4, 4) groupsize = (2, 2, 2) launch_kernel3d(arr3d)
196+
@roc gridsize = (2, 2, 2) groupsize = (2, 2, 2) launch_kernel3d(arr3d)
197197
KernelAbstractions.synchronize(backend())
198198
@test all(Array(arr3d) .== 1)
199199

@@ -261,13 +261,13 @@ function no_ki_testsuite(backend, AT)
261261
return
262262
end
263263
arr1d = AT(zeros(Float32, 4))
264-
@roc gridsize = 4 groupsize = 2 launch_kernel1d(arr1d)
264+
@roc gridsize = 2 groupsize = 2 launch_kernel1d(arr1d)
265265
KernelAbstractions.synchronize(backend())
266266
@test all(Array(arr1d) .== 1)
267267

268268
# 1d tuple
269269
arr1dt = AT(zeros(Float32, 4))
270-
@roc gridsize = (4,) groupsize = (2,) launch_kernel1d(arr1dt)
270+
@roc gridsize = (2,) groupsize = (2,) launch_kernel1d(arr1dt)
271271
KernelAbstractions.synchronize(backend())
272272
@test all(Array(arr1dt) .== 1)
273273

@@ -281,7 +281,7 @@ function no_ki_testsuite(backend, AT)
281281
return
282282
end
283283
arr2d = AT(zeros(Float32, 4, 4))
284-
@roc gridsize = (4, 4) groupsize = (2, 2) launch_kernel2d(arr2d)
284+
@roc gridsize = (2, 2) groupsize = (2, 2) launch_kernel2d(arr2d)
285285
KernelAbstractions.synchronize(backend())
286286
@test all(Array(arr2d) .== 1)
287287

@@ -295,7 +295,7 @@ function no_ki_testsuite(backend, AT)
295295
return
296296
end
297297
arr3d = AT(zeros(Float32, 4, 4, 4))
298-
@roc gridsize = (4, 4, 4) groupsize = (2, 2, 2) launch_kernel3d(arr3d)
298+
@roc gridsize = (2, 2, 2) groupsize = (2, 2, 2) launch_kernel3d(arr3d)
299299
KernelAbstractions.synchronize(backend())
300300
@test all(Array(arr3d) .== 1)
301301

@@ -317,7 +317,7 @@ function no_ki_testsuite(backend, AT)
317317
# @test KI.kernel_max_work_group_size(kernel) isa Int
318318
# @test KI.kernel_max_work_group_size(kernel; max_work_items = 1) == 1
319319

320-
kernel(results; groupsize = 4, gridsize = 16)
320+
kernel(results; groupsize = 4, gridsize = 4)
321321
KernelAbstractions.synchronize(backend())
322322

323323
host_results = Array(results)

0 commit comments

Comments
 (0)