1
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
为什么?这里有什么问题?可能的解决方案是什么?
感谢在generateVector和displayVector功能你的帮助有* HDATA什么可能是定义为int一个参数? – user2236653
你的代码中的'hData'在哪里? – sgarizvi
这里没有hData。家伙定义这个函数通过把int * hData我不知道为什么 – user2236653