mirror of
https://github.com/intel/compute-runtime.git
synced 2025-12-30 09:58:55 +08:00
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>
33 lines
976 B
C++
33 lines
976 B
C++
/*
|
|
* Copyright (C) 2021-2022 Intel Corporation
|
|
*
|
|
* SPDX-License-Identifier: MIT
|
|
*
|
|
*/
|
|
|
|
#include "shared/source/os_interface/windows/wddm/adapter_factory.h"
|
|
|
|
#include "shared/source/debug_settings/debug_settings_manager.h"
|
|
#include "shared/source/helpers/debug_helpers.h"
|
|
#include "shared/source/os_interface/device_factory.h"
|
|
#include "shared/source/utilities/stackvec.h"
|
|
|
|
#include <cstdlib>
|
|
#include <cstring>
|
|
#include <memory>
|
|
|
|
namespace NEO {
|
|
|
|
bool canUseAdapterBasedOnDriverDesc(const char *driverDescription) {
|
|
return (strstr(driverDescription, "Intel") != nullptr) ||
|
|
(strstr(driverDescription, "Citrix") != nullptr) ||
|
|
(strstr(driverDescription, "Virtual Render") != nullptr);
|
|
}
|
|
|
|
bool isAllowedDeviceId(uint32_t deviceId) {
|
|
return DeviceFactory::isAllowedDeviceId(deviceId, DebugManager.flags.FilterDeviceId.get()) &&
|
|
DeviceFactory::isAllowedDeviceId(deviceId, DebugManager.flags.ForceDeviceId.get());
|
|
}
|
|
|
|
} // namespace NEO
|