【发布时间】:2013-03-24 19:49:36
【问题描述】:
thrust::host_vector<int> A;
thrust::host_vector<int> B;
int rand_from_0_to_100_gen(void)
{
return rand() % 100;
}
__host__ void generateVector(int count) {
thrust::host_vector<int> A(count);
thrust::generate(A.begin(),A.end(),rand_from_0_to_100_gen);
thrust::host_vector<int> B(count);
thrust::generate(B.begin(),B.end(),rand_from_0_to_100_gen);
}
__host__ void displayVector(int count){
void generateVector(count);
cout << A[1];
}
在上面的代码中,为什么我不能显示向量值?它在
处给出错误void generateVector(count);
上面写着incomplete is not allowed 为什么?这里有什么问题?可能的解决方案是什么?
【问题讨论】:
标签: cuda compiler-errors thrust