Files
compute-runtime/shared/source/os_interface/windows/wddm/adapter_factory.cpp
Jaroslaw Chodor a2da0d5e70 Refactor/cleanup around wddm
Signed-off-by: Jaroslaw Chodor <jaroslaw.chodor@intel.com>
2021-05-26 16:26:28 +02:00

37 lines
992 B
C++

/*
* Copyright (C) 2021 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/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) {
if (DebugManager.flags.ForceDeviceId.get() == "unk") {
return true;
}
char *endptr = nullptr;
auto reqDeviceId = strtoul(DebugManager.flags.ForceDeviceId.get().c_str(), &endptr, 16);
return (static_cast<uint32_t>(reqDeviceId) == deviceId);
}
} // namespace NEO