X-Git-Url: https://bilbo.iut-bm.univ-fcomte.fr/and/gitweb/book_gpu.git/blobdiff_plain/4f8020b1c6324b056b53b4325cd80d59bb7cf19f..17bff40b83bcdcc39769f9e59c70ffae1c525b72:/BookGPU/Chapters/chapter5/code/ex1.cu?ds=sidebyside diff --git a/BookGPU/Chapters/chapter5/code/ex1.cu b/BookGPU/Chapters/chapter5/code/ex1.cu index 13d4322..847d20a 100644 --- a/BookGPU/Chapters/chapter5/code/ex1.cu +++ b/BookGPU/Chapters/chapter5/code/ex1.cu @@ -1,29 +1,29 @@ -#include - -__global__ void add(double* a, double const* b, int N) -{ - int i = blockDim.x*blockIdx.x + threadIdx.x; - if(i>>(a1, b1, N); - - // gpulab example - gpulab::vector a2(N, 2.0); - gpulab::vector b2(N, 3.0); - a2.axpy(1.0, b2); // BLAS1: a2 = 1*b2 + a2 - - return 0; +#include + +__global__ void add(double* a, double const* b, int N) +{ + int i = blockDim.x*blockIdx.x + threadIdx.x; + if(i>>(a1, b1, N); + + // gpulab example + gpulab::vector a2(N, 2.0); + gpulab::vector b2(N, 3.0); + a2.axpy(1.0, b2); // BLAS1: a2 = 1*b2 + a2 + + return 0; } \ No newline at end of file