2019-08-27 15:34:20 +08:00
|
|
|
/*
|
|
|
|
* Copyright (C) 2019 Intel Corporation
|
|
|
|
*
|
|
|
|
* SPDX-License-Identifier: MIT
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
#include "runtime/device/device.h"
|
|
|
|
|
|
|
|
namespace NEO {
|
|
|
|
|
|
|
|
class SubDevice;
|
|
|
|
|
|
|
|
class RootDevice : public Device {
|
|
|
|
public:
|
|
|
|
RootDevice(ExecutionEnvironment *executionEnvironment, uint32_t deviceIndex);
|
|
|
|
~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-08-28 19:12:44 +08:00
|
|
|
uint32_t getNumSubDevices() const;
|
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;
|
2019-08-28 19:12:44 +08:00
|
|
|
|
|
|
|
/* We hide the retain and release function of BaseObject. */
|
|
|
|
void retain() override;
|
|
|
|
unique_ptr_if_unused<Device> release() override;
|
2019-08-27 15:34:20 +08:00
|
|
|
|
|
|
|
protected:
|
2019-09-17 16:44:49 +08:00
|
|
|
DeviceBitfield getDeviceBitfieldForOsContext() const override;
|
2019-08-28 19:12:44 +08:00
|
|
|
std::vector<std::unique_ptr<SubDevice>> subdevices;
|
2019-08-27 15:34:20 +08:00
|
|
|
};
|
|
|
|
} // namespace NEO
|