"Expected an expression" issue at <<<X,X>>> syntact (Visual Studio 2019 & Cuda 10.1)

Hello!

I have the following error while I’m trying to run the template kernel.
[url]https://i.imgur.com/So1Y036.jpg[/url]
The compiler doesn’t recognize <<<X,X>>> syntact.
I tried reinstall, tried other version of VS and cuda etc. They don’t work either. Anyone has any suggestion?
Windows 10, GTX 1060 6g
Thanks!

1 Like

See the box that says “Build + Intellisense” ?

Change that box to read just “Build”

If the error disappears from the list it is an intellisense error, and you can safely ignore it. Intellisense does not recognize CUDA syntax. Or you can google “cuda red underline” and see if any of the descriptions of it on the internet are things you wish to try. There isn’t any standard solution.

If this is an actual build error, then your project is misconfigured in some way. Build a CUDA sample project (such as vectorAdd) to show how a properly configured project will build correctly, even with <<<X,Y>>> in it.

1 Like

I am having this same problem. I don’t see a “Build + Intellisense” option anywhere.

[EDIT] Never mind, found it. It’s above the error list. I was looking in the project properties.
It’s somewhat annoying that it shows a red squiggle under the <<< , but it still compiles just fine. (or so it says, I haven’t gotten far enough to actually try running it yet)

1 Like

The current version of Visual Studio provides CudaRuntime1 as a sample C++ project. When it was loaded. The error “expected an expression” occured at line 91 of kernel.c. This error disappeared when “Build + IntelliSense” was changed to “Build Only”. Thank you.

However, I do not really understand the following code and other code:

// Launch a kernel on the GPU with one thread for each element.
addKernel<<<1, size>>>(dev_c, dev_a, dev_b);

I am testing Tesla T4, I get an error message stating that OpenGL extensions are missing. I feel that this problem is caused not by Tesla T4, but by the graphics card NVIDIA GeForce GT 720 which is currently installed. This graphics card is no longer supported by
NVIDIA.

I once saw a page listing the graphics card supported by NVIDIA, but I did not record its URL.

I will appriciae any help.