2

I am getting an error when using triple angle brackets to mark a call from host code to device code, which look like this: <<< param1, param2 >>>.

The code I am using:

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

I am getting an red underline error beneath the third triple angle bracket marked here in bold: <<<

The error description: "expected an expression"

I have followed all of the procedures to ensure that I have set up the CUDA project correctly. Within Properties>CUDA C/C++> Common> CUDA Toolkit Custom Dir, I have set the path as:

C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v9.1

I feel that the problem is being caused by the fact that I am possibly using the VS2017 compiler rather than the NVCC compiler. I have deleted the project and created it again in the hopes that the NVCC compiler would be set automatically. I have not found any resources online showing how to set the NVCC compiler (I don't even know if this is what's causing the error), the only resources tell you how to set up the CUDA project which I have followed multiple times.

To summarise:

  1. Is this problem being caused by the fact I am using the VS2017 compiler rather than the NVCC compiler?
  2. If the answer is yes to question (1), how do I manually set the NVCC compiler for my CUDA file?
  3. Was I correct in the way I set the path for the GPU toolkit in the project Properties?

NOTES:

My file extension is .cu.

The libraries I have included:

#include "cuda_runtime.h"
#include "device_launch_parameters.h"

#include <stdio.h>
talonmies
  • 70,661
  • 34
  • 192
  • 269
p.luck
  • 646
  • 2
  • 9
  • 34

0 Answers0