我有两个结构
struct collapsed {
char **seq;
int num;
};
struct data {
collapsed *x;
int num;
int numblocks;
int *blocksizes;
float *regmult;
float *learnmult;
};
我将它传递给我的内核;
__global__ void KERNEL(data* X,...){
...
collapsed x = X->x[0]; // GIVES CUDA_EXPECTION_1:Lane Illegal Address
}
data X;
//init X
data *X_dev;
cudaMalloc((data **) & X_dev, sizeof(data));
cudaMemcpy(X_dev, &X, sizeof(data), cudaMemcpyHostToDevice);
KERNEL<<<...>>>(X_dev,...);
此代码在内核代码中给出了CUDA_EXPECTION_1:Lane Illegal Address。什么是错误的或正确的方法是什么?任何想法?