X-Git-Url: https://bilbo.iut-bm.univ-fcomte.fr/and/gitweb/book_gpu.git/blobdiff_plain/d74981733767eca78dbbe5be810b9b2e239e8aee..1874c46934f4ba7e8c2013d3829f65309456d292:/BookGPU/Chapters/chapter10/updateBasis.cu diff --git a/BookGPU/Chapters/chapter10/updateBasis.cu b/BookGPU/Chapters/chapter10/updateBasis.cu index 894667a..a699a6c 100644 --- a/BookGPU/Chapters/chapter10/updateBasis.cu +++ b/BookGPU/Chapters/chapter10/updateBasis.cu @@ -1,25 +1,25 @@ -extern __shared__ volatile double sData[]; +extern __shared__ volatile double sdata[]; __global__ void -updateBasisKernel(int m, uint l, double d_l, double *B, uint pitch_B, double *d) -{ +updateBasisKernel(int m, uint l, double d_l, double *B, + uint pitch_B, double *d) { uint bId = blockIdx.x, tId = threadIdx.x; uint colStart = bId*pitch_B; double Bij, d_i, B2ij; - // First thread load Blj so it can be - // broadcasted via shared memory to each threads - if(tId == 0) - sdata[0] = B[colStart+leave] / d_l; + // First thread loads Blj so it can be + // broadcast via shared memory to each thread + if (tId == 0) + sdata[0] = B[colStart+l] / d_l; __syncthreads(); - // Each thread proccess mutiple elements - while(tId < m){ + // Each thread proccesses multiple elements + while (tId < m) { // Load di and Bij d_i = d[tId]; Bij = B[colStart+tId]; // Update Bij B2ij = sdata[0]; - if(tId != q){ + if (tId != q) { B2ij *= -d_i; B2ij += Bij } @@ -28,4 +28,4 @@ updateBasisKernel(int m, uint l, double d_l, double *B, uint pitch_B, double *d) tId += blockDim.x; } -} \ No newline at end of file +}