New to Cuda - dumb question

I have been reading a few books and watching a few videos on GPU/Cuda based computing.

I have been noticing in these examples a construct of void** but unless I am missing it, I cannot figure out what the ** is for. I understand a single * or a & but the double * has me confuses.

It also seems that the only time I’ve seen it (so far) is with a “void”

Can some one explain the meaning of the ** or point me to where I can read about it. So far the only reference to ** I have found is B. Stroustrup stating to use pow() to raise to a power v. ** in C++.


It’s a pointer to a pointer. It is a C or C++ concept. It is not unique to CUDA.

One of the reasons it comes up in CUDA is that we frequently (e.g. with an API like cudaMalloc) want to set a pointer value, i.e. we want to change the address a pointer points to. When we are passing a pointer to a function, and the function will change the pointer address, we must pass the address of the pointer, so that the function can modify it. The address of the pointer is a ** type.

@txbob, thank you. I had a feeling that is what it was but could not find a reference for it. Every time I tried a google search it would not resolve the double * and return links to * as pointer.

(I should also note that I haven’t used C/C++ in 20+ years so I am ‘re-learning’ a lot.)