D3D9 resource for CUDA output

What kind of D3D9 resource (texture, surface, render target buffer etc.) is to be used as output for CUDA kernel? In OpenGL I use PBO as such an output buffer (registered and mapped) and then copy its contents to a texture before rendering it onto the screen. But in D3D9 I am not sure how to do it. As far as I know there is no such thing as PBO in D3D9, while both textures and surfaces confuse me a bit. Can I render from CUDA to a D3D9 texture/surface directly? Should I use a D3D9 render target of some kind to do that instead, and then copy its content to a texture that I can display, like in OpenGL case?

There is a demo called ‘cudaDecodeD3D9’ in the CUDA samples that seems to have code that would be useful in my case, but most of the driver API functions used there are deprecated (if not all of them). Is there an updated version of this particular demo that does not use deprecated functionality? Or is the whole of the D3D9 support in CUDA only legacy and such a thing that I want to achieve here is impossible to do at all?

I’ve also posed the same question on StackOverflow.