User Tools

Site Tools


examples

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
examples [2025/12/29 21:36] dimitarexamples [2025/12/30 23:27] (current) – [C++ program which uses GPU] dimitar
Line 768: Line 768:
     CUDA_CHECK(cudaMalloc(&d_c, bytes));     CUDA_CHECK(cudaMalloc(&d_c, bytes));
  
-    double transfer_start = getTime(); 
     CUDA_CHECK(cudaMemcpy(d_a, h_a, bytes, cudaMemcpyHostToDevice));     CUDA_CHECK(cudaMemcpy(d_a, h_a, bytes, cudaMemcpyHostToDevice));
     CUDA_CHECK(cudaMemcpy(d_b, h_b, bytes, cudaMemcpyHostToDevice));     CUDA_CHECK(cudaMemcpy(d_b, h_b, bytes, cudaMemcpyHostToDevice));
Line 792: Line 791:
     CUDA_CHECK(cudaFree(d_b));     CUDA_CHECK(cudaFree(d_b));
     CUDA_CHECK(cudaFree(d_c));     CUDA_CHECK(cudaFree(d_c));
-    CUDA_CHECK(cudaEventDestroy(start)); 
-    CUDA_CHECK(cudaEventDestroy(stop)); 
     free(h_a);     free(h_a);
     free(h_b);     free(h_b);
examples.1767036981.txt.gz · Last modified: 2025/12/29 21:36 by dimitar

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki