flatironinstitute / finufft

Non-uniform fast Fourier transform library of types 1,2,3 in dimensions 1,2,3
Other
303 stars 79 forks source link

Internal function to update the stream? #582

Open chaithyagr opened 1 month ago

chaithyagr commented 1 month ago

It could help a lot to have an internal function to change the stream for computing, accessible on python through plans. This can be very useful in practice to have memory efficient implementation of NUFFT with data transfers happening on different streams.

The idea would be: Copy input1 on Stream1 Copy input2 on Stream2 Compute1 on Stream1 Copy Result1 on Stream2

Copy input3 on Stream1 Compute2 on Stream2 Copy Result2 on Stream2

Copy input4 on Stream2 Compute3 on Stream1 Copy Result3 on Stream1

All this can be done using a single plan if we can update the streams, and help hiding the performance overloads of memory copies.

This can be made a discussion as I am not fully sure if this can work.