KernelAbstractions.jl icon indicating copy to clipboard operation
KernelAbstractions.jl copied to clipboard

Suggestion: Better ergonomics around collecting multiple kernels

Open moll-dev opened this issue 5 years ago • 0 comments

Hey there, I'm really enjoying using KernelAbstractions so far!

Doing Multievents feels clunky, from looking at the source I've used it as follows:

events = []
for layer in 1:layers
    push!(events, kernel_func!(cuda_grids, layer))
end
wait(MultiEvent(Tuple(events)))

Perhaps I missed something, but a suggestion would be to make wait accept an Array{Event,1}? Under the hood, I understand it's using a tuple. Is there any limitation to the way that wait is implemented such that it couldn't accept an Array?

For instance:

events = [box_blur!(model.grids, layer) for layer in 1:length(model.agent_configs)]
wait(events)

Thanks, Tom

moll-dev avatar Dec 18 '20 07:12 moll-dev