为b[10][8]开辟2维的数组空间这样写对不对:
cudaMallocPitch((void**)&dev_b,&pitch, 8 * sizeof(int),10);
将数组b[10][8]从主机复制到设备这样写对不对:
cudaMemcpy2D(dev_b,pitch, b,8* sizeof(int) ,8* sizeof(int),10,cudaMemcpyHostToDevice);
将数组dev_b[10][8]从主机复制到设备这样写对不对:
cudaMemcpy2D(b,sizeof(int)*8, dev_b,pitch,sizeof(int)*8,10,cudaMemcpyDeviceToHost);
|