ここに問題があります... 学校のプロジェクトでは、CUDA C を使用して並列アプリケーションを作成する必要があります。最も単純な例でさえコンパイルできません。Windows7 と MS Visual Studio を使用しています。コードは本から取られています: CUDA by example。汎用 GPU コンピューティングの概要。
#include<iostream>
#include<cuda.h>
using namespace std;
__global__ void kernel(void){
}
int main(){
kernel<<<1, 1>>>();
cout << "Hello world" << endl;
return 0;
}
エラーは次のとおりです。
1>c:\users\administrator\documents\visualstudio2010\projects\test\test\test.cpp(6): error C2144: syntax error : 'void' should be preceded by ';'
1>c:\users\administrator\documents\visualstudio2010\projects\test\test\test.cpp(6): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\users\administrator\documents\visualstudio2010\projects\test\test\test.cpp(10): error C2059: syntax error : '<'
cl.exe の代わりに nvcc.exe を既定のコンパイラとして設定する必要がありますか? その場合、どうすればよいですか?どんな助けでも大歓迎です!