The current implementation uses KernelAbstractions.jl with the CUDABackend to generate a CUDA kernel which we compile to PTX. This PTX is executed by the gpu_variant function of the legate task.
For the CPU side I think we should be able to implement cpu_variant where we pass a cfunction pointer (a la @cfunction) in place of PTX. I think it is best to avoid KernelAbstractions CPUBackend here and just used Julia's Base broadcast implementation which already fuses functions for us.
The current implementation uses KernelAbstractions.jl with the
CUDABackendto generate a CUDA kernel which we compile to PTX. This PTX is executed by thegpu_variantfunction of the legate task.For the CPU side I think we should be able to implement
cpu_variantwhere we pass a cfunction pointer (a la@cfunction) in place of PTX. I think it is best to avoid KernelAbstractionsCPUBackendhere and just used Julia's Base broadcast implementation which already fuses functions for us.