mirror of
https://github.com/intel/compute-runtime.git
synced 2025-12-30 18:37:46 +08:00
Include files are now grouped and sorted in following order: 1. Header file of the class the current file implements 2. Project files 3. Third party files 4. Standard library Change-Id: If31af05652184169f7fee1d7ad08f1b2ed602cf0 Signed-off-by: Filip Hazubski <filip.hazubski@intel.com>
50 lines
1.8 KiB
C++
50 lines
1.8 KiB
C++
/*
|
|
* Copyright (C) 2018-2019 Intel Corporation
|
|
*
|
|
* SPDX-License-Identifier: MIT
|
|
*
|
|
*/
|
|
|
|
#include "runtime/command_stream/aub_command_stream_receiver.h"
|
|
#include "runtime/command_stream/command_stream_receiver.h"
|
|
#include "runtime/command_stream/create_command_stream_impl.h"
|
|
#include "runtime/command_stream/tbx_command_stream_receiver.h"
|
|
#include "runtime/helpers/options.h"
|
|
#include "unit_tests/libult/ult_command_stream_receiver.h"
|
|
|
|
#include <cassert>
|
|
|
|
namespace OCLRT {
|
|
|
|
extern CommandStreamReceiverCreateFunc commandStreamReceiverFactory[2 * IGFX_MAX_CORE];
|
|
bool getDevicesResult = true;
|
|
|
|
bool overrideCommandStreamReceiverCreation = false;
|
|
bool overrideDeviceWithDefaultHardwareInfo = true;
|
|
|
|
CommandStreamReceiver *createCommandStream(const HardwareInfo *pHwInfo, ExecutionEnvironment &executionEnvironment) {
|
|
CommandStreamReceiver *commandStreamReceiver = nullptr;
|
|
assert(nullptr != pHwInfo->pPlatform);
|
|
auto offset = !overrideCommandStreamReceiverCreation ? IGFX_MAX_CORE : 0;
|
|
if (offset != 0) {
|
|
auto funcCreate = commandStreamReceiverFactory[offset + pHwInfo->pPlatform->eRenderCoreFamily];
|
|
if (funcCreate) {
|
|
commandStreamReceiver = funcCreate(*pHwInfo, false, executionEnvironment);
|
|
}
|
|
} else {
|
|
commandStreamReceiver = createCommandStreamImpl(pHwInfo, executionEnvironment);
|
|
}
|
|
return commandStreamReceiver;
|
|
}
|
|
|
|
bool getDevices(HardwareInfo **hwInfo, size_t &numDevicesReturned, ExecutionEnvironment &executionEnvironment) {
|
|
if (overrideDeviceWithDefaultHardwareInfo) {
|
|
*hwInfo = const_cast<HardwareInfo *>(*platformDevices);
|
|
numDevicesReturned = numPlatformDevices;
|
|
return getDevicesResult;
|
|
}
|
|
|
|
return getDevicesImpl(hwInfo, numDevicesReturned, executionEnvironment);
|
|
}
|
|
} // namespace OCLRT
|