Host device context should return a valid queue
Host memory allocations use shared device context, which allows to have access from any device. That breaks default queue detection. Change-Id: I27ad1234d49ab0ea8f5edd6f2e3ffa93c47d4b1f
Este commit está contenido en:
@@ -92,15 +92,23 @@ amd::HostQueue* getQueue(hipStream_t stream) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// ================================================================================================
|
||||||
amd::HostQueue* getNullStream(amd::Context& ctx) {
|
amd::HostQueue* getNullStream(amd::Context& ctx) {
|
||||||
for (auto& it : g_devices) {
|
for (auto& it : g_devices) {
|
||||||
if (it->asContext() == &ctx) {
|
if (it->asContext() == &ctx) {
|
||||||
return it->NullStream();
|
return it->NullStream();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return nullptr;
|
// If it's a pure SVM allocation with system memory access, then it shouldn't matter which device
|
||||||
|
// runtime selects by default
|
||||||
|
if (hip::host_device->asContext() == &ctx) {
|
||||||
|
// Return current...
|
||||||
|
return getNullStream();
|
||||||
|
}
|
||||||
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// ================================================================================================
|
||||||
amd::HostQueue* getNullStream() {
|
amd::HostQueue* getNullStream() {
|
||||||
Device* device = getCurrentDevice();
|
Device* device = getCurrentDevice();
|
||||||
return device ? device->NullStream() : nullptr;
|
return device ? device->NullStream() : nullptr;
|
||||||
|
|||||||
Referencia en una nueva incidencia
Block a user