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