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:
@@ -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_;
|
||||
|
||||
Yeni konuda referans
Bir kullanıcı engelle