Files
compute-runtime/shared/source/device/sub_device.h
Michal Mrozek dc44b13b53 Optimize getRootDeviceIndex.
Virtual functions are not easily optimizable by compiler,
so making this normal function.
This function is called heavily so it needs to be highly optimized.

Signed-off-by: Michal Mrozek <michal.mrozek@intel.com>
2021-12-16 11:53:12 +01:00

32 lines
868 B
C++

/*
* Copyright (C) 2019-2021 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
*/
#pragma once
#include "shared/source/device/device.h"
namespace NEO {
class RootDevice;
class SubDevice : public Device {
public:
SubDevice(ExecutionEnvironment *executionEnvironment, uint32_t subDeviceIndex, Device &rootDevice);
SubDevice(ExecutionEnvironment *executionEnvironment, uint32_t subDeviceIndex, Device &rootDevice, aub_stream::EngineType engineType);
void incRefInternal() override;
unique_ptr_if_unused<Device> decRefInternal() override;
Device *getRootDevice() const override;
uint32_t getSubDeviceIndex() const;
bool isSubDevice() const override { return true; }
protected:
bool genericSubDevicesAllowed() override { return false; };
RootDevice &rootDevice;
const uint32_t subDeviceIndex;
};
} // namespace NEO