]> AND Private Git Repository - book_gpu.git/blobdiff - BookGPU/Chapters/chapter2/ex2.cu
Logo AND Algorithmique Numérique Distribuée

Private GIT Repository
last version
[book_gpu.git] / BookGPU / Chapters / chapter2 / ex2.cu
index 156764dc320c5aa9e8c398d6ee73c170dbfbdd65..62931cdce0dc439a8bca3de46d8926d21723ce5a 100644 (file)
@@ -54,7 +54,7 @@ int main( int argc, char** argv)
 
        unsigned int timer_cpu = 0;
        cutilCheckError(cutCreateTimer(&timer_cpu));
 
        unsigned int timer_cpu = 0;
        cutilCheckError(cutCreateTimer(&timer_cpu));
-  cutilCheckError(cutStartTimer(timer_cpu));
+       cutilCheckError(cutStartTimer(timer_cpu));
        double dot=0;
        for(i=0;i<size;i++) {
                h_arrayC[i]=h_arrayA[i]+h_arrayB[i];
        double dot=0;
        for(i=0;i<size;i++) {
                h_arrayC[i]=h_arrayA[i]+h_arrayB[i];
@@ -66,7 +66,7 @@ int main( int argc, char** argv)
 
        unsigned int timer_gpu = 0;
        cutilCheckError(cutCreateTimer(&timer_gpu));
 
        unsigned int timer_gpu = 0;
        cutilCheckError(cutCreateTimer(&timer_gpu));
-  cutilCheckError(cutStartTimer(timer_gpu));
+       cutilCheckError(cutStartTimer(timer_gpu));
        stat = cublasSetVector(size,sizeof(double),h_arrayA,1,d_arrayA,1);
        stat = cublasSetVector(size,sizeof(double),h_arrayB,1,d_arrayB,1);
        int nbBlocs=(size+nbThreadsPerBloc-1)/nbThreadsPerBloc;
        stat = cublasSetVector(size,sizeof(double),h_arrayA,1,d_arrayA,1);
        stat = cublasSetVector(size,sizeof(double),h_arrayB,1,d_arrayB,1);
        int nbBlocs=(size+nbThreadsPerBloc-1)/nbThreadsPerBloc;