Skip to content

Commit

Permalink
Update ReactantCUDAExt.jl
Browse files Browse the repository at this point in the history
  • Loading branch information
wsmoses authored Feb 1, 2025
1 parent a320d27 commit 8adc3de
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions ext/ReactantCUDAExt.jl
Original file line number Diff line number Diff line change
Expand Up @@ -263,6 +263,15 @@ function Adapt.adapt_structure(
)
end

function threads_to_workgroupsize(threads, ndrange)
total = 1
return map(ndrange) do n
x = min(div(threads, total), n)
total *= x
return x
end
end

function (obj::KA.Kernel{ReactantBackend})(args...; ndrange=nothing, workgroupsize=nothing)
backend = KA.backend(obj)

Expand Down

0 comments on commit 8adc3de

Please sign in to comment.