unsigned int timer_cpu = 0;
cutilCheckError(cutCreateTimer(&timer_cpu));
- cutilCheckError(cutStartTimer(timer_cpu));
+ cutilCheckError(cutStartTimer(timer_cpu));
for(i=0;i<size;i++) {
h_arrayC[i]=h_arrayA[i]+h_arrayB[i];
}
unsigned int timer_gpu = 0;
cutilCheckError(cutCreateTimer(&timer_gpu));
- cutilCheckError(cutStartTimer(timer_gpu));
+ cutilCheckError(cutStartTimer(timer_gpu));
cudaMemcpy(d_arrayA,h_arrayA, size * sizeof(int), cudaMemcpyHostToDevice);
cudaMemcpy(d_arrayB,h_arrayB, size * sizeof(int), cudaMemcpyHostToDevice);
printf("GPU processing time : %f (ms) \n", cutGetTimerValue(timer_gpu));
cutDeleteTimer(timer_gpu);
- for(i=0;i<size;i++)
+ for(i=0;i<size;i++) {
assert(h_arrayC[i]==h_arrayCgpu[i]);
-
+ }
cudaFree(d_arrayA);
cudaFree(d_arrayB);
cudaFree(d_arrayC);