212
edits
Changes
BetaT
,→Optimizing Problems
'''
__global__ void Initalize(double* u, double* un, int nx, int nt, double dx)
{ int i = blockIdx.x * blockDim.x + threadIdx.x;
int j = blockIdx.y * blockDim.y + threadIdx.y;
for (int k = 0; k <= nx - 1; k++) if (k*dx >= 0.5 && k*dx <= 1) { u[k * nt] = 2; __syncthreads(); } else { u[k * nt] = 1; __syncthreads();
}
}