cudaStream_t where I can find it's definition

Hey I recently installed cuda toolkit 3.2.

Unfortunately, when I try too compile my project (which was compilable on earlier toolkit).

The proble is that in one .h file I have such definition:

#ifndef cudaStream_t 

typedef int cudaStream_t; 

#endif

Stream = new cudaStream_t[STREAMSNO]; 

    for (int i=0; i<STREAMSNO; i++)

        cudaStreamCreate(&Stream[i]);

Don’t ask me why it so - just it is :).

Anyway VS compiler says:

...: error: argument of type "cudaStream_t *" is incompatible with parameter of type "cudaStream_t *"

I think its because cudaStream_t is no more “int”…

The question is where I can find definition of cudaStream_t?

I tried to grep in include dir, but I found only that cudaStream t = CUStream and I couldn’t find definition of CUStream…

cudaStream_t is an opaque structure

You should use cudaStreamCreate this way :

cudaStream_t stream;
cudaError_t cudaErr = cudaStreamCreate(&stream);

and there is also the pending cudaStreamDestroy

All I had to do was to include <cuda_runtime.h> and a line “typedef cudaStream_t cudaStream_t”.

I works fine now.

1 Like