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