CUDA __syncthreads() compiles fine but is underlined with red
cuda, visual-studio-2010
Solution
I added the following few lines to the top of the cu file and it began to recognize these functions. For some reason, Intellisense did not pick up this #define:
#ifndef __CUDACC__
#define __CUDACC__
#endif
I lost some color-coding in the code, but I no longer get strange false positive errors.
Problem
I have been working with CUDA 4.2 for a week now and I have a little problem. When I write the __syncthreads() function it becomes underlined and looks like it is wrong... Then if I put the mouse on the function it appears a message writing: identifier __syncthreads(); is undefined. but when i compile my project the output form build says: ========== Build: 1 succeeded, 0 failed, 0 up-to-date, 0 skipped ========== So I am guessing that everything works fine but the fact that Visual Studio underlines the function is confusing me...How can I make Visual studio to know that this function is defined before the compiling process? NOTE:The same thing happens with the kernel call: kernel<<<...,...>>> where the third "<" is underlined red too... I know that this probably is a minor problem but i want to solve it...Thanks a lot! I am using Visual Studio 2010 on win7 with Cuda 4.2 and Nsight 2.2