Fill devices from api thread

Signed-off-by: Mateusz Hoppe <mateusz.hoppe@intel.com>
This commit is contained in:
Mateusz Hoppe
2021-09-21 18:18:16 +00:00
committed by Compute-Runtime-Automation
parent 5c1c96fa94
commit b0ec436b3e
4 changed files with 61 additions and 0 deletions

View File

@@ -157,6 +157,23 @@ bool DebugSession::areRequestedThreadsStopped(ze_device_thread_t thread) {
return requestedThreadsStopped;
}
void DebugSession::fillDevicesFromThread(ze_device_thread_t thread, std::vector<uint8_t> &devices) {
auto deviceCount = std::max(1u, connectedDevice->getNEODevice()->getNumSubDevices());
UNRECOVERABLE_IF(devices.size() < deviceCount);
uint32_t deviceIndex = 0;
convertToPhysical(thread, deviceIndex);
bool singleDevice = (thread.slice != UINT32_MAX && deviceCount > 1) || deviceCount == 1;
if (singleDevice) {
devices[deviceIndex] = 1;
} else {
for (uint32_t i = 0; i < deviceCount; i++) {
devices[i] = 1;
}
}
}
bool DebugSession::isBindlessSystemRoutine() {
if (debugArea.reserved1 &= 1) {
return true;