关于cudaError_t的返回值为77,怎么解决?
代码如下所示,
其中bdecoded,jc,LLR_intrinsic是作为参数传递进来的指针。
内核函数如下
在上面cudaStatus的返回值为77,
去查了下解释说是内存问题,如上面所示,我想知道该如何解决这个问题?
cudaMalloc((unsigned char **)&dev_bdecoded, CodeLength * sizeof(unsigned char));
cudaMalloc((int **)&dev_jc, (n + 1) * sizeof(int));
cudaMalloc((double **)&dev_LLR_extrinsic, nzmax * sizeof(double));
cudaMalloc((double **)&dev_LLR_intrinsic, CodeLength * sizeof(double));
cudaMemcpy(dev_bdecoded, bdecoded, CodeLength * sizeof(unsigned char), cudaMemcpyHostToDevice);
cudaMemcpy(dev_jc, jc, (n + 1) * sizeof(int), cudaMemcpyHostToDevice);
cudaMemcpy(dev_LLR_intrinsic, LLR_intrinsic, CodeLength * sizeof(double), cudaMemcpyHostToDevice);
threadsPerBlock = 256;
blocksPerGrid = (n + threadsPerBlock - 1) / threadsPerBlock;
Kernel1<<<blocksPerGrid,threadsPerBlock>>>(dev_bdecoded, dev_jc, dev_LLR_extrinsic, dev_LLR_intrinsic);
cudaStatus = cudaDeviceSynchronize();
if (cudaStatus != cudaSuccess) {
fprintf(stderr, "cudaDeviceSynchronize returned error code %d after launching addKernel!\n", cudaStatus);
}
其中bdecoded,jc,LLR_intrinsic是作为参数传递进来的指针。
内核函数如下
__global__ void Kernel1(unsigned char *dev_bdecoded, int *dev_jc, double *dev_LLR_extrinsic, double *dev_LLR_intrinsic)
{
int i = blockDim.x * blockIdx.x + threadIdx.x;
int j;
dev_bdecoded[i] = 0;
for (j = dev_jc[i]; j < dev_jc[i + 1]; j++)
dev_LLR_extrinsic[j] = dev_LLR_intrinsic[i];
}
在上面cudaStatus的返回值为77,
/**
* The device encountered a load or store instruction on an invalid memory address.
* The context cannot be used, so it must be destroyed (and a new one should be created).
* All existing device memory allocations from this context are invalid
* and must be reconstructed if the program is to continue using CUDA.
*/
cudaErrorIllegalAddress = 77,
去查了下解释说是内存问题,如上面所示,我想知道该如何解决这个问题?
...全文
相关推荐
CUDA参考手册
GPU高性能开发,英伟达提出的CUDA开发,很强大
0528-极智开发-解读CUDA常见错误类型cudaError-t
0528_极智开发_解读CUDA常见错误类型cudaError_t
CUDA_C_Programming_Guide、CUDA并行程序设计 GPU编程指南
高清cuda学习文档 CUDA并行程序设计 GPU编程指南和CUDA_C_Programming_Guide
CUDA_Getting_Started_Guide.rar_CUDA书_CUDA并行计算_Getting Started
关于CUDA并行计算的编程指导书,为英伟达公司提供
CUDA_LDPC
CUDA_LDPC


