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 RootDevice;
|
|
|
|
class SubDevice : public Device {
|
|
|
|
public:
|
2019-10-24 19:34:25 +08:00
|
|
|
SubDevice(ExecutionEnvironment *executionEnvironment, uint32_t internalDeviceIndex, uint32_t subDeviceIndex, RootDevice &rootDevice);
|
2019-08-28 19:12:44 +08:00
|
|
|
void retain() override;
|
|
|
|
unique_ptr_if_unused<Device> release() override;
|
|
|
|
void retainInternal();
|
|
|
|
void releaseInternal();
|
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;
|
2019-08-27 15:34:20 +08:00
|
|
|
|
|
|
|
protected:
|
2019-09-17 16:44:49 +08:00
|
|
|
DeviceBitfield getDeviceBitfieldForOsContext() const override;
|
|
|
|
const uint32_t subDeviceIndex;
|
2019-08-28 19:12:44 +08:00
|
|
|
RootDevice &rootDevice;
|
2019-08-27 15:34:20 +08:00
|
|
|
};
|
|
|
|
} // namespace NEO
|