Changes

Jump to: navigation, search

BetaT

12 bytes added, 17:56, 29 March 2017
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(); } }'''
212
edits

Navigation menu