Reputation: 395
Super simple program:
#include "cuda_runtime.h"
#include <iostream>
__global__ void kernal_function()
{
}
int main(void)
{
kernal_function<<<1,1>>>();
return 0;
}
Won't compile because the compiler doesn't know what the <<<>>>
is (error: expected an expression and syntax error: '<').
How do I make the compiler understand what this (<<<>>>
) is?
Upvotes: 0
Views: 556
Reputation: 1721
The triple angle brackets syntax <<<...>>>
is specific to CUDA. It not part of C or C++ standard. It will be recognized by nvcc
, but not by gcc
or any other 'classic' compiler.
You can build a CUDA runtime program this way:
nvcc main.cu -o my-program
Upvotes: 2