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
此提交包含在:
German Andryeyev
2020-05-01 09:22:31 -04:00
父節點 2ff8f533a4
當前提交 fca05eae5f
共有 4 個檔案被更改,包括 37 行新增 和 13 行删除
+3 -3
查看文件
@@ -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_;