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

Unified memory interface?

Open christiangnrd opened this issue 6 months ago • 2 comments

A few backends have the option to create arrays using unified memory. Using unified memory for certain algorithms can have significant (positive) impact on performance by removing the need for @allowscalar. See the Metal.jl private array findall benchmarks.

I think it would be nice to have a way for backends to indicate whether they support unified memory or not so KA kernels can use this.

christiangnrd avatar May 25 '25 02:05 christiangnrd

Yeah it something I haven't thought much abou. Do you just want a query or some additional utility functions? Like an unsafe_wrap?

vchuravy avatar May 25 '25 15:05 vchuravy

I was thinking of just query since that's all that's needed for use-cases like the findall example listed above or how it's used in the Metal LinearAlgebra.lu!. To be clear I'm not suggesting ever defining a generic KA version of lu!, I'm just using it as an example of how shared/unified memory can be used to speed up algorithms

christiangnrd avatar May 26 '25 02:05 christiangnrd