2017-12-21 07:45:38 +08:00
|
|
|
/*
|
2019-02-06 00:38:57 +08:00
|
|
|
* Copyright (C) 2017-2019 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
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include "runtime/command_stream/tbx_command_stream_receiver.h"
|
2019-02-27 18:39:32 +08:00
|
|
|
|
2019-11-29 22:41:47 +08:00
|
|
|
#include "core/helpers/hw_info.h"
|
2019-12-09 22:29:30 +08:00
|
|
|
#include "core/helpers/options.h"
|
2019-02-27 17:06:14 +08:00
|
|
|
#include "runtime/execution_environment/execution_environment.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] = {};
|
|
|
|
|
2019-10-29 15:01:53 +08:00
|
|
|
CommandStreamReceiver *TbxCommandStreamReceiver::create(const std::string &baseName, bool withAubDump, ExecutionEnvironment &executionEnvironment, uint32_t rootDeviceIndex) {
|
2019-02-27 17:06:14 +08:00
|
|
|
auto hwInfo = executionEnvironment.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
|
|
|
|
2019-10-29 15:01:53 +08:00
|
|
|
return pCreate ? pCreate(baseName, withAubDump, executionEnvironment, rootDeviceIndex) : nullptr;
|
2017-12-21 07:45:38 +08:00
|
|
|
}
|
2019-03-26 18:59:46 +08:00
|
|
|
} // namespace NEO
|