Open main menu

CDOT Wiki β

Changes

BetaT

10 bytes added, 23:55, 7 April 2017
Parallelizing with 2 Kernels
The program takes 2 arrays. Let us say the X's represent the arrays below
__global__ void Calculate (float* u, float* un,int nx, int c, float dx, float dt) {
int j = blockIdx.x * blockDim.x + threadIdx.x;
int i = blockIdx.y * blockDim.y + threadIdx.y;
xxxxx xxxxx
Upon initialization the 1st column of the first array gets set, this will be represented by o's
Array 1 Array 2
oxxxx xxxxx
The next kernel below will execute the following calucations.  1st: Array 2 will copy the first column of Array 1
Array 1 Array 2
212
edits