Solving 2d diffusion (heat) equation with CUDA
问题 I am learning CUDA with trying to solve some standard problems. As a example, I am solving the diffusion equation in two dimensions with the following code. But my results are different than the standard results and I am not able to figure that out. //kernel definition __global__ void diffusionSolver(double* A, double * old,int n_x,int n_y) { int i = blockIdx.x * blockDim.x + threadIdx.x; int j = blockIdx.y * blockDim.y + threadIdx.y; if(i*(n_x-i-1)*j*(n_y-j-1)!=0) A[i+n_y*j] = A[i+n_y*j] +