VkFFT
VkFFT copied to clipboard
Improve user's `tempBuffer` allocation workflow
Hi,
as I understand it, right now VkFFT supports two ways of allocating tempBuffer:
- auto allocation - the user does not set the
userTempBufferflag, does not supply both thetempBufferSizeandtempBufferarrays, everything is managed by the plan - user allocation - the user sets the
userTempBufferflag, passes the temp buffer sizes viatempBufferSize(config) and the temp bufferstempBuffer(config or launch) in arrays of sizetempBufferNum.
I think it would be a nice feature to allow the user to do his own allocation, while supplying the required temporary buffer count and sizes. I would suggest to add a third way:
- user allocation v2 - the user sets the
userTempBufferflag, the planner will fill the temp buffer sizes intempBufferSizearray of sizetempBufferNummanaged by the plan (as in auto allocation) . Then the user can read the sizes fromapp->configuration->tempBufferSize, do the allocation and pass the temp buffers via the launch configuration.
The main advantage of this approach is that the user needn't to calculate the proper buffer sizes and counts himself. This behaviour is more similar to what other libraries offer.
What do you think about it?
Thanks.
David
Hello,
as far as I know, no one has reported using the manual tempBuffer submission before you (which is why none of the vendor libraries even try doing it), but this suggestion is reasonable and not hard to implement, I will add it soon. Thank you!
Best regards, Dmitrii
Great! Actually all of the GPU FFT libraries I know about allow user's tembuffer allocation, they just call it a workspace or work area. For example here is the link to cuFFT work area API.
David
Ah, ok, guess I somehow missed that.
Best regards, Dmitrii