mirror of
https://github.com/intel/compute-runtime.git
synced 2025-12-21 01:04:57 +08:00
Add new debug flags for filtering devices to open
FilterBdfPath is used only on Linux as a filter for BDF when opening from /dev/dri/by-path FilterDeviceId is used on both OSes as a filter for device id Signed-off-by: Mateusz Jablonski <mateusz.jablonski@intel.com>
This commit is contained in:
committed by
Compute-Runtime-Automation
parent
36f8f67f20
commit
1671e0a1a7
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2018-2021 Intel Corporation
|
||||
* Copyright (C) 2018-2022 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
@@ -206,4 +206,12 @@ bool (*DeviceFactory::createMemoryManagerFunc)(ExecutionEnvironment &) = [](Exec
|
||||
return executionEnvironment.initializeMemoryManager();
|
||||
};
|
||||
|
||||
bool DeviceFactory::isAllowedDeviceId(uint32_t deviceId, const std::string &deviceIdString) {
|
||||
if (deviceIdString != "unk") {
|
||||
char *endptr = nullptr;
|
||||
auto reqDeviceId = strtoul(deviceIdString.c_str(), &endptr, 16);
|
||||
return (static_cast<uint32_t>(reqDeviceId) == deviceId);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
} // namespace NEO
|
||||
|
||||
Reference in New Issue
Block a user