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