current CUDA-GL Interoperability API Which is the suggested way for GL interop

I see some documentation about some of the CUDA-GL interop being depreciated.
I guess that the cudaGL* (runtime) and cuGL* (driver) calls were depreciated at 3.0.

I’m starting a new project (AND I’m new to CUDA), and I’d like to know what set of calls
I should be using. I see some cudaGraphicsGL* calls… are those intended
for use going forward?

I’m a bit confused by them. The seem to set up some sort of resource pointers.
What are the calls dealing with these resource pointers that I need to use
in order to get pointers to GL buffers into my cuda kernels?

Will I be able to register a buffer only once, then just map and unmap it
as I use it? The old calls said I needed to unregister a buffer to allow
GL to render to it when I’m done with it.
Will I need some sort of cudaGLsetGLDevice () call… this call messes things up for me now.

So far, my best guess is something like…

// GLint bufID is the GL ID of the buffer I want to read.
static struct cudaGraphicsResource *rp = 0;

if (rp==0)
cudaGraphicsGLRegisterBuffer(&rp,bufID,cudaGraphicsMapFlagsReadOnly);
cudaGraphicsMapResources(1,&rp,0);
float *dp; // device pointer for data in GL buffer bufID
size_t nBytes;
cudaGraphicsGetMappedPointer((void **)&dp,&nBytes,rp);

// call my kernel, with dp as a parameter here<<< >>>

cudaGraphicsUnmapResources(1,&rp,0);

… when I shut down:
cudaGraphicsUnregisterResource(rp);

Is this close? Any documentation or tutorials on what is the
suggested/current/modern way to access a GL buffer from CUDA?

Hope this topic would be helpful in understanding the matter. Some time ago I had problems with proper GL initialization for my interop application. Though I’ve changed my hardware, the solution works.

Regards,
MK