Skip to content

Commit 4305bbc

Browse files
committed
Fix?
1 parent baa1b44 commit 4305bbc

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/ROCKernels.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -147,10 +147,10 @@ function (obj::KI.Kernel{ROCBackend})(args...; numworkgroups = 1, workgroupsize
147147
end
148148

149149

150-
function KI.kernel_max_work_group_size(kikern::KI.Kernel{<:ROCBackend}; max_work_items::Int=typemax(Int))::Int
150+
function KI.kernel_max_work_group_size(kikern::KI.Kernel{<:ROCBackend}; max_work_items::Int=Int(typemax(Int32)))::Int
151151
(; groupsize) = AMDGPU.launch_configuration(kikern.kern; max_block_size = max_work_items)
152152

153-
return Int(groupsize)
153+
return Int(min(max_work_items, groupsize))
154154
end
155155
function KI.max_work_group_size(::ROCBackend)::Int
156156
Int(HIP.attribute(AMDGPU.HIP.device(), AMDGPU.HIP.hipDeviceAttributeMaxThreadsPerBlock))

0 commit comments

Comments
 (0)