Skip to content

Commit

Permalink
add cudaDeviceReset() into p2pBandwidthLatencyTest to free gpu memory…
Browse files Browse the repository at this point in the history
… after test
  • Loading branch information
konnase committed Aug 10, 2019
1 parent 337815d commit 6661519
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions Samples/p2pBandwidthLatencyTest/p2pBandwidthLatencyTest.cu
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,7 @@ void performP2PCopy(int *dest, int destDevice, int *src, int srcDevice,
sizeof(int) * num_elems, streamToRun);
}
}
cudaDeviceReset();
}

void outputBandwidthMatrix(int numGPUs, bool p2p, P2PDataTransfer p2p_method) {
Expand Down Expand Up @@ -280,6 +281,7 @@ void outputBandwidthMatrix(int numGPUs, bool p2p, P2PDataTransfer p2p_method) {
}

cudaFreeHost((void *)flag);
cudaDeviceReset();
cudaCheckError();
}

Expand Down Expand Up @@ -436,6 +438,7 @@ void outputBidirectionalBandwidthMatrix(int numGPUs, bool p2p) {
}

cudaFreeHost((void *)flag);
cudaDeviceReset();
cudaCheckError();
}

Expand Down Expand Up @@ -591,6 +594,7 @@ void outputLatencyMatrix(int numGPUs, bool p2p, P2PDataTransfer p2p_method) {
sdkDeleteTimer(&stopWatch);

cudaFreeHost((void *)flag);
cudaDeviceReset();
cudaCheckError();
}

Expand Down

0 comments on commit 6661519

Please sign in to comment.