2017-12-21 00:45:38 +01:00
|
|
|
/*
|
2021-05-16 20:51:16 +02:00
|
|
|
* Copyright (C) 2018-2021 Intel Corporation
|
2017-12-21 00:45:38 +01:00
|
|
|
*
|
2018-09-18 09:11:08 +02:00
|
|
|
* SPDX-License-Identifier: MIT
|
2017-12-21 00:45:38 +01:00
|
|
|
*
|
|
|
|
|
*/
|
|
|
|
|
|
2021-05-31 11:28:07 +02:00
|
|
|
#include "shared/source/command_stream/tbx_command_stream_receiver.h"
|
2019-02-27 11:39:32 +01:00
|
|
|
|
2020-02-23 22:44:01 +01:00
|
|
|
#include "shared/source/execution_environment/execution_environment.h"
|
|
|
|
|
#include "shared/source/execution_environment/root_device_environment.h"
|
|
|
|
|
#include "shared/source/helpers/hw_info.h"
|
2019-02-27 11:39:32 +01:00
|
|
|
|
2017-12-21 00:45:38 +01:00
|
|
|
#include <string>
|
|
|
|
|
|
2019-03-26 11:59:46 +01:00
|
|
|
namespace NEO {
|
2017-12-21 00:45:38 +01:00
|
|
|
|
|
|
|
|
TbxCommandStreamReceiverCreateFunc tbxCommandStreamReceiverFactory[IGFX_MAX_CORE] = {};
|
|
|
|
|
|
2020-10-28 16:08:37 +01:00
|
|
|
CommandStreamReceiver *TbxCommandStreamReceiver::create(const std::string &baseName,
|
|
|
|
|
bool withAubDump,
|
|
|
|
|
ExecutionEnvironment &executionEnvironment,
|
|
|
|
|
uint32_t rootDeviceIndex,
|
2020-10-29 15:33:35 +01:00
|
|
|
const DeviceBitfield deviceBitfield) {
|
2020-02-18 13:29:30 +01:00
|
|
|
auto hwInfo = executionEnvironment.rootDeviceEnvironments[rootDeviceIndex]->getHardwareInfo();
|
2017-12-21 00:45:38 +01:00
|
|
|
|
2019-05-08 16:00:24 +02:00
|
|
|
if (hwInfo->platform.eRenderCoreFamily >= IGFX_MAX_CORE) {
|
2017-12-21 00:45:38 +01:00
|
|
|
DEBUG_BREAK_IF(!false);
|
|
|
|
|
return nullptr;
|
|
|
|
|
}
|
|
|
|
|
|
2019-05-08 16:00:24 +02:00
|
|
|
auto pCreate = tbxCommandStreamReceiverFactory[hwInfo->platform.eRenderCoreFamily];
|
2017-12-21 00:45:38 +01:00
|
|
|
|
2020-10-28 16:08:37 +01:00
|
|
|
return pCreate ? pCreate(baseName, withAubDump, executionEnvironment, rootDeviceIndex, deviceBitfield) : nullptr;
|
2017-12-21 00:45:38 +01:00
|
|
|
}
|
2019-03-26 11:59:46 +01:00
|
|
|
} // namespace NEO
|