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


[ROCm/hip commit: fd8ec70847]
This commit is contained in:
German Andryeyev
2020-05-01 09:22:31 -04:00
parent adae775a90
commit 57779166a7
4 changed files with 37 additions and 13 deletions
+3 -3
View File
@@ -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_;