mirror of
https://github.com/NVIDIA/cuda-samples.git
synced 2024-11-24 20:29:15 +08:00
add cudaDeviceReset() into p2pBandwidthLatencyTest to free gpu memory after test
This commit is contained in:
parent
337815dbee
commit
f53f159886
|
@ -277,11 +277,10 @@ void outputBandwidthMatrix(int numGPUs, bool p2p, P2PDataTransfer p2p_method) {
|
||||||
cudaCheckError();
|
cudaCheckError();
|
||||||
cudaStreamDestroy(stream[d]);
|
cudaStreamDestroy(stream[d]);
|
||||||
cudaCheckError();
|
cudaCheckError();
|
||||||
}
|
cudaDeviceReset();
|
||||||
|
|
||||||
cudaFreeHost((void *)flag);
|
|
||||||
cudaCheckError();
|
cudaCheckError();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void outputBidirectionalBandwidthMatrix(int numGPUs, bool p2p) {
|
void outputBidirectionalBandwidthMatrix(int numGPUs, bool p2p) {
|
||||||
int numElems = 10000000;
|
int numElems = 10000000;
|
||||||
|
@ -433,11 +432,10 @@ void outputBidirectionalBandwidthMatrix(int numGPUs, bool p2p) {
|
||||||
cudaCheckError();
|
cudaCheckError();
|
||||||
cudaStreamDestroy(stream1[d]);
|
cudaStreamDestroy(stream1[d]);
|
||||||
cudaCheckError();
|
cudaCheckError();
|
||||||
}
|
cudaDeviceReset();
|
||||||
|
|
||||||
cudaFreeHost((void *)flag);
|
|
||||||
cudaCheckError();
|
cudaCheckError();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void outputLatencyMatrix(int numGPUs, bool p2p, P2PDataTransfer p2p_method) {
|
void outputLatencyMatrix(int numGPUs, bool p2p, P2PDataTransfer p2p_method) {
|
||||||
int repeat = 100;
|
int repeat = 100;
|
||||||
|
@ -586,12 +584,11 @@ void outputLatencyMatrix(int numGPUs, bool p2p, P2PDataTransfer p2p_method) {
|
||||||
cudaCheckError();
|
cudaCheckError();
|
||||||
cudaStreamDestroy(stream[d]);
|
cudaStreamDestroy(stream[d]);
|
||||||
cudaCheckError();
|
cudaCheckError();
|
||||||
|
cudaDeviceReset();
|
||||||
|
cudaCheckError();
|
||||||
}
|
}
|
||||||
|
|
||||||
sdkDeleteTimer(&stopWatch);
|
sdkDeleteTimer(&stopWatch);
|
||||||
|
|
||||||
cudaFreeHost((void *)flag);
|
|
||||||
cudaCheckError();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int main(int argc, char **argv) {
|
int main(int argc, char **argv) {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user