mirror of
https://github.com/intel/compute-runtime.git
synced 2026-01-08 14:02:58 +08:00
Allow Device creating multiple CSRs [4/n]
- Introduce additional RCS engine - Set fixed size for Engines array Change-Id: I06533a425684b64214f956783b07877e6157935b Signed-off-by: Dunajski, Bartosz <bartosz.dunajski@intel.com>
This commit is contained in:
committed by
sys_ocldev
parent
cd5f85052e
commit
7781089740
@@ -96,8 +96,8 @@ class AUBCommandStreamReceiverHw : public CommandStreamReceiverSimulatedHw<GfxFa
|
||||
uint32_t ggttRingBuffer;
|
||||
size_t sizeRingBuffer;
|
||||
uint32_t tailRingBuffer;
|
||||
} engineInfoTable[arrayCount(allEngineInstances)] = {};
|
||||
size_t gpgpuEngineIndex = arrayCount(gpgpuEngineInstances) - 1;
|
||||
} engineInfoTable[allEngineInstances.size()] = {};
|
||||
size_t gpgpuEngineIndex = gpgpuEngineInstances.size() - 1;
|
||||
|
||||
std::unique_ptr<AubSubCaptureManager> subCaptureManager;
|
||||
uint32_t aubDeviceId;
|
||||
|
||||
@@ -93,13 +93,10 @@ const AubMemDump::LrcaHelper &AUBCommandStreamReceiverHw<GfxFamily>::getCsTraits
|
||||
|
||||
template <typename GfxFamily>
|
||||
size_t AUBCommandStreamReceiverHw<GfxFamily>::getEngineIndexFromInstance(EngineInstanceT engineInstance) {
|
||||
constexpr auto numAllEngines = arrayCount(allEngineInstances);
|
||||
constexpr auto findBegin = allEngineInstances;
|
||||
constexpr auto findEnd = findBegin + numAllEngines;
|
||||
auto findCriteria = [&](const auto &it) { return it.type == engineInstance.type && it.id == engineInstance.id; };
|
||||
auto findResult = std::find_if(findBegin, findEnd, findCriteria);
|
||||
UNRECOVERABLE_IF(findResult == findEnd);
|
||||
return findResult - findBegin;
|
||||
auto findResult = std::find_if(allEngineInstances.begin(), allEngineInstances.end(), findCriteria);
|
||||
UNRECOVERABLE_IF(findResult == allEngineInstances.end());
|
||||
return findResult - allEngineInstances.begin();
|
||||
}
|
||||
|
||||
template <typename GfxFamily>
|
||||
|
||||
@@ -6,7 +6,9 @@
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
#include <array>
|
||||
#include <cstdint>
|
||||
|
||||
namespace OCLRT {
|
||||
|
||||
enum EngineType : uint32_t {
|
||||
@@ -25,14 +27,16 @@ struct EngineInstanceT {
|
||||
int id;
|
||||
};
|
||||
|
||||
static constexpr EngineInstanceT allEngineInstances[] = {
|
||||
{ENGINE_RCS},
|
||||
static constexpr std::array<EngineInstanceT, 5> allEngineInstances = {{
|
||||
{ENGINE_RCS, 0},
|
||||
{ENGINE_RCS, 1},
|
||||
{ENGINE_BCS},
|
||||
{ENGINE_VCS},
|
||||
{ENGINE_VECS},
|
||||
};
|
||||
}};
|
||||
|
||||
static constexpr EngineInstanceT gpgpuEngineInstances[] = {
|
||||
{ENGINE_RCS},
|
||||
};
|
||||
static constexpr std::array<EngineInstanceT, 2> gpgpuEngineInstances = {{
|
||||
{ENGINE_RCS, 0},
|
||||
{ENGINE_RCS, 1},
|
||||
}};
|
||||
} // namespace OCLRT
|
||||
|
||||
@@ -87,7 +87,9 @@ Device::~Device() {
|
||||
}
|
||||
|
||||
for (auto &engine : engines) {
|
||||
engine.commandStreamReceiver->flushBatchedSubmissions();
|
||||
if (engine.commandStreamReceiver) {
|
||||
engine.commandStreamReceiver->flushBatchedSubmissions();
|
||||
}
|
||||
}
|
||||
|
||||
if (deviceInfo.sourceLevelDebuggerActive && executionEnvironment->sourceLevelDebugger) {
|
||||
@@ -122,7 +124,7 @@ bool Device::createDeviceImpl(const HardwareInfo *pHwInfo, Device &outDevice) {
|
||||
return false;
|
||||
}
|
||||
|
||||
outDevice.engines.emplace_back(commandStreamReceiver, osContext);
|
||||
outDevice.engines[0] = {commandStreamReceiver, osContext};
|
||||
|
||||
auto pDevice = &outDevice;
|
||||
if (!pDevice->osTime) {
|
||||
@@ -253,7 +255,9 @@ bool Device::isSourceLevelDebuggerActive() const {
|
||||
|
||||
void Device::initMaxPowerSavingMode() {
|
||||
for (auto &engine : engines) {
|
||||
engine.commandStreamReceiver->peekKmdNotifyHelper()->initMaxPowerSavingMode();
|
||||
if (engine.commandStreamReceiver) {
|
||||
engine.commandStreamReceiver->peekKmdNotifyHelper()->initMaxPowerSavingMode();
|
||||
}
|
||||
}
|
||||
}
|
||||
} // namespace OCLRT
|
||||
|
||||
@@ -157,7 +157,7 @@ class Device : public BaseObject<_cl_device_id> {
|
||||
std::unique_ptr<DriverInfo> driverInfo;
|
||||
std::unique_ptr<PerformanceCounters> performanceCounters;
|
||||
|
||||
std::vector<EngineControl> engines;
|
||||
std::array<EngineControl, gpgpuEngineInstances.size()> engines = {{}};
|
||||
|
||||
void *slmWindowStartAddress = nullptr;
|
||||
|
||||
|
||||
@@ -37,9 +37,6 @@ bool ExecutionEnvironment::initializeCommandStreamReceiver(const HardwareInfo *p
|
||||
if (deviceIndex + 1 > commandStreamReceivers.size()) {
|
||||
commandStreamReceivers.resize(deviceIndex + 1);
|
||||
}
|
||||
if (deviceCsrIndex + 1 > commandStreamReceivers[deviceIndex].size()) {
|
||||
commandStreamReceivers[deviceIndex].resize(deviceCsrIndex + 1);
|
||||
}
|
||||
|
||||
if (this->commandStreamReceivers[deviceIndex][deviceCsrIndex]) {
|
||||
return true;
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
#include "engine_node.h"
|
||||
#include "runtime/os_interface/device_factory.h"
|
||||
#include "runtime/utilities/reference_tracked_object.h"
|
||||
|
||||
@@ -23,7 +24,7 @@ class BuiltIns;
|
||||
struct HardwareInfo;
|
||||
class OSInterface;
|
||||
|
||||
using CsrContainer = std::vector<std::unique_ptr<CommandStreamReceiver>>;
|
||||
using CsrContainer = std::array<std::unique_ptr<CommandStreamReceiver>, gpgpuEngineInstances.size()>;
|
||||
|
||||
class ExecutionEnvironment : public ReferenceTrackedObject<ExecutionEnvironment> {
|
||||
private:
|
||||
|
||||
@@ -44,7 +44,7 @@ class AUBFixture : public CommandQueueHwFixture {
|
||||
}
|
||||
|
||||
executionEnvironment->commandStreamReceivers.resize(deviceIndex + 1);
|
||||
executionEnvironment->commandStreamReceivers[deviceIndex].push_back(std::unique_ptr<CommandStreamReceiver>(this->csr));
|
||||
executionEnvironment->commandStreamReceivers[deviceIndex][0].reset(this->csr);
|
||||
device.reset(MockDevice::create<MockDevice>(&hwInfo, executionEnvironment, deviceIndex));
|
||||
|
||||
CommandQueueHwFixture::SetUp(AUBFixture::device.get(), cl_command_queue_properties(0));
|
||||
|
||||
@@ -342,7 +342,7 @@ HWTEST_F(EnqueueHandlerTestBasic, givenEnqueueHandlerWhenCommandIsBlokingThenCom
|
||||
auto executionEnvironment = new ExecutionEnvironment;
|
||||
auto mockCsr = new MockCsrBase<FamilyType>(tag, *executionEnvironment);
|
||||
executionEnvironment->commandStreamReceivers.resize(1);
|
||||
executionEnvironment->commandStreamReceivers[0].push_back(std::unique_ptr<CommandStreamReceiver>(mockCsr));
|
||||
executionEnvironment->commandStreamReceivers[0][0].reset(mockCsr);
|
||||
std::unique_ptr<MockDevice> pDevice(MockDevice::createWithExecutionEnvironment<MockDevice>(nullptr, executionEnvironment, 0u));
|
||||
auto context = std::make_unique<MockContext>(pDevice.get());
|
||||
MockKernelWithInternals kernelInternals(*pDevice, context.get());
|
||||
|
||||
@@ -74,12 +74,13 @@ HWTEST_F(AubCommandStreamReceiverTests, givenAubCommandStreamReceiverWhenGetEngi
|
||||
auto aubCsr = std::make_unique<AUBCommandStreamReceiverHw<FamilyType>>(**platformDevices, "", true, executionEnvironment);
|
||||
EXPECT_NE(nullptr, aubCsr);
|
||||
|
||||
EXPECT_TRUE(aubCsr->getEngineIndexFromInstance(EngineInstanceT(EngineType::ENGINE_RCS, 0)) < arrayCount(allEngineInstances));
|
||||
EXPECT_TRUE(aubCsr->getEngineIndexFromInstance(EngineInstanceT(EngineType::ENGINE_BCS, 0)) < arrayCount(allEngineInstances));
|
||||
EXPECT_TRUE(aubCsr->getEngineIndexFromInstance(EngineInstanceT(EngineType::ENGINE_VCS, 0)) < arrayCount(allEngineInstances));
|
||||
EXPECT_TRUE(aubCsr->getEngineIndexFromInstance(EngineInstanceT(EngineType::ENGINE_VECS, 0)) < arrayCount(allEngineInstances));
|
||||
EXPECT_TRUE(aubCsr->getEngineIndexFromInstance(EngineInstanceT(EngineType::ENGINE_RCS, 0)) < allEngineInstances.size());
|
||||
EXPECT_TRUE(aubCsr->getEngineIndexFromInstance(EngineInstanceT(EngineType::ENGINE_RCS, 1)) < allEngineInstances.size());
|
||||
EXPECT_TRUE(aubCsr->getEngineIndexFromInstance(EngineInstanceT(EngineType::ENGINE_BCS, 0)) < allEngineInstances.size());
|
||||
EXPECT_TRUE(aubCsr->getEngineIndexFromInstance(EngineInstanceT(EngineType::ENGINE_VCS, 0)) < allEngineInstances.size());
|
||||
EXPECT_TRUE(aubCsr->getEngineIndexFromInstance(EngineInstanceT(EngineType::ENGINE_VECS, 0)) < allEngineInstances.size());
|
||||
|
||||
EXPECT_THROW(aubCsr->getEngineIndexFromInstance(EngineInstanceT(EngineType::ENGINE_RCS, 1)), std::exception);
|
||||
EXPECT_THROW(aubCsr->getEngineIndexFromInstance(EngineInstanceT(EngineType::ENGINE_RCS, 2)), std::exception);
|
||||
EXPECT_THROW(aubCsr->getEngineIndexFromInstance(EngineInstanceT(EngineType::ENGINE_BCS, 1)), std::exception);
|
||||
EXPECT_THROW(aubCsr->getEngineIndexFromInstance(EngineInstanceT(EngineType::ENGINE_VCS, 1)), std::exception);
|
||||
EXPECT_THROW(aubCsr->getEngineIndexFromInstance(EngineInstanceT(EngineType::ENGINE_VECS, 1)), std::exception);
|
||||
|
||||
@@ -661,7 +661,7 @@ HWTEST_F(CommandStreamReceiverFlushTaskTests, givenCsrInBatchingModeWhenTotalRes
|
||||
executionEnvironment.memoryManager.reset(mockedMemoryManager);
|
||||
auto mockCsr = new MockCsrHw2<FamilyType>(*platformDevices[0], executionEnvironment);
|
||||
executionEnvironment.commandStreamReceivers.resize(1);
|
||||
executionEnvironment.commandStreamReceivers[0].push_back(std::unique_ptr<CommandStreamReceiver>(mockCsr));
|
||||
executionEnvironment.commandStreamReceivers[0][0].reset(mockCsr);
|
||||
mockCsr->initializeTagAllocation();
|
||||
mockCsr->setPreemptionCsrAllocation(pDevice->getPreemptionAllocation());
|
||||
mockCsr->overrideDispatchPolicy(DispatchMode::BatchedDispatch);
|
||||
|
||||
@@ -298,7 +298,7 @@ TEST(CommandStreamReceiverSimpleTest, givenCommandStreamReceiverWhenItIsDestroye
|
||||
mockGraphicsAllocation->destructorCalled = &destructorCalled;
|
||||
ExecutionEnvironment executionEnvironment;
|
||||
executionEnvironment.commandStreamReceivers.resize(1);
|
||||
executionEnvironment.commandStreamReceivers[0].push_back(std::make_unique<MockCommandStreamReceiver>(executionEnvironment));
|
||||
executionEnvironment.commandStreamReceivers[0][0] = (std::make_unique<MockCommandStreamReceiver>(executionEnvironment));
|
||||
auto csr = executionEnvironment.commandStreamReceivers[0][0].get();
|
||||
executionEnvironment.memoryManager.reset(new OsAgnosticMemoryManager(false, false, executionEnvironment));
|
||||
csr->setTagAllocation(mockGraphicsAllocation);
|
||||
@@ -311,7 +311,7 @@ TEST(CommandStreamReceiverSimpleTest, givenCommandStreamReceiverWhenInitializeTa
|
||||
ExecutionEnvironment executionEnvironment;
|
||||
auto csr = new MockCommandStreamReceiver(executionEnvironment);
|
||||
executionEnvironment.commandStreamReceivers.resize(1);
|
||||
executionEnvironment.commandStreamReceivers[0].push_back(std::unique_ptr<CommandStreamReceiver>(csr));
|
||||
executionEnvironment.commandStreamReceivers[0][0].reset(csr);
|
||||
executionEnvironment.memoryManager.reset(new OsAgnosticMemoryManager(false, false, executionEnvironment));
|
||||
EXPECT_EQ(nullptr, csr->getTagAllocation());
|
||||
EXPECT_TRUE(csr->getTagAddress() == nullptr);
|
||||
@@ -327,7 +327,7 @@ TEST(CommandStreamReceiverSimpleTest, givenNullHardwareDebugModeWhenInitializeTa
|
||||
ExecutionEnvironment executionEnvironment;
|
||||
executionEnvironment.commandStreamReceivers.resize(1);
|
||||
auto csr = new MockCommandStreamReceiver(executionEnvironment);
|
||||
executionEnvironment.commandStreamReceivers[0].push_back(std::unique_ptr<CommandStreamReceiver>(csr));
|
||||
executionEnvironment.commandStreamReceivers[0][0].reset(csr);
|
||||
executionEnvironment.memoryManager.reset(new OsAgnosticMemoryManager(false, false, executionEnvironment));
|
||||
EXPECT_EQ(nullptr, csr->getTagAllocation());
|
||||
EXPECT_TRUE(csr->getTagAddress() == nullptr);
|
||||
|
||||
@@ -43,8 +43,8 @@ HWTEST_P(CreateCommandStreamReceiverTest, givenCreateCommandStreamWhenCsrIsSetTo
|
||||
overrideCommandStreamReceiverCreation = true;
|
||||
DebugManager.flags.SetCommandStreamReceiver.set(csrType);
|
||||
executionEnvironment->commandStreamReceivers.resize(1);
|
||||
executionEnvironment->commandStreamReceivers[0].push_back(std::unique_ptr<CommandStreamReceiver>(createCommandStream(hwInfo,
|
||||
*executionEnvironment)));
|
||||
executionEnvironment->commandStreamReceivers[0][0] = std::unique_ptr<CommandStreamReceiver>(createCommandStream(hwInfo,
|
||||
*executionEnvironment));
|
||||
|
||||
if (csrType < CommandStreamReceiverType::CSR_TYPES_NUM) {
|
||||
EXPECT_NE(nullptr, executionEnvironment->commandStreamReceivers[0][0].get());
|
||||
|
||||
@@ -191,12 +191,19 @@ TEST(DeviceCreation, givenMultiDeviceWhenTheyAreCreatedThenEachDeviceHasSeperate
|
||||
auto device2 = std::unique_ptr<MockDevice>(Device::create<MockDevice>(nullptr, &executionEnvironment, 1u));
|
||||
|
||||
EXPECT_EQ(2u, executionEnvironment.commandStreamReceivers.size());
|
||||
EXPECT_EQ(1u, executionEnvironment.commandStreamReceivers[0].size());
|
||||
EXPECT_EQ(1u, executionEnvironment.commandStreamReceivers[1].size());
|
||||
EXPECT_EQ(gpgpuEngineInstances.size(), executionEnvironment.commandStreamReceivers[0].size());
|
||||
EXPECT_EQ(gpgpuEngineInstances.size(), executionEnvironment.commandStreamReceivers[1].size());
|
||||
EXPECT_NE(nullptr, executionEnvironment.commandStreamReceivers[0][0]);
|
||||
EXPECT_NE(nullptr, executionEnvironment.commandStreamReceivers[1][0]);
|
||||
EXPECT_EQ(&device->getCommandStreamReceiver(), executionEnvironment.commandStreamReceivers[0][0].get());
|
||||
EXPECT_EQ(&device2->getCommandStreamReceiver(), executionEnvironment.commandStreamReceivers[1][0].get());
|
||||
EXPECT_EQ(device->getEngine(0).commandStreamReceiver, executionEnvironment.commandStreamReceivers[0][0].get());
|
||||
EXPECT_EQ(device2->getEngine(0).commandStreamReceiver, executionEnvironment.commandStreamReceivers[1][0].get());
|
||||
|
||||
for (size_t i = 1; i < gpgpuEngineInstances.size(); i++) {
|
||||
EXPECT_EQ(nullptr, executionEnvironment.commandStreamReceivers[0][i]);
|
||||
EXPECT_EQ(nullptr, executionEnvironment.commandStreamReceivers[1][i]);
|
||||
EXPECT_EQ(nullptr, device->getEngine(i).commandStreamReceiver);
|
||||
EXPECT_EQ(nullptr, device2->getEngine(i).commandStreamReceiver);
|
||||
}
|
||||
}
|
||||
|
||||
TEST(DeviceCreation, givenFtrSimulationModeFlagTrueWhenNoOtherSimulationFlagsArePresentThenIsSimulationReturnsTrue) {
|
||||
|
||||
@@ -120,7 +120,7 @@ TEST(ExecutionEnvironment, givenExecutionEnvironmentWhenInitializeIsCalledMultip
|
||||
executionEnvironment->initializeCommandStreamReceiver(platformDevices[0], 0, 1);
|
||||
|
||||
EXPECT_EQ(currentCommandStreamReceiver, executionEnvironment->commandStreamReceivers[0][1].get());
|
||||
EXPECT_EQ(2u, executionEnvironment->commandStreamReceivers[0].size());
|
||||
EXPECT_EQ(gpgpuEngineInstances.size(), executionEnvironment->commandStreamReceivers[0].size());
|
||||
EXPECT_EQ(nullptr, executionEnvironment->commandStreamReceivers[0][0].get());
|
||||
}
|
||||
|
||||
@@ -200,7 +200,7 @@ TEST(ExecutionEnvironment, givenExecutionEnvironmentWithVariousMembersWhenItIsDe
|
||||
executionEnvironment->osInterface = std::make_unique<OsInterfaceMock>(destructorId);
|
||||
executionEnvironment->memoryManager = std::make_unique<MemoryMangerMock>(destructorId);
|
||||
executionEnvironment->aubCenter = std::make_unique<AubCenterMock>(destructorId);
|
||||
executionEnvironment->commandStreamReceivers[0].push_back(std::make_unique<CommandStreamReceiverMock>(destructorId, *executionEnvironment));
|
||||
executionEnvironment->commandStreamReceivers[0][0] = std::make_unique<CommandStreamReceiverMock>(destructorId, *executionEnvironment);
|
||||
executionEnvironment->builtins = std::make_unique<BuiltinsMock>(destructorId);
|
||||
executionEnvironment->compilerInterface = std::make_unique<CompilerInterfaceMock>(destructorId);
|
||||
executionEnvironment->sourceLevelDebugger = std::make_unique<SourceLevelDebuggerMock>(destructorId);
|
||||
|
||||
@@ -17,7 +17,7 @@ void MemoryManagerWithCsrFixture::SetUp() {
|
||||
executionEnvironment.memoryManager.reset(memoryManager);
|
||||
csr->tagAddress = ¤tGpuTag;
|
||||
executionEnvironment.commandStreamReceivers.resize(1);
|
||||
executionEnvironment.commandStreamReceivers[0].push_back(std::unique_ptr<CommandStreamReceiver>(csr));
|
||||
executionEnvironment.commandStreamReceivers[0][0].reset(csr);
|
||||
}
|
||||
|
||||
void MemoryManagerWithCsrFixture::TearDown() {
|
||||
|
||||
@@ -59,7 +59,7 @@ HWTEST_TYPED_TEST(SurfaceTest, GivenSurfaceWhenInterfaceIsUsedThenSurfaceBehaves
|
||||
ExecutionEnvironment executionEnvironment;
|
||||
executionEnvironment.commandStreamReceivers.resize(1);
|
||||
MockCsr<FamilyType> *csr = new MockCsr<FamilyType>(execStamp, executionEnvironment);
|
||||
executionEnvironment.commandStreamReceivers[0].push_back(std::unique_ptr<CommandStreamReceiver>(csr));
|
||||
executionEnvironment.commandStreamReceivers[0][0].reset(csr);
|
||||
executionEnvironment.memoryManager.reset(csr->createMemoryManager(false, false));
|
||||
|
||||
Surface *surface = createSurface::Create<TypeParam>(this->data,
|
||||
|
||||
@@ -123,7 +123,7 @@ template <typename CsrType>
|
||||
std::unique_ptr<AubExecutionEnvironment> getEnvironment(bool createTagAllocation, bool allocateCommandBuffer, bool standalone) {
|
||||
std::unique_ptr<ExecutionEnvironment> executionEnvironment(new ExecutionEnvironment);
|
||||
executionEnvironment->commandStreamReceivers.resize(1);
|
||||
executionEnvironment->commandStreamReceivers[0].push_back(std::make_unique<CsrType>(*platformDevices[0], "", standalone, *executionEnvironment));
|
||||
executionEnvironment->commandStreamReceivers[0][0] = std::make_unique<CsrType>(*platformDevices[0], "", standalone, *executionEnvironment);
|
||||
executionEnvironment->memoryManager.reset(executionEnvironment->commandStreamReceivers[0][0]->createMemoryManager(false, false));
|
||||
if (createTagAllocation) {
|
||||
executionEnvironment->commandStreamReceivers[0][0]->initializeTagAllocation();
|
||||
|
||||
@@ -17,9 +17,9 @@ MockDevice::MockDevice(const HardwareInfo &hwInfo)
|
||||
: MockDevice(hwInfo, new ExecutionEnvironment, 0u) {
|
||||
CommandStreamReceiver *commandStreamReceiver = createCommandStream(&hwInfo, *this->executionEnvironment);
|
||||
executionEnvironment->commandStreamReceivers.resize(getDeviceIndex() + 1);
|
||||
executionEnvironment->commandStreamReceivers[getDeviceIndex()].push_back(std::unique_ptr<CommandStreamReceiver>(commandStreamReceiver));
|
||||
executionEnvironment->commandStreamReceivers[getDeviceIndex()][0].reset(commandStreamReceiver);
|
||||
this->executionEnvironment->memoryManager = std::move(this->mockMemoryManager);
|
||||
this->engines.emplace_back(commandStreamReceiver, nullptr);
|
||||
this->engines[0] = {commandStreamReceiver, nullptr};
|
||||
}
|
||||
MockDevice::MockDevice(const HardwareInfo &hwInfo, ExecutionEnvironment *executionEnvironment, uint32_t deviceIndex)
|
||||
: Device(hwInfo, executionEnvironment, deviceIndex) {
|
||||
|
||||
@@ -44,7 +44,7 @@ class DrmCommandStreamFixture {
|
||||
gemCloseWorkerMode::gemCloseWorkerActive);
|
||||
ASSERT_NE(nullptr, csr);
|
||||
executionEnvironment.commandStreamReceivers.resize(1);
|
||||
executionEnvironment.commandStreamReceivers[0].push_back(std::unique_ptr<CommandStreamReceiver>(csr));
|
||||
executionEnvironment.commandStreamReceivers[0][0].reset(csr);
|
||||
|
||||
// Memory manager creates pinBB with ioctl, expect one call
|
||||
EXPECT_CALL(*mock, ioctl(::testing::_, ::testing::_))
|
||||
|
||||
@@ -1616,7 +1616,7 @@ TEST_F(DrmMemoryManagerTest, givenTwoGraphicsAllocationsThatShareTheSameBufferOb
|
||||
executionEnvironment->osInterface->get()->setDrm(mock);
|
||||
auto testedCsr = new TestedDrmCommandStreamReceiver<DEFAULT_TEST_FAMILY_NAME>(*executionEnvironment);
|
||||
executionEnvironment->commandStreamReceivers.resize(1);
|
||||
executionEnvironment->commandStreamReceivers[0].push_back(std::unique_ptr<CommandStreamReceiver>(testedCsr));
|
||||
executionEnvironment->commandStreamReceivers[0][0].reset(testedCsr);
|
||||
|
||||
testedCsr->makeResident(*graphicsAllocation);
|
||||
testedCsr->makeResident(*graphicsAllocation2);
|
||||
@@ -1645,7 +1645,7 @@ TEST_F(DrmMemoryManagerTest, givenTwoGraphicsAllocationsThatDoesnShareTheSameBuf
|
||||
executionEnvironment->osInterface->get()->setDrm(mock);
|
||||
auto testedCsr = new TestedDrmCommandStreamReceiver<DEFAULT_TEST_FAMILY_NAME>(*executionEnvironment);
|
||||
executionEnvironment->commandStreamReceivers.resize(1);
|
||||
executionEnvironment->commandStreamReceivers[0].push_back(std::unique_ptr<CommandStreamReceiver>(testedCsr));
|
||||
executionEnvironment->commandStreamReceivers[0][0].reset(testedCsr);
|
||||
|
||||
testedCsr->makeResident(*graphicsAllocation);
|
||||
testedCsr->makeResident(*graphicsAllocation2);
|
||||
|
||||
@@ -63,7 +63,7 @@ class WddmCommandStreamFixture {
|
||||
|
||||
csr = new WddmCommandStreamReceiver<DEFAULT_TEST_FAMILY_NAME>(*platformDevices[0], *executionEnvironment);
|
||||
executionEnvironment->commandStreamReceivers.resize(1);
|
||||
executionEnvironment->commandStreamReceivers[0].push_back(std::unique_ptr<CommandStreamReceiver>(csr));
|
||||
executionEnvironment->commandStreamReceivers[0][0].reset(csr);
|
||||
|
||||
memoryManager = new MockWddmMemoryManager(wddm, *executionEnvironment);
|
||||
executionEnvironment->memoryManager.reset(memoryManager);
|
||||
@@ -127,9 +127,9 @@ class WddmCommandStreamWithMockGdiFixture {
|
||||
ASSERT_NE(wddm, nullptr);
|
||||
DebugManager.flags.CsrDispatchMode.set(static_cast<uint32_t>(DispatchMode::ImmediateDispatch));
|
||||
executionEnvironment->commandStreamReceivers.resize(1);
|
||||
executionEnvironment->commandStreamReceivers[0]
|
||||
.push_back(std::make_unique<MockWddmCsr<DEFAULT_TEST_FAMILY_NAME>>(*platformDevices[0],
|
||||
*executionEnvironment));
|
||||
executionEnvironment->commandStreamReceivers[0][0] =
|
||||
std::make_unique<MockWddmCsr<DEFAULT_TEST_FAMILY_NAME>>(*platformDevices[0],
|
||||
*executionEnvironment);
|
||||
this->csr = static_cast<MockWddmCsr<DEFAULT_TEST_FAMILY_NAME> *>(executionEnvironment->commandStreamReceivers[0][0].get());
|
||||
memoryManager = csr->createMemoryManager(false, false);
|
||||
ASSERT_NE(nullptr, memoryManager);
|
||||
@@ -249,8 +249,8 @@ TEST(WddmPreemptionHeaderTests, givenWddmCommandStreamReceiverWhenPreemptionIsOf
|
||||
hwInfo->capabilityTable.defaultPreemptionMode = PreemptionMode::Disabled;
|
||||
auto wddm = static_cast<WddmMock *>(executionEnvironment->osInterface->get()->getWddm());
|
||||
executionEnvironment->commandStreamReceivers.resize(1);
|
||||
executionEnvironment->commandStreamReceivers[0].push_back(std::make_unique<MockWddmCsr<DEFAULT_TEST_FAMILY_NAME>>(hwInfo[0],
|
||||
*executionEnvironment));
|
||||
executionEnvironment->commandStreamReceivers[0][0] =
|
||||
std::make_unique<MockWddmCsr<DEFAULT_TEST_FAMILY_NAME>>(hwInfo[0], *executionEnvironment);
|
||||
executionEnvironment->memoryManager.reset(executionEnvironment->commandStreamReceivers[0][0]->createMemoryManager(false, false));
|
||||
executionEnvironment->commandStreamReceivers[0][0]->overrideDispatchPolicy(DispatchMode::ImmediateDispatch);
|
||||
|
||||
@@ -275,8 +275,8 @@ TEST(WddmPreemptionHeaderTests, givenWddmCommandStreamReceiverWhenPreemptionIsOn
|
||||
hwInfo->capabilityTable.defaultPreemptionMode = PreemptionMode::MidThread;
|
||||
auto wddm = static_cast<WddmMock *>(executionEnvironment->osInterface->get()->getWddm());
|
||||
executionEnvironment->commandStreamReceivers.resize(1);
|
||||
executionEnvironment->commandStreamReceivers[0].push_back(std::make_unique<MockWddmCsr<DEFAULT_TEST_FAMILY_NAME>>(hwInfo[0],
|
||||
*executionEnvironment));
|
||||
executionEnvironment->commandStreamReceivers[0][0] = std::make_unique<MockWddmCsr<DEFAULT_TEST_FAMILY_NAME>>(hwInfo[0],
|
||||
*executionEnvironment);
|
||||
executionEnvironment->memoryManager.reset(executionEnvironment->commandStreamReceivers[0][0]->createMemoryManager(false, false));
|
||||
executionEnvironment->commandStreamReceivers[0][0]->overrideDispatchPolicy(DispatchMode::ImmediateDispatch);
|
||||
|
||||
@@ -886,7 +886,7 @@ HWTEST_F(WddmCsrCompressionTests, givenEnabledCompressionWhenFlushingThenInitTra
|
||||
mockWddmCsr->createPageTableManager();
|
||||
mockWddmCsr->overrideDispatchPolicy(DispatchMode::BatchedDispatch);
|
||||
executionEnvironment->commandStreamReceivers.resize(1);
|
||||
executionEnvironment->commandStreamReceivers[0].push_back(std::unique_ptr<CommandStreamReceiver>(mockWddmCsr));
|
||||
executionEnvironment->commandStreamReceivers[0][0].reset(mockWddmCsr);
|
||||
|
||||
auto mockMngr = reinterpret_cast<MockGmmPageTableMngr *>(myMockWddm->getPageTableManager());
|
||||
std::unique_ptr<MockDevice> device(Device::create<MockDevice>(hwInfo, executionEnvironment, 0u));
|
||||
@@ -927,7 +927,7 @@ HWTEST_F(WddmCsrCompressionTests, givenDisabledCompressionWhenFlushingThenDontIn
|
||||
|
||||
auto mockWddmCsr = new MockWddmCsr<FamilyType>(hwInfo[0], *executionEnvironment);
|
||||
executionEnvironment->commandStreamReceivers.resize(1);
|
||||
executionEnvironment->commandStreamReceivers[0].push_back(std::unique_ptr<CommandStreamReceiver>(mockWddmCsr));
|
||||
executionEnvironment->commandStreamReceivers[0][0].reset(mockWddmCsr);
|
||||
mockWddmCsr->overrideDispatchPolicy(DispatchMode::BatchedDispatch);
|
||||
|
||||
std::unique_ptr<MockDevice> device(Device::create<MockDevice>(hwInfo, executionEnvironment, 0u));
|
||||
|
||||
@@ -1428,7 +1428,8 @@ TEST(WddmMemoryManagerCleanupTest, givenUsedTagAllocationInWddmMemoryManagerWhen
|
||||
EXPECT_TRUE(wddm->init());
|
||||
ExecutionEnvironment executionEnvironment;
|
||||
executionEnvironment.commandStreamReceivers.resize(1);
|
||||
executionEnvironment.commandStreamReceivers[0].push_back(std::unique_ptr<CommandStreamReceiver>(createCommandStream(*platformDevices, executionEnvironment)));
|
||||
executionEnvironment.commandStreamReceivers[0][0] =
|
||||
std::unique_ptr<CommandStreamReceiver>(createCommandStream(*platformDevices, executionEnvironment));
|
||||
executionEnvironment.memoryManager = std::make_unique<WddmMemoryManager>(false, false, wddm.get(), executionEnvironment);
|
||||
EXPECT_EQ(executionEnvironment.commandStreamReceivers[0][0].get(), executionEnvironment.memoryManager->getCommandStreamReceiver(0));
|
||||
auto tagAllocator = executionEnvironment.memoryManager->obtainEventPerfCountAllocator(1);
|
||||
|
||||
@@ -66,7 +66,7 @@ struct GlArbSyncEventTest : public ::testing::Test {
|
||||
executionEnvironment = new ExecutionEnvironment;
|
||||
auto mockCsr = new MockCommandStreamReceiver(*executionEnvironment);
|
||||
executionEnvironment->commandStreamReceivers.resize(1);
|
||||
executionEnvironment->commandStreamReceivers[0].push_back(std::unique_ptr<MockCommandStreamReceiver>(mockCsr));
|
||||
executionEnvironment->commandStreamReceivers[0][0].reset(mockCsr);
|
||||
executionEnvironment->memoryManager = std::make_unique<OsAgnosticMemoryManager>(false, false, *executionEnvironment);
|
||||
device.reset(MockDevice::create<MockDevice>(nullptr, executionEnvironment, 0u));
|
||||
ctx.reset(new MockContext);
|
||||
|
||||
Reference in New Issue
Block a user