Multiple texture addressing and MIPMAP

Hello everybody.

I have a kernel that is supposed to read from a texture interpolated values at different resolutions. I need to access different levels during the same kernel call. I have 2 questions:

what is the best way of storing the pyramid for best performance? (the size of the original image should not be an issue).

is there a flexible and simple way of using openGL MIPMAP generation in CUDA for computing something similar to a pyramid quickly?

Ideally I would want to be able to just call tex2DLod() and read from normalized coordinates but also trilinearly interpolate between levels (but I can settle even without this feature and just have integer level access).

CUDA offers OpenGL interop as well as some mipmap-oriented functions like cudaMallocMipmappedArray(), but I am not aware of a fully worked example program that shows how to best use that to have CUDA operate on mipmaps. I am not sure at all that CUDA can do interpolated texture access from a mipmap.

Maybe other forum participants have deeper insight into such interoperability. If I may ask, what is the use case for this functionality? Could it be addressed by use of OpenGL compute shaders?

cross posting (I think):

may give some additional insight, possibly