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 f53f159
Showing 1 changed file with 6 additions and 9 deletions.
15 changes: 6 additions & 9 deletions Samples/p2pBandwidthLatencyTest/p2pBandwidthLatencyTest.cu
Original file line number Diff line number Diff line change
Expand Up @@ -277,10 +277,9 @@ void outputBandwidthMatrix(int numGPUs, bool p2p, P2PDataTransfer p2p_method) {
cudaCheckError();
cudaStreamDestroy(stream[d]);
cudaCheckError();
cudaDeviceReset();
cudaCheckError();
}

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

void outputBidirectionalBandwidthMatrix(int numGPUs, bool p2p) {
Expand Down Expand Up @@ -433,10 +432,9 @@ void outputBidirectionalBandwidthMatrix(int numGPUs, bool p2p) {
cudaCheckError();
cudaStreamDestroy(stream1[d]);
cudaCheckError();
cudaDeviceReset();
cudaCheckError();
}

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

void outputLatencyMatrix(int numGPUs, bool p2p, P2PDataTransfer p2p_method) {
Expand Down Expand Up @@ -586,12 +584,11 @@ void outputLatencyMatrix(int numGPUs, bool p2p, P2PDataTransfer p2p_method) {
cudaCheckError();
cudaStreamDestroy(stream[d]);
cudaCheckError();
cudaDeviceReset();
cudaCheckError();
}

sdkDeleteTimer(&stopWatch);

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

int main(int argc, char **argv) {
Expand Down

0 comments on commit f53f159

Please sign in to comment.