SWDEV-276396 - Implement hipDeviceReset

Add a hip::Stream::destroyAllStreams static function to destroy all streams
Also call MemObjMap::Purge

Change-Id: I6ee7e3f26ab1f1870a9271c65e99fb818134482b
This commit is contained in:
Christophe Paquot
2021-06-10 08:28:34 -07:00
committed by Saleel Kudchadker
orang tua 2223a508f5
melakukan bea4fa8700
3 mengubah file dengan 21 tambahan dan 1 penghapusan
+3 -1
Melihat File
@@ -429,7 +429,9 @@ hipError_t hipDeviceGetSharedMemConfig ( hipSharedMemConfig * pConfig ) {
hipError_t hipDeviceReset ( void ) {
HIP_INIT_API(hipDeviceReset);
/* FIXME */
hip::Device* dev = hip::getCurrentDevice();
hip::Stream::destroyAllStreams(dev->deviceId());
amd::MemObjMap::Purge(dev->devices()[0]);
HIP_RETURN(hipSuccess);
}