2019-08-27 15:34:20 +08:00
|
|
|
/*
|
2021-01-25 17:24:00 +08:00
|
|
|
* Copyright (C) 2019-2021 Intel Corporation
|
2019-08-27 15:34:20 +08:00
|
|
|
*
|
|
|
|
* SPDX-License-Identifier: MIT
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
#pragma once
|
2020-02-24 05:44:01 +08:00
|
|
|
#include "shared/source/device/device.h"
|
2019-08-27 15:34:20 +08:00
|
|
|
|
|
|
|
namespace NEO {
|
|
|
|
|
|
|
|
class SubDevice;
|
|
|
|
|
|
|
|
class RootDevice : public Device {
|
|
|
|
public:
|
2019-10-24 19:34:25 +08:00
|
|
|
RootDevice(ExecutionEnvironment *executionEnvironment, uint32_t rootDeviceIndex);
|
2019-08-27 15:34:20 +08:00
|
|
|
~RootDevice() override;
|
2019-08-28 19:12:44 +08:00
|
|
|
bool createDeviceImpl() override;
|
2019-09-23 20:04:18 +08:00
|
|
|
uint32_t getNumAvailableDevices() const override;
|
2019-10-21 19:41:35 +08:00
|
|
|
uint32_t getRootDeviceIndex() const override;
|
2019-10-10 21:56:10 +08:00
|
|
|
Device *getDeviceById(uint32_t deviceId) const override;
|
2020-07-15 18:38:34 +08:00
|
|
|
Device *getParentDevice() const override;
|
2019-11-05 20:38:20 +08:00
|
|
|
uint32_t getNumSubDevices() const;
|
2020-11-18 19:17:45 +08:00
|
|
|
BindlessHeapsHelper *getBindlessHeapsHelper() const override;
|
2019-08-27 15:34:20 +08:00
|
|
|
|
|
|
|
protected:
|
2019-12-03 17:15:46 +08:00
|
|
|
DeviceBitfield getDeviceBitfield() const override;
|
2019-10-07 18:42:28 +08:00
|
|
|
bool createEngines() override;
|
2019-11-05 20:38:20 +08:00
|
|
|
|
2020-01-20 14:02:07 +08:00
|
|
|
void initializeRootCommandStreamReceiver();
|
2019-11-05 20:38:20 +08:00
|
|
|
MOCKABLE_VIRTUAL SubDevice *createSubDevice(uint32_t subDeviceIndex);
|
|
|
|
|
2020-01-14 21:32:11 +08:00
|
|
|
std::vector<SubDevice *> subdevices;
|
2019-10-24 19:34:25 +08:00
|
|
|
const uint32_t rootDeviceIndex;
|
2021-01-25 17:24:00 +08:00
|
|
|
DeviceBitfield deviceBitfield = DeviceBitfield{1u};
|
|
|
|
uint32_t numSubDevices = 0;
|
2019-08-27 15:34:20 +08:00
|
|
|
};
|
|
|
|
} // namespace NEO
|