2017-12-21 00:45:38 +01:00
|
|
|
/*
|
2023-02-16 16:51:55 +00:00
|
|
|
* Copyright (C) 2018-2023 Intel Corporation
|
2017-12-21 00:45:38 +01:00
|
|
|
*
|
2018-09-18 09:11:08 +02:00
|
|
|
* SPDX-License-Identifier: MIT
|
2017-12-21 00:45:38 +01:00
|
|
|
*
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
#pragma once
|
2020-02-11 11:39:25 +01:00
|
|
|
#include <memory>
|
2021-10-11 15:34:03 +00:00
|
|
|
#include <string>
|
2020-02-11 11:39:25 +01:00
|
|
|
#include <vector>
|
2017-12-21 00:45:38 +01:00
|
|
|
|
2019-03-26 11:59:46 +01:00
|
|
|
namespace NEO {
|
2017-12-21 00:45:38 +01:00
|
|
|
|
2018-08-07 14:46:15 +02:00
|
|
|
class ExecutionEnvironment;
|
2020-02-14 17:36:30 +01:00
|
|
|
class Device;
|
2022-02-04 14:41:04 +01:00
|
|
|
struct HardwareInfo;
|
|
|
|
|
const HardwareInfo *getDefaultHwInfo();
|
2020-03-23 09:13:25 +01:00
|
|
|
bool prepareDeviceEnvironments(ExecutionEnvironment &executionEnvironment);
|
2021-10-11 15:34:03 +00:00
|
|
|
bool prepareDeviceEnvironment(ExecutionEnvironment &executionEnvironment, std::string &osPciPath, const uint32_t rootDeviceIndex);
|
2017-12-21 00:45:38 +01:00
|
|
|
class DeviceFactory {
|
|
|
|
|
public:
|
2020-03-23 09:13:25 +01:00
|
|
|
static bool prepareDeviceEnvironments(ExecutionEnvironment &executionEnvironment);
|
2021-10-11 15:34:03 +00:00
|
|
|
static bool prepareDeviceEnvironment(ExecutionEnvironment &executionEnvironment, std::string &osPciPath, const uint32_t rootDeviceIndex);
|
2020-03-23 09:13:25 +01:00
|
|
|
static bool prepareDeviceEnvironmentsForProductFamilyOverride(ExecutionEnvironment &executionEnvironment);
|
2020-02-14 17:36:30 +01:00
|
|
|
static std::vector<std::unique_ptr<Device>> createDevices(ExecutionEnvironment &executionEnvironment);
|
2021-10-11 15:34:03 +00:00
|
|
|
static std::unique_ptr<Device> createDevice(ExecutionEnvironment &executionEnvironment, std::string &osPciPath, const uint32_t rootDeviceIndex);
|
2020-02-07 09:00:25 +01:00
|
|
|
static bool isHwModeSelected();
|
2020-02-14 17:36:30 +01:00
|
|
|
|
|
|
|
|
static std::unique_ptr<Device> (*createRootDeviceFunc)(ExecutionEnvironment &executionEnvironment, uint32_t rootDeviceIndex);
|
2021-01-12 21:39:04 +00:00
|
|
|
static bool (*createMemoryManagerFunc)(ExecutionEnvironment &executionEnvironment);
|
2022-01-31 17:43:42 +00:00
|
|
|
static bool isAllowedDeviceId(uint32_t deviceId, const std::string &deviceIdString);
|
2018-07-12 11:45:02 +02:00
|
|
|
};
|
2019-03-26 11:59:46 +01:00
|
|
|
} // namespace NEO
|