mirror of
https://github.com/NVIDIA/cuda-samples.git
synced 2024-11-24 18:29:14 +08:00
add cudaDeviceReset() into p2pBandwidthLatencyTest to free gpu memory after test
This commit is contained in:
parent
337815dbee
commit
f53f159886
|
@ -277,10 +277,9 @@ void outputBandwidthMatrix(int numGPUs, bool p2p, P2PDataTransfer p2p_method) {
|
|||
cudaCheckError();
|
||||
cudaStreamDestroy(stream[d]);
|
||||
cudaCheckError();
|
||||
}
|
||||
|
||||
cudaFreeHost((void *)flag);
|
||||
cudaDeviceReset();
|
||||
cudaCheckError();
|
||||
}
|
||||
}
|
||||
|
||||
void outputBidirectionalBandwidthMatrix(int numGPUs, bool p2p) {
|
||||
|
@ -433,10 +432,9 @@ void outputBidirectionalBandwidthMatrix(int numGPUs, bool p2p) {
|
|||
cudaCheckError();
|
||||
cudaStreamDestroy(stream1[d]);
|
||||
cudaCheckError();
|
||||
}
|
||||
|
||||
cudaFreeHost((void *)flag);
|
||||
cudaDeviceReset();
|
||||
cudaCheckError();
|
||||
}
|
||||
}
|
||||
|
||||
void outputLatencyMatrix(int numGPUs, bool p2p, P2PDataTransfer p2p_method) {
|
||||
|
@ -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) {
|
||||
|
|
Loading…
Reference in New Issue
Block a user