'blockIdx' was not declared in this scope

Hi,

I’m using Qt to do C++ programming with cuda. In my code, function “cudaNV12ToRGBAf” is used and it is defined in cudaYUV-NV12.cu, so I added a line “#include cudaYUV-NV12.cu” in my code. When I compiled the code, I got error: ‘blockIdx’ was not declared in this scope.

Please help. Thanks.

Hi,

It is a CUDA variable.
Please check your file is named as *.cu and compile it with nvcc.

Thanks.

Hi AastaLLL,

Do you have any samples to show how to use nvcc in .pro file? Or, is it possible not to compile cudaYUV-NV12.cu, but use the library (.so file) instead?

Thanks.

Hi,

There is a similar sample to link Jetson_inference libraries:
https://devtalk.nvidia.com/default/topic/1038283

Thanks.