mirror of
https://github.com/intel/compute-runtime.git
synced 2025-09-15 13:01:45 +08:00
Add classes for sub devices concept
Related-To: NEO-3007 Change-Id: I27dd4b91e286ba1b75f4b50bec96d98df37983e1 Signed-off-by: Mateusz Jablonski <mateusz.jablonski@intel.com>
This commit is contained in:

committed by
sys_ocldev

parent
4503e04083
commit
c7c6068d1f
@ -1,5 +1,5 @@
|
||||
#
|
||||
# Copyright (C) 2018 Intel Corporation
|
||||
# Copyright (C) 2018-2019 Intel Corporation
|
||||
#
|
||||
# SPDX-License-Identifier: MIT
|
||||
#
|
||||
@ -14,6 +14,9 @@ set(RUNTIME_SRCS_DEVICE
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/device_info_map.h
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/device_vector.h
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/driver_info.h
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/root_device.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/root_device.h
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/sub_device.h
|
||||
)
|
||||
target_sources(${NEO_STATIC_LIB_NAME} PRIVATE ${RUNTIME_SRCS_DEVICE})
|
||||
set_property(GLOBAL PROPERTY RUNTIME_SRCS_DEVICE ${RUNTIME_SRCS_DEVICE})
|
||||
|
17
runtime/device/root_device.cpp
Normal file
17
runtime/device/root_device.cpp
Normal file
@ -0,0 +1,17 @@
|
||||
/*
|
||||
* Copyright (C) 2019 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
*/
|
||||
|
||||
#include "runtime/device/root_device.h"
|
||||
|
||||
#include "runtime/device/sub_device.h"
|
||||
|
||||
namespace NEO {
|
||||
|
||||
RootDevice::~RootDevice() = default;
|
||||
RootDevice::RootDevice(ExecutionEnvironment *executionEnvironment, uint32_t deviceIndex) : Device(executionEnvironment, deviceIndex) {}
|
||||
|
||||
} // namespace NEO
|
23
runtime/device/root_device.h
Normal file
23
runtime/device/root_device.h
Normal file
@ -0,0 +1,23 @@
|
||||
/*
|
||||
* 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;
|
||||
|
||||
protected:
|
||||
std::vector<SubDevice *> subdevices;
|
||||
};
|
||||
} // namespace NEO
|
20
runtime/device/sub_device.h
Normal file
20
runtime/device/sub_device.h
Normal file
@ -0,0 +1,20 @@
|
||||
/*
|
||||
* 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:
|
||||
using Device::Device;
|
||||
|
||||
protected:
|
||||
RootDevice *rootDevice = nullptr;
|
||||
};
|
||||
} // namespace NEO
|
@ -11,7 +11,7 @@
|
||||
#include "runtime/api/api.h"
|
||||
#include "runtime/command_stream/command_stream_receiver.h"
|
||||
#include "runtime/compiler_interface/compiler_interface.h"
|
||||
#include "runtime/device/device.h"
|
||||
#include "runtime/device/root_device.h"
|
||||
#include "runtime/event/async_events_handler.h"
|
||||
#include "runtime/execution_environment/execution_environment.h"
|
||||
#include "runtime/gmm_helper/gmm_helper.h"
|
||||
@ -147,7 +147,7 @@ bool Platform::initialize() {
|
||||
|
||||
this->devices.resize(numDevicesReturned);
|
||||
for (uint32_t deviceOrdinal = 0; deviceOrdinal < numDevicesReturned; ++deviceOrdinal) {
|
||||
auto pDevice = Device::create<NEO::Device>(executionEnvironment, deviceOrdinal);
|
||||
auto pDevice = Device::create<RootDevice>(executionEnvironment, deviceOrdinal);
|
||||
DEBUG_BREAK_IF(!pDevice);
|
||||
if (pDevice) {
|
||||
this->devices[deviceOrdinal] = pDevice;
|
||||
|
@ -28,7 +28,7 @@ MockDevice::MockDevice()
|
||||
}
|
||||
|
||||
MockDevice::MockDevice(ExecutionEnvironment *executionEnvironment, uint32_t deviceIndex)
|
||||
: Device(executionEnvironment, deviceIndex) {
|
||||
: RootDevice(executionEnvironment, deviceIndex) {
|
||||
auto &hwInfo = getHardwareInfo();
|
||||
bool enableLocalMemory = HwHelper::get(hwInfo.platform.eRenderCoreFamily).getEnableLocalMemory(hwInfo);
|
||||
bool aubUsage = (testMode == TestMode::AubTests) || (testMode == TestMode::AubTestsWithTbx);
|
||||
|
@ -6,7 +6,7 @@
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
#include "runtime/device/device.h"
|
||||
#include "runtime/device/root_device.h"
|
||||
#include "runtime/helpers/hw_helper.h"
|
||||
#include "unit_tests/fixtures/mock_aub_center_fixture.h"
|
||||
#include "unit_tests/libult/ult_command_stream_receiver.h"
|
||||
@ -18,7 +18,7 @@ class FailMemoryManager;
|
||||
|
||||
extern CommandStreamReceiver *createCommandStream(ExecutionEnvironment &executionEnvironment);
|
||||
|
||||
class MockDevice : public Device {
|
||||
class MockDevice : public RootDevice {
|
||||
public:
|
||||
using Device::createDeviceInternals;
|
||||
using Device::createEngine;
|
||||
|
Reference in New Issue
Block a user