From c42667abfabd80cefd93183ee4baf33206d4ac6e Mon Sep 17 00:00:00 2001 From: Vlad Sytchenko Date: Fri, 10 Apr 2020 22:49:13 -0400 Subject: [PATCH] Default stream needs to be initialized Change-Id: I5cbf9076bffb51c0e99601393645f443c1658e13 [ROCm/hip commit: 5d8d752da5d309fe4a257d8cfd3001a44cb36a3d] --- projects/hip/vdi/hip_device.cpp | 4 ++++ projects/hip/vdi/hip_internal.hpp | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/projects/hip/vdi/hip_device.cpp b/projects/hip/vdi/hip_device.cpp index cc27fef05e..80e247f37c 100644 --- a/projects/hip/vdi/hip_device.cpp +++ b/projects/hip/vdi/hip_device.cpp @@ -30,6 +30,10 @@ amd::HostQueue* Device::defaultStream() { defaultStream_ = new amd::HostQueue(*asContext(), *devices()[0], properties, amd::CommandQueue::RealTimeDisabled, amd::CommandQueue::Priority::Normal); + if ((defaultStream_ == nullptr) || + !defaultStream_->create()) { + return nullptr; + } } return defaultStream_; } diff --git a/projects/hip/vdi/hip_internal.hpp b/projects/hip/vdi/hip_internal.hpp index 03dcf0d51d..9b4bd17042 100755 --- a/projects/hip/vdi/hip_internal.hpp +++ b/projects/hip/vdi/hip_internal.hpp @@ -85,7 +85,7 @@ namespace hip { /// VDI context amd::Context* context_; /// VDI host queue for default streams - amd::HostQueue* defaultStream_; + amd::HostQueue* defaultStream_ = nullptr; /// Device's ID /// Store it here so we don't have to loop through the device list every time int deviceId_;