Avoid null stream allocation in hipFree

- Add option to skip stream allocation on access.
- Avoid null stream allocation in ihipFree, so an inactive device
won't be initialized

Change-Id: Id24426640df59a5e7a08b2dd9dcd4d67758b84bf
Bu işleme şunda yer alıyor:
German Andryeyev
2020-05-01 09:22:31 -04:00
ebeveyn 79834f3d0f
işleme fd8ec70847
4 değiştirilmiş dosya ile 37 ekleme ve 13 silme
+3 -3
Dosyayı Görüntüle
@@ -68,13 +68,13 @@ bool Stream::Create() {
}
// ================================================================================================
amd::HostQueue* Stream::asHostQueue() {
amd::HostQueue* Stream::asHostQueue(bool skip_alloc) {
// Access to the stream object is lock protected, because possible allocation
amd::ScopedLock l(Lock());
if (queue_ == nullptr) {
// Create the host queue for the first time
if (!Create()) {
return nullptr;
if (!skip_alloc) {
Create();
}
}
return queue_;