How to eliminate the error message in visual studio 2022 with CUDA environment?

Viewed 6

I'm using VS 2022 CE and CUDA 11.7 version. With correctly installed both of them. And when I create a CUDA project with tiny hello world program. There are syntax error in VS(only in IDE and not in compiler). Here is the code:

#include "stdio.h"
#include <cuda.h>
#include <cuda_runtime_api.h>
#include <device_launch_parameters.h>

__global__ void cuda_hello() {
    printf("Hello World from GPU!\n");
}

int main() {
    cuda_hello << <1, 1 >> > ();
    return 0;
}

The error is in "cuda_hello << <1, 1 >> > ()" line. The third left bracket. which syntax VS can not recognize.

So, is there a way to eliminate this annoying problem?

0 Answers
Related