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

Add Feature to Select Devices to Execute Kernels On

Open matinraayai opened this issue 1 year ago • 5 comments

It would be great in a multi-device system, the device id that will run a KA kernel could be set through a function call. cc: @vchuravy

matinraayai avatar Feb 07 '24 21:02 matinraayai

We can do this in a backwards compatible manor.

What function do we need?

  • device(::Backend)
  • device!(::Backend)
  • ?devices or ndevices

vchuravy avatar Feb 09 '24 15:02 vchuravy

Those, as well as synchronization functions on a single device. I'll look into CUDA standards to see if there's something else I'm missing.

matinraayai avatar Feb 09 '24 18:02 matinraayai

Those, as well as synchronization functions on a single device.

Can you expand on that? We already have synchronize w.r.t to the current active device.

vchuravy avatar Feb 10 '24 00:02 vchuravy

Having a synchronize function that takes a device would have been nice, but if there's one w.r.t active device, I think it does the job just as well.

matinraayai avatar Feb 13 '24 17:02 matinraayai

It may also depend if you need stream/queue or device sync. Currently, it implements stream/queue sync for GPU backends.

luraess avatar Feb 13 '24 17:02 luraess