diff --git a/level_zero/core/test/unit_tests/sources/cmdqueue/test_cmdqueue.cpp b/level_zero/core/test/unit_tests/sources/cmdqueue/test_cmdqueue.cpp index 3b9eedb013..9ae4a460e0 100644 --- a/level_zero/core/test/unit_tests/sources/cmdqueue/test_cmdqueue.cpp +++ b/level_zero/core/test/unit_tests/sources/cmdqueue/test_cmdqueue.cpp @@ -210,7 +210,7 @@ using CommandQueueCommands = Test; HWTEST_F(CommandQueueCommands, givenCommandQueueWhenExecutingCommandListsThenHardwareContextIsProgrammedAndGlobalAllocationResident) { const ze_command_queue_desc_t desc = {}; - MockCsrHw2 csr(*neoDevice->getExecutionEnvironment(), 0); + MockCsrHw2 csr(*neoDevice->getExecutionEnvironment(), 0, neoDevice->getDeviceBitfield()); csr.initializeTagAllocation(); csr.setupContext(*neoDevice->getDefaultEngine().osContext); @@ -246,7 +246,7 @@ using CommandQueueIndirectAllocations = Test; HWTEST_F(CommandQueueIndirectAllocations, givenCommandQueueWhenExecutingCommandListsThenExpectedIndirectAllocationsAddedToResidencyContainer) { const ze_command_queue_desc_t desc = {}; - MockCsrHw2 csr(*neoDevice->getExecutionEnvironment(), 0); + MockCsrHw2 csr(*neoDevice->getExecutionEnvironment(), 0, neoDevice->getDeviceBitfield()); csr.initializeTagAllocation(); csr.setupContext(*neoDevice->getDefaultEngine().osContext); @@ -443,7 +443,8 @@ HWTEST_F(CommandQueueSynchronizeTest, givenCallToSynchronizeThenCorrectEnableTim ~SynchronizeCsr() override { delete tagAddress; } - SynchronizeCsr(const NEO::ExecutionEnvironment &executionEnvironment) : NEO::UltCommandStreamReceiver(const_cast(executionEnvironment), 0) { + SynchronizeCsr(const NEO::ExecutionEnvironment &executionEnvironment, DeviceBitfield deviceBitfield) + : NEO::UltCommandStreamReceiver(const_cast(executionEnvironment), 0, deviceBitfield) { tagAddress = new uint32_t; } bool waitForCompletionWithTimeout(bool enableTimeout, int64_t timeoutMs, uint32_t taskCountToWait) override { @@ -458,7 +459,8 @@ HWTEST_F(CommandQueueSynchronizeTest, givenCallToSynchronizeThenCorrectEnableTim uint32_t *tagAddress; }; - auto csr = std::unique_ptr(new SynchronizeCsr(*device->getNEODevice()->getExecutionEnvironment())); + auto csr = std::unique_ptr(new SynchronizeCsr(*device->getNEODevice()->getExecutionEnvironment(), + device->getNEODevice()->getDeviceBitfield())); ze_command_queue_desc_t desc = {}; ze_command_queue_handle_t commandQueue = {}; ze_result_t res = context->createCommandQueue(device, &desc, &commandQueue); diff --git a/level_zero/core/test/unit_tests/sources/fence/test_fence.cpp b/level_zero/core/test/unit_tests/sources/fence/test_fence.cpp index 263e15e458..be767ebb90 100644 --- a/level_zero/core/test/unit_tests/sources/fence/test_fence.cpp +++ b/level_zero/core/test/unit_tests/sources/fence/test_fence.cpp @@ -18,7 +18,7 @@ namespace ult { using FenceTest = Test; TEST_F(FenceTest, whenQueryingStatusThenCsrAllocationsAreDownloaded) { - auto csr = std::make_unique(*neoDevice->getExecutionEnvironment(), 0); + auto csr = std::make_unique(*neoDevice->getExecutionEnvironment(), 0, neoDevice->getDeviceBitfield()); Mock cmdQueue(device, csr.get()); auto fence = Fence::create(&cmdQueue, nullptr); diff --git a/opencl/source/command_stream/aub_command_stream_receiver.cpp b/opencl/source/command_stream/aub_command_stream_receiver.cpp index 9cb004a5b4..3c287a01aa 100644 --- a/opencl/source/command_stream/aub_command_stream_receiver.cpp +++ b/opencl/source/command_stream/aub_command_stream_receiver.cpp @@ -51,7 +51,11 @@ std::string AUBCommandStreamReceiver::createFullFilePath(const HardwareInfo &hwI return filePath; } -CommandStreamReceiver *AUBCommandStreamReceiver::create(const std::string &baseName, bool standalone, ExecutionEnvironment &executionEnvironment, uint32_t rootDeviceIndex) { +CommandStreamReceiver *AUBCommandStreamReceiver::create(const std::string &baseName, + bool standalone, + ExecutionEnvironment &executionEnvironment, + uint32_t rootDeviceIndex, + DeviceBitfield deviceBitfield) { auto hwInfo = executionEnvironment.rootDeviceEnvironments[rootDeviceIndex]->getHardwareInfo(); std::string filePath = AUBCommandStreamReceiver::createFullFilePath(*hwInfo, baseName); if (DebugManager.flags.AUBDumpCaptureFileName.get() != "unk") { @@ -64,7 +68,7 @@ CommandStreamReceiver *AUBCommandStreamReceiver::create(const std::string &baseN } auto pCreate = aubCommandStreamReceiverFactory[hwInfo->platform.eRenderCoreFamily]; - return pCreate ? pCreate(filePath, standalone, executionEnvironment, rootDeviceIndex) : nullptr; + return pCreate ? pCreate(filePath, standalone, executionEnvironment, rootDeviceIndex, deviceBitfield) : nullptr; } } // namespace NEO diff --git a/opencl/source/command_stream/aub_command_stream_receiver.h b/opencl/source/command_stream/aub_command_stream_receiver.h index e59ee4ce19..0b4cbb5802 100644 --- a/opencl/source/command_stream/aub_command_stream_receiver.h +++ b/opencl/source/command_stream/aub_command_stream_receiver.h @@ -7,6 +7,7 @@ #pragma once #include "shared/source/aub_mem_dump/aub_mem_dump.h" +#include "shared/source/helpers/common_types.h" #include @@ -16,11 +17,19 @@ class CommandStreamReceiver; class ExecutionEnvironment; struct AUBCommandStreamReceiver { - static CommandStreamReceiver *create(const std::string &filename, bool standalone, ExecutionEnvironment &executionEnvironment, uint32_t rootDeviceIndex); + static CommandStreamReceiver *create(const std::string &filename, + bool standalone, + ExecutionEnvironment &executionEnvironment, + uint32_t rootDeviceIndex, + DeviceBitfield deviceBitfield); static std::string createFullFilePath(const HardwareInfo &hwInfo, const std::string &filename); using AubFileStream = AubMemDump::AubFileStream; }; -typedef CommandStreamReceiver *(*AubCommandStreamReceiverCreateFunc)(const std::string &fileName, bool standalone, ExecutionEnvironment &executionEnvironment, uint32_t rootDeviceIndex); +typedef CommandStreamReceiver *(*AubCommandStreamReceiverCreateFunc)(const std::string &fileName, + bool standalone, + ExecutionEnvironment &executionEnvironment, + uint32_t rootDeviceIndex, + DeviceBitfield deviceBitfield); } // namespace NEO diff --git a/opencl/source/command_stream/aub_command_stream_receiver_hw.h b/opencl/source/command_stream/aub_command_stream_receiver_hw.h index 04f0e237c6..ffc45100e0 100644 --- a/opencl/source/command_stream/aub_command_stream_receiver_hw.h +++ b/opencl/source/command_stream/aub_command_stream_receiver_hw.h @@ -68,9 +68,13 @@ class AUBCommandStreamReceiverHw : public CommandStreamReceiverSimulatedHw -AUBCommandStreamReceiverHw::AUBCommandStreamReceiverHw(const std::string &fileName, bool standalone, ExecutionEnvironment &executionEnvironment, uint32_t rootDeviceIndex) - : BaseClass(executionEnvironment, rootDeviceIndex), +AUBCommandStreamReceiverHw::AUBCommandStreamReceiverHw(const std::string &fileName, + bool standalone, + ExecutionEnvironment &executionEnvironment, + uint32_t rootDeviceIndex, + DeviceBitfield deviceBitfield) + : BaseClass(executionEnvironment, rootDeviceIndex, deviceBitfield), standalone(standalone) { executionEnvironment.rootDeviceEnvironments[rootDeviceIndex]->initAubCenter(this->isLocalMemoryEnabled(), fileName, this->getType()); @@ -279,8 +283,12 @@ void AUBCommandStreamReceiverHw::initializeEngine() { } template -CommandStreamReceiver *AUBCommandStreamReceiverHw::create(const std::string &fileName, bool standalone, ExecutionEnvironment &executionEnvironment, uint32_t rootDeviceIndex) { - auto csr = std::make_unique>(fileName, standalone, executionEnvironment, rootDeviceIndex); +CommandStreamReceiver *AUBCommandStreamReceiverHw::create(const std::string &fileName, + bool standalone, + ExecutionEnvironment &executionEnvironment, + uint32_t rootDeviceIndex, + DeviceBitfield deviceBitfield) { + auto csr = std::make_unique>(fileName, standalone, executionEnvironment, rootDeviceIndex, deviceBitfield); if (!csr->subCaptureManager->isSubCaptureMode()) { csr->openFile(fileName); diff --git a/opencl/source/command_stream/command_stream_receiver_simulated_common_hw.h b/opencl/source/command_stream/command_stream_receiver_simulated_common_hw.h index efa499f218..c2a81564d6 100644 --- a/opencl/source/command_stream/command_stream_receiver_simulated_common_hw.h +++ b/opencl/source/command_stream/command_stream_receiver_simulated_common_hw.h @@ -33,7 +33,7 @@ class CommandStreamReceiverSimulatedCommonHw : public CommandStreamReceiverHw::getDeviceIndex() con return osContext->getDeviceBitfield().any() ? static_cast(Math::log2(static_cast(osContext->getDeviceBitfield().to_ulong()))) : 0u; } template -CommandStreamReceiverSimulatedCommonHw::CommandStreamReceiverSimulatedCommonHw(ExecutionEnvironment &executionEnvironment, uint32_t rootDeviceIndex) : CommandStreamReceiverHw(executionEnvironment, rootDeviceIndex) { +CommandStreamReceiverSimulatedCommonHw::CommandStreamReceiverSimulatedCommonHw(ExecutionEnvironment &executionEnvironment, + uint32_t rootDeviceIndex, + DeviceBitfield deviceBitfield) + : CommandStreamReceiverHw(executionEnvironment, rootDeviceIndex, deviceBitfield) { this->useNewResourceImplicitFlush = false; this->useGpuIdleImplicitFlush = false; } diff --git a/opencl/source/command_stream/command_stream_receiver_with_aub_dump.h b/opencl/source/command_stream/command_stream_receiver_with_aub_dump.h index 420d18ea03..bee7533faa 100644 --- a/opencl/source/command_stream/command_stream_receiver_with_aub_dump.h +++ b/opencl/source/command_stream/command_stream_receiver_with_aub_dump.h @@ -18,7 +18,10 @@ class CommandStreamReceiverWithAUBDump : public BaseCSR { using BaseCSR::osContext; public: - CommandStreamReceiverWithAUBDump(const std::string &baseName, ExecutionEnvironment &executionEnvironment, uint32_t rootDeviceIndex); + CommandStreamReceiverWithAUBDump(const std::string &baseName, + ExecutionEnvironment &executionEnvironment, + uint32_t rootDeviceIndex, + DeviceBitfield deviceBitfield); CommandStreamReceiverWithAUBDump(const CommandStreamReceiverWithAUBDump &) = delete; CommandStreamReceiverWithAUBDump &operator=(const CommandStreamReceiverWithAUBDump &) = delete; diff --git a/opencl/source/command_stream/command_stream_receiver_with_aub_dump.inl b/opencl/source/command_stream/command_stream_receiver_with_aub_dump.inl index 3d0f391420..a2c408467e 100644 --- a/opencl/source/command_stream/command_stream_receiver_with_aub_dump.inl +++ b/opencl/source/command_stream/command_stream_receiver_with_aub_dump.inl @@ -17,13 +17,16 @@ namespace NEO { extern CommandStreamReceiverCreateFunc commandStreamReceiverFactory[IGFX_MAX_CORE]; template -CommandStreamReceiverWithAUBDump::CommandStreamReceiverWithAUBDump(const std::string &baseName, ExecutionEnvironment &executionEnvironment, uint32_t rootDeviceIndex) - : BaseCSR(executionEnvironment, rootDeviceIndex) { +CommandStreamReceiverWithAUBDump::CommandStreamReceiverWithAUBDump(const std::string &baseName, + ExecutionEnvironment &executionEnvironment, + uint32_t rootDeviceIndex, + DeviceBitfield deviceBitfield) + : BaseCSR(executionEnvironment, rootDeviceIndex, deviceBitfield) { bool isAubManager = executionEnvironment.rootDeviceEnvironments[rootDeviceIndex]->aubCenter && executionEnvironment.rootDeviceEnvironments[rootDeviceIndex]->aubCenter->getAubManager(); bool isTbxMode = CommandStreamReceiverType::CSR_TBX == BaseCSR::getType(); bool createAubCsr = (isAubManager && isTbxMode) ? false : true; if (createAubCsr) { - aubCSR.reset(AUBCommandStreamReceiver::create(baseName, false, executionEnvironment, rootDeviceIndex)); + aubCSR.reset(AUBCommandStreamReceiver::create(baseName, false, executionEnvironment, rootDeviceIndex, deviceBitfield)); UNRECOVERABLE_IF(!aubCSR->initializeTagAllocation()); *aubCSR->getTagAddress() = std::numeric_limits::max(); } diff --git a/opencl/source/command_stream/create_command_stream_impl.cpp b/opencl/source/command_stream/create_command_stream_impl.cpp index 1d97b95319..bbcb149845 100644 --- a/opencl/source/command_stream/create_command_stream_impl.cpp +++ b/opencl/source/command_stream/create_command_stream_impl.cpp @@ -17,7 +17,7 @@ namespace NEO { extern CommandStreamReceiverCreateFunc commandStreamReceiverFactory[IGFX_MAX_CORE]; -CommandStreamReceiver *createCommandStreamImpl(ExecutionEnvironment &executionEnvironment, uint32_t rootDeviceIndex) { +CommandStreamReceiver *createCommandStreamImpl(ExecutionEnvironment &executionEnvironment, uint32_t rootDeviceIndex, DeviceBitfield deviceBitfield) { auto funcCreate = commandStreamReceiverFactory[executionEnvironment.rootDeviceEnvironments[rootDeviceIndex]->getHardwareInfo()->platform.eRenderCoreFamily]; if (funcCreate == nullptr) { return nullptr; @@ -29,19 +29,19 @@ CommandStreamReceiver *createCommandStreamImpl(ExecutionEnvironment &executionEn } switch (csr) { case CSR_HW: - commandStreamReceiver = funcCreate(false, executionEnvironment, rootDeviceIndex); + commandStreamReceiver = funcCreate(false, executionEnvironment, rootDeviceIndex, deviceBitfield); break; case CSR_AUB: - commandStreamReceiver = AUBCommandStreamReceiver::create("aubfile", true, executionEnvironment, rootDeviceIndex); + commandStreamReceiver = AUBCommandStreamReceiver::create("aubfile", true, executionEnvironment, rootDeviceIndex, deviceBitfield); break; case CSR_TBX: - commandStreamReceiver = TbxCommandStreamReceiver::create("", false, executionEnvironment, rootDeviceIndex); + commandStreamReceiver = TbxCommandStreamReceiver::create("", false, executionEnvironment, rootDeviceIndex, deviceBitfield); break; case CSR_HW_WITH_AUB: - commandStreamReceiver = funcCreate(true, executionEnvironment, rootDeviceIndex); + commandStreamReceiver = funcCreate(true, executionEnvironment, rootDeviceIndex, deviceBitfield); break; case CSR_TBX_WITH_AUB: - commandStreamReceiver = TbxCommandStreamReceiver::create("aubfile", true, executionEnvironment, rootDeviceIndex); + commandStreamReceiver = TbxCommandStreamReceiver::create("aubfile", true, executionEnvironment, rootDeviceIndex, deviceBitfield); break; default: break; diff --git a/opencl/source/command_stream/create_command_stream_impl.h b/opencl/source/command_stream/create_command_stream_impl.h index 9a27c993b8..8b5e2aa52a 100644 --- a/opencl/source/command_stream/create_command_stream_impl.h +++ b/opencl/source/command_stream/create_command_stream_impl.h @@ -10,6 +10,6 @@ namespace NEO { class ExecutionEnvironment; -extern CommandStreamReceiver *createCommandStreamImpl(ExecutionEnvironment &executionEnvironment, uint32_t rootDeviceIndex); +extern CommandStreamReceiver *createCommandStreamImpl(ExecutionEnvironment &executionEnvironment, uint32_t rootDeviceIndex, DeviceBitfield deviceBitfield); extern bool prepareDeviceEnvironmentsImpl(ExecutionEnvironment &executionEnvironment); } // namespace NEO diff --git a/opencl/source/command_stream/tbx_command_stream_receiver.cpp b/opencl/source/command_stream/tbx_command_stream_receiver.cpp index c9e84e9ea1..7f7c8d8a7a 100644 --- a/opencl/source/command_stream/tbx_command_stream_receiver.cpp +++ b/opencl/source/command_stream/tbx_command_stream_receiver.cpp @@ -17,7 +17,11 @@ namespace NEO { TbxCommandStreamReceiverCreateFunc tbxCommandStreamReceiverFactory[IGFX_MAX_CORE] = {}; -CommandStreamReceiver *TbxCommandStreamReceiver::create(const std::string &baseName, bool withAubDump, ExecutionEnvironment &executionEnvironment, uint32_t rootDeviceIndex) { +CommandStreamReceiver *TbxCommandStreamReceiver::create(const std::string &baseName, + bool withAubDump, + ExecutionEnvironment &executionEnvironment, + uint32_t rootDeviceIndex, + DeviceBitfield deviceBitfield) { auto hwInfo = executionEnvironment.rootDeviceEnvironments[rootDeviceIndex]->getHardwareInfo(); if (hwInfo->platform.eRenderCoreFamily >= IGFX_MAX_CORE) { @@ -27,6 +31,6 @@ CommandStreamReceiver *TbxCommandStreamReceiver::create(const std::string &baseN auto pCreate = tbxCommandStreamReceiverFactory[hwInfo->platform.eRenderCoreFamily]; - return pCreate ? pCreate(baseName, withAubDump, executionEnvironment, rootDeviceIndex) : nullptr; + return pCreate ? pCreate(baseName, withAubDump, executionEnvironment, rootDeviceIndex, deviceBitfield) : nullptr; } } // namespace NEO diff --git a/opencl/source/command_stream/tbx_command_stream_receiver.h b/opencl/source/command_stream/tbx_command_stream_receiver.h index 9aa8e2ab3e..4eabb57bd5 100644 --- a/opencl/source/command_stream/tbx_command_stream_receiver.h +++ b/opencl/source/command_stream/tbx_command_stream_receiver.h @@ -7,6 +7,7 @@ #pragma once #include "shared/source/aub_mem_dump/aub_mem_dump.h" +#include "shared/source/helpers/common_types.h" namespace NEO { class CommandStreamReceiver; @@ -37,10 +38,18 @@ class TbxStream : public AubMemDump::AubStream { }; struct TbxCommandStreamReceiver { - static CommandStreamReceiver *create(const std::string &baseName, bool withAubDump, ExecutionEnvironment &executionEnvironment, uint32_t rootDeviceIndex); + static CommandStreamReceiver *create(const std::string &baseName, + bool withAubDump, + ExecutionEnvironment &executionEnvironment, + uint32_t rootDeviceIndex, + DeviceBitfield deviceBitfield); using TbxStream = NEO::TbxStream; }; -typedef CommandStreamReceiver *(*TbxCommandStreamReceiverCreateFunc)(const std::string &baseName, bool withAubDump, ExecutionEnvironment &executionEnvironment, uint32_t rootDeviceIndex); +typedef CommandStreamReceiver *(*TbxCommandStreamReceiverCreateFunc)(const std::string &baseName, + bool withAubDump, + ExecutionEnvironment &executionEnvironment, + uint32_t rootDeviceIndex, + DeviceBitfield deviceBitfield); } // namespace NEO diff --git a/opencl/source/command_stream/tbx_command_stream_receiver_hw.h b/opencl/source/command_stream/tbx_command_stream_receiver_hw.h index d2ed84d345..9f1adfd146 100644 --- a/opencl/source/command_stream/tbx_command_stream_receiver_hw.h +++ b/opencl/source/command_stream/tbx_command_stream_receiver_hw.h @@ -62,9 +62,9 @@ class TbxCommandStreamReceiverHw : public CommandStreamReceiverSimulatedHw -TbxCommandStreamReceiverHw::TbxCommandStreamReceiverHw(ExecutionEnvironment &executionEnvironment, uint32_t rootDeviceIndex) - : BaseClass(executionEnvironment, rootDeviceIndex) { +TbxCommandStreamReceiverHw::TbxCommandStreamReceiverHw(ExecutionEnvironment &executionEnvironment, + uint32_t rootDeviceIndex, + DeviceBitfield deviceBitfield) + : BaseClass(executionEnvironment, rootDeviceIndex, deviceBitfield) { physicalAddressAllocator.reset(this->createPhysicalAddressAllocator(&this->peekHwInfo())); executionEnvironment.rootDeviceEnvironments[rootDeviceIndex]->initAubCenter(this->localMemoryEnabled, "", this->getType()); @@ -152,7 +154,7 @@ void TbxCommandStreamReceiverHw::initializeEngine() { } template -CommandStreamReceiver *TbxCommandStreamReceiverHw::create(const std::string &baseName, bool withAubDump, ExecutionEnvironment &executionEnvironment, uint32_t rootDeviceIndex) { +CommandStreamReceiver *TbxCommandStreamReceiverHw::create(const std::string &baseName, bool withAubDump, ExecutionEnvironment &executionEnvironment, uint32_t rootDeviceIndex, DeviceBitfield deviceBitfield) { TbxCommandStreamReceiverHw *csr; if (withAubDump) { auto hwInfo = executionEnvironment.rootDeviceEnvironments[rootDeviceIndex]->getHardwareInfo(); @@ -164,7 +166,7 @@ CommandStreamReceiver *TbxCommandStreamReceiverHw::create(const std:: } executionEnvironment.rootDeviceEnvironments[rootDeviceIndex]->initAubCenter(localMemoryEnabled, fullName, CommandStreamReceiverType::CSR_TBX_WITH_AUB); - csr = new CommandStreamReceiverWithAUBDump>(baseName, executionEnvironment, rootDeviceIndex); + csr = new CommandStreamReceiverWithAUBDump>(baseName, executionEnvironment, rootDeviceIndex, deviceBitfield); auto aubCenter = executionEnvironment.rootDeviceEnvironments[rootDeviceIndex]->aubCenter.get(); UNRECOVERABLE_IF(nullptr == aubCenter); @@ -183,7 +185,7 @@ CommandStreamReceiver *TbxCommandStreamReceiverHw::create(const std:: } } } else { - csr = new TbxCommandStreamReceiverHw(executionEnvironment, rootDeviceIndex); + csr = new TbxCommandStreamReceiverHw(executionEnvironment, rootDeviceIndex, deviceBitfield); } if (!csr->aubManager) { diff --git a/opencl/source/dll/create_command_stream.cpp b/opencl/source/dll/create_command_stream.cpp index 0b8087a3d1..ad370187e5 100644 --- a/opencl/source/dll/create_command_stream.cpp +++ b/opencl/source/dll/create_command_stream.cpp @@ -15,8 +15,8 @@ namespace NEO { -CommandStreamReceiver *createCommandStream(ExecutionEnvironment &executionEnvironment, uint32_t rootDeviceIndex) { - return createCommandStreamImpl(executionEnvironment, rootDeviceIndex); +CommandStreamReceiver *createCommandStream(ExecutionEnvironment &executionEnvironment, uint32_t rootDeviceIndex, DeviceBitfield deviceBitfield) { + return createCommandStreamImpl(executionEnvironment, rootDeviceIndex, deviceBitfield); } } // namespace NEO diff --git a/opencl/source/os_interface/linux/device_command_stream.inl b/opencl/source/os_interface/linux/device_command_stream.inl index 6fb3652d3f..5acf128384 100644 --- a/opencl/source/os_interface/linux/device_command_stream.inl +++ b/opencl/source/os_interface/linux/device_command_stream.inl @@ -14,12 +14,12 @@ namespace NEO { template -CommandStreamReceiver *DeviceCommandStreamReceiver::create(bool withAubDump, ExecutionEnvironment &executionEnvironment, uint32_t rootDeviceIndex) { +CommandStreamReceiver *DeviceCommandStreamReceiver::create(bool withAubDump, ExecutionEnvironment &executionEnvironment, uint32_t rootDeviceIndex, DeviceBitfield deviceBitfield) { if (withAubDump) { - return new CommandStreamReceiverWithAUBDump>("aubfile", executionEnvironment, rootDeviceIndex); + return new CommandStreamReceiverWithAUBDump>("aubfile", executionEnvironment, rootDeviceIndex, deviceBitfield); } else { auto gemMode = DebugManager.flags.EnableGemCloseWorker.get() ? gemCloseWorkerMode::gemCloseWorkerActive : gemCloseWorkerMode::gemCloseWorkerInactive; - return new DrmCommandStreamReceiver(executionEnvironment, rootDeviceIndex, gemMode); + return new DrmCommandStreamReceiver(executionEnvironment, rootDeviceIndex, deviceBitfield, gemMode); } }; } // namespace NEO diff --git a/opencl/source/os_interface/linux/drm_command_stream.h b/opencl/source/os_interface/linux/drm_command_stream.h index ef0a60918b..0e2609802e 100644 --- a/opencl/source/os_interface/linux/drm_command_stream.h +++ b/opencl/source/os_interface/linux/drm_command_stream.h @@ -34,7 +34,7 @@ class DrmCommandStreamReceiver : public DeviceCommandStreamReceiver { public: // When drm is null default implementation is used. In this case DrmCommandStreamReceiver is responsible to free drm. // When drm is passed, DCSR will not free it at destruction - DrmCommandStreamReceiver(ExecutionEnvironment &executionEnvironment, uint32_t rootDeviceIndex, + DrmCommandStreamReceiver(ExecutionEnvironment &executionEnvironment, uint32_t rootDeviceIndex, DeviceBitfield deviceBitfield, gemCloseWorkerMode mode = gemCloseWorkerMode::gemCloseWorkerActive); bool flush(BatchBuffer &batchBuffer, ResidencyContainer &allocationsForResidency) override; diff --git a/opencl/source/os_interface/linux/drm_command_stream.inl b/opencl/source/os_interface/linux/drm_command_stream.inl index 2e55838efb..1e564cf407 100644 --- a/opencl/source/os_interface/linux/drm_command_stream.inl +++ b/opencl/source/os_interface/linux/drm_command_stream.inl @@ -32,8 +32,8 @@ namespace NEO { template -DrmCommandStreamReceiver::DrmCommandStreamReceiver(ExecutionEnvironment &executionEnvironment, uint32_t rootDeviceIndex, gemCloseWorkerMode mode) - : BaseClass(executionEnvironment, rootDeviceIndex), gemCloseWorkerOperationMode(mode) { +DrmCommandStreamReceiver::DrmCommandStreamReceiver(ExecutionEnvironment &executionEnvironment, uint32_t rootDeviceIndex, DeviceBitfield deviceBitfield, gemCloseWorkerMode mode) + : BaseClass(executionEnvironment, rootDeviceIndex, deviceBitfield), gemCloseWorkerOperationMode(mode) { auto rootDeviceEnvironment = executionEnvironment.rootDeviceEnvironments[rootDeviceIndex].get(); diff --git a/opencl/source/os_interface/windows/device_command_stream.inl b/opencl/source/os_interface/windows/device_command_stream.inl index faff074215..2f03056136 100644 --- a/opencl/source/os_interface/windows/device_command_stream.inl +++ b/opencl/source/os_interface/windows/device_command_stream.inl @@ -20,11 +20,14 @@ namespace NEO { template -CommandStreamReceiver *DeviceCommandStreamReceiver::create(bool withAubDump, ExecutionEnvironment &executionEnvironment, uint32_t rootDeviceIndex) { +CommandStreamReceiver *DeviceCommandStreamReceiver::create(bool withAubDump, + ExecutionEnvironment &executionEnvironment, + uint32_t rootDeviceIndex, + DeviceBitfield deviceBitfield) { if (withAubDump) { - return new CommandStreamReceiverWithAUBDump>("aubfile", executionEnvironment, rootDeviceIndex); + return new CommandStreamReceiverWithAUBDump>("aubfile", executionEnvironment, rootDeviceIndex, deviceBitfield); } else { - return new WddmCommandStreamReceiver(executionEnvironment, rootDeviceIndex); + return new WddmCommandStreamReceiver(executionEnvironment, rootDeviceIndex, deviceBitfield); } } } // namespace NEO diff --git a/opencl/source/os_interface/windows/wddm_device_command_stream.h b/opencl/source/os_interface/windows/wddm_device_command_stream.h index d1e4da9818..d511276c54 100644 --- a/opencl/source/os_interface/windows/wddm_device_command_stream.h +++ b/opencl/source/os_interface/windows/wddm_device_command_stream.h @@ -21,7 +21,7 @@ class WddmCommandStreamReceiver : public DeviceCommandStreamReceiver typedef DeviceCommandStreamReceiver BaseClass; public: - WddmCommandStreamReceiver(ExecutionEnvironment &executionEnvironment, uint32_t rootDeviceIndex); + WddmCommandStreamReceiver(ExecutionEnvironment &executionEnvironment, uint32_t rootDeviceIndex, DeviceBitfield deviceBitfield); virtual ~WddmCommandStreamReceiver(); bool flush(BatchBuffer &batchBuffer, ResidencyContainer &allocationsForResidency) override; diff --git a/opencl/source/os_interface/windows/wddm_device_command_stream.inl b/opencl/source/os_interface/windows/wddm_device_command_stream.inl index 6c241edfb2..7b098be30f 100644 --- a/opencl/source/os_interface/windows/wddm_device_command_stream.inl +++ b/opencl/source/os_interface/windows/wddm_device_command_stream.inl @@ -37,8 +37,8 @@ namespace NEO { DECLARE_COMMAND_BUFFER(CommandBufferHeader, UMD_OCL, FALSE, FALSE, PERFTAG_OCL); template -WddmCommandStreamReceiver::WddmCommandStreamReceiver(ExecutionEnvironment &executionEnvironment, uint32_t rootDeviceIndex) - : BaseClass(executionEnvironment, rootDeviceIndex) { +WddmCommandStreamReceiver::WddmCommandStreamReceiver(ExecutionEnvironment &executionEnvironment, uint32_t rootDeviceIndex, DeviceBitfield deviceBitfield) + : BaseClass(executionEnvironment, rootDeviceIndex, deviceBitfield) { notifyAubCaptureImpl = DeviceCallbacks::notifyAubCapture; this->wddm = executionEnvironment.rootDeviceEnvironments[rootDeviceIndex]->osInterface->get()->getWddm(); diff --git a/opencl/test/unit_test/aub_tests/command_stream/aub_command_stream_fixture.cpp b/opencl/test/unit_test/aub_tests/command_stream/aub_command_stream_fixture.cpp index f0d43c0fb7..c5d948270d 100644 --- a/opencl/test/unit_test/aub_tests/command_stream/aub_command_stream_fixture.cpp +++ b/opencl/test/unit_test/aub_tests/command_stream/aub_command_stream_fixture.cpp @@ -35,9 +35,9 @@ void AUBCommandStreamFixture::SetUp(CommandQueue *pCmdQ) { strfilename << testInfo->test_case_name() << "_" << testInfo->name() << "_" << hwHelper.getCsTraits(engineType).name; if (testMode == TestMode::AubTestsWithTbx) { - pCommandStreamReceiver = TbxCommandStreamReceiver::create(strfilename.str(), true, *device.executionEnvironment, device.getRootDeviceIndex()); + pCommandStreamReceiver = TbxCommandStreamReceiver::create(strfilename.str(), true, *device.executionEnvironment, device.getRootDeviceIndex(), device.getDeviceBitfield()); } else { - pCommandStreamReceiver = AUBCommandStreamReceiver::create(strfilename.str(), true, *device.executionEnvironment, device.getRootDeviceIndex()); + pCommandStreamReceiver = AUBCommandStreamReceiver::create(strfilename.str(), true, *device.executionEnvironment, device.getRootDeviceIndex(), device.getDeviceBitfield()); } ASSERT_NE(nullptr, pCommandStreamReceiver); diff --git a/opencl/test/unit_test/aub_tests/fixtures/aub_fixture.h b/opencl/test/unit_test/aub_tests/fixtures/aub_fixture.h index 6eaf5ac800..5027e8c25d 100644 --- a/opencl/test/unit_test/aub_tests/fixtures/aub_fixture.h +++ b/opencl/test/unit_test/aub_tests/fixtures/aub_fixture.h @@ -48,9 +48,9 @@ class AUBFixture : public CommandQueueHwFixture { device = std::make_unique(MockDevice::create(executionEnvironment, rootDeviceIndex)); if (testMode == TestMode::AubTestsWithTbx) { - this->csr = TbxCommandStreamReceiver::create(strfilename.str(), true, *executionEnvironment, 0); + this->csr = TbxCommandStreamReceiver::create(strfilename.str(), true, *executionEnvironment, 0, device->getDeviceBitfield()); } else { - this->csr = AUBCommandStreamReceiver::create(strfilename.str(), true, *executionEnvironment, 0); + this->csr = AUBCommandStreamReceiver::create(strfilename.str(), true, *executionEnvironment, 0, device->getDeviceBitfield()); } device->resetCommandStreamReceiver(this->csr); diff --git a/opencl/test/unit_test/command_queue/blit_enqueue_tests.cpp b/opencl/test/unit_test/command_queue/blit_enqueue_tests.cpp index 947b85f6b0..20688dcf4f 100644 --- a/opencl/test/unit_test/command_queue/blit_enqueue_tests.cpp +++ b/opencl/test/unit_test/command_queue/blit_enqueue_tests.cpp @@ -38,7 +38,7 @@ struct BlitEnqueueTests : public ::testing::Test { BcsMockContext(ClDevice *device) : MockContext(device) { bcsOsContext.reset(OsContext::create(nullptr, 0, 0, aub_stream::ENGINE_BCS, PreemptionMode::Disabled, false, false, false)); - bcsCsr.reset(createCommandStream(*device->getExecutionEnvironment(), device->getRootDeviceIndex())); + bcsCsr.reset(createCommandStream(*device->getExecutionEnvironment(), device->getRootDeviceIndex(), device->getDeviceBitfield())); bcsCsr->setupContext(*bcsOsContext); bcsCsr->initializeTagAllocation(); @@ -1111,8 +1111,8 @@ struct BlitEnqueueFlushTests : public BlitEnqueueTests<1> { return UltCommandStreamReceiver::flush(batchBuffer, allocationsForResidency); } - static CommandStreamReceiver *create(bool withAubDump, ExecutionEnvironment &executionEnvironment, uint32_t rootDeviceIndex) { - return new MyUltCsr(executionEnvironment, rootDeviceIndex); + static CommandStreamReceiver *create(bool withAubDump, ExecutionEnvironment &executionEnvironment, uint32_t rootDeviceIndex, DeviceBitfield deviceBitfield) { + return new MyUltCsr(executionEnvironment, rootDeviceIndex, deviceBitfield); } uint32_t *flushCounter = nullptr; diff --git a/opencl/test/unit_test/command_queue/command_queue_hw_tests.cpp b/opencl/test/unit_test/command_queue/command_queue_hw_tests.cpp index 6829566b5a..14e1c5f07d 100644 --- a/opencl/test/unit_test/command_queue/command_queue_hw_tests.cpp +++ b/opencl/test/unit_test/command_queue/command_queue_hw_tests.cpp @@ -377,7 +377,7 @@ HWTEST_F(CommandQueueHwTest, GivenEventsWaitlistOnBlockingMapBufferWillWaitForEv HWTEST_F(CommandQueueHwTest, GivenNotCompleteUserEventPassedToEnqueueWhenEventIsUnblockedThenAllSurfacesForBlockedCommandsAreMadeResident) { int32_t executionStamp = 0; - auto mockCSR = new MockCsr(executionStamp, *pDevice->executionEnvironment, pDevice->getRootDeviceIndex()); + auto mockCSR = new MockCsr(executionStamp, *pDevice->executionEnvironment, pDevice->getRootDeviceIndex(), pDevice->getDeviceBitfield()); pDevice->resetCommandStreamReceiver(mockCSR); auto userEvent = make_releaseable(context); @@ -1074,7 +1074,7 @@ HWTEST_F(CommandQueueHwTest, givenBlockedInOrderCmdQueueAndAsynchronouslyComplet CommandQueueHw *cmdQHw = static_cast *>(this->pCmdQ); int32_t executionStamp = 0; - auto mockCSR = new MockCsr(executionStamp, *pDevice->executionEnvironment, pDevice->getRootDeviceIndex()); + auto mockCSR = new MockCsr(executionStamp, *pDevice->executionEnvironment, pDevice->getRootDeviceIndex(), pDevice->getDeviceBitfield()); pDevice->resetCommandStreamReceiver(mockCSR); @@ -1154,7 +1154,7 @@ HWTEST_F(OOQueueHwTest, givenBlockedOutOfOrderCmdQueueAndAsynchronouslyCompleted CommandQueueHw *cmdQHw = static_cast *>(this->pCmdQ); int32_t executionStamp = 0; - auto mockCSR = new MockCsr(executionStamp, *pDevice->executionEnvironment, pDevice->getRootDeviceIndex()); + auto mockCSR = new MockCsr(executionStamp, *pDevice->executionEnvironment, pDevice->getRootDeviceIndex(), pDevice->getDeviceBitfield()); pDevice->resetCommandStreamReceiver(mockCSR); MockKernelWithInternals mockKernelWithInternals(*pClDevice); @@ -1315,9 +1315,8 @@ struct MockCommandQueueHwWithOverwrittenCsr : public CommandQueueHw { }; HWTEST_F(CommandQueueHwTest, givenFlushWhenFlushBatchedSubmissionsFailsThenErrorIsRetured) { - MockCommandQueueHwWithOverwrittenCsr cmdQueue(context, pClDevice, nullptr, false); - MockCommandStreamReceiverWithFailingFlushBatchedSubmission csr(*pDevice->executionEnvironment, 0); + MockCommandStreamReceiverWithFailingFlushBatchedSubmission csr(*pDevice->executionEnvironment, 0, pDevice->getDeviceBitfield()); cmdQueue.csr = &csr; cl_int errorCode = cmdQueue.flush(); EXPECT_EQ(CL_OUT_OF_RESOURCES, errorCode); @@ -1325,7 +1324,7 @@ HWTEST_F(CommandQueueHwTest, givenFlushWhenFlushBatchedSubmissionsFailsThenError HWTEST_F(CommandQueueHwTest, givenFinishWhenFlushBatchedSubmissionsFailsThenErrorIsRetured) { MockCommandQueueHwWithOverwrittenCsr cmdQueue(context, pClDevice, nullptr, false); - MockCommandStreamReceiverWithFailingFlushBatchedSubmission csr(*pDevice->executionEnvironment, 0); + MockCommandStreamReceiverWithFailingFlushBatchedSubmission csr(*pDevice->executionEnvironment, 0, pDevice->getDeviceBitfield()); cmdQueue.csr = &csr; cl_int errorCode = cmdQueue.finish(); EXPECT_EQ(CL_OUT_OF_RESOURCES, errorCode); diff --git a/opencl/test/unit_test/command_queue/enqueue_handler_tests.cpp b/opencl/test/unit_test/command_queue/enqueue_handler_tests.cpp index 4e0f496521..a0b701a7cd 100644 --- a/opencl/test/unit_test/command_queue/enqueue_handler_tests.cpp +++ b/opencl/test/unit_test/command_queue/enqueue_handler_tests.cpp @@ -32,7 +32,7 @@ using namespace NEO; HWTEST_F(EnqueueHandlerTest, WhenEnqueingHandlerWithKernelThenProcessEvictionOnCsrIsCalled) { int32_t tag; - auto csr = new MockCsrBase(tag, *pDevice->executionEnvironment, pDevice->getRootDeviceIndex()); + auto csr = new MockCsrBase(tag, *pDevice->executionEnvironment, pDevice->getRootDeviceIndex(), pDevice->getDeviceBitfield()); pDevice->resetCommandStreamReceiver(csr); MockKernelWithInternals mockKernel(*pClDevice); @@ -46,7 +46,7 @@ HWTEST_F(EnqueueHandlerTest, WhenEnqueingHandlerWithKernelThenProcessEvictionOnC HWTEST_F(EnqueueHandlerTest, givenEnqueueHandlerWithKernelWhenAubCsrIsActiveThenAddCommentWithKernelName) { int32_t tag; - auto aubCsr = new MockCsrAub(tag, *pDevice->executionEnvironment, pDevice->getRootDeviceIndex()); + auto aubCsr = new MockCsrAub(tag, *pDevice->executionEnvironment, pDevice->getRootDeviceIndex(), pDevice->getDeviceBitfield()); pDevice->resetCommandStreamReceiver(aubCsr); MockKernelWithInternals mockKernel(*pClDevice); @@ -64,7 +64,7 @@ HWTEST_F(EnqueueHandlerTest, givenEnqueueHandlerWithKernelWhenAubCsrIsActiveThen HWTEST_F(EnqueueHandlerTest, givenEnqueueHandlerWithKernelSplitWhenAubCsrIsActiveThenAddCommentWithKernelName) { int32_t tag; - auto aubCsr = new MockCsrAub(tag, *pDevice->executionEnvironment, pDevice->getRootDeviceIndex()); + auto aubCsr = new MockCsrAub(tag, *pDevice->executionEnvironment, pDevice->getRootDeviceIndex(), pDevice->getDeviceBitfield()); pDevice->resetCommandStreamReceiver(aubCsr); MockKernelWithInternals kernel1(*pClDevice); @@ -86,7 +86,7 @@ HWTEST_F(EnqueueHandlerTest, givenEnqueueHandlerWithKernelSplitWhenAubCsrIsActiv HWTEST_F(EnqueueHandlerTest, givenEnqueueHandlerWithEmptyDispatchInfoWhenAubCsrIsActiveThenDontAddCommentWithKernelName) { int32_t tag; - auto aubCsr = new MockCsrAub(tag, *pDevice->executionEnvironment, pDevice->getRootDeviceIndex()); + auto aubCsr = new MockCsrAub(tag, *pDevice->executionEnvironment, pDevice->getRootDeviceIndex(), pDevice->getDeviceBitfield()); pDevice->resetCommandStreamReceiver(aubCsr); MockKernelWithInternals mockKernel(*pClDevice); @@ -124,7 +124,7 @@ HWTEST_F(EnqueueHandlerWithAubSubCaptureTests, givenEnqueueHandlerWithAubSubCapt DebugManagerStateRestore stateRestore; DebugManager.flags.AUBDumpSubCaptureMode.set(1); - auto aubCsr = new MockAubCsr("", true, *pDevice->executionEnvironment, pDevice->getRootDeviceIndex()); + auto aubCsr = new MockAubCsr("", true, *pDevice->executionEnvironment, pDevice->getRootDeviceIndex(), pDevice->getDeviceBitfield()); pDevice->resetCommandStreamReceiver(aubCsr); AubSubCaptureCommon subCaptureCommon; @@ -146,7 +146,7 @@ HWTEST_F(EnqueueHandlerWithAubSubCaptureTests, givenEnqueueHandlerWithAubSubCapt DebugManager.flags.AUBDumpSubCaptureMode.set(1); DebugManager.flags.EnableTimestampPacket.set(true); - auto aubCsr = new MockAubCsr("", true, *pDevice->executionEnvironment, pDevice->getRootDeviceIndex()); + auto aubCsr = new MockAubCsr("", true, *pDevice->executionEnvironment, pDevice->getRootDeviceIndex(), pDevice->getDeviceBitfield()); pDevice->resetCommandStreamReceiver(aubCsr); AubSubCaptureCommon subCaptureCommon; @@ -191,7 +191,7 @@ class MyCommandQueueHw : public CommandQueueHw { HWTEST_F(EnqueueHandlerTest, givenLocalWorkgroupSizeGreaterThenGlobalWorkgroupSizeWhenEnqueueKernelThenLwsIsClamped) { int32_t tag; - auto csr = new MockCsrBase(tag, *pDevice->executionEnvironment, pDevice->getRootDeviceIndex()); + auto csr = new MockCsrBase(tag, *pDevice->executionEnvironment, pDevice->getRootDeviceIndex(), pDevice->getDeviceBitfield()); pDevice->resetCommandStreamReceiver(csr); MockKernelWithInternals mockKernel(*pClDevice); auto mockProgram = mockKernel.mockProgram; @@ -225,7 +225,7 @@ HWTEST_F(EnqueueHandlerTest, givenLocalWorkgroupSizeGreaterThenGlobalWorkgroupSi HWTEST_F(EnqueueHandlerTest, givenLocalWorkgroupSizeGreaterThenGlobalWorkgroupSizeAndNonUniformWorkGroupWhenEnqueueKernelThenClIvalidWorkGroupSizeIsReturned) { int32_t tag; - auto csr = new MockCsrBase(tag, *pDevice->executionEnvironment, pDevice->getRootDeviceIndex()); + auto csr = new MockCsrBase(tag, *pDevice->executionEnvironment, pDevice->getRootDeviceIndex(), pDevice->getDeviceBitfield()); pDevice->resetCommandStreamReceiver(csr); MockKernelWithInternals mockKernel(*pClDevice); auto mockProgram = mockKernel.mockProgram; @@ -240,7 +240,7 @@ HWTEST_F(EnqueueHandlerTest, givenLocalWorkgroupSizeGreaterThenGlobalWorkgroupSi HWTEST_F(EnqueueHandlerTest, WhenEnqueuingHandlerCallOnEnqueueMarkerThenCallProcessEvictionOnCsrIsNotCalled) { int32_t tag; - auto csr = new MockCsrBase(tag, *pDevice->executionEnvironment, pDevice->getRootDeviceIndex()); + auto csr = new MockCsrBase(tag, *pDevice->executionEnvironment, pDevice->getRootDeviceIndex(), pDevice->getDeviceBitfield()); pDevice->resetCommandStreamReceiver(csr); auto mockCmdQ = std::unique_ptr>(new MockCommandQueueHw(context, pClDevice, 0)); @@ -257,7 +257,7 @@ HWTEST_F(EnqueueHandlerTest, WhenEnqueuingHandlerCallOnEnqueueMarkerThenCallProc HWTEST_F(EnqueueHandlerTest, WhenEnqueuingHandlerForMarkerOnUnblockedQueueThenTaskLevelIsNotIncremented) { int32_t tag; - auto csr = new MockCsrBase(tag, *pDevice->executionEnvironment, pDevice->getRootDeviceIndex()); + auto csr = new MockCsrBase(tag, *pDevice->executionEnvironment, pDevice->getRootDeviceIndex(), pDevice->getDeviceBitfield()); pDevice->resetCommandStreamReceiver(csr); auto mockCmdQ = std::unique_ptr>(new MockCommandQueueHw(context, pClDevice, 0)); @@ -275,7 +275,7 @@ HWTEST_F(EnqueueHandlerTest, WhenEnqueuingHandlerForMarkerOnUnblockedQueueThenTa HWTEST_F(EnqueueHandlerTest, WhenEnqueuingHandlerForMarkerOnBlockedQueueThenTaskLevelIsNotIncremented) { int32_t tag; - auto csr = new MockCsrBase(tag, *pDevice->executionEnvironment, pDevice->getRootDeviceIndex()); + auto csr = new MockCsrBase(tag, *pDevice->executionEnvironment, pDevice->getRootDeviceIndex(), pDevice->getDeviceBitfield()); pDevice->resetCommandStreamReceiver(csr); auto mockCmdQ = std::unique_ptr>(new MockCommandQueueHw(context, pClDevice, 0)); @@ -379,7 +379,7 @@ HWTEST_F(EnqueueHandlerTest, WhenEnqueuingWithOutputEventThenEventIsRegistered) } HWTEST_F(EnqueueHandlerTest, givenEnqueueHandlerWhenAddPatchInfoCommentsForAUBDumpIsNotSetThenPatchInfoDataIsNotTransferredToCSR) { - auto csr = new MockCsrHw2(*pDevice->executionEnvironment, pDevice->getRootDeviceIndex()); + auto csr = new MockCsrHw2(*pDevice->executionEnvironment, pDevice->getRootDeviceIndex(), pDevice->getDeviceBitfield()); auto mockHelper = new MockFlatBatchBufferHelper(*pDevice->executionEnvironment); csr->overwriteFlatBatchBufferHelper(mockHelper); pDevice->resetCommandStreamReceiver(csr); @@ -401,7 +401,7 @@ HWTEST_F(EnqueueHandlerTest, givenEnqueueHandlerWhenAddPatchInfoCommentsForAUBDu DebugManager.flags.AddPatchInfoCommentsForAUBDump.set(true); DebugManager.flags.FlattenBatchBufferForAUBDump.set(true); - auto csr = new MockCsrHw2(*pDevice->executionEnvironment, pDevice->getRootDeviceIndex()); + auto csr = new MockCsrHw2(*pDevice->executionEnvironment, pDevice->getRootDeviceIndex(), pDevice->getDeviceBitfield()); auto mockHelper = new MockFlatBatchBufferHelper(*pDevice->executionEnvironment); csr->overwriteFlatBatchBufferHelper(mockHelper); pDevice->resetCommandStreamReceiver(csr); diff --git a/opencl/test/unit_test/command_queue/enqueue_kernel_1_tests.cpp b/opencl/test/unit_test/command_queue/enqueue_kernel_1_tests.cpp index f054c52574..52a9f64ca8 100644 --- a/opencl/test/unit_test/command_queue/enqueue_kernel_1_tests.cpp +++ b/opencl/test/unit_test/command_queue/enqueue_kernel_1_tests.cpp @@ -574,7 +574,7 @@ HWTEST_F(EnqueueKernelTest, givenEnqueueWithGlobalWorkSizeWhenZeroValueIsPassedI } HWTEST_F(EnqueueKernelTest, givenCommandStreamReceiverInBatchingModeWhenEnqueueKernelIsCalledThenKernelIsRecorded) { - auto mockCsr = new MockCsrHw2(*pDevice->executionEnvironment, pDevice->getRootDeviceIndex()); + auto mockCsr = new MockCsrHw2(*pDevice->executionEnvironment, pDevice->getRootDeviceIndex(), pDevice->getDeviceBitfield()); mockCsr->useNewResourceImplicitFlush = false; mockCsr->useGpuIdleImplicitFlush = false; mockCsr->overrideDispatchPolicy(DispatchMode::BatchedDispatch); @@ -606,7 +606,7 @@ HWTEST_F(EnqueueKernelTest, givenReducedAddressSpaceGraphicsAllocationForHostPtr auto hwInfoToModify = *defaultHwInfo; hwInfoToModify.capabilityTable.gpuAddressSpace = MemoryConstants::max36BitAddress; device.reset(new MockClDevice{MockDevice::createWithNewExecutionEnvironment(&hwInfoToModify)}); - auto mockCsr = new MockCsrHw2(*device->executionEnvironment, device->getRootDeviceIndex()); + auto mockCsr = new MockCsrHw2(*device->executionEnvironment, device->getRootDeviceIndex(), device->getDeviceBitfield()); device->resetCommandStreamReceiver(mockCsr); auto memoryManager = mockCsr->getMemoryManager(); uint32_t hostPtr[10]{}; @@ -630,7 +630,7 @@ HWTEST_F(EnqueueKernelTest, givenReducedAddressSpaceGraphicsAllocationForHostPtr auto hwInfoToModify = *defaultHwInfo; hwInfoToModify.capabilityTable.gpuAddressSpace = MemoryConstants::max36BitAddress; device.reset(new MockClDevice{MockDevice::createWithNewExecutionEnvironment(&hwInfoToModify)}); - auto mockCsr = new MockCsrHw2(*device->executionEnvironment, device->getRootDeviceIndex()); + auto mockCsr = new MockCsrHw2(*device->executionEnvironment, device->getRootDeviceIndex(), device->getDeviceBitfield()); device->resetCommandStreamReceiver(mockCsr); auto memoryManager = mockCsr->getMemoryManager(); uint32_t hostPtr[10]{}; @@ -655,7 +655,7 @@ HWTEST_F(EnqueueKernelTest, givenFullAddressSpaceGraphicsAllocationWhenEnqueueKe hwInfoToModify = *defaultHwInfo; hwInfoToModify.capabilityTable.gpuAddressSpace = MemoryConstants::max48BitAddress; device.reset(new MockClDevice{MockDevice::createWithNewExecutionEnvironment(&hwInfoToModify)}); - auto mockCsr = new MockCsrHw2(*device->executionEnvironment, device->getRootDeviceIndex()); + auto mockCsr = new MockCsrHw2(*device->executionEnvironment, device->getRootDeviceIndex(), device->getDeviceBitfield()); device->resetCommandStreamReceiver(mockCsr); auto memoryManager = mockCsr->getMemoryManager(); uint32_t hostPtr[10]{}; @@ -691,7 +691,7 @@ HWTEST_F(EnqueueKernelTest, givenDefaultCommandStreamReceiverWhenClFlushIsCalled } HWTEST_F(EnqueueKernelTest, givenCommandStreamReceiverInBatchingModeAndBatchedKernelWhenFlushIsCalledThenKernelIsSubmitted) { - auto mockCsrmockCsr = new MockCsrHw2(*pDevice->executionEnvironment, pDevice->getRootDeviceIndex()); + auto mockCsrmockCsr = new MockCsrHw2(*pDevice->executionEnvironment, pDevice->getRootDeviceIndex(), pDevice->getDeviceBitfield()); mockCsrmockCsr->overrideDispatchPolicy(DispatchMode::BatchedDispatch); mockCsrmockCsr->useNewResourceImplicitFlush = false; mockCsrmockCsr->useGpuIdleImplicitFlush = false; @@ -714,7 +714,7 @@ HWTEST_F(EnqueueKernelTest, givenCommandStreamReceiverInBatchingModeAndBatchedKe } HWTEST_F(EnqueueKernelTest, givenCommandStreamReceiverInBatchingModeAndBatchedKernelWhenFlushIsCalledTwiceThenNothingChanges) { - auto mockCsrmockCsr = new MockCsrHw2(*pDevice->executionEnvironment, pDevice->getRootDeviceIndex()); + auto mockCsrmockCsr = new MockCsrHw2(*pDevice->executionEnvironment, pDevice->getRootDeviceIndex(), pDevice->getDeviceBitfield()); mockCsrmockCsr->overrideDispatchPolicy(DispatchMode::BatchedDispatch); pDevice->resetCommandStreamReceiver(mockCsrmockCsr); @@ -763,7 +763,7 @@ HWTEST_F(EnqueueKernelTest, givenCommandStreamReceiverInBatchingModeWhenKernelIs } HWTEST_F(EnqueueKernelTest, givenCommandStreamReceiverInBatchingModeWhenFlushIsCalledOnTwoBatchedKernelsThenTheyAreExecutedInOrder) { - auto mockCsr = new MockCsrHw2(*pDevice->executionEnvironment, pDevice->getRootDeviceIndex()); + auto mockCsr = new MockCsrHw2(*pDevice->executionEnvironment, pDevice->getRootDeviceIndex(), pDevice->getDeviceBitfield()); mockCsr->overrideDispatchPolicy(DispatchMode::BatchedDispatch); mockCsr->useNewResourceImplicitFlush = false; mockCsr->useGpuIdleImplicitFlush = false; @@ -783,7 +783,7 @@ HWTEST_F(EnqueueKernelTest, givenCommandStreamReceiverInBatchingModeWhenFlushIsC } HWTEST_F(EnqueueKernelTest, givenCsrInBatchingModeWhenFinishIsCalledThenBatchesSubmissionsAreFlushed) { - auto mockCsr = new MockCsrHw2(*pDevice->executionEnvironment, pDevice->getRootDeviceIndex()); + auto mockCsr = new MockCsrHw2(*pDevice->executionEnvironment, pDevice->getRootDeviceIndex(), pDevice->getDeviceBitfield()); mockCsr->overrideDispatchPolicy(DispatchMode::BatchedDispatch); mockCsr->useNewResourceImplicitFlush = false; mockCsr->useGpuIdleImplicitFlush = false; @@ -804,7 +804,7 @@ HWTEST_F(EnqueueKernelTest, givenCsrInBatchingModeWhenFinishIsCalledThenBatchesS } HWTEST_F(EnqueueKernelTest, givenCsrInBatchingModeWhenThressEnqueueKernelsAreCalledThenBatchesSubmissionsAreFlushed) { - auto mockCsr = new MockCsrHw2(*pDevice->executionEnvironment, pDevice->getRootDeviceIndex()); + auto mockCsr = new MockCsrHw2(*pDevice->executionEnvironment, pDevice->getRootDeviceIndex(), pDevice->getDeviceBitfield()); mockCsr->overrideDispatchPolicy(DispatchMode::BatchedDispatch); mockCsr->useNewResourceImplicitFlush = false; mockCsr->useGpuIdleImplicitFlush = false; @@ -826,7 +826,7 @@ HWTEST_F(EnqueueKernelTest, givenCsrInBatchingModeWhenThressEnqueueKernelsAreCal } HWTEST_F(EnqueueKernelTest, givenCsrInBatchingModeWhenWaitForEventsIsCalledThenBatchedSubmissionsAreFlushed) { - auto mockCsr = new MockCsrHw2(*pDevice->executionEnvironment, pDevice->getRootDeviceIndex()); + auto mockCsr = new MockCsrHw2(*pDevice->executionEnvironment, pDevice->getRootDeviceIndex(), pDevice->getDeviceBitfield()); mockCsr->overrideDispatchPolicy(DispatchMode::BatchedDispatch); mockCsr->useNewResourceImplicitFlush = false; mockCsr->useGpuIdleImplicitFlush = false; @@ -852,7 +852,7 @@ HWTEST_F(EnqueueKernelTest, givenCsrInBatchingModeWhenWaitForEventsIsCalledThenB } HWTEST_F(EnqueueKernelTest, givenCsrInBatchingModeWhenCommandIsFlushedThenFlushStampIsUpdatedInCommandQueueCsrAndEvent) { - auto mockCsr = new MockCsrHw2(*pDevice->executionEnvironment, pDevice->getRootDeviceIndex()); + auto mockCsr = new MockCsrHw2(*pDevice->executionEnvironment, pDevice->getRootDeviceIndex(), pDevice->getDeviceBitfield()); mockCsr->overrideDispatchPolicy(DispatchMode::BatchedDispatch); mockCsr->useNewResourceImplicitFlush = false; mockCsr->useGpuIdleImplicitFlush = false; @@ -886,7 +886,7 @@ HWTEST_F(EnqueueKernelTest, givenCsrInBatchingModeWhenCommandIsFlushedThenFlushS } HWTEST_F(EnqueueKernelTest, givenCsrInBatchingModeWhenNonBlockingMapFollowsNdrCallThenFlushStampIsUpdatedProperly) { - auto mockCsr = new MockCsrHw2(*pDevice->executionEnvironment, pDevice->getRootDeviceIndex()); + auto mockCsr = new MockCsrHw2(*pDevice->executionEnvironment, pDevice->getRootDeviceIndex(), pDevice->getDeviceBitfield()); mockCsr->overrideDispatchPolicy(DispatchMode::BatchedDispatch); pDevice->resetCommandStreamReceiver(mockCsr); @@ -904,7 +904,7 @@ HWTEST_F(EnqueueKernelTest, givenCsrInBatchingModeWhenNonBlockingMapFollowsNdrCa } HWTEST_F(EnqueueKernelTest, givenCsrInBatchingModeWhenCommandWithEventIsFollowedByCommandWithoutEventThenFlushStampIsUpdatedInCommandQueueCsrAndEvent) { - auto mockCsr = new MockCsrHw2(*pDevice->executionEnvironment, pDevice->getRootDeviceIndex()); + auto mockCsr = new MockCsrHw2(*pDevice->executionEnvironment, pDevice->getRootDeviceIndex(), pDevice->getDeviceBitfield()); mockCsr->overrideDispatchPolicy(DispatchMode::BatchedDispatch); mockCsr->useNewResourceImplicitFlush = false; mockCsr->useGpuIdleImplicitFlush = false; @@ -938,7 +938,7 @@ HWTEST_F(EnqueueKernelTest, givenCsrInBatchingModeWhenCommandWithEventIsFollowed } HWTEST_F(EnqueueKernelTest, givenCsrInBatchingModeWhenClFlushIsCalledThenQueueFlushStampIsUpdated) { - auto mockCsr = new MockCsrHw2(*pDevice->executionEnvironment, pDevice->getRootDeviceIndex()); + auto mockCsr = new MockCsrHw2(*pDevice->executionEnvironment, pDevice->getRootDeviceIndex(), pDevice->getDeviceBitfield()); mockCsr->overrideDispatchPolicy(DispatchMode::BatchedDispatch); mockCsr->useNewResourceImplicitFlush = false; mockCsr->useGpuIdleImplicitFlush = false; @@ -957,7 +957,7 @@ HWTEST_F(EnqueueKernelTest, givenCsrInBatchingModeWhenClFlushIsCalledThenQueueFl } HWTEST_F(EnqueueKernelTest, givenCsrInBatchingModeWhenWaitForEventsIsCalledWithUnflushedTaskCountThenBatchedSubmissionsAreFlushed) { - auto mockCsr = new MockCsrHw2(*pDevice->executionEnvironment, pDevice->getRootDeviceIndex()); + auto mockCsr = new MockCsrHw2(*pDevice->executionEnvironment, pDevice->getRootDeviceIndex(), pDevice->getDeviceBitfield()); mockCsr->overrideDispatchPolicy(DispatchMode::BatchedDispatch); pDevice->resetCommandStreamReceiver(mockCsr); @@ -981,7 +981,7 @@ HWTEST_F(EnqueueKernelTest, givenCsrInBatchingModeWhenWaitForEventsIsCalledWithU } HWTEST_F(EnqueueKernelTest, givenCsrInBatchingModeWhenFinishIsCalledWithUnflushedTaskCountThenBatchedSubmissionsAreFlushed) { - auto mockCsr = new MockCsrHw2(*pDevice->executionEnvironment, pDevice->getRootDeviceIndex()); + auto mockCsr = new MockCsrHw2(*pDevice->executionEnvironment, pDevice->getRootDeviceIndex(), pDevice->getDeviceBitfield()); mockCsr->overrideDispatchPolicy(DispatchMode::BatchedDispatch); pDevice->resetCommandStreamReceiver(mockCsr); @@ -1008,7 +1008,7 @@ HWTEST_F(EnqueueKernelTest, givenOutOfOrderCommandQueueWhenEnqueueKernelIsMadeTh const cl_queue_properties props[3] = {CL_QUEUE_PROPERTIES, CL_QUEUE_OUT_OF_ORDER_EXEC_MODE_ENABLE, 0}; auto ooq = clCreateCommandQueueWithProperties(context, pClDevice, props, nullptr); - auto mockCsr = new MockCsrHw2(*pDevice->executionEnvironment, pDevice->getRootDeviceIndex()); + auto mockCsr = new MockCsrHw2(*pDevice->executionEnvironment, pDevice->getRootDeviceIndex(), pDevice->getDeviceBitfield()); mockCsr->overrideDispatchPolicy(DispatchMode::BatchedDispatch); mockCsr->useNewResourceImplicitFlush = false; mockCsr->useGpuIdleImplicitFlush = false; @@ -1054,7 +1054,7 @@ HWTEST_F(EnqueueKernelTest, givenInOrderCommandQueueWhenEnqueueKernelThatHasShar const cl_queue_properties props[] = {0}; auto inOrderQueue = clCreateCommandQueueWithProperties(context, pClDevice, props, nullptr); - auto mockCsr = new MockCsrHw2(*pDevice->executionEnvironment, pDevice->getRootDeviceIndex()); + auto mockCsr = new MockCsrHw2(*pDevice->executionEnvironment, pDevice->getRootDeviceIndex(), pDevice->getDeviceBitfield()); mockCsr->overrideDispatchPolicy(DispatchMode::BatchedDispatch); mockCsr->useNewResourceImplicitFlush = false; mockCsr->useGpuIdleImplicitFlush = false; @@ -1077,7 +1077,7 @@ HWTEST_F(EnqueueKernelTest, givenInOrderCommandQueueWhenEnqueueKernelThatHasShar } HWTEST_F(EnqueueKernelTest, givenInOrderCommandQueueWhenEnqueueKernelThatHasSharedObjectsAsArgIsMadeThenPipeControlDoesntHaveDcFlush) { - auto mockCsr = new MockCsrHw2(*pDevice->executionEnvironment, pDevice->getRootDeviceIndex()); + auto mockCsr = new MockCsrHw2(*pDevice->executionEnvironment, pDevice->getRootDeviceIndex(), pDevice->getDeviceBitfield()); mockCsr->overrideDispatchPolicy(DispatchMode::BatchedDispatch); pDevice->resetCommandStreamReceiver(mockCsr); @@ -1093,7 +1093,7 @@ HWTEST_F(EnqueueKernelTest, givenInOrderCommandQueueWhenEnqueueKernelReturningEv const cl_queue_properties props[] = {0}; auto inOrderQueue = clCreateCommandQueueWithProperties(context, pClDevice, props, nullptr); - auto mockCsr = new MockCsrHw2(*pDevice->executionEnvironment, pDevice->getRootDeviceIndex()); + auto mockCsr = new MockCsrHw2(*pDevice->executionEnvironment, pDevice->getRootDeviceIndex(), pDevice->getDeviceBitfield()); mockCsr->overrideDispatchPolicy(DispatchMode::BatchedDispatch); mockCsr->useNewResourceImplicitFlush = false; mockCsr->useGpuIdleImplicitFlush = false; @@ -1122,7 +1122,7 @@ HWTEST_F(EnqueueKernelTest, givenInOrderCommandQueueWhenEnqueueKernelReturningEv const cl_queue_properties props[] = {0}; auto inOrderQueue = clCreateCommandQueueWithProperties(context, pClDevice, props, nullptr); - auto mockCsr = new MockCsrHw2(*pDevice->executionEnvironment, pDevice->getRootDeviceIndex()); + auto mockCsr = new MockCsrHw2(*pDevice->executionEnvironment, pDevice->getRootDeviceIndex(), pDevice->getDeviceBitfield()); mockCsr->overrideDispatchPolicy(DispatchMode::BatchedDispatch); mockCsr->useNewResourceImplicitFlush = false; mockCsr->useGpuIdleImplicitFlush = false; @@ -1148,7 +1148,7 @@ HWTEST_F(EnqueueKernelTest, givenInOrderCommandQueueWhenEnqueueKernelReturningEv } HWTEST_F(EnqueueKernelTest, givenOutOfOrderCommandQueueWhenEnqueueKernelReturningEventIsMadeThenPipeControlPositionIsRecorded) { - auto mockCsr = new MockCsrHw2(*pDevice->executionEnvironment, pDevice->getRootDeviceIndex()); + auto mockCsr = new MockCsrHw2(*pDevice->executionEnvironment, pDevice->getRootDeviceIndex(), pDevice->getDeviceBitfield()); mockCsr->overrideDispatchPolicy(DispatchMode::BatchedDispatch); mockCsr->useNewResourceImplicitFlush = false; mockCsr->useGpuIdleImplicitFlush = false; @@ -1178,7 +1178,7 @@ HWTEST_F(EnqueueKernelTest, givenOutOfOrderCommandQueueWhenEnqueueKernelReturnin HWTEST_F(EnqueueKernelTest, givenCsrInBatchingModeWhenBlockingCallIsMadeThenEventAssociatedWithCommandHasProperFlushStamp) { DebugManagerStateRestore stateRestore; DebugManager.flags.MakeEachEnqueueBlocking.set(true); - auto mockCsr = new MockCsrHw2(*pDevice->executionEnvironment, pDevice->getRootDeviceIndex()); + auto mockCsr = new MockCsrHw2(*pDevice->executionEnvironment, pDevice->getRootDeviceIndex(), pDevice->getDeviceBitfield()); mockCsr->overrideDispatchPolicy(DispatchMode::BatchedDispatch); pDevice->resetCommandStreamReceiver(mockCsr); @@ -1195,7 +1195,7 @@ HWTEST_F(EnqueueKernelTest, givenCsrInBatchingModeWhenBlockingCallIsMadeThenEven } HWTEST_F(EnqueueKernelTest, givenKernelWhenItIsEnqueuedThenAllResourceGraphicsAllocationsAreUpdatedWithCsrTaskCount) { - auto mockCsr = new MockCsrHw2(*pDevice->executionEnvironment, pDevice->getRootDeviceIndex()); + auto mockCsr = new MockCsrHw2(*pDevice->executionEnvironment, pDevice->getRootDeviceIndex(), pDevice->getDeviceBitfield()); pDevice->resetCommandStreamReceiver(mockCsr); MockKernelWithInternals mockKernel(*pClDevice); @@ -1271,7 +1271,7 @@ TEST_F(EnqueueKernelTest, givenEnqueueCommandThatLocalWorkgroupSizeContainsZeroW } HWTEST_F(EnqueueKernelTest, givenVMEKernelWhenEnqueueKernelThenDispatchFlagsHaveMediaSamplerRequired) { - auto mockCsr = new MockCsrHw2(*pDevice->executionEnvironment, pDevice->getRootDeviceIndex()); + auto mockCsr = new MockCsrHw2(*pDevice->executionEnvironment, pDevice->getRootDeviceIndex(), pDevice->getDeviceBitfield()); mockCsr->overrideDispatchPolicy(DispatchMode::BatchedDispatch); pDevice->resetCommandStreamReceiver(mockCsr); @@ -1283,7 +1283,7 @@ HWTEST_F(EnqueueKernelTest, givenVMEKernelWhenEnqueueKernelThenDispatchFlagsHave } HWTEST_F(EnqueueKernelTest, givenNonVMEKernelWhenEnqueueKernelThenDispatchFlagsDoesntHaveMediaSamplerRequired) { - auto mockCsr = new MockCsrHw2(*pDevice->executionEnvironment, pDevice->getRootDeviceIndex()); + auto mockCsr = new MockCsrHw2(*pDevice->executionEnvironment, pDevice->getRootDeviceIndex(), pDevice->getDeviceBitfield()); mockCsr->overrideDispatchPolicy(DispatchMode::BatchedDispatch); pDevice->resetCommandStreamReceiver(mockCsr); diff --git a/opencl/test/unit_test/command_queue/enqueue_kernel_2_tests.cpp b/opencl/test/unit_test/command_queue/enqueue_kernel_2_tests.cpp index 1af7271e2a..be0a6242b1 100644 --- a/opencl/test/unit_test/command_queue/enqueue_kernel_2_tests.cpp +++ b/opencl/test/unit_test/command_queue/enqueue_kernel_2_tests.cpp @@ -439,7 +439,7 @@ INSTANTIATE_TEST_CASE_P(EnqueueKernel, typedef EnqueueKernelTypeTest EnqueueKernelWithScratch; HWTEST_P(EnqueueKernelWithScratch, GivenKernelRequiringScratchWhenItIsEnqueuedWithDifferentScratchSizesThenPreviousScratchAllocationIsMadeNonResidentPriorStoringOnResueList) { - auto mockCsr = new MockCsrHw(*pDevice->executionEnvironment, pDevice->getRootDeviceIndex()); + auto mockCsr = new MockCsrHw(*pDevice->executionEnvironment, pDevice->getRootDeviceIndex(), pDevice->getDeviceBitfield()); pDevice->resetCommandStreamReceiver(mockCsr); SPatchMediaVFEState mediaVFEstate; diff --git a/opencl/test/unit_test/command_queue/enqueue_kernel_mt_tests.cpp b/opencl/test/unit_test/command_queue/enqueue_kernel_mt_tests.cpp index b8aa1dbd84..58b14776c6 100644 --- a/opencl/test/unit_test/command_queue/enqueue_kernel_mt_tests.cpp +++ b/opencl/test/unit_test/command_queue/enqueue_kernel_mt_tests.cpp @@ -14,7 +14,7 @@ typedef HelloWorldFixture EnqueueKernelFixture; typedef Test EnqueueKernelTest; HWTEST_F(EnqueueKernelTest, givenCsrInBatchingModeWhenFinishIsCalledThenBatchesSubmissionsAreFlushed) { - auto mockCsr = new MockCsrHw2(*pDevice->executionEnvironment, pDevice->getRootDeviceIndex()); + auto mockCsr = new MockCsrHw2(*pDevice->executionEnvironment, pDevice->getRootDeviceIndex(), pDevice->getDeviceBitfield()); mockCsr->overrideDispatchPolicy(DispatchMode::BatchedDispatch); pDevice->resetCommandStreamReceiver(mockCsr); diff --git a/opencl/test/unit_test/command_queue/enqueue_svm_tests.cpp b/opencl/test/unit_test/command_queue/enqueue_svm_tests.cpp index 8fba34bd36..1f30e67ffe 100644 --- a/opencl/test/unit_test/command_queue/enqueue_svm_tests.cpp +++ b/opencl/test/unit_test/command_queue/enqueue_svm_tests.cpp @@ -1786,7 +1786,7 @@ HWTEST_F(EnqueueSvmTest, GivenDstHostPtrWhenHostPtrAllocationCreationFailsThenRe void *pDstSVM = dstHostPtr; void *pSrcSVM = ptrSVM; MockCommandQueueHw cmdQ(context, pClDevice, nullptr); - auto failCsr = std::make_unique>(*pDevice->getExecutionEnvironment(), pDevice->getRootDeviceIndex()); + auto failCsr = std::make_unique>(*pDevice->getExecutionEnvironment(), pDevice->getRootDeviceIndex(), pDevice->getDeviceBitfield()); CommandStreamReceiver *oldCommandStreamReceiver = cmdQ.gpgpuEngine->commandStreamReceiver; cmdQ.gpgpuEngine->commandStreamReceiver = failCsr.get(); retVal = cmdQ.enqueueSVMMemcpy( @@ -1807,7 +1807,7 @@ HWTEST_F(EnqueueSvmTest, GivenSrcHostPtrAndSizeZeroWhenHostPtrAllocationCreation void *pDstSVM = ptrSVM; void *pSrcSVM = srcHostPtr; MockCommandQueueHw cmdQ(context, pClDevice, nullptr); - auto failCsr = std::make_unique>(*pDevice->getExecutionEnvironment(), pDevice->getRootDeviceIndex()); + auto failCsr = std::make_unique>(*pDevice->getExecutionEnvironment(), pDevice->getRootDeviceIndex(), pDevice->getDeviceBitfield()); CommandStreamReceiver *oldCommandStreamReceiver = cmdQ.gpgpuEngine->commandStreamReceiver; cmdQ.gpgpuEngine->commandStreamReceiver = failCsr.get(); retVal = cmdQ.enqueueSVMMemcpy( @@ -1829,7 +1829,7 @@ HWTEST_F(EnqueueSvmTest, givenDstHostPtrAndSrcHostPtrWhenHostPtrAllocationCreati void *pDstSVM = dstHostPtr; void *pSrcSVM = srcHostPtr; MockCommandQueueHw cmdQ(context, pClDevice, nullptr); - auto failCsr = std::make_unique>(*pDevice->getExecutionEnvironment(), pDevice->getRootDeviceIndex()); + auto failCsr = std::make_unique>(*pDevice->getExecutionEnvironment(), pDevice->getRootDeviceIndex(), pDevice->getDeviceBitfield()); CommandStreamReceiver *oldCommandStreamReceiver = cmdQ.gpgpuEngine->commandStreamReceiver; cmdQ.gpgpuEngine->commandStreamReceiver = failCsr.get(); retVal = cmdQ.enqueueSVMMemcpy( diff --git a/opencl/test/unit_test/command_queue/enqueue_thread_tests.cpp b/opencl/test/unit_test/command_queue/enqueue_thread_tests.cpp index d2a2009b0c..b4d00ef140 100644 --- a/opencl/test/unit_test/command_queue/enqueue_thread_tests.cpp +++ b/opencl/test/unit_test/command_queue/enqueue_thread_tests.cpp @@ -32,7 +32,7 @@ class CommandStreamReceiverMock : public UltCommandStreamReceiver { public: size_t expectedToFreeCount = (size_t)-1; - CommandStreamReceiverMock(Device *pDevice) : UltCommandStreamReceiver(*pDevice->getExecutionEnvironment(), pDevice->getRootDeviceIndex()) { + CommandStreamReceiverMock(Device *pDevice) : UltCommandStreamReceiver(*pDevice->getExecutionEnvironment(), pDevice->getRootDeviceIndex(), pDevice->getDeviceBitfield()) { this->pDevice = pDevice; this->pClDevice = pDevice->getSpecializedDevice(); } diff --git a/opencl/test/unit_test/command_queue/ooq_task_tests.cpp b/opencl/test/unit_test/command_queue/ooq_task_tests.cpp index d28405515f..bd51980d74 100644 --- a/opencl/test/unit_test/command_queue/ooq_task_tests.cpp +++ b/opencl/test/unit_test/command_queue/ooq_task_tests.cpp @@ -133,7 +133,7 @@ HWTEST_F(OOQTaskTests, givenCommandQueueWithLowerTaskLevelThenCsrWhenItIsSubmitt } HWTEST_F(OOQTaskTests, givenCommandQueueAtTaskLevel100WhenMultipleEnqueueAreDoneThenTaskLevelDoesntChange) { - auto mockCsr = new MockCsrHw2(*pDevice->executionEnvironment, pDevice->getRootDeviceIndex()); + auto mockCsr = new MockCsrHw2(*pDevice->executionEnvironment, pDevice->getRootDeviceIndex(), pDevice->getDeviceBitfield()); pDevice->resetCommandStreamReceiver(mockCsr); mockCsr->overrideDispatchPolicy(DispatchMode::BatchedDispatch); mockCsr->useNewResourceImplicitFlush = false; @@ -150,7 +150,7 @@ HWTEST_F(OOQTaskTests, givenCommandQueueAtTaskLevel100WhenMultipleEnqueueAreDone } HWTEST_F(OOQTaskTests, givenCommandQueueAtTaskLevel100WhenItIsFlushedAndFollowedByNewCommandsThenTheyHaveHigherTaskLevel) { - auto mockCsr = new MockCsrHw2(*pDevice->executionEnvironment, pDevice->getRootDeviceIndex()); + auto mockCsr = new MockCsrHw2(*pDevice->executionEnvironment, pDevice->getRootDeviceIndex(), pDevice->getDeviceBitfield()); pDevice->resetCommandStreamReceiver(mockCsr); mockCsr->overrideDispatchPolicy(DispatchMode::BatchedDispatch); mockCsr->useNewResourceImplicitFlush = false; @@ -171,7 +171,7 @@ HWTEST_F(OOQTaskTests, givenCommandQueueAtTaskLevel100WhenItIsFlushedAndFollowed } HWTEST_F(OOQTaskTests, givenCommandQueueAtTaskLevel100WhenItIsFlushedAndFollowedByNewCommandsAndBarrierThenCsrTaskLevelIncreases) { - auto mockCsr = new MockCsrHw2(*pDevice->executionEnvironment, pDevice->getRootDeviceIndex()); + auto mockCsr = new MockCsrHw2(*pDevice->executionEnvironment, pDevice->getRootDeviceIndex(), pDevice->getDeviceBitfield()); pDevice->resetCommandStreamReceiver(mockCsr); mockCsr->overrideDispatchPolicy(DispatchMode::BatchedDispatch); mockCsr->useNewResourceImplicitFlush = false; @@ -193,7 +193,7 @@ HWTEST_F(OOQTaskTests, givenCommandQueueAtTaskLevel100WhenItIsFlushedAndFollowed } HWTEST_F(OOQTaskTests, givenCommandQueueAtTaskLevel100WhenItIsFlushedAndFollowedByNewCommandsAndMarkerThenCsrTaskLevelIsNotIncreasing) { - auto mockCsr = new MockCsrHw2(*pDevice->executionEnvironment, pDevice->getRootDeviceIndex()); + auto mockCsr = new MockCsrHw2(*pDevice->executionEnvironment, pDevice->getRootDeviceIndex(), pDevice->getDeviceBitfield()); pDevice->resetCommandStreamReceiver(mockCsr); mockCsr->overrideDispatchPolicy(DispatchMode::BatchedDispatch); mockCsr->useNewResourceImplicitFlush = false; @@ -215,7 +215,7 @@ HWTEST_F(OOQTaskTests, givenCommandQueueAtTaskLevel100WhenItIsFlushedAndFollowed } HWTEST_F(OOQTaskTests, givenTwoEnqueueCommandSynchronizedByEventsWhenTheyAreEnqueueThenSecondHasHigherTaskLevelThenFirst) { - auto mockCsr = new MockCsrHw2(*pDevice->executionEnvironment, pDevice->getRootDeviceIndex()); + auto mockCsr = new MockCsrHw2(*pDevice->executionEnvironment, pDevice->getRootDeviceIndex(), pDevice->getDeviceBitfield()); pDevice->resetCommandStreamReceiver(mockCsr); mockCsr->overrideDispatchPolicy(DispatchMode::BatchedDispatch); mockCsr->useNewResourceImplicitFlush = false; diff --git a/opencl/test/unit_test/command_stream/aub_command_stream_receiver_1_tests.cpp b/opencl/test/unit_test/command_stream/aub_command_stream_receiver_1_tests.cpp index 3e4714a184..886e8232f3 100644 --- a/opencl/test/unit_test/command_stream/aub_command_stream_receiver_1_tests.cpp +++ b/opencl/test/unit_test/command_stream/aub_command_stream_receiver_1_tests.cpp @@ -68,12 +68,12 @@ TEST_F(AubCommandStreamReceiverTests, givenAubCommandStreamReceiverWhenItIsCreat hwInfo->platform.eRenderCoreFamily = GFXCORE_FAMILY_FORCE_ULONG; // wrong gfx core family - CommandStreamReceiver *aubCsr = AUBCommandStreamReceiver::create("", true, *pDevice->executionEnvironment, pDevice->getRootDeviceIndex()); + CommandStreamReceiver *aubCsr = AUBCommandStreamReceiver::create("", true, *pDevice->executionEnvironment, pDevice->getRootDeviceIndex(), pDevice->getDeviceBitfield()); EXPECT_EQ(nullptr, aubCsr); } TEST_F(AubCommandStreamReceiverTests, givenAubCommandStreamReceiverWhenTypeIsCheckedThenAubCsrIsReturned) { - std::unique_ptr aubCsr(AUBCommandStreamReceiver::create("", true, *pDevice->executionEnvironment, pDevice->getRootDeviceIndex())); + std::unique_ptr aubCsr(AUBCommandStreamReceiver::create("", true, *pDevice->executionEnvironment, pDevice->getRootDeviceIndex(), pDevice->getDeviceBitfield())); EXPECT_NE(nullptr, aubCsr); EXPECT_EQ(CommandStreamReceiverType::CSR_AUB, aubCsr->getType()); } @@ -83,8 +83,8 @@ HWTEST_F(AubCommandStreamReceiverTests, givenAubCommandStreamReceiverWhenItIsCre DebugManager.flags.UseAubStream.set(false); MockExecutionEnvironment executionEnvironment(defaultHwInfo.get(), false, 1); executionEnvironment.initializeMemoryManager(); - - auto aubCsr = std::make_unique>("", true, executionEnvironment, 0); + DeviceBitfield deviceBitfield(1); + auto aubCsr = std::make_unique>("", true, executionEnvironment, 0, deviceBitfield); ASSERT_NE(nullptr, aubCsr); EXPECT_EQ(nullptr, aubCsr->aubManager); @@ -94,64 +94,64 @@ HWTEST_F(AubCommandStreamReceiverTests, givenAubCommandStreamReceiverWhenItIsCre HWTEST_F(AubCommandStreamReceiverTests, givenAubCsrWhenItIsCreatedWithDefaultSettingsThenItHasBatchedDispatchModeEnabled) { DebugManagerStateRestore stateRestore; DebugManager.flags.CsrDispatchMode.set(0); - std::unique_ptr> aubCsr(new MockAubCsr("", true, *pDevice->executionEnvironment, pDevice->getRootDeviceIndex())); + std::unique_ptr> aubCsr(new MockAubCsr("", true, *pDevice->executionEnvironment, pDevice->getRootDeviceIndex(), pDevice->getDeviceBitfield())); EXPECT_EQ(DispatchMode::BatchedDispatch, aubCsr->peekDispatchMode()); } HWTEST_F(AubCommandStreamReceiverTests, givenAubCsrWhenItIsCreatedWithDebugSettingsThenItHasProperDispatchModeEnabled) { DebugManagerStateRestore stateRestore; DebugManager.flags.CsrDispatchMode.set(static_cast(DispatchMode::ImmediateDispatch)); - std::unique_ptr> aubCsr(new MockAubCsr("", true, *pDevice->executionEnvironment, pDevice->getRootDeviceIndex())); + std::unique_ptr> aubCsr(new MockAubCsr("", true, *pDevice->executionEnvironment, pDevice->getRootDeviceIndex(), pDevice->getDeviceBitfield())); EXPECT_EQ(DispatchMode::ImmediateDispatch, aubCsr->peekDispatchMode()); } HWTEST_F(AubCommandStreamReceiverTests, givenAubCommandStreamReceiverWhenItIsCreatedThenMemoryManagerIsNotNull) { - std::unique_ptr> aubCsr(new AUBCommandStreamReceiverHw("", true, *pDevice->executionEnvironment, pDevice->getRootDeviceIndex())); + std::unique_ptr> aubCsr(new AUBCommandStreamReceiverHw("", true, *pDevice->executionEnvironment, pDevice->getRootDeviceIndex(), pDevice->getDeviceBitfield())); std::unique_ptr memoryManager(new OsAgnosticMemoryManager(*pDevice->executionEnvironment)); EXPECT_NE(nullptr, memoryManager.get()); } HWTEST_F(AubCommandStreamReceiverTests, givenAubCommandStreamReceiverWhenMultipleInstancesAreCreatedThenTheyOperateOnSingleFileStream) { - auto aubCsr1 = std::make_unique>("", true, *pDevice->executionEnvironment, pDevice->getRootDeviceIndex()); - auto aubCsr2 = std::make_unique>("", true, *pDevice->executionEnvironment, pDevice->getRootDeviceIndex()); + auto aubCsr1 = std::make_unique>("", true, *pDevice->executionEnvironment, pDevice->getRootDeviceIndex(), pDevice->getDeviceBitfield()); + auto aubCsr2 = std::make_unique>("", true, *pDevice->executionEnvironment, pDevice->getRootDeviceIndex(), pDevice->getDeviceBitfield()); EXPECT_EQ(aubCsr1->stream, aubCsr2->stream); } HWTEST_F(AubCommandStreamReceiverTests, givenAubCommandStreamReceiverWhenMultipleInstancesAreCreatedThenTheyUseTheSameFileStream) { - auto aubCsr1 = std::make_unique>("", true, *pDevice->executionEnvironment, pDevice->getRootDeviceIndex()); + auto aubCsr1 = std::make_unique>("", true, *pDevice->executionEnvironment, pDevice->getRootDeviceIndex(), pDevice->getDeviceBitfield()); auto streamProvider1 = pDevice->executionEnvironment->rootDeviceEnvironments[0]->aubCenter->getStreamProvider(); EXPECT_NE(nullptr, streamProvider1); - auto aubCsr2 = std::make_unique>("", true, *pDevice->executionEnvironment, pDevice->getRootDeviceIndex()); + auto aubCsr2 = std::make_unique>("", true, *pDevice->executionEnvironment, pDevice->getRootDeviceIndex(), pDevice->getDeviceBitfield()); auto streamProvider2 = pDevice->executionEnvironment->rootDeviceEnvironments[0]->aubCenter->getStreamProvider(); EXPECT_NE(nullptr, streamProvider2); EXPECT_EQ(streamProvider1, streamProvider2); } HWTEST_F(AubCommandStreamReceiverTests, givenAubCommandStreamReceiverWhenMultipleInstancesAreCreatedThenTheyUseTheSamePhysicalAddressAllocator) { - auto aubCsr1 = std::make_unique>("", true, *pDevice->executionEnvironment, pDevice->getRootDeviceIndex()); + auto aubCsr1 = std::make_unique>("", true, *pDevice->executionEnvironment, pDevice->getRootDeviceIndex(), pDevice->getDeviceBitfield()); auto physicalAddressAlocator1 = pDevice->executionEnvironment->rootDeviceEnvironments[0]->aubCenter->getPhysicalAddressAllocator(); EXPECT_NE(nullptr, physicalAddressAlocator1); - auto aubCsr2 = std::make_unique>("", true, *pDevice->executionEnvironment, pDevice->getRootDeviceIndex()); + auto aubCsr2 = std::make_unique>("", true, *pDevice->executionEnvironment, pDevice->getRootDeviceIndex(), pDevice->getDeviceBitfield()); auto physicalAddressAlocator2 = pDevice->executionEnvironment->rootDeviceEnvironments[0]->aubCenter->getPhysicalAddressAllocator(); EXPECT_NE(nullptr, physicalAddressAlocator2); EXPECT_EQ(physicalAddressAlocator1, physicalAddressAlocator2); } HWTEST_F(AubCommandStreamReceiverTests, givenAubCommandStreamReceiverWhenMultipleInstancesAreCreatedThenTheyUseTheSameAddressMapper) { - auto aubCsr1 = std::make_unique>("", true, *pDevice->executionEnvironment, pDevice->getRootDeviceIndex()); + auto aubCsr1 = std::make_unique>("", true, *pDevice->executionEnvironment, pDevice->getRootDeviceIndex(), pDevice->getDeviceBitfield()); auto addressMapper1 = pDevice->executionEnvironment->rootDeviceEnvironments[0]->aubCenter->getAddressMapper(); EXPECT_NE(nullptr, addressMapper1); - auto aubCsr2 = std::make_unique>("", true, *pDevice->executionEnvironment, pDevice->getRootDeviceIndex()); + auto aubCsr2 = std::make_unique>("", true, *pDevice->executionEnvironment, pDevice->getRootDeviceIndex(), pDevice->getDeviceBitfield()); auto addressMapper2 = pDevice->executionEnvironment->rootDeviceEnvironments[0]->aubCenter->getAddressMapper(); EXPECT_NE(nullptr, addressMapper2); EXPECT_EQ(addressMapper1, addressMapper2); } HWTEST_F(AubCommandStreamReceiverTests, givenAubCommandStreamReceiverWhenMultipleInstancesAreCreatedThenTheyUseTheSameSubCaptureCommon) { - auto aubCsr1 = std::make_unique>("", true, *pDevice->executionEnvironment, pDevice->getRootDeviceIndex()); + auto aubCsr1 = std::make_unique>("", true, *pDevice->executionEnvironment, pDevice->getRootDeviceIndex(), pDevice->getDeviceBitfield()); auto subCaptureCommon1 = pDevice->executionEnvironment->rootDeviceEnvironments[0]->aubCenter->getSubCaptureCommon(); EXPECT_NE(nullptr, subCaptureCommon1); - auto aubCsr2 = std::make_unique>("", true, *pDevice->executionEnvironment, pDevice->getRootDeviceIndex()); + auto aubCsr2 = std::make_unique>("", true, *pDevice->executionEnvironment, pDevice->getRootDeviceIndex(), pDevice->getDeviceBitfield()); auto subCaptureCommon2 = pDevice->executionEnvironment->rootDeviceEnvironments[0]->aubCenter->getSubCaptureCommon(); EXPECT_NE(nullptr, subCaptureCommon2); EXPECT_EQ(subCaptureCommon1, subCaptureCommon2); @@ -164,7 +164,7 @@ HWTEST_F(AubCommandStreamReceiverTests, givenAubCommandStreamReceiverWithAubMana mockAubCenter->aubManager = std::unique_ptr(mockManager); pDevice->executionEnvironment->rootDeviceEnvironments[0]->aubCenter = std::unique_ptr(mockAubCenter); - std::unique_ptr> aubCsr(static_cast *>(AUBCommandStreamReceiver::create(fileName, true, *pDevice->executionEnvironment, pDevice->getRootDeviceIndex()))); + std::unique_ptr> aubCsr(static_cast *>(AUBCommandStreamReceiver::create(fileName, true, *pDevice->executionEnvironment, pDevice->getRootDeviceIndex(), pDevice->getDeviceBitfield()))); ASSERT_NE(nullptr, aubCsr); EXPECT_TRUE(aubCsr->isFileOpen()); @@ -180,7 +180,7 @@ HWTEST_F(AubCommandStreamReceiverTests, givenAubCsrWhenOsContextIsSetThenCreateH mockAubCenter->aubManager = std::unique_ptr(mockManager); pDevice->executionEnvironment->rootDeviceEnvironments[0]->aubCenter = std::unique_ptr(mockAubCenter); - std::unique_ptr> aubCsr(static_cast *>(AUBCommandStreamReceiver::create(fileName, true, *pDevice->executionEnvironment, pDevice->getRootDeviceIndex()))); + std::unique_ptr> aubCsr(static_cast *>(AUBCommandStreamReceiver::create(fileName, true, *pDevice->executionEnvironment, pDevice->getRootDeviceIndex(), pDevice->getDeviceBitfield()))); EXPECT_EQ(nullptr, aubCsr->hardwareContextController.get()); aubCsr->setupContext(osContext); @@ -197,7 +197,7 @@ HWTEST_F(AubCommandStreamReceiverTests, givenAubCsrWhenLowPriorityOsContextIsSet mockAubCenter->aubManager = std::unique_ptr(mockManager); pDevice->executionEnvironment->rootDeviceEnvironments[0]->aubCenter = std::unique_ptr(mockAubCenter); - std::unique_ptr> aubCsr(static_cast *>(AUBCommandStreamReceiver::create(fileName, true, *pDevice->executionEnvironment, pDevice->getRootDeviceIndex()))); + std::unique_ptr> aubCsr(static_cast *>(AUBCommandStreamReceiver::create(fileName, true, *pDevice->executionEnvironment, pDevice->getRootDeviceIndex(), pDevice->getDeviceBitfield()))); EXPECT_EQ(nullptr, aubCsr->hardwareContextController.get()); aubCsr->setupContext(osContext); @@ -210,14 +210,15 @@ HWTEST_F(AubCommandStreamReceiverTests, givenAubCommandStreamReceiverInSubCaptur std::string fileName = "file_name.aub"; MockExecutionEnvironment executionEnvironment(defaultHwInfo.get()); executionEnvironment.initializeMemoryManager(); - std::unique_ptr> aubCsr(static_cast *>(AUBCommandStreamReceiver::create(fileName, true, executionEnvironment, 0))); + DeviceBitfield deviceBitfield(1); + std::unique_ptr> aubCsr(static_cast *>(AUBCommandStreamReceiver::create(fileName, true, executionEnvironment, 0, deviceBitfield))); EXPECT_NE(nullptr, aubCsr); EXPECT_FALSE(aubCsr->isFileOpen()); } HWTEST_F(AubCommandStreamReceiverTests, givenGraphicsAllocationWhenMakeResidentCalledMultipleTimesAffectsResidencyOnce) { std::unique_ptr memoryManager(nullptr); - std::unique_ptr> aubCsr(new AUBCommandStreamReceiverHw("", true, *pDevice->executionEnvironment, pDevice->getRootDeviceIndex())); + std::unique_ptr> aubCsr(new AUBCommandStreamReceiverHw("", true, *pDevice->executionEnvironment, pDevice->getRootDeviceIndex(), pDevice->getDeviceBitfield())); memoryManager.reset(new OsAgnosticMemoryManager(*pDevice->executionEnvironment)); aubCsr->setupContext(*pDevice->getDefaultEngine().osContext); auto gfxAllocation = memoryManager->allocateGraphicsMemoryWithProperties(MockAllocationProperties{pDevice->getRootDeviceIndex(), MemoryConstants::pageSize}); @@ -258,8 +259,8 @@ HWTEST_F(AubCommandStreamReceiverTests, givenAubCommandStreamReceiverWhenMultipl auto engineInstance = HwHelper::get(hwInfo.platform.eRenderCoreFamily).getGpgpuEngineInstances(hwInfo)[0]; MockOsContext osContext(0, 1, engineInstance.first, PreemptionMode::Disabled, false, false, false); - auto aubCsr1 = std::make_unique>("", true, *pDevice->executionEnvironment, pDevice->getRootDeviceIndex()); - auto aubCsr2 = std::make_unique>("", true, *pDevice->executionEnvironment, pDevice->getRootDeviceIndex()); + auto aubCsr1 = std::make_unique>("", true, *pDevice->executionEnvironment, pDevice->getRootDeviceIndex(), pDevice->getDeviceBitfield()); + auto aubCsr2 = std::make_unique>("", true, *pDevice->executionEnvironment, pDevice->getRootDeviceIndex(), pDevice->getDeviceBitfield()); aubCsr1->setupContext(osContext); aubCsr1->initializeEngine(); @@ -708,7 +709,7 @@ HWTEST_F(AubCommandStreamReceiverTests, givenAubCommandStreamReceiverWhenProcess HWTEST_F(AubCommandStreamReceiverTests, givenAubCommandStreamReceiverWhenWriteMemoryIsCalledOnBufferAndImageTypeAllocationsThenAllocationsHaveAubWritableSetToFalse) { std::unique_ptr memoryManager(nullptr); - std::unique_ptr> aubCsr(new AUBCommandStreamReceiverHw("", true, *pDevice->executionEnvironment, pDevice->getRootDeviceIndex())); + std::unique_ptr> aubCsr(new AUBCommandStreamReceiverHw("", true, *pDevice->executionEnvironment, pDevice->getRootDeviceIndex(), pDevice->getDeviceBitfield())); aubCsr->setupContext(*pDevice->getDefaultEngine().osContext); memoryManager.reset(new OsAgnosticMemoryManager(*pDevice->executionEnvironment)); @@ -742,7 +743,7 @@ HWTEST_F(AubCommandStreamReceiverTests, givenAubCommandStreamReceiverWhenWriteMe HWTEST_F(AubCommandStreamReceiverTests, givenAubCommandStreamReceiverWhenProcessResidencyIsCalledOnBufferAndImageAllocationsThenAllocationsTypesShouldBeMadeNonAubWritable) { std::unique_ptr memoryManager(nullptr); - std::unique_ptr> aubCsr(new AUBCommandStreamReceiverHw("", true, *pDevice->executionEnvironment, pDevice->getRootDeviceIndex())); + std::unique_ptr> aubCsr(new AUBCommandStreamReceiverHw("", true, *pDevice->executionEnvironment, pDevice->getRootDeviceIndex(), pDevice->getDeviceBitfield())); memoryManager.reset(new OsAgnosticMemoryManager(*pDevice->executionEnvironment)); aubCsr->setupContext(*pDevice->getDefaultEngine().osContext); @@ -763,7 +764,7 @@ HWTEST_F(AubCommandStreamReceiverTests, givenAubCommandStreamReceiverWhenProcess HWTEST_F(AubCommandStreamReceiverTests, givenAubCommandStreamReceiverInSubCaptureModWhenProcessResidencyIsCalledWithDumpAubNonWritableFlagThenAllocationsTypesShouldBeMadeAubWritable) { DebugManagerStateRestore stateRestore; std::unique_ptr memoryManager(nullptr); - std::unique_ptr> aubCsr(new MockAubCsrToTestDumpAubNonWritable("", true, *pDevice->executionEnvironment, pDevice->getRootDeviceIndex())); + std::unique_ptr> aubCsr(new MockAubCsrToTestDumpAubNonWritable("", true, *pDevice->executionEnvironment, pDevice->getRootDeviceIndex(), pDevice->getDeviceBitfield())); memoryManager.reset(new OsAgnosticMemoryManager(*pDevice->executionEnvironment)); aubCsr->setupContext(*pDevice->getDefaultEngine().osContext); @@ -788,7 +789,7 @@ HWTEST_F(AubCommandStreamReceiverTests, givenAubCommandStreamReceiverInSubCaptur HWTEST_F(AubCommandStreamReceiverTests, givenAubCommandStreamReceiverWhenProcessResidencyIsCalledWithoutDumpAubWritableFlagThenAllocationsTypesShouldBeKeptNonAubWritable) { DebugManagerStateRestore stateRestore; std::unique_ptr memoryManager(nullptr); - std::unique_ptr> aubCsr(new MockAubCsrToTestDumpAubNonWritable("", true, *pDevice->executionEnvironment, pDevice->getRootDeviceIndex())); + std::unique_ptr> aubCsr(new MockAubCsrToTestDumpAubNonWritable("", true, *pDevice->executionEnvironment, pDevice->getRootDeviceIndex(), pDevice->getDeviceBitfield())); memoryManager.reset(new OsAgnosticMemoryManager(*pDevice->executionEnvironment)); aubCsr->setupContext(*pDevice->getDefaultEngine().osContext); @@ -812,7 +813,7 @@ HWTEST_F(AubCommandStreamReceiverTests, givenAubCommandStreamReceiverWhenProcess HWTEST_F(AubCommandStreamReceiverTests, givenOsContextWithMultipleDevicesSupportedWhenSetupIsCalledThenCreateMultipleHardwareContexts) { MockOsContext osContext(1, 0b11, aub_stream::ENGINE_RCS, PreemptionMode::Disabled, false, false, false); - auto aubCsr = std::make_unique>("", true, *pDevice->executionEnvironment, pDevice->getRootDeviceIndex()); + auto aubCsr = std::make_unique>("", true, *pDevice->executionEnvironment, pDevice->getRootDeviceIndex(), pDevice->getDeviceBitfield()); aubCsr->setupContext(osContext); EXPECT_EQ(2u, aubCsr->hardwareContextController->hardwareContexts.size()); @@ -820,7 +821,7 @@ HWTEST_F(AubCommandStreamReceiverTests, givenOsContextWithMultipleDevicesSupport HWTEST_F(AubCommandStreamReceiverTests, givenAubCommandStreamReceiverWhenGraphicsAllocationTypeIsntNonAubWritableThenWriteMemoryIsAllowed) { std::unique_ptr memoryManager(nullptr); - std::unique_ptr> aubCsr(new AUBCommandStreamReceiverHw("", true, *pDevice->executionEnvironment, pDevice->getRootDeviceIndex())); + std::unique_ptr> aubCsr(new AUBCommandStreamReceiverHw("", true, *pDevice->executionEnvironment, pDevice->getRootDeviceIndex(), pDevice->getDeviceBitfield())); aubCsr->setupContext(*pDevice->getDefaultEngine().osContext); memoryManager.reset(new OsAgnosticMemoryManager(*pDevice->executionEnvironment)); @@ -834,7 +835,7 @@ HWTEST_F(AubCommandStreamReceiverTests, givenAubCommandStreamReceiverWhenGraphic HWTEST_F(AubCommandStreamReceiverTests, givenAubCommandStreamReceiverWhenGraphicsAllocationTypeIsNonAubWritableThenWriteMemoryIsNotAllowed) { std::unique_ptr memoryManager(nullptr); - std::unique_ptr> aubCsr(new AUBCommandStreamReceiverHw("", true, *pDevice->executionEnvironment, pDevice->getRootDeviceIndex())); + std::unique_ptr> aubCsr(new AUBCommandStreamReceiverHw("", true, *pDevice->executionEnvironment, pDevice->getRootDeviceIndex(), pDevice->getDeviceBitfield())); memoryManager.reset(new OsAgnosticMemoryManager(*pDevice->executionEnvironment)); aubCsr->setupContext(*pDevice->getDefaultEngine().osContext); auto gfxAllocation = memoryManager->allocateGraphicsMemoryWithProperties(MockAllocationProperties{pDevice->getRootDeviceIndex(), MemoryConstants::pageSize}); @@ -846,14 +847,14 @@ HWTEST_F(AubCommandStreamReceiverTests, givenAubCommandStreamReceiverWhenGraphic } HWTEST_F(AubCommandStreamReceiverTests, givenAubCommandStreamReceiverWhenGraphicsAllocationSizeIsZeroThenWriteMemoryIsNotAllowed) { - std::unique_ptr> aubCsr(new AUBCommandStreamReceiverHw("", true, *pDevice->executionEnvironment, pDevice->getRootDeviceIndex())); + std::unique_ptr> aubCsr(new AUBCommandStreamReceiverHw("", true, *pDevice->executionEnvironment, pDevice->getRootDeviceIndex(), pDevice->getDeviceBitfield())); MockGraphicsAllocation gfxAllocation((void *)0x1234, 0); aubCsr->setupContext(*pDevice->getDefaultEngine().osContext); EXPECT_FALSE(aubCsr->writeMemory(gfxAllocation)); } HWTEST_F(AubCommandStreamReceiverTests, givenAubCommandStreamReceiverWhenAllocationDataIsPassedInAllocationViewThenWriteMemoryIsAllowed) { - auto aubCsr = std::make_unique>("", true, *pDevice->executionEnvironment, pDevice->getRootDeviceIndex()); + auto aubCsr = std::make_unique>("", true, *pDevice->executionEnvironment, pDevice->getRootDeviceIndex(), pDevice->getDeviceBitfield()); aubCsr->setupContext(*pDevice->getDefaultEngine().osContext); size_t size = 100; auto ptr = std::make_unique(size); @@ -864,7 +865,7 @@ HWTEST_F(AubCommandStreamReceiverTests, givenAubCommandStreamReceiverWhenAllocat } HWTEST_F(AubCommandStreamReceiverTests, givenAubCommandStreamReceiverWhenAllocationSizeInAllocationViewIsZeroThenWriteMemoryIsNotAllowed) { - auto aubCsr = std::make_unique>("", true, *pDevice->executionEnvironment, pDevice->getRootDeviceIndex()); + auto aubCsr = std::make_unique>("", true, *pDevice->executionEnvironment, pDevice->getRootDeviceIndex(), pDevice->getDeviceBitfield()); AllocationView allocationView(0x1234, 0); aubCsr->setupContext(*pDevice->getDefaultEngine().osContext); EXPECT_FALSE(aubCsr->writeMemory(allocationView)); @@ -874,7 +875,7 @@ HWTEST_F(AubCommandStreamReceiverTests, givenAubCommandStreamReceiverWhenAUBDump DebugManagerStateRestore stateRestore; DebugManager.flags.AUBDumpCaptureFileName.set("file_name.aub"); - std::unique_ptr> aubCsr(static_cast *>(AUBCommandStreamReceiver::create("", true, *pDevice->executionEnvironment, pDevice->getRootDeviceIndex()))); + std::unique_ptr> aubCsr(static_cast *>(AUBCommandStreamReceiver::create("", true, *pDevice->executionEnvironment, pDevice->getRootDeviceIndex(), pDevice->getDeviceBitfield()))); EXPECT_NE(nullptr, aubCsr); EXPECT_TRUE(aubCsr->isFileOpen()); @@ -883,7 +884,7 @@ HWTEST_F(AubCommandStreamReceiverTests, givenAubCommandStreamReceiverWhenAUBDump HWTEST_F(AubCommandStreamReceiverTests, givenAubCommandStreamReceiverInSubCaptureModeWhenAubSubCaptureIsActivatedThenFileIsOpened) { DebugManagerStateRestore stateRestore; - std::unique_ptr> aubCsr(new MockAubCsr("", false, *pDevice->executionEnvironment, pDevice->getRootDeviceIndex())); + std::unique_ptr> aubCsr(new MockAubCsr("", false, *pDevice->executionEnvironment, pDevice->getRootDeviceIndex(), pDevice->getDeviceBitfield())); AubSubCaptureCommon aubSubCaptureCommon; auto subCaptureManagerMock = new AubSubCaptureManagerMock("", aubSubCaptureCommon); @@ -906,7 +907,7 @@ HWTEST_F(AubCommandStreamReceiverTests, givenAubCommandStreamReceiverInSubCaptur HWTEST_F(AubCommandStreamReceiverTests, givenAubCommandStreamReceiverInSubCaptureModeWhenAubSubCaptureRemainsActivedThenTheSameFileShouldBeKeptOpened) { DebugManagerStateRestore stateRestore; - std::unique_ptr> aubCsr(new MockAubCsr("", false, *pDevice->executionEnvironment, pDevice->getRootDeviceIndex())); + std::unique_ptr> aubCsr(new MockAubCsr("", false, *pDevice->executionEnvironment, pDevice->getRootDeviceIndex(), pDevice->getDeviceBitfield())); AubSubCaptureCommon aubSubCaptureCommon; auto subCaptureManagerMock = new AubSubCaptureManagerMock("", aubSubCaptureCommon); @@ -930,7 +931,7 @@ HWTEST_F(AubCommandStreamReceiverTests, givenAubCommandStreamReceiverInSubCaptur HWTEST_F(AubCommandStreamReceiverTests, givenAubCommandStreamReceiverInSubCaptureModeWhenAubSubCaptureIsActivatedWithNewFileNameThenNewFileShouldBeReOpened) { DebugManagerStateRestore stateRestore; - std::unique_ptr> aubCsr(new MockAubCsr("", false, *pDevice->executionEnvironment, pDevice->getRootDeviceIndex())); + std::unique_ptr> aubCsr(new MockAubCsr("", false, *pDevice->executionEnvironment, pDevice->getRootDeviceIndex(), pDevice->getDeviceBitfield())); std::string newFileName = "new_file_name.aub"; AubSubCaptureCommon aubSubCaptureCommon; @@ -959,7 +960,7 @@ HWTEST_F(AubCommandStreamReceiverTests, givenAubCommandStreamReceiverInSubCaptur HWTEST_F(AubCommandStreamReceiverTests, givenAubCommandStreamReceiverInSubCaptureModeWhenAubSubCaptureIsActivatedForNewFileThenOldEngineInfoShouldBeFreed) { DebugManagerStateRestore stateRestore; - std::unique_ptr> aubCsr(new MockAubCsr("", false, *pDevice->executionEnvironment, pDevice->getRootDeviceIndex())); + std::unique_ptr> aubCsr(new MockAubCsr("", false, *pDevice->executionEnvironment, pDevice->getRootDeviceIndex(), pDevice->getDeviceBitfield())); std::string newFileName = "new_file_name.aub"; AubSubCaptureCommon aubSubCaptureCommon; @@ -988,7 +989,7 @@ HWTEST_F(AubCommandStreamReceiverTests, givenAubCommandStreamReceiverInSubCaptur HWTEST_F(AubCommandStreamReceiverTests, givenAubCommandStreamReceiverInSubCaptureModeWhenAubSubCaptureIsActivatedThenForceDumpingAllocationsAubNonWritable) { DebugManagerStateRestore stateRestore; - std::unique_ptr> aubCsr(new MockAubCsrToTestDumpAubNonWritable("", false, *pDevice->executionEnvironment, pDevice->getRootDeviceIndex())); + std::unique_ptr> aubCsr(new MockAubCsrToTestDumpAubNonWritable("", false, *pDevice->executionEnvironment, pDevice->getRootDeviceIndex(), pDevice->getDeviceBitfield())); AubSubCaptureCommon aubSubCaptureCommon; auto subCaptureManagerMock = new AubSubCaptureManagerMock("", aubSubCaptureCommon); @@ -1008,7 +1009,7 @@ HWTEST_F(AubCommandStreamReceiverTests, givenAubCommandStreamReceiverInSubCaptur HWTEST_F(AubCommandStreamReceiverTests, givenAubCommandStreamReceiverInSubCaptureModeWhenAubSubCaptureRemainsActivatedThenDontForceDumpingAllocationsAubNonWritable) { DebugManagerStateRestore stateRestore; - std::unique_ptr> aubCsr(new MockAubCsrToTestDumpAubNonWritable("", false, *pDevice->executionEnvironment, pDevice->getRootDeviceIndex())); + std::unique_ptr> aubCsr(new MockAubCsrToTestDumpAubNonWritable("", false, *pDevice->executionEnvironment, pDevice->getRootDeviceIndex(), pDevice->getDeviceBitfield())); AubSubCaptureCommon aubSubCaptureCommon; auto subCaptureManagerMock = new AubSubCaptureManagerMock("", aubSubCaptureCommon); @@ -1028,7 +1029,7 @@ HWTEST_F(AubCommandStreamReceiverTests, givenAubCommandStreamReceiverInSubCaptur HWTEST_F(AubCommandStreamReceiverTests, givenAubCommandStreamReceiverInSubCaptureModeWhenSubCaptureModeRemainsDeactivatedThenSubCaptureIsDisabled) { DebugManagerStateRestore stateRestore; - std::unique_ptr> aubCsr(new MockAubCsr("", false, *pDevice->executionEnvironment, pDevice->getRootDeviceIndex())); + std::unique_ptr> aubCsr(new MockAubCsr("", false, *pDevice->executionEnvironment, pDevice->getRootDeviceIndex(), pDevice->getDeviceBitfield())); AubSubCaptureCommon aubSubCaptureCommon; auto subCaptureManagerMock = new AubSubCaptureManagerMock("", aubSubCaptureCommon); @@ -1049,7 +1050,7 @@ HWTEST_F(AubCommandStreamReceiverTests, givenAubCommandStreamReceiverInSubCaptur HWTEST_F(AubCommandStreamReceiverTests, givenAubCommandStreamReceiverInSubCaptureModeWhenSubCaptureIsToggledOnThenSubCaptureGetsEnabled) { DebugManagerStateRestore stateRestore; - std::unique_ptr> aubCsr(new MockAubCsr("", false, *pDevice->executionEnvironment, pDevice->getRootDeviceIndex())); + std::unique_ptr> aubCsr(new MockAubCsr("", false, *pDevice->executionEnvironment, pDevice->getRootDeviceIndex(), pDevice->getDeviceBitfield())); AubSubCaptureCommon aubSubCaptureCommon; auto subCaptureManagerMock = new AubSubCaptureManagerMock("", aubSubCaptureCommon); @@ -1069,7 +1070,7 @@ HWTEST_F(AubCommandStreamReceiverTests, givenAubCommandStreamReceiverInSubCaptur HWTEST_F(AubCommandStreamReceiverTests, givenAubCommandStreamReceiverInStandaloneAndSubCaptureModeWhenSubCaptureRemainsDeactivatedThenNeitherProgrammingFlagsAreInitializedNorCsrIsFlushed) { DebugManagerStateRestore stateRestore; - std::unique_ptr> aubCsr(new MockAubCsr("", true, *pDevice->executionEnvironment, pDevice->getRootDeviceIndex())); + std::unique_ptr> aubCsr(new MockAubCsr("", true, *pDevice->executionEnvironment, pDevice->getRootDeviceIndex(), pDevice->getDeviceBitfield())); AubSubCaptureCommon aubSubCaptureCommon; auto subCaptureManagerMock = new AubSubCaptureManagerMock("", aubSubCaptureCommon); @@ -1089,7 +1090,7 @@ HWTEST_F(AubCommandStreamReceiverTests, givenAubCommandStreamReceiverInStandalon HWTEST_F(AubCommandStreamReceiverTests, givenAubCommandStreamReceiverInStandaloneAndSubCaptureModeWhenSubCaptureRemainsActivatedThenNeitherProgrammingFlagsAreInitializedNorCsrIsFlushed) { DebugManagerStateRestore stateRestore; - std::unique_ptr> aubCsr(new MockAubCsr("", true, *pDevice->executionEnvironment, pDevice->getRootDeviceIndex())); + std::unique_ptr> aubCsr(new MockAubCsr("", true, *pDevice->executionEnvironment, pDevice->getRootDeviceIndex(), pDevice->getDeviceBitfield())); AubSubCaptureCommon aubSubCaptureCommon; auto subCaptureManagerMock = new AubSubCaptureManagerMock("", aubSubCaptureCommon); @@ -1109,7 +1110,7 @@ HWTEST_F(AubCommandStreamReceiverTests, givenAubCommandStreamReceiverInStandalon HWTEST_F(AubCommandStreamReceiverTests, givenAubCommandStreamReceiverInStandaloneAndSubCaptureModeWhenSubCaptureGetsActivatedThenProgrammingFlagsAreInitialized) { DebugManagerStateRestore stateRestore; - std::unique_ptr> aubCsr(new MockAubCsr("", true, *pDevice->executionEnvironment, pDevice->getRootDeviceIndex())); + std::unique_ptr> aubCsr(new MockAubCsr("", true, *pDevice->executionEnvironment, pDevice->getRootDeviceIndex(), pDevice->getDeviceBitfield())); AubSubCaptureCommon aubSubCaptureCommon; auto subCaptureManagerMock = new AubSubCaptureManagerMock("", aubSubCaptureCommon); @@ -1130,7 +1131,7 @@ HWTEST_F(AubCommandStreamReceiverTests, givenAubCommandStreamReceiverInStandalon HWTEST_F(AubCommandStreamReceiverTests, givenAubCommandStreamReceiverInStandaloneAndSubCaptureModeWhenSubCaptureGetsDeactivatedThenCsrIsFlushed) { DebugManagerStateRestore stateRestore; - std::unique_ptr> aubCsr(new MockAubCsr("", true, *pDevice->executionEnvironment, pDevice->getRootDeviceIndex())); + std::unique_ptr> aubCsr(new MockAubCsr("", true, *pDevice->executionEnvironment, pDevice->getRootDeviceIndex(), pDevice->getDeviceBitfield())); AubSubCaptureCommon aubSubCaptureCommon; auto subCaptureManagerMock = new AubSubCaptureManagerMock("", aubSubCaptureCommon); diff --git a/opencl/test/unit_test/command_stream/aub_command_stream_receiver_2_tests.cpp b/opencl/test/unit_test/command_stream/aub_command_stream_receiver_2_tests.cpp index 1db14494ad..522180c9e4 100644 --- a/opencl/test/unit_test/command_stream/aub_command_stream_receiver_2_tests.cpp +++ b/opencl/test/unit_test/command_stream/aub_command_stream_receiver_2_tests.cpp @@ -40,7 +40,7 @@ using namespace NEO; using AubCommandStreamReceiverTests = Test; HWTEST_F(AubCommandStreamReceiverTests, givenAubCommandStreamReceiverWhenForcedBatchBufferFlatteningInImmediateDispatchModeThenNewCombinedBatchBufferIsCreated) { - std::unique_ptr> aubCsr(new AUBCommandStreamReceiverHw("", true, *pDevice->executionEnvironment, pDevice->getRootDeviceIndex())); + std::unique_ptr> aubCsr(new AUBCommandStreamReceiverHw("", true, *pDevice->executionEnvironment, pDevice->getRootDeviceIndex(), pDevice->getDeviceBitfield())); std::unique_ptr memoryManager(new OsAgnosticMemoryManager(*pDevice->executionEnvironment)); auto flatBatchBufferHelper = new FlatBatchBufferHelperHw(*pDevice->executionEnvironment); aubCsr->overwriteFlatBatchBufferHelper(flatBatchBufferHelper); @@ -69,7 +69,7 @@ HWTEST_F(AubCommandStreamReceiverTests, givenAubCommandStreamReceiverWhenForcedB } HWTEST_F(AubCommandStreamReceiverTests, givenAubCommandStreamReceiverWhenForcedBatchBufferInImmediateDispatchModeAndNoChainedBatchBufferThenCombinedBatchBufferIsNotCreated) { - std::unique_ptr> aubCsr(new AUBCommandStreamReceiverHw("", true, *pDevice->executionEnvironment, pDevice->getRootDeviceIndex())); + std::unique_ptr> aubCsr(new AUBCommandStreamReceiverHw("", true, *pDevice->executionEnvironment, pDevice->getRootDeviceIndex(), pDevice->getDeviceBitfield())); std::unique_ptr memoryManager(new OsAgnosticMemoryManager(*pDevice->executionEnvironment)); auto flatBatchBufferHelper = new FlatBatchBufferHelperHw(*pDevice->executionEnvironment); aubCsr->overwriteFlatBatchBufferHelper(flatBatchBufferHelper); @@ -92,7 +92,7 @@ HWTEST_F(AubCommandStreamReceiverTests, givenAubCommandStreamReceiverWhenForcedB } HWTEST_F(AubCommandStreamReceiverTests, givenAubCommandStreamReceiverWhenForcedBatchBufferAndNotImmediateOrBatchedDispatchModeThenCombinedBatchBufferIsNotCreated) { - std::unique_ptr> aubCsr(new AUBCommandStreamReceiverHw("", true, *pDevice->executionEnvironment, pDevice->getRootDeviceIndex())); + std::unique_ptr> aubCsr(new AUBCommandStreamReceiverHw("", true, *pDevice->executionEnvironment, pDevice->getRootDeviceIndex(), pDevice->getDeviceBitfield())); std::unique_ptr memoryManager(new OsAgnosticMemoryManager(*pDevice->executionEnvironment)); auto flatBatchBufferHelper = new FlatBatchBufferHelperHw(*pDevice->executionEnvironment); aubCsr->overwriteFlatBatchBufferHelper(flatBatchBufferHelper); @@ -375,7 +375,7 @@ HWTEST_F(AubCommandStreamReceiverTests, givenAubCommandStreamReceiverWhenGetIndi HWTEST_F(AubCommandStreamReceiverTests, givenAubCommandStreamReceiverWhenGetIndirectPatchCommandsIsCalledForNonEmptyPatchInfoListThenIndirectPatchCommandBufferIsCreated) { typedef typename FamilyType::MI_STORE_DATA_IMM MI_STORE_DATA_IMM; - std::unique_ptr> aubCsr(new AUBCommandStreamReceiverHw("", true, *pDevice->executionEnvironment, pDevice->getRootDeviceIndex())); + std::unique_ptr> aubCsr(new AUBCommandStreamReceiverHw("", true, *pDevice->executionEnvironment, pDevice->getRootDeviceIndex(), pDevice->getDeviceBitfield())); PatchInfoData patchInfo1(0xA000, 0u, PatchInfoAllocationType::KernelArg, 0x6000, 0x100, PatchInfoAllocationType::IndirectObjectHeap); PatchInfoData patchInfo2(0xB000, 0u, PatchInfoAllocationType::KernelArg, 0x6000, 0x200, PatchInfoAllocationType::IndirectObjectHeap); @@ -397,7 +397,7 @@ HWTEST_F(AubCommandStreamReceiverTests, givenAubCommandStreamReceiverWhenGetIndi HWTEST_F(AubCommandStreamReceiverTests, GivenAubCommandStreamReceiverWhenGetIndirectPatchCommandsIsCalledFor64BitAddressingModeThenDwordLengthAndStoreQwordAreSetCorrectly) { using MI_STORE_DATA_IMM = typename FamilyType::MI_STORE_DATA_IMM; - std::unique_ptr> aubCsr(new AUBCommandStreamReceiverHw("", true, *pDevice->executionEnvironment, pDevice->getRootDeviceIndex())); + std::unique_ptr> aubCsr(new AUBCommandStreamReceiverHw("", true, *pDevice->executionEnvironment, pDevice->getRootDeviceIndex(), pDevice->getDeviceBitfield())); PatchInfoData patchInfo(0xA000, 0u, PatchInfoAllocationType::KernelArg, 0x6000, 0x100, PatchInfoAllocationType::IndirectObjectHeap, sizeof(uint64_t)); aubCsr->getFlatBatchBufferHelper().setPatchInfoData(patchInfo); @@ -416,7 +416,7 @@ HWTEST_F(AubCommandStreamReceiverTests, GivenAubCommandStreamReceiverWhenGetIndi HWTEST_F(AubCommandStreamReceiverTests, GivenAubCommandStreamReceiverWhenGetIndirectPatchCommandsIsCalledFor32BitAddressingModeThenDwordLengthAndSetStoreDwordAreSetCorrectly) { using MI_STORE_DATA_IMM = typename FamilyType::MI_STORE_DATA_IMM; - std::unique_ptr> aubCsr(new AUBCommandStreamReceiverHw("", true, *pDevice->executionEnvironment, pDevice->getRootDeviceIndex())); + std::unique_ptr> aubCsr(new AUBCommandStreamReceiverHw("", true, *pDevice->executionEnvironment, pDevice->getRootDeviceIndex(), pDevice->getDeviceBitfield())); PatchInfoData patchInfo(0xA000, 0u, PatchInfoAllocationType::KernelArg, 0x6000, 0x100, PatchInfoAllocationType::IndirectObjectHeap, sizeof(uint32_t)); aubCsr->getFlatBatchBufferHelper().setPatchInfoData(patchInfo); @@ -438,7 +438,7 @@ HWTEST_F(AubCommandStreamReceiverTests, givenAubCommandStreamReceiverWhenAddBatc DebugManagerStateRestore dbgRestore; DebugManager.flags.FlattenBatchBufferForAUBDump.set(true); - std::unique_ptr> aubCsr(new AUBCommandStreamReceiverHw("", true, *pDevice->executionEnvironment, pDevice->getRootDeviceIndex())); + std::unique_ptr> aubCsr(new AUBCommandStreamReceiverHw("", true, *pDevice->executionEnvironment, pDevice->getRootDeviceIndex(), pDevice->getDeviceBitfield())); MI_BATCH_BUFFER_START bbStart; @@ -500,10 +500,10 @@ HWTEST_F(AubCommandStreamReceiverNoHostPtrTests, givenAubCommandStreamReceiverWh executionEnvironment->memoryManager.reset(memoryManager); auto hwInfo = executionEnvironment->rootDeviceEnvironments[0]->getHardwareInfo(); auto engineInstance = HwHelper::get(hwInfo->platform.eRenderCoreFamily).getGpgpuEngineInstances(*hwInfo)[0]; - - MockOsContext osContext(0, 1, engineInstance.first, PreemptionMode::Disabled, + DeviceBitfield deviceBitfield(1); + MockOsContext osContext(0, deviceBitfield, engineInstance.first, PreemptionMode::Disabled, false, false, false); - std::unique_ptr> aubCsr(new AUBCommandStreamReceiverHw("", true, *executionEnvironment, 0)); + std::unique_ptr> aubCsr(new AUBCommandStreamReceiverHw("", true, *executionEnvironment, 0, deviceBitfield)); aubCsr->setupContext(osContext); cl_image_desc imgDesc = {}; @@ -533,9 +533,9 @@ HWTEST_F(AubCommandStreamReceiverNoHostPtrTests, givenAubCommandStreamReceiverWh ExecutionEnvironment *executionEnvironment = platform()->peekExecutionEnvironment(); auto memoryManager = new OsAgnosticMemoryManagerForImagesWithNoHostPtr(*executionEnvironment); executionEnvironment->memoryManager.reset(memoryManager); - - std::unique_ptr> aubCsr(new AUBCommandStreamReceiverHw("", true, *executionEnvironment, 0)); - auto osContext = memoryManager->createAndRegisterOsContext(aubCsr.get(), getChosenEngineType(*defaultHwInfo), 0, + DeviceBitfield deviceBitfield(1); + std::unique_ptr> aubCsr(new AUBCommandStreamReceiverHw("", true, *executionEnvironment, 0, deviceBitfield)); + auto osContext = memoryManager->createAndRegisterOsContext(aubCsr.get(), getChosenEngineType(*defaultHwInfo), deviceBitfield, PreemptionMode::Disabled, false, false, false); aubCsr->setupContext(*osContext); @@ -549,19 +549,19 @@ HWTEST_F(AubCommandStreamReceiverNoHostPtrTests, givenAubCommandStreamReceiverWh } HWTEST_F(AubCommandStreamReceiverTests, givenNoDbgDeviceIdFlagWhenAubCsrIsCreatedThenUseDefaultDeviceId) { - std::unique_ptr> aubCsr(new MockAubCsr("", true, *pDevice->executionEnvironment, pDevice->getRootDeviceIndex())); + std::unique_ptr> aubCsr(new MockAubCsr("", true, *pDevice->executionEnvironment, pDevice->getRootDeviceIndex(), pDevice->getDeviceBitfield())); EXPECT_EQ(pDevice->getHardwareInfo().capabilityTable.aubDeviceId, aubCsr->aubDeviceId); } HWTEST_F(AubCommandStreamReceiverTests, givenDbgDeviceIdFlagIsSetWhenAubCsrIsCreatedThenUseDebugDeviceId) { DebugManagerStateRestore stateRestore; DebugManager.flags.OverrideAubDeviceId.set(9); //this is Hsw, not used - std::unique_ptr> aubCsr(new MockAubCsr("", true, *pDevice->executionEnvironment, pDevice->getRootDeviceIndex())); + std::unique_ptr> aubCsr(new MockAubCsr("", true, *pDevice->executionEnvironment, pDevice->getRootDeviceIndex(), pDevice->getDeviceBitfield())); EXPECT_EQ(9u, aubCsr->aubDeviceId); } HWTEST_F(AubCommandStreamReceiverTests, givenAubCommandStreamReceiverWhenGetGTTDataIsCalledThenLocalMemoryIsSetAccordingToCsrFeature) { - std::unique_ptr> aubCsr(new MockAubCsr("", true, *pDevice->executionEnvironment, pDevice->getRootDeviceIndex())); + std::unique_ptr> aubCsr(new MockAubCsr("", true, *pDevice->executionEnvironment, pDevice->getRootDeviceIndex(), pDevice->getDeviceBitfield())); AubGTTData data = {}; aubCsr->getGTTData(nullptr, data); EXPECT_TRUE(data.present); @@ -587,7 +587,7 @@ HWTEST_F(AubCommandStreamReceiverTests, givenPhysicalAddressWhenSetGttEntryIsCal } HWTEST_F(AubCommandStreamReceiverTests, whenGetMemoryBankForGttIsCalledThenCorrectBankIsReturned) { - std::unique_ptr> aubCsr(new MockAubCsr("", true, *pDevice->executionEnvironment, pDevice->getRootDeviceIndex())); + std::unique_ptr> aubCsr(new MockAubCsr("", true, *pDevice->executionEnvironment, pDevice->getRootDeviceIndex(), pDevice->getDeviceBitfield())); aubCsr->localMemoryEnabled = false; aubCsr->setupContext(*pDevice->getDefaultEngine().osContext); @@ -596,7 +596,7 @@ HWTEST_F(AubCommandStreamReceiverTests, whenGetMemoryBankForGttIsCalledThenCorre } HWTEST_F(AubCommandStreamReceiverTests, givenEntryBitsPresentAndWritableWhenGetAddressSpaceFromPTEBitsIsCalledThenTraceNonLocalIsReturned) { - std::unique_ptr> aubCsr(new MockAubCsr("", true, *pDevice->executionEnvironment, pDevice->getRootDeviceIndex())); + std::unique_ptr> aubCsr(new MockAubCsr("", true, *pDevice->executionEnvironment, pDevice->getRootDeviceIndex(), pDevice->getDeviceBitfield())); auto space = aubCsr->getAddressSpaceFromPTEBits(PageTableEntry::presentBit | PageTableEntry::writableBit); EXPECT_EQ(AubMemDump::AddressSpaceValues::TraceNonlocal, space); @@ -621,7 +621,7 @@ struct MockAubCsrToTestExternalAllocations : public AUBCommandStreamReceiverHw>("", true, *pDevice->executionEnvironment, pDevice->getRootDeviceIndex()); + auto aubCsr = std::make_unique>("", true, *pDevice->executionEnvironment, pDevice->getRootDeviceIndex(), pDevice->getDeviceBitfield()); size_t size = 100; auto ptr = std::make_unique(size); auto addr = reinterpret_cast(ptr.get()); @@ -635,7 +635,7 @@ HWTEST_F(AubCommandStreamReceiverTests, givenAubCommandStreamReceiverWhenMakeRes } HWTEST_F(AubCommandStreamReceiverTests, givenAubCommandStreamReceiverWhenMakeNonResidentExternalIsCalledThenMatchingAllocationViewShouldBeRemovedFromExternalAllocations) { - auto aubCsr = std::make_unique>("", true, *pDevice->executionEnvironment, pDevice->getRootDeviceIndex()); + auto aubCsr = std::make_unique>("", true, *pDevice->executionEnvironment, pDevice->getRootDeviceIndex(), pDevice->getDeviceBitfield()); size_t size = 100; auto ptr = std::make_unique(size); auto addr = reinterpret_cast(ptr.get()); @@ -648,7 +648,7 @@ HWTEST_F(AubCommandStreamReceiverTests, givenAubCommandStreamReceiverWhenMakeNon } HWTEST_F(AubCommandStreamReceiverTests, givenAubCommandStreamReceiverWhenMakeNonResidentExternalIsCalledThenNonMatchingAllocationViewShouldNotBeRemovedFromExternalAllocations) { - auto aubCsr = std::make_unique>("", true, *pDevice->executionEnvironment, pDevice->getRootDeviceIndex()); + auto aubCsr = std::make_unique>("", true, *pDevice->executionEnvironment, pDevice->getRootDeviceIndex(), pDevice->getDeviceBitfield()); size_t size = 100; auto ptr = std::make_unique(size); auto addr = reinterpret_cast(ptr.get()); @@ -661,7 +661,7 @@ HWTEST_F(AubCommandStreamReceiverTests, givenAubCommandStreamReceiverWhenMakeNon } HWTEST_F(AubCommandStreamReceiverTests, givenAubCommandStreamReceiverWhenProcessResidencyIsCalledThenExternalAllocationsShouldBeMadeResident) { - auto aubCsr = std::make_unique>("", true, *pDevice->executionEnvironment, pDevice->getRootDeviceIndex()); + auto aubCsr = std::make_unique>("", true, *pDevice->executionEnvironment, pDevice->getRootDeviceIndex(), pDevice->getDeviceBitfield()); size_t size = 100; auto ptr = std::make_unique(size); auto addr = reinterpret_cast(ptr.get()); @@ -679,7 +679,7 @@ HWTEST_F(AubCommandStreamReceiverTests, givenAubCommandStreamReceiverWhenProcess } HWTEST_F(AubCommandStreamReceiverTests, givenAubCommandStreamReceiverWhenProcessResidencyIsCalledThenExternalAllocationWithZeroSizeShouldNotBeMadeResident) { - auto aubCsr = std::make_unique>("", true, *pDevice->executionEnvironment, pDevice->getRootDeviceIndex()); + auto aubCsr = std::make_unique>("", true, *pDevice->executionEnvironment, pDevice->getRootDeviceIndex(), pDevice->getDeviceBitfield()); AllocationView externalAllocation(0, 0); aubCsr->makeResidentExternal(externalAllocation); @@ -696,7 +696,7 @@ HWTEST_F(AubCommandStreamReceiverTests, givenAubCommandStreamReceiverWhenProcess HWTEST_F(AubCommandStreamReceiverTests, givenAubCommandStreamReceiverWhenWriteMemoryIsCalledThenGraphicsAllocationSizeIsReadCorrectly) { pDevice->executionEnvironment->rootDeviceEnvironments[0]->aubCenter.reset(new AubCenter()); - auto aubCsr = std::make_unique>("", false, *pDevice->executionEnvironment, pDevice->getRootDeviceIndex()); + auto aubCsr = std::make_unique>("", false, *pDevice->executionEnvironment, pDevice->getRootDeviceIndex(), pDevice->getDeviceBitfield()); aubCsr->setupContext(*pDevice->getDefaultEngine().osContext); std::unique_ptr memoryManager(new OsAgnosticMemoryManager(*pDevice->executionEnvironment)); @@ -735,7 +735,7 @@ HWTEST_F(AubCommandStreamReceiverTests, givenAubCommandStreamReceiverWhenWriteMe } HWTEST_F(AubCommandStreamReceiverTests, whenAubCommandStreamReceiverIsCreatedThenPPGTTAndGGTTCreatedHavePhysicalAddressAllocatorSet) { - auto aubCsr = std::make_unique>("", false, *pDevice->executionEnvironment, pDevice->getRootDeviceIndex()); + auto aubCsr = std::make_unique>("", false, *pDevice->executionEnvironment, pDevice->getRootDeviceIndex(), pDevice->getDeviceBitfield()); ASSERT_NE(nullptr, aubCsr->ppgtt.get()); ASSERT_NE(nullptr, aubCsr->ggtt.get()); @@ -751,11 +751,12 @@ HWTEST_F(AubCommandStreamReceiverTests, givenAubCommandStreamReceiverWhenEngineI MockExecutionEnvironment executionEnvironment(defaultHwInfo.get()); auto hwInfo = executionEnvironment.rootDeviceEnvironments[0]->getHardwareInfo(); auto engineInstance = HwHelper::get(hwInfo->platform.eRenderCoreFamily).getGpgpuEngineInstances(*hwInfo)[0]; - MockOsContext osContext(0, 1, engineInstance.first, PreemptionMode::Disabled, + DeviceBitfield deviceBitfield(1); + MockOsContext osContext(0, deviceBitfield, engineInstance.first, PreemptionMode::Disabled, false, false, false); executionEnvironment.initializeMemoryManager(); - auto aubCsr = std::make_unique>("", true, executionEnvironment, 0); + auto aubCsr = std::make_unique>("", true, executionEnvironment, 0, deviceBitfield); EXPECT_NE(nullptr, aubCsr); EXPECT_EQ(nullptr, aubCsr->hardwareContextController.get()); aubCsr->aubManager = nullptr; @@ -771,7 +772,7 @@ HWTEST_F(InjectMmmioTest, givenAddMmioKeySetToZeroWhenInitAdditionalMmioCalledTh DebugManagerStateRestore stateRestore; DebugManager.flags.AubDumpAddMmioRegistersList.set(""); - auto aubCsr = std::make_unique>("", true, *pDevice->executionEnvironment, pDevice->getRootDeviceIndex()); + auto aubCsr = std::make_unique>("", true, *pDevice->executionEnvironment, pDevice->getRootDeviceIndex(), pDevice->getDeviceBitfield()); EXPECT_NE(nullptr, aubCsr); auto stream = std::make_unique(); @@ -788,7 +789,7 @@ HWTEST_F(InjectMmmioTest, givenAddMmioRegistersListSetWhenInitAdditionalMmioCall DebugManagerStateRestore stateRestore; DebugManager.flags.AubDumpAddMmioRegistersList.set(registers); - auto aubCsr = std::make_unique>("", true, *pDevice->executionEnvironment, pDevice->getRootDeviceIndex()); + auto aubCsr = std::make_unique>("", true, *pDevice->executionEnvironment, pDevice->getRootDeviceIndex(), pDevice->getDeviceBitfield()); EXPECT_NE(nullptr, aubCsr); auto stream = std::make_unique(); @@ -805,7 +806,7 @@ HWTEST_F(InjectMmmioTest, givenLongSequenceOfAddMmioRegistersListSetWhenInitAddi DebugManagerStateRestore stateRestore; DebugManager.flags.AubDumpAddMmioRegistersList.set(registers); - auto aubCsr = std::make_unique>("", true, *pDevice->executionEnvironment, pDevice->getRootDeviceIndex()); + auto aubCsr = std::make_unique>("", true, *pDevice->executionEnvironment, pDevice->getRootDeviceIndex(), pDevice->getDeviceBitfield()); EXPECT_NE(nullptr, aubCsr); auto stream = std::make_unique(); @@ -823,7 +824,7 @@ HWTEST_F(InjectMmmioTest, givenSequenceWithIncompletePairOfAddMmioRegistersListS DebugManagerStateRestore stateRestore; DebugManager.flags.AubDumpAddMmioRegistersList.set(registers); - auto aubCsr = std::make_unique>("", true, *pDevice->executionEnvironment, pDevice->getRootDeviceIndex()); + auto aubCsr = std::make_unique>("", true, *pDevice->executionEnvironment, pDevice->getRootDeviceIndex(), pDevice->getDeviceBitfield()); EXPECT_NE(nullptr, aubCsr); auto stream = std::make_unique(); @@ -842,7 +843,7 @@ HWTEST_F(InjectMmmioTest, givenAddMmioRegistersListSetWithSemicolonAtTheEndWhenI DebugManagerStateRestore stateRestore; DebugManager.flags.AubDumpAddMmioRegistersList.set(registers); - auto aubCsr = std::make_unique>("", true, *pDevice->executionEnvironment, pDevice->getRootDeviceIndex()); + auto aubCsr = std::make_unique>("", true, *pDevice->executionEnvironment, pDevice->getRootDeviceIndex(), pDevice->getDeviceBitfield()); EXPECT_NE(nullptr, aubCsr); auto stream = std::make_unique(); @@ -859,7 +860,7 @@ HWTEST_F(InjectMmmioTest, givenAddMmioRegistersListSetWithInvalidValueWhenInitAd DebugManagerStateRestore stateRestore; DebugManager.flags.AubDumpAddMmioRegistersList.set(registers); - auto aubCsr = std::make_unique>("", true, *pDevice->executionEnvironment, pDevice->getRootDeviceIndex()); + auto aubCsr = std::make_unique>("", true, *pDevice->executionEnvironment, pDevice->getRootDeviceIndex(), pDevice->getDeviceBitfield()); EXPECT_NE(nullptr, aubCsr); auto stream = std::make_unique(); @@ -885,7 +886,7 @@ HWTEST_F(AubCommandStreamReceiverTests, givenAubCsrWhenAskedForMemoryExpectation uint32_t compareEqual = AubMemDump::CmdServicesMemTraceMemoryCompare::CompareOperationValues::CompareEqual; auto mockStream = std::make_unique(); - MyMockAubCsr myMockCsr(std::string(), true, *pDevice->getExecutionEnvironment(), pDevice->getRootDeviceIndex()); + MyMockAubCsr myMockCsr(std::string(), true, *pDevice->getExecutionEnvironment(), pDevice->getRootDeviceIndex(), pDevice->getDeviceBitfield()); myMockCsr.setupContext(pDevice->commandStreamReceivers[0]->getOsContext()); myMockCsr.stream = mockStream.get(); @@ -899,17 +900,17 @@ HWTEST_F(AubCommandStreamReceiverTests, givenAubCsrWhenAskedForMemoryExpectation } HWTEST_F(AubCommandStreamReceiverTests, givenAubCommandStreamReceiverWhenObtainingPreferredTagPoolSizeThenReturnOne) { - auto aubCsr = std::make_unique>("", true, *pDevice->executionEnvironment, pDevice->getRootDeviceIndex()); + auto aubCsr = std::make_unique>("", true, *pDevice->executionEnvironment, pDevice->getRootDeviceIndex(), pDevice->getDeviceBitfield()); EXPECT_EQ(1u, aubCsr->getPreferredTagPoolSize()); } HWTEST_F(AubCommandStreamReceiverTests, givenAubCommandStreamReceiverWhenSshSizeIsObtainedItEqualsTo64KB) { - auto aubCsr = std::make_unique>("", true, *pDevice->executionEnvironment, pDevice->getRootDeviceIndex()); + auto aubCsr = std::make_unique>("", true, *pDevice->executionEnvironment, pDevice->getRootDeviceIndex(), pDevice->getDeviceBitfield()); EXPECT_EQ(64 * KB, aubCsr->defaultSshSize); } HWTEST_F(AubCommandStreamReceiverTests, givenAubCommandStreamReceiverWhenPhysicalAddressAllocatorIsCreatedThenItIsNotNull) { - MockAubCsr aubCsr("", true, *pDevice->executionEnvironment, pDevice->getRootDeviceIndex()); + MockAubCsr aubCsr("", true, *pDevice->executionEnvironment, pDevice->getRootDeviceIndex(), pDevice->getDeviceBitfield()); std::unique_ptr allocator(aubCsr.createPhysicalAddressAllocator(&hardwareInfo)); ASSERT_NE(nullptr, allocator); } @@ -918,7 +919,7 @@ HWTEST_F(AubCommandStreamReceiverTests, givenGraphicsAllocationWritableWhenDumpA DebugManagerStateRestore dbgRestore; DebugManager.flags.AUBDumpBufferFormat.set("BIN"); - MockAubCsr aubCsr("", true, *pDevice->executionEnvironment, pDevice->getRootDeviceIndex()); + MockAubCsr aubCsr("", true, *pDevice->executionEnvironment, pDevice->getRootDeviceIndex(), pDevice->getDeviceBitfield()); MockOsContext osContext(0, 1, aub_stream::ENGINE_RCS, PreemptionMode::Disabled, false, false, false); aubCsr.setupContext(osContext); @@ -941,7 +942,7 @@ HWTEST_F(AubCommandStreamReceiverTests, givenBcsEngineWhenDumpAllocationCalledTh DebugManagerStateRestore dbgRestore; DebugManager.flags.AUBDumpBufferFormat.set("BIN"); - MockAubCsr aubCsr("", true, *pDevice->executionEnvironment, pDevice->getRootDeviceIndex()); + MockAubCsr aubCsr("", true, *pDevice->executionEnvironment, pDevice->getRootDeviceIndex(), pDevice->getDeviceBitfield()); MockOsContext osContext(0, 1, aub_stream::ENGINE_BCS, PreemptionMode::Disabled, false, false, false); aubCsr.setupContext(osContext); @@ -969,7 +970,7 @@ HWTEST_F(AubCommandStreamReceiverTests, givenCompressedGraphicsAllocationWritabl mockAubCenter->aubManager = std::make_unique(); pDevice->executionEnvironment->rootDeviceEnvironments[0]->aubCenter.reset(mockAubCenter); - MockAubCsr aubCsr("", true, *pDevice->executionEnvironment, pDevice->getRootDeviceIndex()); + MockAubCsr aubCsr("", true, *pDevice->executionEnvironment, pDevice->getRootDeviceIndex(), pDevice->getDeviceBitfield()); MockOsContext osContext(0, 1, aub_stream::ENGINE_RCS, PreemptionMode::Disabled, false, false, false); aubCsr.setupContext(osContext); @@ -991,7 +992,7 @@ HWTEST_F(AubCommandStreamReceiverTests, givenCompressedGraphicsAllocationWritabl HWTEST_F(AubCommandStreamReceiverTests, givenGraphicsAllocationWritableWhenDumpAllocationIsCalledButDumpFormatIsNotSpecifiedThenGraphicsAllocationShouldNotBeDumped) { DebugManagerStateRestore dbgRestore; - MockAubCsr aubCsr("", true, *pDevice->executionEnvironment, pDevice->getRootDeviceIndex()); + MockAubCsr aubCsr("", true, *pDevice->executionEnvironment, pDevice->getRootDeviceIndex(), pDevice->getDeviceBitfield()); MockOsContext osContext(0, 1, aub_stream::ENGINE_RCS, PreemptionMode::Disabled, false, false, false); aubCsr.setupContext(osContext); @@ -1015,7 +1016,7 @@ HWTEST_F(AubCommandStreamReceiverTests, givenGraphicsAllocationNonWritableWhenDu DebugManagerStateRestore dbgRestore; DebugManager.flags.AUBDumpBufferFormat.set("BIN"); - MockAubCsr aubCsr("", true, *pDevice->executionEnvironment, pDevice->getRootDeviceIndex()); + MockAubCsr aubCsr("", true, *pDevice->executionEnvironment, pDevice->getRootDeviceIndex(), pDevice->getDeviceBitfield()); MockOsContext osContext(0, 1, aub_stream::ENGINE_RCS, PreemptionMode::Disabled, false, false, false); aubCsr.setupContext(osContext); @@ -1040,7 +1041,7 @@ HWTEST_F(AubCommandStreamReceiverTests, givenGraphicsAllocationNotDumpableWhenDu DebugManager.flags.AUBDumpAllocsOnEnqueueReadOnly.set(true); DebugManager.flags.AUBDumpBufferFormat.set("BIN"); - MockAubCsr aubCsr("", true, *pDevice->executionEnvironment, pDevice->getRootDeviceIndex()); + MockAubCsr aubCsr("", true, *pDevice->executionEnvironment, pDevice->getRootDeviceIndex(), pDevice->getDeviceBitfield()); MockOsContext osContext(0, 1, aub_stream::ENGINE_RCS, PreemptionMode::Disabled, false, false, false); aubCsr.setupContext(osContext); @@ -1066,7 +1067,7 @@ HWTEST_F(AubCommandStreamReceiverTests, givenGraphicsAllocationDumpableWhenDumpA DebugManager.flags.AUBDumpAllocsOnEnqueueReadOnly.set(true); DebugManager.flags.AUBDumpBufferFormat.set("BIN"); - MockAubCsr aubCsr("", true, *pDevice->executionEnvironment, pDevice->getRootDeviceIndex()); + MockAubCsr aubCsr("", true, *pDevice->executionEnvironment, pDevice->getRootDeviceIndex(), pDevice->getDeviceBitfield()); MockOsContext osContext(0, 1, aub_stream::ENGINE_RCS, PreemptionMode::Disabled, false, false, false); aubCsr.setupContext(osContext); @@ -1135,7 +1136,7 @@ HWTEST_F(AubCommandStreamReceiverTests, givenGraphicsAllocationWhenDumpAllocatio DebugManager.flags.AUBDumpAllocsOnEnqueueSVMMemcpyOnly.set(true); DebugManager.flags.AUBDumpBufferFormat.set("BIN"); - MockAubCsr aubCsr("", true, *pDevice->executionEnvironment, pDevice->getRootDeviceIndex()); + MockAubCsr aubCsr("", true, *pDevice->executionEnvironment, pDevice->getRootDeviceIndex(), pDevice->getDeviceBitfield()); MockOsContext osContext(0, 1, aub_stream::ENGINE_RCS, PreemptionMode::Disabled, false, false, false); aubCsr.setupContext(osContext); @@ -1163,7 +1164,7 @@ HWTEST_F(AubCommandStreamReceiverTests, givenGraphicsAllocationWritableWhenDumpA DebugManagerStateRestore dbgRestore; DebugManager.flags.AUBDumpBufferFormat.set("BIN"); - MockAubCsr aubCsr("", true, *pDevice->executionEnvironment, pDevice->getRootDeviceIndex()); + MockAubCsr aubCsr("", true, *pDevice->executionEnvironment, pDevice->getRootDeviceIndex(), pDevice->getDeviceBitfield()); MockOsContext osContext(0, 1, aub_stream::ENGINE_RCS, PreemptionMode::Disabled, false, false, false); aubCsr.setupContext(osContext); @@ -1196,8 +1197,8 @@ HWTEST_F(SimulatedCsrTest, givenAubCsrTypeWhenCreateCommandStreamReceiverThenPro EXPECT_EQ(nullptr, executionEnvironment.rootDeviceEnvironments[expectedRootDeviceIndex]->aubCenter.get()); EXPECT_FALSE(rootDeviceEnvironment->initAubCenterCalled); - - auto csr = std::make_unique>("", true, executionEnvironment, expectedRootDeviceIndex); + DeviceBitfield deviceBitfield(1); + auto csr = std::make_unique>("", true, executionEnvironment, expectedRootDeviceIndex, deviceBitfield); EXPECT_TRUE(rootDeviceEnvironment->initAubCenterCalled); EXPECT_NE(nullptr, executionEnvironment.rootDeviceEnvironments[expectedRootDeviceIndex]->aubCenter.get()); } diff --git a/opencl/test/unit_test/command_stream/aub_file_stream_tests.cpp b/opencl/test/unit_test/command_stream/aub_file_stream_tests.cpp index c616647480..d4917de6d9 100644 --- a/opencl/test/unit_test/command_stream/aub_file_stream_tests.cpp +++ b/opencl/test/unit_test/command_stream/aub_file_stream_tests.cpp @@ -39,7 +39,7 @@ using ::testing::Return; using AubFileStreamTests = Test; HWTEST_F(AubFileStreamTests, givenAubCommandStreamReceiverWhenInitFileIsCalledWithInvalidFileNameThenFileIsNotOpened) { - auto aubCsr = std::make_unique>("", true, *pDevice->executionEnvironment, pDevice->getRootDeviceIndex()); + auto aubCsr = std::make_unique>("", true, *pDevice->executionEnvironment, pDevice->getRootDeviceIndex(), pDevice->getDeviceBitfield()); std::string invalidFileName = ""; EXPECT_THROW(aubCsr->initFile(invalidFileName), std::exception); @@ -48,7 +48,8 @@ HWTEST_F(AubFileStreamTests, givenAubCommandStreamReceiverWhenInitFileIsCalledWi HWTEST_F(AubFileStreamTests, givenAubCommandStreamReceiverWithoutAubManagerWhenInitFileIsCalledWithInvalidFileNameThenFileIsNotOpened) { MockExecutionEnvironment executionEnvironment(defaultHwInfo.get()); executionEnvironment.initializeMemoryManager(); - auto aubCsr = std::make_unique>("", true, executionEnvironment, 0); + DeviceBitfield deviceBitfield(1); + auto aubCsr = std::make_unique>("", true, executionEnvironment, 0, deviceBitfield); std::string invalidFileName = ""; aubCsr->aubManager = nullptr; @@ -56,7 +57,7 @@ HWTEST_F(AubFileStreamTests, givenAubCommandStreamReceiverWithoutAubManagerWhenI } HWTEST_F(AubFileStreamTests, givenAubCommandStreamReceiverWhenInitFileIsCalledThenFileIsOpenedAndFileNameIsStored) { - auto aubCsr = std::make_unique>("", true, *pDevice->executionEnvironment, pDevice->getRootDeviceIndex()); + auto aubCsr = std::make_unique>("", true, *pDevice->executionEnvironment, pDevice->getRootDeviceIndex(), pDevice->getDeviceBitfield()); std::string fileName = "file_name.aub"; aubCsr->initFile(fileName); @@ -69,7 +70,7 @@ HWTEST_F(AubFileStreamTests, givenAubCommandStreamReceiverWhenInitFileIsCalledTh } HWTEST_F(AubFileStreamTests, givenAubCommandStreamReceiverWhenReopenFileIsCalledThenFileWithSpecifiedNameIsReopened) { - auto aubCsr = std::make_unique>("", true, *pDevice->executionEnvironment, pDevice->getRootDeviceIndex()); + auto aubCsr = std::make_unique>("", true, *pDevice->executionEnvironment, pDevice->getRootDeviceIndex(), pDevice->getDeviceBitfield()); std::string fileName = "file_name.aub"; std::string newFileName = "new_file_name.aub"; @@ -84,7 +85,7 @@ HWTEST_F(AubFileStreamTests, givenAubCommandStreamReceiverWhenReopenFileIsCalled HWTEST_F(AubFileStreamTests, givenAubCommandStreamReceiverWithoutAubManagerWhenInitFileIsCalledThenFileShouldBeInitializedWithHeaderOnce) { auto mockAubFileStream = std::make_unique(); - auto aubCsr = std::make_unique>("", true, *pDevice->executionEnvironment, pDevice->getRootDeviceIndex()); + auto aubCsr = std::make_unique>("", true, *pDevice->executionEnvironment, pDevice->getRootDeviceIndex(), pDevice->getDeviceBitfield()); std::string fileName = "file_name.aub"; aubCsr->aubManager = nullptr; aubCsr->stream = mockAubFileStream.get(); @@ -98,7 +99,7 @@ HWTEST_F(AubFileStreamTests, givenAubCommandStreamReceiverWithoutAubManagerWhenI HWTEST_F(AubFileStreamTests, givenAubCommandStreamReceiverWithAubManagerWhenInitFileIsCalledThenFileShouldBeInitializedOnce) { auto mockAubManager = std::make_unique(); - auto aubCsr = std::make_unique>("", true, *pDevice->executionEnvironment, pDevice->getRootDeviceIndex()); + auto aubCsr = std::make_unique>("", true, *pDevice->executionEnvironment, pDevice->getRootDeviceIndex(), pDevice->getDeviceBitfield()); std::string fileName = "file_name.aub"; aubCsr->aubManager = mockAubManager.get(); @@ -110,7 +111,7 @@ HWTEST_F(AubFileStreamTests, givenAubCommandStreamReceiverWithAubManagerWhenInit HWTEST_F(AubFileStreamTests, givenAubCommandStreamReceiverWithoutAubManagerWhenFileFunctionsAreCalledThenTheyShouldCallTheExpectedAubManagerFunctions) { auto mockAubFileStream = std::make_unique(); - auto aubCsr = std::make_unique>("", true, *pDevice->executionEnvironment, pDevice->getRootDeviceIndex()); + auto aubCsr = std::make_unique>("", true, *pDevice->executionEnvironment, pDevice->getRootDeviceIndex(), pDevice->getDeviceBitfield()); std::string fileName = "file_name.aub"; aubCsr->aubManager = nullptr; aubCsr->stream = mockAubFileStream.get(); @@ -132,7 +133,7 @@ HWTEST_F(AubFileStreamTests, givenAubCommandStreamReceiverWithoutAubManagerWhenF HWTEST_F(AubFileStreamTests, givenAubCommandStreamReceiverWithAubManagerWhenFileFunctionsAreCalledThenTheyShouldCallTheExpectedAubManagerFunctions) { auto mockAubManager = std::make_unique(); - auto aubCsr = std::make_unique>("", true, *pDevice->executionEnvironment, pDevice->getRootDeviceIndex()); + auto aubCsr = std::make_unique>("", true, *pDevice->executionEnvironment, pDevice->getRootDeviceIndex(), pDevice->getDeviceBitfield()); std::string fileName = "file_name.aub"; aubCsr->aubManager = mockAubManager.get(); @@ -153,7 +154,7 @@ HWTEST_F(AubFileStreamTests, givenAubCommandStreamReceiverWithAubManagerWhenFile HWTEST_F(AubFileStreamTests, givenAubCommandStreamReceiverWhenOpenFileIsCalledThenFileStreamShouldBeLocked) { auto mockAubFileStream = std::make_unique(); - auto aubCsr = std::make_unique>("", true, *pDevice->executionEnvironment, pDevice->getRootDeviceIndex()); + auto aubCsr = std::make_unique>("", true, *pDevice->executionEnvironment, pDevice->getRootDeviceIndex(), pDevice->getDeviceBitfield()); std::string fileName = "file_name.aub"; aubCsr->stream = mockAubFileStream.get(); @@ -164,7 +165,7 @@ HWTEST_F(AubFileStreamTests, givenAubCommandStreamReceiverWhenOpenFileIsCalledTh HWTEST_F(AubFileStreamTests, givenAubCommandStreamReceiverWhenReopenFileIsCalledThenFileStreamShouldBeLocked) { auto mockAubFileStream = std::make_unique(); - auto aubCsr = std::make_unique>("", true, *pDevice->executionEnvironment, pDevice->getRootDeviceIndex()); + auto aubCsr = std::make_unique>("", true, *pDevice->executionEnvironment, pDevice->getRootDeviceIndex(), pDevice->getDeviceBitfield()); std::string fileName = "file_name.aub"; aubCsr->stream = mockAubFileStream.get(); @@ -298,7 +299,7 @@ HWTEST_F(AubFileStreamTests, givenAubCommandStreamReceiverWhenCallingAddAubComme } HWTEST_F(AubFileStreamTests, givenAubCommandStreamReceiverWithAubManagerWhenCallingAddAubCommentThenCallAddCommentOnAubManager) { - MockAubCsr aubCsr("", true, *pDevice->executionEnvironment, pDevice->getRootDeviceIndex()); + MockAubCsr aubCsr("", true, *pDevice->executionEnvironment, pDevice->getRootDeviceIndex(), pDevice->getDeviceBitfield()); MockOsContext osContext(0, 1, aub_stream::ENGINE_RCS, PreemptionMode::Disabled, false, false, false); aubCsr.setupContext(osContext); @@ -380,7 +381,7 @@ HWTEST_F(AubFileStreamTests, givenNoNewTaskSinceLastPollWhenDeletingAubCsrThenDo } HWTEST_F(AubFileStreamTests, givenNewTasksAndHardwareContextPresentWhenCallingPollForCompletionThenCallPollForCompletion) { - MockAubCsr aubCsr("", true, *pDevice->executionEnvironment, pDevice->getRootDeviceIndex()); + MockAubCsr aubCsr("", true, *pDevice->executionEnvironment, pDevice->getRootDeviceIndex(), pDevice->getDeviceBitfield()); MockOsContext osContext(0, 1, aub_stream::ENGINE_RCS, PreemptionMode::Disabled, false, false, false); aubCsr.setupContext(osContext); @@ -395,7 +396,7 @@ HWTEST_F(AubFileStreamTests, givenNewTasksAndHardwareContextPresentWhenCallingPo } HWTEST_F(AubFileStreamTests, givenNoNewTasksAndHardwareContextPresentWhenCallingPollForCompletionThenDontCallPollForCompletion) { - MockAubCsr aubCsr("", true, *pDevice->executionEnvironment, pDevice->getRootDeviceIndex()); + MockAubCsr aubCsr("", true, *pDevice->executionEnvironment, pDevice->getRootDeviceIndex(), pDevice->getDeviceBitfield()); MockOsContext osContext(0, 1, aub_stream::ENGINE_RCS, PreemptionMode::Disabled, false, false, false); aubCsr.setupContext(osContext); @@ -492,7 +493,7 @@ HWTEST_F(AubFileStreamTests, givenAubCommandStreamReceiverWithHardwareContextInS DebugManagerStateRestore stateRestore; AubSubCaptureCommon aubSubCaptureCommon; auto aubSubCaptureManagerMock = new AubSubCaptureManagerMock("", aubSubCaptureCommon); - MockAubCsr aubCsr("", true, *pDevice->executionEnvironment, pDevice->getRootDeviceIndex()); + MockAubCsr aubCsr("", true, *pDevice->executionEnvironment, pDevice->getRootDeviceIndex(), pDevice->getDeviceBitfield()); MockOsContext osContext(0, 1, aub_stream::ENGINE_RCS, PreemptionMode::Disabled, false, false, false); aubCsr.setupContext(osContext); @@ -517,7 +518,7 @@ HWTEST_F(AubFileStreamTests, givenAubCommandStreamReceiverWithHardwareContextInS DebugManagerStateRestore stateRestore; AubSubCaptureCommon aubSubCaptureCommon; auto aubSubCaptureManagerMock = new AubSubCaptureManagerMock("", aubSubCaptureCommon); - MockAubCsr aubCsr("", true, *pDevice->executionEnvironment, pDevice->getRootDeviceIndex()); + MockAubCsr aubCsr("", true, *pDevice->executionEnvironment, pDevice->getRootDeviceIndex(), pDevice->getDeviceBitfield()); MockOsContext osContext(0, 1, aub_stream::ENGINE_RCS, PreemptionMode::Disabled, false, false, false); aubCsr.setupContext(osContext); @@ -569,7 +570,7 @@ HWTEST_F(AubFileStreamTests, givenAubCommandStreamReceiverWhenExpectMemoryNotEqu } HWTEST_F(AubFileStreamTests, givenAubCommandStreamReceiverWhenFlushIsCalledThenItShouldCallTheExpectedHwContextFunctions) { - MockAubCsr aubCsr("", true, *pDevice->executionEnvironment, pDevice->getRootDeviceIndex()); + MockAubCsr aubCsr("", true, *pDevice->executionEnvironment, pDevice->getRootDeviceIndex(), pDevice->getDeviceBitfield()); MockOsContext osContext(0, 1, aub_stream::ENGINE_RCS, PreemptionMode::Disabled, false, false, false); aubCsr.setupContext(osContext); @@ -594,7 +595,7 @@ HWTEST_F(AubFileStreamTests, givenAubCommandStreamReceiverWhenFlushIsCalledThenI } HWTEST_F(AubFileStreamTests, givenAubCommandStreamReceiverWhenFlushIsCalledWithZeroSizedBufferThenSubmitIsNotCalledOnHwContext) { - MockAubCsr aubCsr("", true, *pDevice->executionEnvironment, pDevice->getRootDeviceIndex()); + MockAubCsr aubCsr("", true, *pDevice->executionEnvironment, pDevice->getRootDeviceIndex(), pDevice->getDeviceBitfield()); MockOsContext osContext(0, 1, aub_stream::ENGINE_RCS, PreemptionMode::Disabled, false, false, false); aubCsr.setupContext(osContext); @@ -615,7 +616,7 @@ HWTEST_F(AubFileStreamTests, givenAubCommandStreamReceiverWhenFlushIsCalledWithZ } HWTEST_F(AubFileStreamTests, givenAubCommandStreamReceiverWhenMakeResidentIsCalledThenItShouldCallTheExpectedHwContextFunctions) { - MockAubCsr aubCsr("", true, *pDevice->executionEnvironment, pDevice->getRootDeviceIndex()); + MockAubCsr aubCsr("", true, *pDevice->executionEnvironment, pDevice->getRootDeviceIndex(), pDevice->getDeviceBitfield()); MockOsContext osContext(0, 1, aub_stream::ENGINE_RCS, PreemptionMode::Disabled, false, false, false); aubCsr.setupContext(osContext); @@ -628,7 +629,7 @@ HWTEST_F(AubFileStreamTests, givenAubCommandStreamReceiverWhenMakeResidentIsCall } HWTEST_F(AubFileStreamTests, givenAubCommandStreamReceiverWhenExpectMemoryEqualIsCalledThenItShouldCallTheExpectedHwContextFunctions) { - MockAubCsr aubCsr("", true, *pDevice->executionEnvironment, pDevice->getRootDeviceIndex()); + MockAubCsr aubCsr("", true, *pDevice->executionEnvironment, pDevice->getRootDeviceIndex(), pDevice->getDeviceBitfield()); MockOsContext osContext(0, 1, aub_stream::ENGINE_RCS, PreemptionMode::Disabled, false, false, false); aubCsr.setupContext(osContext); @@ -641,7 +642,7 @@ HWTEST_F(AubFileStreamTests, givenAubCommandStreamReceiverWhenExpectMemoryEqualI } HWTEST_F(AubFileStreamTests, givenAubCommandStreamReceiverWhenExpectMemoryNotEqualIsCalledThenItShouldCallTheExpectedHwContextFunctions) { - MockAubCsr aubCsr("", true, *pDevice->executionEnvironment, pDevice->getRootDeviceIndex()); + MockAubCsr aubCsr("", true, *pDevice->executionEnvironment, pDevice->getRootDeviceIndex(), pDevice->getDeviceBitfield()); MockOsContext osContext(0, 1, aub_stream::ENGINE_RCS, PreemptionMode::Disabled, false, false, false); aubCsr.setupContext(osContext); @@ -670,7 +671,7 @@ HWTEST_F(AubFileStreamTests, givenAubCommandStreamReceiverWhenFlushIsCalledThenF HWTEST_F(AubFileStreamTests, givenAubCommandStreamReceiverWhenExpectMemoryIsCalledThenPageWalkIsCallingStreamsExpectMemory) { auto mockAubFileStream = std::make_unique(); - auto aubCsr = std::make_unique>("", true, *pDevice->executionEnvironment, pDevice->getRootDeviceIndex()); + auto aubCsr = std::make_unique>("", true, *pDevice->executionEnvironment, pDevice->getRootDeviceIndex(), pDevice->getDeviceBitfield()); aubCsr->setupContext(pDevice->commandStreamReceivers[0]->getOsContext()); aubCsr->stream = mockAubFileStream.get(); @@ -690,7 +691,7 @@ HWTEST_F(AubFileStreamTests, givenAubCommandStreamReceiverWhenExpectMemoryIsCall HWTEST_F(AubFileStreamTests, givenAubCommandStreamReceiverWithoutAubManagerWhenExpectMMIOIsCalledThenTheCorrectFunctionIsCalledFromAubFileStream) { std::string fileName = "file_name.aub"; auto mockAubFileStream = std::make_unique(); - auto aubCsr = std::make_unique>(fileName.c_str(), true, *pDevice->executionEnvironment, pDevice->getRootDeviceIndex()); + auto aubCsr = std::make_unique>(fileName.c_str(), true, *pDevice->executionEnvironment, pDevice->getRootDeviceIndex(), pDevice->getDeviceBitfield()); aubCsr->aubManager = nullptr; aubCsr->stream = mockAubFileStream.get(); @@ -707,7 +708,7 @@ HWTEST_F(AubFileStreamTests, givenAubCommandStreamReceiverWithAubManagerWhenExpe std::string fileName = "file_name.aub"; auto mockAubManager = std::make_unique(); auto mockAubFileStream = std::make_unique(); - auto aubCsr = std::make_unique>(fileName.c_str(), true, *pDevice->executionEnvironment, pDevice->getRootDeviceIndex()); + auto aubCsr = std::make_unique>(fileName.c_str(), true, *pDevice->executionEnvironment, pDevice->getRootDeviceIndex(), pDevice->getDeviceBitfield()); aubCsr->stream = mockAubFileStream.get(); aubCsr->setupContext(pDevice->commandStreamReceivers[0]->getOsContext()); diff --git a/opencl/test/unit_test/command_stream/command_stream_receiver_flush_task_1_tests.cpp b/opencl/test/unit_test/command_stream/command_stream_receiver_flush_task_1_tests.cpp index 05f69f4b84..2ecd774c44 100644 --- a/opencl/test/unit_test/command_stream/command_stream_receiver_flush_task_1_tests.cpp +++ b/opencl/test/unit_test/command_stream/command_stream_receiver_flush_task_1_tests.cpp @@ -211,7 +211,7 @@ HWTEST_F(CommandStreamReceiverFlushTaskTests, givenCsrInBatchingModeAndMidThread } HWTEST_F(CommandStreamReceiverFlushTaskTests, givenCsrInDefaultModeAndMidThreadPreemptionWhenFlushTaskIsCalledThenSipKernelIsMadeResident) { - auto mockCsr = new MockCsrHw2(*pDevice->executionEnvironment, pDevice->getRootDeviceIndex()); + auto mockCsr = new MockCsrHw2(*pDevice->executionEnvironment, pDevice->getRootDeviceIndex(), pDevice->getDeviceBitfield()); pDevice->resetCommandStreamReceiver(mockCsr); CommandQueueHw commandQueue(nullptr, pClDevice, 0, false); @@ -258,7 +258,7 @@ HWCMDTEST_F(IGFX_GEN8_CORE, CommandStreamReceiverFlushTaskTests, givenDeviceWith DebugManagerStateRestore dbgRestore; DebugManager.flags.ForcePreemptionMode.set(static_cast(PreemptionMode::ThreadGroup)); - auto commandStreamReceiver = new MockCsrHw(*pDevice->executionEnvironment, pDevice->getRootDeviceIndex()); + auto commandStreamReceiver = new MockCsrHw(*pDevice->executionEnvironment, pDevice->getRootDeviceIndex(), pDevice->getDeviceBitfield()); pDevice->setPreemptionMode(PreemptionMode::ThreadGroup); pDevice->resetCommandStreamReceiver(commandStreamReceiver); @@ -900,8 +900,10 @@ HWTEST_F(CommandStreamReceiverFlushTaskTests, GivenEnoughMemoryOnlyForPreambleAn template struct CommandStreamReceiverHwLog : public UltCommandStreamReceiver { - CommandStreamReceiverHwLog(ExecutionEnvironment &executionEnvironment, uint32_t rootDeviceIndex) : UltCommandStreamReceiver(executionEnvironment, rootDeviceIndex), - flushCount(0) { + CommandStreamReceiverHwLog(ExecutionEnvironment &executionEnvironment, + uint32_t rootDeviceIndex, DeviceBitfield deviceBitfield) + : UltCommandStreamReceiver(executionEnvironment, rootDeviceIndex, deviceBitfield), + flushCount(0) { } bool flush(BatchBuffer &batchBuffer, ResidencyContainer &allocationsForResidency) override { @@ -913,7 +915,7 @@ struct CommandStreamReceiverHwLog : public UltCommandStreamReceiver }; HWTEST_F(CommandStreamReceiverFlushTaskTests, GivenBothCsWhenFlushingTaskThenFlushOnce) { - CommandStreamReceiverHwLog commandStreamReceiver(*pDevice->executionEnvironment, pDevice->getRootDeviceIndex()); + CommandStreamReceiverHwLog commandStreamReceiver(*pDevice->executionEnvironment, pDevice->getRootDeviceIndex(), pDevice->getDeviceBitfield()); commandStreamReceiver.setupContext(*pDevice->getDefaultEngine().osContext); commandStreamReceiver.initializeTagAllocation(); commandStreamReceiver.createPreemptionAllocation(); @@ -1008,7 +1010,7 @@ HWTEST_F(CommandStreamReceiverCQFlushTaskTests, WhenGettingCsThenReturnCsWithEno HWCMDTEST_F(IGFX_GEN8_CORE, CommandStreamReceiverFlushTaskTests, GivenBlockingWhenFlushingTaskThenAddPipeControlOnlyToTaskCs) { typedef typename FamilyType::PIPE_CONTROL PIPE_CONTROL; CommandQueueHw commandQueue(nullptr, pClDevice, 0, false); - auto commandStreamReceiver = new MockCsrHw(*pDevice->executionEnvironment, pDevice->getRootDeviceIndex()); + auto commandStreamReceiver = new MockCsrHw(*pDevice->executionEnvironment, pDevice->getRootDeviceIndex(), pDevice->getDeviceBitfield()); pDevice->resetCommandStreamReceiver(commandStreamReceiver); // Configure the CSR to not need to submit any state or commands @@ -1150,7 +1152,7 @@ HWTEST_F(CommandStreamReceiverFlushTaskTests, GivenBlockedKernelRequiringDCFlush } HWTEST_F(CommandStreamReceiverFlushTaskTests, givenDispatchFlagsWhenCallFlushTaskThenThreadArbitrationPolicyIsSetProperly) { - auto mockCsr = new MockCsrHw2(*pDevice->executionEnvironment, pDevice->getRootDeviceIndex()); + auto mockCsr = new MockCsrHw2(*pDevice->executionEnvironment, pDevice->getRootDeviceIndex(), pDevice->getDeviceBitfield()); pDevice->resetCommandStreamReceiver(mockCsr); CommandQueueHw commandQueue(nullptr, pClDevice, 0, false); diff --git a/opencl/test/unit_test/command_stream/command_stream_receiver_flush_task_2_tests.cpp b/opencl/test/unit_test/command_stream/command_stream_receiver_flush_task_2_tests.cpp index 6228d97925..0c23560398 100644 --- a/opencl/test/unit_test/command_stream/command_stream_receiver_flush_task_2_tests.cpp +++ b/opencl/test/unit_test/command_stream/command_stream_receiver_flush_task_2_tests.cpp @@ -358,7 +358,7 @@ HWCMDTEST_F(IGFX_GEN8_CORE, CommandStreamReceiverFlushTaskTests, } HWTEST_F(CommandStreamReceiverFlushTaskTests, givenDefaultCommandStreamReceiverThenRoundRobinPolicyIsSelected) { - MockCsrHw commandStreamReceiver(*pDevice->executionEnvironment, pDevice->getRootDeviceIndex()); + MockCsrHw commandStreamReceiver(*pDevice->executionEnvironment, pDevice->getRootDeviceIndex(), pDevice->getDeviceBitfield()); EXPECT_EQ(HwHelperHw::get().getDefaultThreadArbitrationPolicy(), commandStreamReceiver.peekThreadArbitrationPolicy()); } @@ -368,7 +368,7 @@ HWTEST_F(CommandStreamReceiverFlushTaskTests, GivenKernelWithSlmWhenPreviousSLML MockContext ctx(pClDevice); MockKernelWithInternals kernel(*pClDevice); CommandQueueHw commandQueue(&ctx, pClDevice, 0, false); - auto commandStreamReceiver = new MockCsrHw(*pDevice->executionEnvironment, pDevice->getRootDeviceIndex()); + auto commandStreamReceiver = new MockCsrHw(*pDevice->executionEnvironment, pDevice->getRootDeviceIndex(), pDevice->getDeviceBitfield()); pDevice->resetCommandStreamReceiver(commandStreamReceiver); auto &commandStreamCSR = commandStreamReceiver->getCS(); @@ -394,7 +394,7 @@ HWTEST_F(CommandStreamReceiverFlushTaskTests, GivenKernelWithSlmWhenPreviousSLML HWTEST_F(CommandStreamReceiverFlushTaskTests, WhenCreatingCommandStreamReceiverHwThenValidPointerIsReturned) { DebugManagerStateRestore dbgRestorer; - auto csrHw = CommandStreamReceiverHw::create(*pDevice->executionEnvironment, pDevice->getRootDeviceIndex()); + auto csrHw = CommandStreamReceiverHw::create(*pDevice->executionEnvironment, pDevice->getRootDeviceIndex(), pDevice->getDeviceBitfield()); EXPECT_NE(nullptr, csrHw); GmmPageTableMngr *ptm = csrHw->createPageTableManager(); @@ -405,14 +405,14 @@ HWTEST_F(CommandStreamReceiverFlushTaskTests, WhenCreatingCommandStreamReceiverH int32_t GetCsr = DebugManager.flags.SetCommandStreamReceiver.get(); EXPECT_EQ(0, GetCsr); - auto csr = NEO::createCommandStream(*pDevice->executionEnvironment, pDevice->getRootDeviceIndex()); + auto csr = NEO::createCommandStream(*pDevice->executionEnvironment, pDevice->getRootDeviceIndex(), pDevice->getDeviceBitfield()); EXPECT_NE(nullptr, csr); delete csr; DebugManager.flags.SetCommandStreamReceiver.set(0); } HWTEST_F(CommandStreamReceiverFlushTaskTests, WhenFlushingThenScratchAllocationIsReused) { - auto commandStreamReceiver = new MockCsrHw(*pDevice->executionEnvironment, pDevice->getRootDeviceIndex()); + auto commandStreamReceiver = new MockCsrHw(*pDevice->executionEnvironment, pDevice->getRootDeviceIndex(), pDevice->getDeviceBitfield()); pDevice->resetCommandStreamReceiver(commandStreamReceiver); commandStreamReceiver->setRequiredScratchSizes(1024, 0); // whatever > 0 @@ -450,7 +450,7 @@ HWTEST_F(CommandStreamReceiverFlushTaskTests, WhenFlushingThenScratchAllocationI HWTEST_F(CommandStreamReceiverFlushTaskTests, givenCommandStreamReceiverWhenFenceAllocationIsRequiredAndFlushTaskIsCalledThenFenceAllocationIsMadeResident) { RAIIHwHelperFactory> hwHelperBackup{pDevice->getHardwareInfo().platform.eRenderCoreFamily}; - auto commandStreamReceiver = new MockCsrHw(*pDevice->executionEnvironment, pDevice->getRootDeviceIndex()); + auto commandStreamReceiver = new MockCsrHw(*pDevice->executionEnvironment, pDevice->getRootDeviceIndex(), pDevice->getDeviceBitfield()); pDevice->resetCommandStreamReceiver(commandStreamReceiver); auto globalFenceAllocation = commandStreamReceiver->globalFenceAllocation; @@ -502,7 +502,7 @@ struct MockScratchController : public ScratchSpaceController { }; HWTEST_F(CommandStreamReceiverFlushTaskTests, whenScratchIsRequiredForFirstFlushAndPrivateScratchForSecondFlushThenHandleResidencyProperly) { - auto commandStreamReceiver = new MockCsrHw(*pDevice->executionEnvironment, pDevice->getRootDeviceIndex()); + auto commandStreamReceiver = new MockCsrHw(*pDevice->executionEnvironment, pDevice->getRootDeviceIndex(), pDevice->getDeviceBitfield()); auto scratchController = new MockScratchController(pDevice->getRootDeviceIndex(), *pDevice->executionEnvironment, *commandStreamReceiver->getInternalAllocationStorage()); commandStreamReceiver->scratchSpaceController.reset(scratchController); pDevice->resetCommandStreamReceiver(commandStreamReceiver); @@ -537,7 +537,7 @@ HWTEST_F(CommandStreamReceiverFlushTaskTests, whenScratchIsRequiredForFirstFlush } HWTEST_F(CommandStreamReceiverFlushTaskTests, whenPrivateScratchIsRequiredForFirstFlushAndCommonScratchForSecondFlushThenHandleResidencyProperly) { - auto commandStreamReceiver = new MockCsrHw(*pDevice->executionEnvironment, pDevice->getRootDeviceIndex()); + auto commandStreamReceiver = new MockCsrHw(*pDevice->executionEnvironment, pDevice->getRootDeviceIndex(), pDevice->getDeviceBitfield()); auto scratchController = new MockScratchController(pDevice->getRootDeviceIndex(), *pDevice->executionEnvironment, *commandStreamReceiver->getInternalAllocationStorage()); commandStreamReceiver->scratchSpaceController.reset(scratchController); pDevice->resetCommandStreamReceiver(commandStreamReceiver); @@ -579,7 +579,7 @@ HWCMDTEST_F(IGFX_GEN8_CORE, CommandStreamReceiverFlushTaskTests, givenTwoConsecu MockContext ctx(pClDevice); MockKernelWithInternals kernel(*pClDevice); CommandQueueHw commandQueue(&ctx, pClDevice, 0, false); - auto commandStreamReceiver = new MockCsrHw(*pDevice->executionEnvironment, pDevice->getRootDeviceIndex()); + auto commandStreamReceiver = new MockCsrHw(*pDevice->executionEnvironment, pDevice->getRootDeviceIndex(), pDevice->getDeviceBitfield()); pDevice->resetCommandStreamReceiver(commandStreamReceiver); size_t GWS = 1; @@ -694,7 +694,7 @@ HWCMDTEST_F(IGFX_GEN8_CORE, CommandStreamReceiverFlushTaskTests, givenNDRangeKer MockContext ctx(pClDevice); MockKernelWithInternals kernel(*pClDevice); CommandQueueHw commandQueue(&ctx, pClDevice, 0, false); - auto commandStreamReceiver = new MockCsrHw(*pDevice->executionEnvironment, pDevice->getRootDeviceIndex()); + auto commandStreamReceiver = new MockCsrHw(*pDevice->executionEnvironment, pDevice->getRootDeviceIndex(), pDevice->getDeviceBitfield()); pDevice->resetCommandStreamReceiver(commandStreamReceiver); size_t GWS = 1; @@ -811,7 +811,7 @@ HWTEST_F(CommandStreamReceiverFlushTaskTests, GivenForced32BitAllocationsModeSto DebugManagerStateRestore dbgRestorer; DebugManager.flags.Force32bitAddressing.set(true); - auto commandStreamReceiver = new MockCsrHw(*pDevice->executionEnvironment, pDevice->getRootDeviceIndex()); + auto commandStreamReceiver = new MockCsrHw(*pDevice->executionEnvironment, pDevice->getRootDeviceIndex(), pDevice->getDeviceBitfield()); pDevice->getMemoryManager()->setForce32BitAllocations(true); @@ -845,7 +845,7 @@ HWTEST_F(CommandStreamReceiverFlushTaskTests, GivenForced32BitAllocationsModeSto DebugManagerStateRestore dbgRestorer; DebugManager.flags.Force32bitAddressing.set(true); - auto commandStreamReceiver = new MockCsrHw(*pDevice->executionEnvironment, pDevice->getRootDeviceIndex()); + auto commandStreamReceiver = new MockCsrHw(*pDevice->executionEnvironment, pDevice->getRootDeviceIndex(), pDevice->getDeviceBitfield()); pDevice->getMemoryManager()->setForce32BitAllocations(true); @@ -1128,7 +1128,7 @@ HWCMDTEST_F(IGFX_GEN8_CORE, CommandStreamReceiverFlushTaskTests, givenCsrInNonDi CommandQueueHw commandQueue(nullptr, pClDevice, 0, false); auto &commandStream = commandQueue.getCS(4096u); - auto mockCsr = new MockCsrHw2(*pDevice->executionEnvironment, pDevice->getRootDeviceIndex()); + auto mockCsr = new MockCsrHw2(*pDevice->executionEnvironment, pDevice->getRootDeviceIndex(), pDevice->getDeviceBitfield()); pDevice->resetCommandStreamReceiver(mockCsr); configureCSRtoNonDirtyState(false); @@ -1152,7 +1152,7 @@ HWCMDTEST_F(IGFX_GEN8_CORE, CommandStreamReceiverFlushTaskTests, givenCsrInNonDi CommandQueueHw commandQueue(nullptr, pClDevice, 0, false); auto &commandStream = commandQueue.getCS(4096u); - auto mockCsr = new MockCsrHw2(*pDevice->executionEnvironment, pDevice->getRootDeviceIndex()); + auto mockCsr = new MockCsrHw2(*pDevice->executionEnvironment, pDevice->getRootDeviceIndex(), pDevice->getDeviceBitfield()); pDevice->resetCommandStreamReceiver(mockCsr); mockCsr->overrideDispatchPolicy(DispatchMode::BatchedDispatch); diff --git a/opencl/test/unit_test/command_stream/command_stream_receiver_flush_task_3_tests.cpp b/opencl/test/unit_test/command_stream/command_stream_receiver_flush_task_3_tests.cpp index c995fbd541..f3527989b6 100644 --- a/opencl/test/unit_test/command_stream/command_stream_receiver_flush_task_3_tests.cpp +++ b/opencl/test/unit_test/command_stream/command_stream_receiver_flush_task_3_tests.cpp @@ -37,7 +37,7 @@ HWTEST_F(CommandStreamReceiverFlushTaskTests, givenCsrInBatchingModeWhenFlushTas CommandQueueHw commandQueue(nullptr, pClDevice, 0, false); auto &commandStream = commandQueue.getCS(4096u); - auto mockCsr = new MockCsrHw2(*pDevice->executionEnvironment, pDevice->getRootDeviceIndex()); + auto mockCsr = new MockCsrHw2(*pDevice->executionEnvironment, pDevice->getRootDeviceIndex(), pDevice->getDeviceBitfield()); pDevice->resetCommandStreamReceiver(mockCsr); mockCsr->overrideDispatchPolicy(DispatchMode::BatchedDispatch); @@ -97,7 +97,7 @@ HWTEST_F(CommandStreamReceiverFlushTaskTests, givenCsrInBatchingModeAndTwoRecord CommandQueueHw commandQueue(nullptr, pClDevice, 0, false); auto &commandStream = commandQueue.getCS(4096u); - auto mockCsr = new MockCsrHw2(*pDevice->executionEnvironment, pDevice->getRootDeviceIndex()); + auto mockCsr = new MockCsrHw2(*pDevice->executionEnvironment, pDevice->getRootDeviceIndex(), pDevice->getDeviceBitfield()); pDevice->resetCommandStreamReceiver(mockCsr); mockCsr->useNewResourceImplicitFlush = false; mockCsr->useGpuIdleImplicitFlush = false; @@ -152,7 +152,7 @@ HWTEST_F(CommandStreamReceiverFlushTaskTests, givenCsrInBatchingModeAndThreeReco CommandQueueHw commandQueue(nullptr, pClDevice, 0, false); auto &commandStream = commandQueue.getCS(4096u); - auto mockCsr = new MockCsrHw2(*pDevice->executionEnvironment, pDevice->getRootDeviceIndex()); + auto mockCsr = new MockCsrHw2(*pDevice->executionEnvironment, pDevice->getRootDeviceIndex(), pDevice->getDeviceBitfield()); pDevice->resetCommandStreamReceiver(mockCsr); mockCsr->useNewResourceImplicitFlush = false; mockCsr->useGpuIdleImplicitFlush = false; @@ -217,7 +217,7 @@ HWTEST_F(CommandStreamReceiverFlushTaskTests, givenCsrInBatchingModeAndThreeReco CommandQueueHw commandQueue(nullptr, pClDevice, 0, false); auto &commandStream = commandQueue.getCS(4096u); - auto mockCsr = new MockCsrHw2(*pDevice->executionEnvironment, pDevice->getRootDeviceIndex()); + auto mockCsr = new MockCsrHw2(*pDevice->executionEnvironment, pDevice->getRootDeviceIndex(), pDevice->getDeviceBitfield()); pDevice->resetCommandStreamReceiver(mockCsr); mockCsr->useNewResourceImplicitFlush = false; mockCsr->useGpuIdleImplicitFlush = false; @@ -286,7 +286,7 @@ HWTEST_F(CommandStreamReceiverFlushTaskTests, givenCsrInBatchingModeWhenFlushTas auto initialBase = commandStream.getCpuBase(); auto initialUsed = commandStream.getUsed(); - auto mockCsr = new MockCsrHw2(*pDevice->executionEnvironment, pDevice->getRootDeviceIndex()); + auto mockCsr = new MockCsrHw2(*pDevice->executionEnvironment, pDevice->getRootDeviceIndex(), pDevice->getDeviceBitfield()); pDevice->resetCommandStreamReceiver(mockCsr); mockCsr->useNewResourceImplicitFlush = false; mockCsr->useGpuIdleImplicitFlush = false; @@ -360,7 +360,7 @@ HWCMDTEST_F(IGFX_GEN8_CORE, CommandStreamReceiverFlushTaskTests, givenCsrInBatch CommandQueueHw commandQueue(nullptr, pClDevice, 0, false); auto &commandStream = commandQueue.getCS(4096u); - auto mockCsr = new MockCsrHw2(*pDevice->executionEnvironment, pDevice->getRootDeviceIndex()); + auto mockCsr = new MockCsrHw2(*pDevice->executionEnvironment, pDevice->getRootDeviceIndex(), pDevice->getDeviceBitfield()); pDevice->resetCommandStreamReceiver(mockCsr); mockCsr->useNewResourceImplicitFlush = false; mockCsr->useGpuIdleImplicitFlush = false; @@ -431,7 +431,7 @@ HWCMDTEST_F(IGFX_GEN8_CORE, CommandStreamReceiverFlushTaskTests, givenCsrInBatch HWTEST_F(CommandStreamReceiverFlushTaskTests, givenCsrCreatedWithDedicatedDebugFlagWhenItIsCreatedThenItHasProperDispatchMode) { DebugManagerStateRestore stateRestore; DebugManager.flags.CsrDispatchMode.set(static_cast(DispatchMode::AdaptiveDispatch)); - std::unique_ptr> mockCsr(new MockCsrHw2(*pDevice->executionEnvironment, pDevice->getRootDeviceIndex())); + std::unique_ptr> mockCsr(new MockCsrHw2(*pDevice->executionEnvironment, pDevice->getRootDeviceIndex(), pDevice->getDeviceBitfield())); EXPECT_EQ(DispatchMode::AdaptiveDispatch, mockCsr->dispatchMode); } @@ -439,7 +439,7 @@ HWTEST_F(CommandStreamReceiverFlushTaskTests, givenCsrInBatchingModeWhenBlocking CommandQueueHw commandQueue(nullptr, pClDevice, 0, false); auto &commandStream = commandQueue.getCS(4096u); - auto mockCsr = new MockCsrHw2(*pDevice->executionEnvironment, pDevice->getRootDeviceIndex()); + auto mockCsr = new MockCsrHw2(*pDevice->executionEnvironment, pDevice->getRootDeviceIndex(), pDevice->getDeviceBitfield()); pDevice->resetCommandStreamReceiver(mockCsr); mockCsr->useNewResourceImplicitFlush = false; mockCsr->useGpuIdleImplicitFlush = false; @@ -468,7 +468,7 @@ HWTEST_F(CommandStreamReceiverFlushTaskTests, givenCsrInBatchingModeWhenBlocking } HWTEST_F(CommandStreamReceiverFlushTaskTests, givenBufferToFlushWhenFlushTaskCalledThenUpdateFlushStamp) { - auto mockCsr = new MockCsrHw2(*pDevice->executionEnvironment, pDevice->getRootDeviceIndex()); + auto mockCsr = new MockCsrHw2(*pDevice->executionEnvironment, pDevice->getRootDeviceIndex(), pDevice->getDeviceBitfield()); pDevice->resetCommandStreamReceiver(mockCsr); commandStream.getSpace(1); @@ -481,7 +481,7 @@ HWTEST_F(CommandStreamReceiverFlushTaskTests, givenBufferToFlushWhenFlushTaskCal } HWCMDTEST_F(IGFX_GEN8_CORE, CommandStreamReceiverFlushTaskTests, givenNothingToFlushWhenFlushTaskCalledThenDontFlushStamp) { - auto mockCsr = new MockCsrHw2(*pDevice->executionEnvironment, pDevice->getRootDeviceIndex()); + auto mockCsr = new MockCsrHw2(*pDevice->executionEnvironment, pDevice->getRootDeviceIndex(), pDevice->getDeviceBitfield()); pDevice->resetCommandStreamReceiver(mockCsr); configureCSRtoNonDirtyState(false); @@ -498,7 +498,7 @@ HWTEST_F(CommandStreamReceiverFlushTaskTests, givenCsrInBatchingModeWhenFlushTas CommandQueueHw commandQueue(nullptr, pClDevice, 0, false); auto &commandStream = commandQueue.getCS(4096u); - auto mockCsr = new MockCsrHw2(*pDevice->executionEnvironment, pDevice->getRootDeviceIndex()); + auto mockCsr = new MockCsrHw2(*pDevice->executionEnvironment, pDevice->getRootDeviceIndex(), pDevice->getDeviceBitfield()); pDevice->resetCommandStreamReceiver(mockCsr); mockCsr->useNewResourceImplicitFlush = false; mockCsr->useGpuIdleImplicitFlush = false; @@ -609,7 +609,7 @@ HWTEST_F(CommandStreamReceiverFlushTaskTests, givenCsrInBatchingModeWhenWaitForT CommandQueueHw commandQueue(nullptr, pClDevice, 0, false); auto &commandStream = commandQueue.getCS(4096u); - auto mockCsr = new MockCsrHw2(*pDevice->executionEnvironment, pDevice->getRootDeviceIndex()); + auto mockCsr = new MockCsrHw2(*pDevice->executionEnvironment, pDevice->getRootDeviceIndex(), pDevice->getDeviceBitfield()); pDevice->resetCommandStreamReceiver(mockCsr); mockCsr->useNewResourceImplicitFlush = false; mockCsr->useGpuIdleImplicitFlush = false; @@ -650,7 +650,7 @@ HWTEST_F(CommandStreamReceiverFlushTaskTests, givenCsrInBatchingModeWhenEnqueueI CommandQueueHw commandQueue(nullptr, pClDevice, 0, false); auto &commandStream = commandQueue.getCS(4096u); - auto mockCsr = new MockCsrHw2(*pDevice->executionEnvironment, pDevice->getRootDeviceIndex()); + auto mockCsr = new MockCsrHw2(*pDevice->executionEnvironment, pDevice->getRootDeviceIndex(), pDevice->getDeviceBitfield()); pDevice->resetCommandStreamReceiver(mockCsr); mockCsr->useNewResourceImplicitFlush = false; mockCsr->useGpuIdleImplicitFlush = false; @@ -691,7 +691,7 @@ HWTEST_F(CommandStreamReceiverFlushTaskTests, givenCsrInBatchingModeWhenSusbsequ CommandQueueHw commandQueue(nullptr, pClDevice, 0, false); auto &commandStream = commandQueue.getCS(4096u); - auto mockCsr = new MockCsrHw2(*pDevice->executionEnvironment, pDevice->getRootDeviceIndex()); + auto mockCsr = new MockCsrHw2(*pDevice->executionEnvironment, pDevice->getRootDeviceIndex(), pDevice->getDeviceBitfield()); pDevice->resetCommandStreamReceiver(mockCsr); mockCsr->useNewResourceImplicitFlush = false; mockCsr->useGpuIdleImplicitFlush = false; @@ -750,7 +750,7 @@ HWTEST_F(CommandStreamReceiverFlushTaskTests, givenCsrInBatchingModeWhenTotalRes ExecutionEnvironment *executionEnvironment = platform()->peekExecutionEnvironment(); auto mockedMemoryManager = new MockedMemoryManager(*executionEnvironment); executionEnvironment->memoryManager.reset(mockedMemoryManager); - auto mockCsr = std::make_unique>(*executionEnvironment, 0); + auto mockCsr = std::make_unique>(*executionEnvironment, 0, pDevice->getDeviceBitfield()); mockCsr->setupContext(*pDevice->getDefaultEngine().osContext); if (pDevice->getPreemptionMode() == PreemptionMode::MidThread || pDevice->isDebuggerActive()) { @@ -812,7 +812,7 @@ HWTEST_F(CommandStreamReceiverFlushTaskTests, CommandQueueHw commandQueue(nullptr, pClDevice, 0, false); auto &commandStream = commandQueue.getCS(4096u); - auto mockCsr = new MockCsrHw2(*pDevice->executionEnvironment, pDevice->getRootDeviceIndex()); + auto mockCsr = new MockCsrHw2(*pDevice->executionEnvironment, pDevice->getRootDeviceIndex(), pDevice->getDeviceBitfield()); pDevice->resetCommandStreamReceiver(mockCsr); mockCsr->useNewResourceImplicitFlush = false; mockCsr->useGpuIdleImplicitFlush = false; @@ -894,7 +894,7 @@ HWTEST_F(CommandStreamReceiverFlushTaskTests, givenCsrInBatchingModeWhenDcFlushI CommandQueueHw commandQueue(nullptr, pClDevice, 0, false); auto &commandStream = commandQueue.getCS(4096u); - auto mockCsr = new MockCsrHw2(*pDevice->executionEnvironment, pDevice->getRootDeviceIndex()); + auto mockCsr = new MockCsrHw2(*pDevice->executionEnvironment, pDevice->getRootDeviceIndex(), pDevice->getDeviceBitfield()); pDevice->resetCommandStreamReceiver(mockCsr); mockCsr->useNewResourceImplicitFlush = false; mockCsr->useGpuIdleImplicitFlush = false; @@ -923,7 +923,7 @@ HWTEST_F(CommandStreamReceiverFlushTaskTests, givenCsrInBatchingModeWhenCommandA CommandQueueHw commandQueue(nullptr, pClDevice, 0, false); auto &commandStream = commandQueue.getCS(4096u); - auto mockCsr = new MockCsrHw2(*pDevice->executionEnvironment, pDevice->getRootDeviceIndex()); + auto mockCsr = new MockCsrHw2(*pDevice->executionEnvironment, pDevice->getRootDeviceIndex(), pDevice->getDeviceBitfield()); pDevice->resetCommandStreamReceiver(mockCsr); mockCsr->useNewResourceImplicitFlush = false; mockCsr->useGpuIdleImplicitFlush = false; @@ -955,7 +955,7 @@ HWTEST_F(CommandStreamReceiverFlushTaskTests, givenCsrInBatchingModeWithOutOfOrd CommandQueueHw commandQueue(nullptr, pClDevice, 0, false); auto &commandStream = commandQueue.getCS(4096u); - auto mockCsr = new MockCsrHw2(*pDevice->executionEnvironment, pDevice->getRootDeviceIndex()); + auto mockCsr = new MockCsrHw2(*pDevice->executionEnvironment, pDevice->getRootDeviceIndex(), pDevice->getDeviceBitfield()); pDevice->resetCommandStreamReceiver(mockCsr); mockCsr->useNewResourceImplicitFlush = false; mockCsr->useGpuIdleImplicitFlush = false; @@ -987,7 +987,7 @@ HWTEST_F(CommandStreamReceiverFlushTaskTests, givenCsrInBatchingModeWhenDcFlushI CommandQueueHw commandQueue(nullptr, pClDevice, 0, false); auto &commandStream = commandQueue.getCS(4096u); - auto mockCsr = new MockCsrHw2(*pDevice->executionEnvironment, pDevice->getRootDeviceIndex()); + auto mockCsr = new MockCsrHw2(*pDevice->executionEnvironment, pDevice->getRootDeviceIndex(), pDevice->getDeviceBitfield()); pDevice->resetCommandStreamReceiver(mockCsr); mockCsr->useNewResourceImplicitFlush = false; mockCsr->useGpuIdleImplicitFlush = false; @@ -1021,7 +1021,7 @@ HWTEST_F(CommandStreamReceiverFlushTaskTests, givenEpiloguePipeControlThenDcFlus CommandQueueHw commandQueue(nullptr, pClDevice, 0, false); auto &commandStream = commandQueue.getCS(4096u); - auto mockCsr = new MockCsrHw2(*pDevice->executionEnvironment, pDevice->getRootDeviceIndex()); + auto mockCsr = new MockCsrHw2(*pDevice->executionEnvironment, pDevice->getRootDeviceIndex(), pDevice->getDeviceBitfield()); pDevice->resetCommandStreamReceiver(mockCsr); mockCsr->useNewResourceImplicitFlush = false; mockCsr->useGpuIdleImplicitFlush = false; @@ -1061,7 +1061,7 @@ HWTEST_F(CommandStreamReceiverFlushTaskTests, givenEpiloguePipeControlWhendDcFlu CommandQueueHw commandQueue(nullptr, pClDevice, 0, false); auto &commandStream = commandQueue.getCS(4096u); - auto mockCsr = new MockCsrHw2(*pDevice->executionEnvironment, pDevice->getRootDeviceIndex()); + auto mockCsr = new MockCsrHw2(*pDevice->executionEnvironment, pDevice->getRootDeviceIndex(), pDevice->getDeviceBitfield()); pDevice->resetCommandStreamReceiver(mockCsr); mockCsr->useNewResourceImplicitFlush = false; mockCsr->useGpuIdleImplicitFlush = false; @@ -1097,7 +1097,7 @@ HWTEST_F(CommandStreamReceiverFlushTaskTests, CommandQueueHw commandQueue(nullptr, pClDevice, 0, false); auto &commandStream = commandQueue.getCS(4096u); - auto mockCsr = new MockCsrHw2(*pDevice->executionEnvironment, pDevice->getRootDeviceIndex()); + auto mockCsr = new MockCsrHw2(*pDevice->executionEnvironment, pDevice->getRootDeviceIndex(), pDevice->getDeviceBitfield()); pDevice->resetCommandStreamReceiver(mockCsr); mockCsr->timestampPacketWriteEnabled = false; mockCsr->useNewResourceImplicitFlush = false; @@ -1157,7 +1157,7 @@ HWTEST_F(CommandStreamReceiverFlushTaskTests, givenCsrInBatchingModeAndOoqFlagSe CommandQueueHw commandQueue(nullptr, pClDevice, 0, false); auto &commandStream = commandQueue.getCS(4096u); - auto mockCsr = new MockCsrHw2(*pDevice->executionEnvironment, pDevice->getRootDeviceIndex()); + auto mockCsr = new MockCsrHw2(*pDevice->executionEnvironment, pDevice->getRootDeviceIndex(), pDevice->getDeviceBitfield()); pDevice->resetCommandStreamReceiver(mockCsr); mockCsr->useNewResourceImplicitFlush = false; mockCsr->useGpuIdleImplicitFlush = false; @@ -1197,7 +1197,7 @@ HWTEST_F(CommandStreamReceiverFlushTaskTests, givenCsrInBatchingModeWhenPipeCont CommandQueueHw commandQueue(nullptr, pClDevice, 0, false); auto &commandStream = commandQueue.getCS(4096u); - auto mockCsr = new MockCsrHw2(*pDevice->executionEnvironment, pDevice->getRootDeviceIndex()); + auto mockCsr = new MockCsrHw2(*pDevice->executionEnvironment, pDevice->getRootDeviceIndex(), pDevice->getDeviceBitfield()); pDevice->resetCommandStreamReceiver(mockCsr); mockCsr->useNewResourceImplicitFlush = false; mockCsr->useGpuIdleImplicitFlush = false; @@ -1260,7 +1260,7 @@ HWTEST_F(CommandStreamReceiverFlushTaskTests, CommandQueueHw commandQueue(nullptr, pClDevice, 0, false); auto &commandStream = commandQueue.getCS(4096u); - auto mockCsr = new MockCsrHw2(*pDevice->executionEnvironment, pDevice->getRootDeviceIndex()); + auto mockCsr = new MockCsrHw2(*pDevice->executionEnvironment, pDevice->getRootDeviceIndex(), pDevice->getDeviceBitfield()); pDevice->resetCommandStreamReceiver(mockCsr); mockCsr->useNewResourceImplicitFlush = false; mockCsr->useGpuIdleImplicitFlush = false; @@ -1402,7 +1402,7 @@ HWTEST_F(CommandStreamReceiverFlushTaskTests, givenDispatchFlagsWithThrottleSetT CommandQueueHw commandQueue(nullptr, pClDevice, 0, false); auto &commandStream = commandQueue.getCS(4096u); - auto mockCsr = new MockCsrHw2(*pDevice->executionEnvironment, pDevice->getRootDeviceIndex()); + auto mockCsr = new MockCsrHw2(*pDevice->executionEnvironment, pDevice->getRootDeviceIndex(), pDevice->getDeviceBitfield()); pDevice->resetCommandStreamReceiver(mockCsr); mockCsr->useNewResourceImplicitFlush = false; mockCsr->useGpuIdleImplicitFlush = false; @@ -1435,7 +1435,7 @@ HWTEST_F(CommandStreamReceiverFlushTaskTests, givenDispatchFlagsWithThrottleSetT CommandQueueHw commandQueue(nullptr, pClDevice, 0, false); auto &commandStream = commandQueue.getCS(4096u); - auto mockCsr = new MockCsrHw2(*pDevice->executionEnvironment, pDevice->getRootDeviceIndex()); + auto mockCsr = new MockCsrHw2(*pDevice->executionEnvironment, pDevice->getRootDeviceIndex(), pDevice->getDeviceBitfield()); pDevice->resetCommandStreamReceiver(mockCsr); mockCsr->useNewResourceImplicitFlush = false; mockCsr->useGpuIdleImplicitFlush = false; @@ -1468,7 +1468,7 @@ HWTEST_F(CommandStreamReceiverFlushTaskTests, givenCommandQueueWithThrottleHintW cl_queue_properties properties[] = {CL_QUEUE_THROTTLE_KHR, CL_QUEUE_THROTTLE_LOW_KHR, 0}; CommandQueueHw commandQueue(&context, pClDevice, properties, false); - auto mockCsr = new MockCsrHw2(*pDevice->executionEnvironment, pDevice->getRootDeviceIndex()); + auto mockCsr = new MockCsrHw2(*pDevice->executionEnvironment, pDevice->getRootDeviceIndex(), pDevice->getDeviceBitfield()); pDevice->resetCommandStreamReceiver(mockCsr); cl_int retVal = CL_SUCCESS; @@ -1485,7 +1485,7 @@ HWTEST_F(CommandStreamReceiverFlushTaskTests, givenDispatchFlagsWithThrottleSetT CommandQueueHw commandQueue(nullptr, pClDevice, 0, false); auto &commandStream = commandQueue.getCS(4096u); - auto mockCsr = new MockCsrHw2(*pDevice->executionEnvironment, pDevice->getRootDeviceIndex()); + auto mockCsr = new MockCsrHw2(*pDevice->executionEnvironment, pDevice->getRootDeviceIndex(), pDevice->getDeviceBitfield()); pDevice->resetCommandStreamReceiver(mockCsr); mockCsr->useNewResourceImplicitFlush = false; mockCsr->useGpuIdleImplicitFlush = false; @@ -1567,7 +1567,7 @@ HWTEST_F(CommandStreamReceiverFlushTaskTests, givenDispatchFlagsWithNewSliceCoun CommandQueueHw commandQueue(nullptr, pClDevice, 0, false); auto &commandStream = commandQueue.getCS(4096u); - auto mockCsr = new MockCsrHw2(*pDevice->executionEnvironment, pDevice->getRootDeviceIndex()); + auto mockCsr = new MockCsrHw2(*pDevice->executionEnvironment, pDevice->getRootDeviceIndex(), pDevice->getDeviceBitfield()); pDevice->resetCommandStreamReceiver(mockCsr); mockCsr->useNewResourceImplicitFlush = false; mockCsr->useGpuIdleImplicitFlush = false; @@ -1601,7 +1601,8 @@ class UltCommandStreamReceiverForDispatchFlags : public UltCommandStreamReceiver using BaseClass = UltCommandStreamReceiver; public: - UltCommandStreamReceiverForDispatchFlags(ExecutionEnvironment &executionEnvironment) : BaseClass(executionEnvironment, 0) {} + UltCommandStreamReceiverForDispatchFlags(ExecutionEnvironment &executionEnvironment, DeviceBitfield deviceBitfield) + : BaseClass(executionEnvironment, 0, deviceBitfield) {} CompletionStamp flushTask(LinearStream &commandStream, size_t commandStreamStart, const IndirectHeap &dsh, const IndirectHeap &ioh, const IndirectHeap &ssh, @@ -1615,7 +1616,7 @@ class UltCommandStreamReceiverForDispatchFlags : public UltCommandStreamReceiver HWTEST_F(CommandStreamReceiverFlushTaskTests, GivenBlockedKernelWhenItIsUnblockedThenDispatchFlagsAreSetCorrectly) { MockContext mockContext; - auto csr = new UltCommandStreamReceiverForDispatchFlags(*pDevice->executionEnvironment); + auto csr = new UltCommandStreamReceiverForDispatchFlags(*pDevice->executionEnvironment, pDevice->getDeviceBitfield()); pDevice->resetCommandStreamReceiver(csr); uint32_t numGrfRequired = 666u; @@ -1724,7 +1725,8 @@ class MockCsrWithFailingFlush : public CommandStreamReceiverHw { using CommandStreamReceiverHw::latestSentTaskCount; using CommandStreamReceiverHw::submissionAggregator; - MockCsrWithFailingFlush(ExecutionEnvironment &executionEnvironment, uint32_t rootDeviceIndex) : CommandStreamReceiverHw(executionEnvironment, rootDeviceIndex) { + MockCsrWithFailingFlush(ExecutionEnvironment &executionEnvironment, uint32_t rootDeviceIndex, DeviceBitfield deviceBitfield) + : CommandStreamReceiverHw(executionEnvironment, rootDeviceIndex, deviceBitfield) { this->dispatchMode = DispatchMode::BatchedDispatch; this->tagAddress = &tag; } @@ -1735,7 +1737,7 @@ class MockCsrWithFailingFlush : public CommandStreamReceiverHw { }; HWTEST_F(CommandStreamReceiverFlushTaskTests, givenWaitForCompletionWithTimeoutIsCalledWhenFlushBatchedSubmissionsReturnsFailureThenItIsPropagated) { - MockCsrWithFailingFlush mockCsr(*pDevice->executionEnvironment, pDevice->getRootDeviceIndex()); + MockCsrWithFailingFlush mockCsr(*pDevice->executionEnvironment, pDevice->getRootDeviceIndex(), pDevice->getDeviceBitfield()); MockOsContext osContext(0, 8, aub_stream::ENGINE_RCS, PreemptionMode::Disabled, false, false, false); mockCsr.setupContext(osContext); @@ -1746,8 +1748,8 @@ HWTEST_F(CommandStreamReceiverFlushTaskTests, givenWaitForCompletionWithTimeoutI } HWTEST_F(CommandStreamReceiverFlushTaskTests, givenCommandStreamReceiverWhenFlushTaskIsCalledThenInitializePageTableManagerRegister) { - auto csr = new MockCsrHw2(*pDevice->executionEnvironment, pDevice->getRootDeviceIndex()); - auto csr2 = new MockCsrHw2(*pDevice->executionEnvironment, pDevice->getRootDeviceIndex()); + auto csr = new MockCsrHw2(*pDevice->executionEnvironment, pDevice->getRootDeviceIndex(), pDevice->getDeviceBitfield()); + auto csr2 = new MockCsrHw2(*pDevice->executionEnvironment, pDevice->getRootDeviceIndex(), pDevice->getDeviceBitfield()); pDevice->resetCommandStreamReceiver(csr); MockGmmPageTableMngr *pageTableManager = new MockGmmPageTableMngr(); @@ -1781,7 +1783,7 @@ HWTEST_F(CommandStreamReceiverFlushTaskTests, givenCommandStreamReceiverWhenFlus } HWTEST_F(CommandStreamReceiverFlushTaskTests, givenCommandStreamReceiverWhenInitializingPageTableManagerRegisterFailsThenPageTableManagerIsNotInitialized) { - auto csr = new MockCsrHw2(*pDevice->executionEnvironment, pDevice->getRootDeviceIndex()); + auto csr = new MockCsrHw2(*pDevice->executionEnvironment, pDevice->getRootDeviceIndex(), pDevice->getDeviceBitfield()); pDevice->resetCommandStreamReceiver(csr); MockGmmPageTableMngr *pageTableManager = new MockGmmPageTableMngr(); diff --git a/opencl/test/unit_test/command_stream/command_stream_receiver_flush_task_gmock_tests.cpp b/opencl/test/unit_test/command_stream/command_stream_receiver_flush_task_gmock_tests.cpp index 066bb85117..07d61f2dda 100644 --- a/opencl/test/unit_test/command_stream/command_stream_receiver_flush_task_gmock_tests.cpp +++ b/opencl/test/unit_test/command_stream/command_stream_receiver_flush_task_gmock_tests.cpp @@ -64,7 +64,7 @@ HWTEST_F(CommandStreamReceiverFlushTaskGmockTests, givenCsrInBatchingModeThreeRe CommandQueueHw commandQueue(nullptr, pClDevice, 0, false); auto &commandStream = commandQueue.getCS(4096u); - auto mockCsr = new MockCsrHw2(*pDevice->executionEnvironment, pDevice->getRootDeviceIndex()); + auto mockCsr = new MockCsrHw2(*pDevice->executionEnvironment, pDevice->getRootDeviceIndex(), pDevice->getDeviceBitfield()); auto mockHelper = new MockFlatBatchBufferHelper(*pDevice->executionEnvironment); mockCsr->overwriteFlatBatchBufferHelper(mockHelper); pDevice->resetCommandStreamReceiver(mockCsr); @@ -132,7 +132,7 @@ HWTEST_F(CommandStreamReceiverFlushTaskGmockTests, givenMockCommandStreamerWhenA CommandQueueHw commandQueue(nullptr, pClDevice, 0, false); auto &commandStream = commandQueue.getCS(4096u); - auto mockCsr = new MockCsrHw2(*pDevice->executionEnvironment, pDevice->getRootDeviceIndex()); + auto mockCsr = new MockCsrHw2(*pDevice->executionEnvironment, pDevice->getRootDeviceIndex(), pDevice->getDeviceBitfield()); auto mockHelper = new MockFlatBatchBufferHelper(*pDevice->executionEnvironment); mockCsr->overwriteFlatBatchBufferHelper(mockHelper); pDevice->resetCommandStreamReceiver(mockCsr); @@ -159,7 +159,7 @@ HWTEST_F(CommandStreamReceiverFlushTaskGmockTests, givenMockCommandStreamerWhenA CommandQueueHw commandQueue(nullptr, pClDevice, 0, false); auto &commandStream = commandQueue.getCS(4096u); - auto mockCsr = new MockCsrHw2(*pDevice->executionEnvironment, pDevice->getRootDeviceIndex()); + auto mockCsr = new MockCsrHw2(*pDevice->executionEnvironment, pDevice->getRootDeviceIndex(), pDevice->getDeviceBitfield()); auto mockHelper = new MockFlatBatchBufferHelper(*pDevice->executionEnvironment); mockCsr->overwriteFlatBatchBufferHelper(mockHelper); @@ -210,7 +210,7 @@ HWTEST_F(CommandStreamReceiverFlushTaskGmockTests, givenMockCommandStreamerWhenA HWTEST_F(CommandStreamReceiverFlushTaskGmockTests, givenMockCsrWhenCollectStateBaseAddresPatchInfoIsCalledThenAppropriateAddressesAreTaken) { typedef typename FamilyType::STATE_BASE_ADDRESS STATE_BASE_ADDRESS; - std::unique_ptr> mockCsr(new MockCsrHw2(*pDevice->executionEnvironment, pDevice->getRootDeviceIndex())); + std::unique_ptr> mockCsr(new MockCsrHw2(*pDevice->executionEnvironment, pDevice->getRootDeviceIndex(), pDevice->getDeviceBitfield())); auto mockHelper = new MockFlatBatchBufferHelper(*pDevice->executionEnvironment); mockCsr->overwriteFlatBatchBufferHelper(mockHelper); @@ -265,7 +265,7 @@ HWCMDTEST_F(IGFX_GEN8_CORE, CommandStreamReceiverFlushTaskGmockTests, givenPatch CommandQueueHw commandQueue(nullptr, pClDevice, 0, false); auto &commandStream = commandQueue.getCS(4096u); - std::unique_ptr> mockCsr(new MockCsrHw2(*pDevice->executionEnvironment, pDevice->getRootDeviceIndex())); + std::unique_ptr> mockCsr(new MockCsrHw2(*pDevice->executionEnvironment, pDevice->getRootDeviceIndex(), pDevice->getDeviceBitfield())); mockCsr->overwriteFlatBatchBufferHelper(new MockFlatBatchBufferHelper(*pDevice->executionEnvironment)); bool stateBaseAddressDirty; @@ -287,7 +287,7 @@ HWCMDTEST_F(IGFX_GEN8_CORE, CommandStreamReceiverFlushTaskGmockTests, givenPatch CommandQueueHw commandQueue(nullptr, pClDevice, 0, false); auto &commandStream = commandQueue.getCS(4096u); - std::unique_ptr> mockCsr(new MockCsrHw2(*pDevice->executionEnvironment, pDevice->getRootDeviceIndex())); + std::unique_ptr> mockCsr(new MockCsrHw2(*pDevice->executionEnvironment, pDevice->getRootDeviceIndex(), pDevice->getDeviceBitfield())); mockCsr->overwriteFlatBatchBufferHelper(new MockFlatBatchBufferHelper(*pDevice->executionEnvironment)); bool stateBaseAddressDirty; @@ -311,7 +311,7 @@ HWCMDTEST_F(IGFX_GEN8_CORE, CommandStreamReceiverFlushTaskGmockTests, givenPatch CommandQueueHw commandQueue(nullptr, pClDevice, 0, false); auto &commandStream = commandQueue.getCS(4096u); - std::unique_ptr> mockCsr(new MockCsrHw2(*pDevice->executionEnvironment, pDevice->getRootDeviceIndex())); + std::unique_ptr> mockCsr(new MockCsrHw2(*pDevice->executionEnvironment, pDevice->getRootDeviceIndex(), pDevice->getDeviceBitfield())); mockCsr->overwriteFlatBatchBufferHelper(new MockFlatBatchBufferHelper(*pDevice->executionEnvironment)); DispatchFlags flags = DispatchFlagsHelper::createDefaultDispatchFlags(); diff --git a/opencl/test/unit_test/command_stream/command_stream_receiver_hw_1_tests.cpp b/opencl/test/unit_test/command_stream/command_stream_receiver_hw_1_tests.cpp index 0ce16c0869..b6ae3443d4 100644 --- a/opencl/test/unit_test/command_stream/command_stream_receiver_hw_1_tests.cpp +++ b/opencl/test/unit_test/command_stream/command_stream_receiver_hw_1_tests.cpp @@ -453,7 +453,7 @@ HWTEST_F(CommandStreamReceiverFlushTests, WhenAligningCommandStreamReceiverToCac typedef Test CommandStreamReceiverHwTest; HWTEST_F(CommandStreamReceiverHwTest, givenCsrHwWhenTypeIsCheckedThenCsrHwIsReturned) { - auto csr = std::unique_ptr(CommandStreamReceiverHw::create(*pDevice->executionEnvironment, pDevice->getRootDeviceIndex())); + auto csr = std::unique_ptr(CommandStreamReceiverHw::create(*pDevice->executionEnvironment, pDevice->getRootDeviceIndex(), pDevice->getDeviceBitfield())); EXPECT_EQ(CommandStreamReceiverType::CSR_HW, csr->getType()); } @@ -464,7 +464,7 @@ HWCMDTEST_F(IGFX_GEN8_CORE, CommandStreamReceiverHwTest, WhenCommandStreamReceiv } HWTEST_F(CommandStreamReceiverHwTest, WhenScratchSpaceIsNotRequiredThenScratchAllocationIsNotCreated) { - auto commandStreamReceiver = std::make_unique>(*pDevice->executionEnvironment, pDevice->getRootDeviceIndex()); + auto commandStreamReceiver = std::make_unique>(*pDevice->executionEnvironment, pDevice->getRootDeviceIndex(), pDevice->getDeviceBitfield()); auto scratchController = commandStreamReceiver->getScratchSpaceController(); bool stateBaseAddressDirty = false; @@ -477,7 +477,7 @@ HWTEST_F(CommandStreamReceiverHwTest, WhenScratchSpaceIsNotRequiredThenScratchAl } HWTEST_F(CommandStreamReceiverHwTest, WhenScratchSpaceIsRequiredThenCorrectAddressIsReturned) { - auto commandStreamReceiver = std::make_unique>(*pDevice->executionEnvironment, pDevice->getRootDeviceIndex()); + auto commandStreamReceiver = std::make_unique>(*pDevice->executionEnvironment, pDevice->getRootDeviceIndex(), pDevice->getDeviceBitfield()); commandStreamReceiver->setupContext(*pDevice->getDefaultEngine().osContext); auto scratchController = commandStreamReceiver->getScratchSpaceController(); @@ -494,7 +494,7 @@ HWTEST_F(CommandStreamReceiverHwTest, WhenScratchSpaceIsRequiredThenCorrectAddre } HWTEST_F(CommandStreamReceiverHwTest, WhenScratchSpaceIsNotRequiredThenGshAddressZeroIsReturned) { - auto commandStreamReceiver = std::make_unique>(*pDevice->executionEnvironment, pDevice->getRootDeviceIndex()); + auto commandStreamReceiver = std::make_unique>(*pDevice->executionEnvironment, pDevice->getRootDeviceIndex(), pDevice->getDeviceBitfield()); auto scratchController = commandStreamReceiver->getScratchSpaceController(); EXPECT_EQ(nullptr, scratchController->getScratchSpaceAllocation()); @@ -502,7 +502,7 @@ HWTEST_F(CommandStreamReceiverHwTest, WhenScratchSpaceIsNotRequiredThenGshAddres } HWTEST_F(CommandStreamReceiverHwTest, givenDefaultPlatformCapabilityWhenNoDebugKeysSetThenExpectDefaultPlatformSettings) { - auto commandStreamReceiver = std::make_unique>(*pDevice->executionEnvironment, pDevice->getRootDeviceIndex()); + auto commandStreamReceiver = std::make_unique>(*pDevice->executionEnvironment, pDevice->getRootDeviceIndex(), pDevice->getDeviceBitfield()); if (commandStreamReceiver->checkPlatformSupportsNewResourceImplicitFlush()) { EXPECT_TRUE(commandStreamReceiver->useNewResourceImplicitFlush); } else { @@ -511,7 +511,7 @@ HWTEST_F(CommandStreamReceiverHwTest, givenDefaultPlatformCapabilityWhenNoDebugK } HWTEST_F(CommandStreamReceiverHwTest, givenDefaultGpuIdleImplicitFlushWhenNoDebugKeysSetThenExpectDefaultPlatformSettings) { - auto commandStreamReceiver = std::make_unique>(*pDevice->executionEnvironment, pDevice->getRootDeviceIndex()); + auto commandStreamReceiver = std::make_unique>(*pDevice->executionEnvironment, pDevice->getRootDeviceIndex(), pDevice->getDeviceBitfield()); if (commandStreamReceiver->checkPlatformSupportsGpuIdleImplicitFlush()) { EXPECT_TRUE(commandStreamReceiver->useGpuIdleImplicitFlush); } else { @@ -523,7 +523,7 @@ HWTEST_F(CommandStreamReceiverHwTest, WhenForceDisableNewResourceImplicitFlushTh DebugManagerStateRestore restore; DebugManager.flags.PerformImplicitFlushForNewResource.set(0); - auto commandStreamReceiver = std::make_unique>(*pDevice->executionEnvironment, pDevice->getRootDeviceIndex()); + auto commandStreamReceiver = std::make_unique>(*pDevice->executionEnvironment, pDevice->getRootDeviceIndex(), pDevice->getDeviceBitfield()); EXPECT_FALSE(commandStreamReceiver->useNewResourceImplicitFlush); } @@ -531,7 +531,7 @@ HWTEST_F(CommandStreamReceiverHwTest, WhenForceEnableNewResourceImplicitFlushThe DebugManagerStateRestore restore; DebugManager.flags.PerformImplicitFlushForNewResource.set(1); - auto commandStreamReceiver = std::make_unique>(*pDevice->executionEnvironment, pDevice->getRootDeviceIndex()); + auto commandStreamReceiver = std::make_unique>(*pDevice->executionEnvironment, pDevice->getRootDeviceIndex(), pDevice->getDeviceBitfield()); EXPECT_TRUE(commandStreamReceiver->useNewResourceImplicitFlush); } @@ -539,7 +539,7 @@ HWTEST_F(CommandStreamReceiverHwTest, WhenForceDisableGpuIdleImplicitFlushThenEx DebugManagerStateRestore restore; DebugManager.flags.PerformImplicitFlushForIdleGpu.set(0); - auto commandStreamReceiver = std::make_unique>(*pDevice->executionEnvironment, pDevice->getRootDeviceIndex()); + auto commandStreamReceiver = std::make_unique>(*pDevice->executionEnvironment, pDevice->getRootDeviceIndex(), pDevice->getDeviceBitfield()); EXPECT_FALSE(commandStreamReceiver->useGpuIdleImplicitFlush); } @@ -547,7 +547,7 @@ HWTEST_F(CommandStreamReceiverHwTest, WhenForceEnableGpuIdleImplicitFlushThenExp DebugManagerStateRestore restore; DebugManager.flags.PerformImplicitFlushForIdleGpu.set(1); - auto commandStreamReceiver = std::make_unique>(*pDevice->executionEnvironment, pDevice->getRootDeviceIndex()); + auto commandStreamReceiver = std::make_unique>(*pDevice->executionEnvironment, pDevice->getRootDeviceIndex(), pDevice->getDeviceBitfield()); EXPECT_TRUE(commandStreamReceiver->useGpuIdleImplicitFlush); } diff --git a/opencl/test/unit_test/command_stream/command_stream_receiver_hw_2_tests.cpp b/opencl/test/unit_test/command_stream/command_stream_receiver_hw_2_tests.cpp index 63ed5baf76..05e241a8ff 100644 --- a/opencl/test/unit_test/command_stream/command_stream_receiver_hw_2_tests.cpp +++ b/opencl/test/unit_test/command_stream/command_stream_receiver_hw_2_tests.cpp @@ -281,7 +281,7 @@ HWTEST_F(BcsTests, givenMultipleBlitPropertiesWhenDispatchingThenProgramCommands HWTEST_F(BcsTests, givenProfilingEnabledWhenBlitBufferThenCommandBufferIsConstructedProperly) { auto bcsOsContext = std::unique_ptr(OsContext::create(nullptr, 0, pDevice->getDeviceBitfield(), aub_stream::ENGINE_BCS, PreemptionMode::Disabled, false, false, false)); - auto bcsCsr = std::make_unique>(*pDevice->getExecutionEnvironment(), pDevice->getRootDeviceIndex()); + auto bcsCsr = std::make_unique>(*pDevice->getExecutionEnvironment(), pDevice->getRootDeviceIndex(), pDevice->getDeviceBitfield()); bcsCsr->setupContext(*bcsOsContext); bcsCsr->initializeTagAllocation(); @@ -366,7 +366,7 @@ HWTEST_F(BcsTests, givenFenceAllocationIsRequiredWhenBlitDispatchedThenMakeAllAl auto bcsOsContext = std::unique_ptr(OsContext::create(nullptr, 0, pDevice->getDeviceBitfield(), aub_stream::ENGINE_BCS, PreemptionMode::Disabled, false, false, false)); - auto bcsCsr = std::make_unique>(*pDevice->getExecutionEnvironment(), pDevice->getRootDeviceIndex()); + auto bcsCsr = std::make_unique>(*pDevice->getExecutionEnvironment(), pDevice->getRootDeviceIndex(), pDevice->getDeviceBitfield()); bcsCsr->setupContext(*bcsOsContext); bcsCsr->initializeTagAllocation(); bcsCsr->createGlobalFenceAllocation(); @@ -464,7 +464,7 @@ HWTEST_F(BcsTests, whenBlitFromHostPtrCalledThenCallWaitWithKmdFallback) { uint32_t waitForTaskCountWithKmdNotifyFallbackCalled = 0; }; - auto myMockCsr = std::make_unique<::testing::NiceMock>(*pDevice->getExecutionEnvironment(), pDevice->getRootDeviceIndex()); + auto myMockCsr = std::make_unique<::testing::NiceMock>(*pDevice->getExecutionEnvironment(), pDevice->getRootDeviceIndex(), pDevice->getDeviceBitfield()); auto &bcsOsContext = pDevice->getUltCommandStreamReceiver().getOsContext(); myMockCsr->initializeTagAllocation(); myMockCsr->setupContext(bcsOsContext); diff --git a/opencl/test/unit_test/command_stream/command_stream_receiver_hw_tests.inl b/opencl/test/unit_test/command_stream/command_stream_receiver_hw_tests.inl index 5dac08142e..68e64e3782 100644 --- a/opencl/test/unit_test/command_stream/command_stream_receiver_hw_tests.inl +++ b/opencl/test/unit_test/command_stream/command_stream_receiver_hw_tests.inl @@ -34,7 +34,7 @@ void CommandStreamReceiverHwTest::givenKernelWithSlmWhenPreviousNOSLM MockContext ctx(pClDevice); MockKernelWithInternals kernel(*pClDevice); CommandQueueHw commandQueue(&ctx, pClDevice, 0, false); - auto commandStreamReceiver = new MockCsrHw(*pDevice->executionEnvironment, pDevice->getRootDeviceIndex()); + auto commandStreamReceiver = new MockCsrHw(*pDevice->executionEnvironment, pDevice->getRootDeviceIndex(), pDevice->getDeviceBitfield()); pDevice->resetCommandStreamReceiver(commandStreamReceiver); auto &commandStreamCSR = commandStreamReceiver->getCS(); @@ -75,7 +75,7 @@ void CommandStreamReceiverHwTest::givenBlockedKernelWithSlmWhenPrevio MockContext ctx(pClDevice); MockKernelWithInternals kernel(*pClDevice); CommandQueueHw commandQueue(&ctx, pClDevice, 0, false); - auto commandStreamReceiver = new MockCsrHw(*pDevice->executionEnvironment, pDevice->getRootDeviceIndex()); + auto commandStreamReceiver = new MockCsrHw(*pDevice->executionEnvironment, pDevice->getRootDeviceIndex(), pDevice->getDeviceBitfield()); pDevice->resetCommandStreamReceiver(commandStreamReceiver); cl_event blockingEvent; MockEvent mockEvent(&ctx); diff --git a/opencl/test/unit_test/command_stream/command_stream_receiver_tests.cpp b/opencl/test/unit_test/command_stream/command_stream_receiver_tests.cpp index 386fc11d95..8613710366 100644 --- a/opencl/test/unit_test/command_stream/command_stream_receiver_tests.cpp +++ b/opencl/test/unit_test/command_stream/command_stream_receiver_tests.cpp @@ -270,7 +270,8 @@ TEST(CommandStreamReceiverSimpleTest, givenCsrWithoutTagAllocationWhenGetTagAllo MockExecutionEnvironment executionEnvironment; executionEnvironment.prepareRootDeviceEnvironments(1); executionEnvironment.initializeMemoryManager(); - MockCommandStreamReceiver csr(executionEnvironment, 0); + DeviceBitfield deviceBitfield(1); + MockCommandStreamReceiver csr(executionEnvironment, 0, deviceBitfield); EXPECT_EQ(nullptr, csr.getTagAllocation()); } @@ -278,7 +279,8 @@ TEST(CommandStreamReceiverSimpleTest, givenCsrWhenSubmitiingBatchBufferThenTaskC MockExecutionEnvironment executionEnvironment; executionEnvironment.prepareRootDeviceEnvironments(1); executionEnvironment.initializeMemoryManager(); - MockCommandStreamReceiver csr(executionEnvironment, 0); + DeviceBitfield deviceBitfield(1); + MockCommandStreamReceiver csr(executionEnvironment, 0, deviceBitfield); GraphicsAllocation *commandBuffer = executionEnvironment.memoryManager->allocateGraphicsMemoryWithProperties(MockAllocationProperties{csr.getRootDeviceIndex(), MemoryConstants::pageSize}); ASSERT_NE(nullptr, commandBuffer); @@ -301,17 +303,17 @@ HWTEST_F(CommandStreamReceiverTest, givenDebugVariableEnabledWhenCreatingCsrThen DebugManagerStateRestore restore; DebugManager.flags.EnableTimestampPacket.set(true); - CommandStreamReceiverHw csr1(*pDevice->executionEnvironment, pDevice->getRootDeviceIndex()); + CommandStreamReceiverHw csr1(*pDevice->executionEnvironment, pDevice->getRootDeviceIndex(), pDevice->getDeviceBitfield()); EXPECT_TRUE(csr1.peekTimestampPacketWriteEnabled()); DebugManager.flags.EnableTimestampPacket.set(false); - CommandStreamReceiverHw csr2(*pDevice->executionEnvironment, pDevice->getRootDeviceIndex()); + CommandStreamReceiverHw csr2(*pDevice->executionEnvironment, pDevice->getRootDeviceIndex(), pDevice->getDeviceBitfield()); EXPECT_FALSE(csr2.peekTimestampPacketWriteEnabled()); } HWTEST_F(CommandStreamReceiverTest, whenDirectSubmissionDisabledThenExpectNoFeatureAvailable) { DeviceFactory::prepareDeviceEnvironments(*pDevice->getExecutionEnvironment()); - CommandStreamReceiverHw csr(*pDevice->executionEnvironment, pDevice->getRootDeviceIndex()); + CommandStreamReceiverHw csr(*pDevice->executionEnvironment, pDevice->getRootDeviceIndex(), pDevice->getDeviceBitfield()); std::unique_ptr osContext(OsContext::create(pDevice->getExecutionEnvironment()->rootDeviceEnvironments[0]->osInterface.get(), 0, pDevice->getDeviceBitfield(), aub_stream::ENGINE_RCS, PreemptionMode::ThreadGroup, false, false, false)); @@ -343,7 +345,7 @@ struct InitDirectSubmissionFixture { using InitDirectSubmissionTest = Test; HWTEST_F(InitDirectSubmissionTest, whenDirectSubmissionEnabledOnRcsThenExpectFeatureAvailable) { - auto csr = std::make_unique>(*device->executionEnvironment, device->getRootDeviceIndex()); + auto csr = std::make_unique>(*device->executionEnvironment, device->getRootDeviceIndex(), device->getDeviceBitfield()); std::unique_ptr osContext(OsContext::create(device->getExecutionEnvironment()->rootDeviceEnvironments[0]->osInterface.get(), 0, device->getDeviceBitfield(), aub_stream::ENGINE_RCS, PreemptionMode::ThreadGroup, false, false, false)); @@ -361,7 +363,7 @@ HWTEST_F(InitDirectSubmissionTest, whenDirectSubmissionEnabledOnRcsThenExpectFea } HWTEST_F(InitDirectSubmissionTest, givenDirectSubmissionEnabledWhenPlatformNotSupportsRcsThenExpectFeatureNotAvailable) { - auto csr = std::make_unique>(*device->executionEnvironment, device->getRootDeviceIndex()); + auto csr = std::make_unique>(*device->executionEnvironment, device->getRootDeviceIndex(), device->getDeviceBitfield()); std::unique_ptr osContext(OsContext::create(device->getExecutionEnvironment()->rootDeviceEnvironments[0]->osInterface.get(), 0, device->getDeviceBitfield(), aub_stream::ENGINE_RCS, PreemptionMode::ThreadGroup, false, false, false)); @@ -378,7 +380,7 @@ HWTEST_F(InitDirectSubmissionTest, givenDirectSubmissionEnabledWhenPlatformNotSu } HWTEST_F(InitDirectSubmissionTest, whenDirectSubmissionEnabledOnBcsThenExpectFeatureAvailable) { - auto csr = std::make_unique>(*device->executionEnvironment, device->getRootDeviceIndex()); + auto csr = std::make_unique>(*device->executionEnvironment, device->getRootDeviceIndex(), device->getDeviceBitfield()); std::unique_ptr osContext(OsContext::create(device->getExecutionEnvironment()->rootDeviceEnvironments[0]->osInterface.get(), 0, device->getDeviceBitfield(), aub_stream::ENGINE_BCS, PreemptionMode::ThreadGroup, false, false, false)); @@ -397,7 +399,7 @@ HWTEST_F(InitDirectSubmissionTest, whenDirectSubmissionEnabledOnBcsThenExpectFea } HWTEST_F(InitDirectSubmissionTest, givenDirectSubmissionEnabledWhenPlatformNotSupportsBcsThenExpectFeatureNotAvailable) { - auto csr = std::make_unique>(*device->executionEnvironment, device->getRootDeviceIndex()); + auto csr = std::make_unique>(*device->executionEnvironment, device->getRootDeviceIndex(), device->getDeviceBitfield()); std::unique_ptr osContext(OsContext::create(device->getExecutionEnvironment()->rootDeviceEnvironments[0]->osInterface.get(), 0, device->getDeviceBitfield(), aub_stream::ENGINE_BCS, PreemptionMode::ThreadGroup, false, false, false)); @@ -416,7 +418,7 @@ HWTEST_F(InitDirectSubmissionTest, givenDirectSubmissionEnabledWhenPlatformNotSu } HWTEST_F(InitDirectSubmissionTest, givenLowPriorityContextWhenDirectSubmissionDisabledOnLowPriorityThenExpectFeatureNotAvailable) { - auto csr = std::make_unique>(*device->executionEnvironment, device->getRootDeviceIndex()); + auto csr = std::make_unique>(*device->executionEnvironment, device->getRootDeviceIndex(), device->getDeviceBitfield()); std::unique_ptr osContext(OsContext::create(device->getExecutionEnvironment()->rootDeviceEnvironments[0]->osInterface.get(), 0, device->getDeviceBitfield(), aub_stream::ENGINE_RCS, PreemptionMode::ThreadGroup, true, false, false)); @@ -435,7 +437,7 @@ HWTEST_F(InitDirectSubmissionTest, givenLowPriorityContextWhenDirectSubmissionDi } HWTEST_F(InitDirectSubmissionTest, givenLowPriorityContextWhenDirectSubmissionEnabledOnLowPriorityThenExpectFeatureAvailable) { - auto csr = std::make_unique>(*device->executionEnvironment, device->getRootDeviceIndex()); + auto csr = std::make_unique>(*device->executionEnvironment, device->getRootDeviceIndex(), device->getDeviceBitfield()); std::unique_ptr osContext(OsContext::create(device->getExecutionEnvironment()->rootDeviceEnvironments[0]->osInterface.get(), 0, device->getDeviceBitfield(), aub_stream::ENGINE_RCS, PreemptionMode::ThreadGroup, true, false, false)); @@ -452,7 +454,7 @@ HWTEST_F(InitDirectSubmissionTest, givenLowPriorityContextWhenDirectSubmissionEn } HWTEST_F(InitDirectSubmissionTest, givenInternalContextWhenDirectSubmissionDisabledOnInternalThenExpectFeatureNotAvailable) { - auto csr = std::make_unique>(*device->executionEnvironment, device->getRootDeviceIndex()); + auto csr = std::make_unique>(*device->executionEnvironment, device->getRootDeviceIndex(), device->getDeviceBitfield()); std::unique_ptr osContext(OsContext::create(device->getExecutionEnvironment()->rootDeviceEnvironments[0]->osInterface.get(), 0, device->getDeviceBitfield(), aub_stream::ENGINE_RCS, PreemptionMode::ThreadGroup, false, true, false)); @@ -471,7 +473,7 @@ HWTEST_F(InitDirectSubmissionTest, givenInternalContextWhenDirectSubmissionDisab } HWTEST_F(InitDirectSubmissionTest, givenInternalContextWhenDirectSubmissionEnabledOnInternalThenExpectFeatureAvailable) { - auto csr = std::make_unique>(*device->executionEnvironment, device->getRootDeviceIndex()); + auto csr = std::make_unique>(*device->executionEnvironment, device->getRootDeviceIndex(), device->getDeviceBitfield()); std::unique_ptr osContext(OsContext::create(device->getExecutionEnvironment()->rootDeviceEnvironments[0]->osInterface.get(), 0, device->getDeviceBitfield(), aub_stream::ENGINE_RCS, PreemptionMode::ThreadGroup, false, true, false)); @@ -489,7 +491,7 @@ HWTEST_F(InitDirectSubmissionTest, givenInternalContextWhenDirectSubmissionEnabl } HWTEST_F(InitDirectSubmissionTest, givenRootDeviceContextWhenDirectSubmissionDisabledOnRootDeviceThenExpectFeatureNotAvailable) { - auto csr = std::make_unique>(*device->executionEnvironment, device->getRootDeviceIndex()); + auto csr = std::make_unique>(*device->executionEnvironment, device->getRootDeviceIndex(), device->getDeviceBitfield()); std::unique_ptr osContext(OsContext::create(device->getExecutionEnvironment()->rootDeviceEnvironments[0]->osInterface.get(), 0, device->getDeviceBitfield(), aub_stream::ENGINE_RCS, PreemptionMode::ThreadGroup, false, false, true)); @@ -508,7 +510,7 @@ HWTEST_F(InitDirectSubmissionTest, givenRootDeviceContextWhenDirectSubmissionDis } HWTEST_F(InitDirectSubmissionTest, givenRootDeviceContextWhenDirectSubmissionEnabledOnRootDeviceThenExpectFeatureAvailable) { - auto csr = std::make_unique>(*device->executionEnvironment, device->getRootDeviceIndex()); + auto csr = std::make_unique>(*device->executionEnvironment, device->getRootDeviceIndex(), device->getDeviceBitfield()); std::unique_ptr osContext(OsContext::create(device->getExecutionEnvironment()->rootDeviceEnvironments[0]->osInterface.get(), 0, device->getDeviceBitfield(), aub_stream::ENGINE_RCS, PreemptionMode::ThreadGroup, false, false, true)); @@ -526,7 +528,7 @@ HWTEST_F(InitDirectSubmissionTest, givenRootDeviceContextWhenDirectSubmissionEna } HWTEST_F(InitDirectSubmissionTest, givenNonDefaultContextWhenDirectSubmissionDisabledOnNonDefaultThenExpectFeatureNotAvailable) { - auto csr = std::make_unique>(*device->executionEnvironment, device->getRootDeviceIndex()); + auto csr = std::make_unique>(*device->executionEnvironment, device->getRootDeviceIndex(), device->getDeviceBitfield()); std::unique_ptr osContext(OsContext::create(device->getExecutionEnvironment()->rootDeviceEnvironments[0]->osInterface.get(), 0, device->getDeviceBitfield(), aub_stream::ENGINE_RCS, PreemptionMode::ThreadGroup, false, false, false)); @@ -545,7 +547,7 @@ HWTEST_F(InitDirectSubmissionTest, givenNonDefaultContextWhenDirectSubmissionDis } HWTEST_F(InitDirectSubmissionTest, givenNonDefaultContextContextWhenDirectSubmissionEnabledOnNonDefaultContextThenExpectFeatureAvailable) { - auto csr = std::make_unique>(*device->executionEnvironment, device->getRootDeviceIndex()); + auto csr = std::make_unique>(*device->executionEnvironment, device->getRootDeviceIndex(), device->getDeviceBitfield()); std::unique_ptr osContext(OsContext::create(device->getExecutionEnvironment()->rootDeviceEnvironments[0]->osInterface.get(), 0, device->getDeviceBitfield(), aub_stream::ENGINE_RCS, PreemptionMode::ThreadGroup, false, false, false)); @@ -566,7 +568,7 @@ HWTEST_F(InitDirectSubmissionTest, givenNonDefaultContextContextWhenDirectSubmis HWTEST_F(InitDirectSubmissionTest, GivenBlitterOverrideEnabledWhenBlitterIsNonDefaultContextThenExpectDirectSubmissionStarted) { DebugManager.flags.DirectSubmissionOverrideBlitterSupport.set(1); - auto csr = std::make_unique>(*device->executionEnvironment, device->getRootDeviceIndex()); + auto csr = std::make_unique>(*device->executionEnvironment, device->getRootDeviceIndex(), device->getDeviceBitfield()); std::unique_ptr osContext(OsContext::create(device->getExecutionEnvironment()->rootDeviceEnvironments[0]->osInterface.get(), 0, device->getDeviceBitfield(), aub_stream::ENGINE_BCS, PreemptionMode::ThreadGroup, false, false, false)); @@ -585,7 +587,7 @@ HWTEST_F(InitDirectSubmissionTest, GivenBlitterOverrideEnabledWhenBlitterIsNonDe } HWTEST_F(CommandStreamReceiverTest, whenCsrIsCreatedThenUseTimestampPacketWriteIfPossible) { - CommandStreamReceiverHw csr(*pDevice->executionEnvironment, pDevice->getRootDeviceIndex()); + CommandStreamReceiverHw csr(*pDevice->executionEnvironment, pDevice->getRootDeviceIndex(), pDevice->getDeviceBitfield()); EXPECT_EQ(UnitTestHelper::isTimestampPacketWriteSupported(), csr.peekTimestampPacketWriteEnabled()); } @@ -646,7 +648,7 @@ TEST(CommandStreamReceiverSimpleTest, givenCommandStreamReceiverWhenItIsDestroye auto mockGraphicsAllocation = new MockGraphicsAllocationWithDestructorTracing(0, GraphicsAllocation::AllocationType::UNKNOWN, &gpuTag, 0llu, 0llu, 1u, MemoryPool::MemoryNull); mockGraphicsAllocation->destructorCalled = &destructorCalled; MockExecutionEnvironment executionEnvironment(defaultHwInfo.get()); - auto csr = std::make_unique(executionEnvironment, 0); + auto csr = std::make_unique(executionEnvironment, 0, 1); executionEnvironment.memoryManager.reset(new OsAgnosticMemoryManager(executionEnvironment)); csr->setTagAllocation(mockGraphicsAllocation); EXPECT_FALSE(destructorCalled); @@ -656,7 +658,7 @@ TEST(CommandStreamReceiverSimpleTest, givenCommandStreamReceiverWhenItIsDestroye TEST(CommandStreamReceiverSimpleTest, givenCommandStreamReceiverWhenInitializeTagAllocationIsCalledThenTagAllocationIsBeingAllocated) { MockExecutionEnvironment executionEnvironment(defaultHwInfo.get()); - auto csr = std::make_unique(executionEnvironment, 0); + auto csr = std::make_unique(executionEnvironment, 0, 1); executionEnvironment.memoryManager.reset(new OsAgnosticMemoryManager(executionEnvironment)); EXPECT_EQ(nullptr, csr->getTagAllocation()); EXPECT_TRUE(csr->getTagAddress() == nullptr); @@ -670,7 +672,7 @@ TEST(CommandStreamReceiverSimpleTest, givenCommandStreamReceiverWhenInitializeTa HWTEST_F(CommandStreamReceiverTest, givenCommandStreamReceiverWhenFenceAllocationIsRequiredAndCreateGlobalFenceAllocationIsCalledThenFenceAllocationIsAllocated) { RAIIHwHelperFactory> hwHelperBackup{pDevice->getHardwareInfo().platform.eRenderCoreFamily}; - MockCsrHw csr(*pDevice->executionEnvironment, pDevice->getRootDeviceIndex()); + MockCsrHw csr(*pDevice->executionEnvironment, pDevice->getRootDeviceIndex(), pDevice->getDeviceBitfield()); csr.setupContext(*pDevice->getDefaultEngine().osContext); EXPECT_EQ(nullptr, csr.globalFenceAllocation); @@ -683,7 +685,7 @@ HWTEST_F(CommandStreamReceiverTest, givenCommandStreamReceiverWhenFenceAllocatio HWTEST_F(CommandStreamReceiverTest, givenCommandStreamReceiverWhenGettingFenceAllocationThenCorrectFenceAllocationIsReturned) { RAIIHwHelperFactory> hwHelperBackup{pDevice->getHardwareInfo().platform.eRenderCoreFamily}; - CommandStreamReceiverHw csr(*pDevice->executionEnvironment, pDevice->getRootDeviceIndex()); + CommandStreamReceiverHw csr(*pDevice->executionEnvironment, pDevice->getRootDeviceIndex(), pDevice->getDeviceBitfield()); csr.setupContext(*pDevice->getDefaultEngine().osContext); EXPECT_EQ(nullptr, csr.getGlobalFenceAllocation()); @@ -697,7 +699,7 @@ TEST(CommandStreamReceiverSimpleTest, givenNullHardwareDebugModeWhenInitializeTa DebugManagerStateRestore dbgRestore; DebugManager.flags.EnableNullHardware.set(true); MockExecutionEnvironment executionEnvironment(defaultHwInfo.get()); - auto csr = std::make_unique(executionEnvironment, 0); + auto csr = std::make_unique(executionEnvironment, 0, 1); executionEnvironment.memoryManager.reset(new OsAgnosticMemoryManager(executionEnvironment)); EXPECT_EQ(nullptr, csr->getTagAllocation()); EXPECT_TRUE(csr->getTagAddress() == nullptr); @@ -711,7 +713,8 @@ TEST(CommandStreamReceiverSimpleTest, givenVariousDataSetsWhenVerifyingMemoryThe MockExecutionEnvironment executionEnvironment; executionEnvironment.prepareRootDeviceEnvironments(1); executionEnvironment.initializeMemoryManager(); - MockCommandStreamReceiver csr(executionEnvironment, 0); + DeviceBitfield deviceBitfield(1); + MockCommandStreamReceiver csr(executionEnvironment, 0, deviceBitfield); constexpr size_t setSize = 6; uint8_t setA1[setSize] = {4, 3, 2, 1, 2, 10}; @@ -737,7 +740,8 @@ TEST(CommandStreamReceiverSimpleTest, givenNewResourceFlushDisabledWhenProviding MockExecutionEnvironment executionEnvironment; executionEnvironment.prepareRootDeviceEnvironments(1); executionEnvironment.initializeMemoryManager(); - MockCommandStreamReceiver csr(executionEnvironment, 0); + DeviceBitfield deviceBitfield(1); + MockCommandStreamReceiver csr(executionEnvironment, 0, deviceBitfield); MockGraphicsAllocation mockAllocation; csr.useNewResourceImplicitFlush = false; @@ -750,7 +754,8 @@ TEST(CommandStreamReceiverSimpleTest, givenNewResourceFlushEnabledWhenProvidingN MockExecutionEnvironment executionEnvironment; executionEnvironment.prepareRootDeviceEnvironments(1); executionEnvironment.initializeMemoryManager(); - MockCommandStreamReceiver csr(executionEnvironment, 0); + DeviceBitfield deviceBitfield(1); + MockCommandStreamReceiver csr(executionEnvironment, 0, deviceBitfield); MockGraphicsAllocation mockAllocation; csr.useNewResourceImplicitFlush = true; @@ -763,7 +768,8 @@ TEST(CommandStreamReceiverSimpleTest, givenNewResourceFlushEnabledWhenProvidingN MockExecutionEnvironment executionEnvironment; executionEnvironment.prepareRootDeviceEnvironments(1); executionEnvironment.initializeMemoryManager(); - MockCommandStreamReceiver csr(executionEnvironment, 0); + DeviceBitfield deviceBitfield(1); + MockCommandStreamReceiver csr(executionEnvironment, 0, deviceBitfield); MockGraphicsAllocation mockAllocation; mockAllocation.setAllocationType(GraphicsAllocation::AllocationType::KERNEL_ISA); @@ -777,7 +783,8 @@ TEST(CommandStreamReceiverSimpleTest, givenNewResourceFlushEnabledWhenProvidingA MockExecutionEnvironment executionEnvironment; executionEnvironment.prepareRootDeviceEnvironments(1); executionEnvironment.initializeMemoryManager(); - MockCommandStreamReceiver csr(executionEnvironment, 0); + DeviceBitfield deviceBitfield(1); + MockCommandStreamReceiver csr(executionEnvironment, 0, deviceBitfield); MockGraphicsAllocation mockAllocation; csr.useNewResourceImplicitFlush = true; @@ -793,7 +800,8 @@ TEST(CommandStreamReceiverSimpleTest, givenNewResourceFlushEnabledWhenProvidingN MockExecutionEnvironment executionEnvironment; executionEnvironment.prepareRootDeviceEnvironments(1); executionEnvironment.initializeMemoryManager(); - MockCommandStreamReceiver csr(executionEnvironment, 0); + DeviceBitfield deviceBitfield(1); + MockCommandStreamReceiver csr(executionEnvironment, 0, deviceBitfield); MockGraphicsAllocation mockAllocation; csr.useNewResourceImplicitFlush = true; @@ -810,13 +818,17 @@ TEST(CommandStreamReceiverSimpleTest, givenNewResourceFlushEnabledWhenProvidingN TEST(CommandStreamReceiverSimpleTest, givenPrintfTagAllocationAddressFlagEnabledWhenCreatingTagAllocationThenPrintItsAddress) { DebugManagerStateRestore restore; DebugManager.flags.PrintTagAllocationAddress.set(true); - - auto osContext = std::unique_ptr(OsContext::create(nullptr, 0, 0, aub_stream::EngineType::ENGINE_BCS, PreemptionMode::Disabled, false, false, false)); + DeviceBitfield deviceBitfield(1); + auto osContext = std::unique_ptr(OsContext::create(nullptr, 0, deviceBitfield, + aub_stream::EngineType::ENGINE_BCS, + PreemptionMode::Disabled, + false, false, false)); MockExecutionEnvironment executionEnvironment; executionEnvironment.prepareRootDeviceEnvironments(1); executionEnvironment.initializeMemoryManager(); - MockCommandStreamReceiver csr(executionEnvironment, 0); + + MockCommandStreamReceiver csr(executionEnvironment, 0, deviceBitfield); csr.setupContext(*osContext); testing::internal::CaptureStdout(); @@ -836,7 +848,8 @@ TEST(CommandStreamReceiverSimpleTest, givenGpuIdleImplicitFlushCheckDisabledWhen MockExecutionEnvironment executionEnvironment; executionEnvironment.prepareRootDeviceEnvironments(1); executionEnvironment.initializeMemoryManager(); - MockCommandStreamReceiver csr(executionEnvironment, 0); + DeviceBitfield deviceBitfield(1); + MockCommandStreamReceiver csr(executionEnvironment, 0, deviceBitfield); csr.callParentGetTagAddress = false; csr.useGpuIdleImplicitFlush = false; @@ -849,7 +862,8 @@ TEST(CommandStreamReceiverSimpleTest, givenGpuIdleImplicitFlushCheckEnabledWhenG MockExecutionEnvironment executionEnvironment; executionEnvironment.prepareRootDeviceEnvironments(1); executionEnvironment.initializeMemoryManager(); - MockCommandStreamReceiver csr(executionEnvironment, 0); + DeviceBitfield deviceBitfield(1); + MockCommandStreamReceiver csr(executionEnvironment, 0, deviceBitfield); csr.callParentGetTagAddress = false; csr.useGpuIdleImplicitFlush = true; @@ -862,7 +876,8 @@ TEST(CommandStreamReceiverSimpleTest, givenGpuNotIdleImplicitFlushCheckEnabledWh MockExecutionEnvironment executionEnvironment; executionEnvironment.prepareRootDeviceEnvironments(1); executionEnvironment.initializeMemoryManager(); - MockCommandStreamReceiver csr(executionEnvironment, 0); + DeviceBitfield deviceBitfield(1); + MockCommandStreamReceiver csr(executionEnvironment, 0, deviceBitfield); csr.callParentGetTagAddress = false; csr.useGpuIdleImplicitFlush = true; @@ -1109,7 +1124,7 @@ HWTEST_F(CommandStreamReceiverTest, givenDebugPauseThreadWhenSettingFlagProgress DebugManager.flags.PauseOnEnqueue.set(0); testing::internal::CaptureStdout(); int32_t executionStamp = 0; - auto mockCSR = new MockCsr(executionStamp, *pDevice->executionEnvironment, pDevice->getRootDeviceIndex()); + auto mockCSR = new MockCsr(executionStamp, *pDevice->executionEnvironment, pDevice->getRootDeviceIndex(), pDevice->getDeviceBitfield()); uint32_t confirmationCounter = 0; @@ -1147,7 +1162,7 @@ HWTEST_F(CommandStreamReceiverTest, givenDebugPauseThreadWhenTerminatingAtFirstS DebugManager.flags.PauseOnEnqueue.set(0); testing::internal::CaptureStdout(); int32_t executionStamp = 0; - auto mockCSR = new MockCsr(executionStamp, *pDevice->executionEnvironment, pDevice->getRootDeviceIndex()); + auto mockCSR = new MockCsr(executionStamp, *pDevice->executionEnvironment, pDevice->getRootDeviceIndex(), pDevice->getDeviceBitfield()); uint32_t confirmationCounter = 0; @@ -1166,7 +1181,7 @@ HWTEST_F(CommandStreamReceiverTest, givenDebugPauseThreadWhenTerminatingAtFirstS HWTEST_F(CommandStreamReceiverTest, whenCreatingCommandStreamReceiverThenLastAddtionalKernelExecInfoValueIsCorrect) { int32_t executionStamp = 0; - std::unique_ptr> mockCSR(new MockCsr(executionStamp, *pDevice->executionEnvironment, pDevice->getRootDeviceIndex())); + std::unique_ptr> mockCSR(new MockCsr(executionStamp, *pDevice->executionEnvironment, pDevice->getRootDeviceIndex(), pDevice->getDeviceBitfield())); EXPECT_EQ(AdditionalKernelExecInfo::NotSet, mockCSR->lastAdditionalKernelExecInfo); } @@ -1175,7 +1190,7 @@ HWTEST_F(CommandStreamReceiverTest, givenDebugPauseThreadWhenTerminatingAtSecond DebugManager.flags.PauseOnEnqueue.set(0); testing::internal::CaptureStdout(); int32_t executionStamp = 0; - auto mockCSR = new MockCsr(executionStamp, *pDevice->executionEnvironment, pDevice->getRootDeviceIndex()); + auto mockCSR = new MockCsr(executionStamp, *pDevice->executionEnvironment, pDevice->getRootDeviceIndex(), pDevice->getDeviceBitfield()); uint32_t confirmationCounter = 0; @@ -1224,7 +1239,7 @@ HWTEST_P(CommandStreamReceiverWithAubSubCaptureTest, givenCommandStreamReceiverW MockExecutionEnvironment executionEnvironment; executionEnvironment.prepareRootDeviceEnvironments(1); executionEnvironment.initializeMemoryManager(); - MyMockCsr mockCsr(executionEnvironment, 0); + MyMockCsr mockCsr(executionEnvironment, 0, 1); mockCsr.programForAubSubCapture(wasActiveInPreviousEnqueue, isActive); @@ -1260,9 +1275,10 @@ HWTEST_F(SimulatedCommandStreamReceiverTest, givenCsrWithOsContextWhenGetDeviceI MockExecutionEnvironment executionEnvironment; executionEnvironment.prepareRootDeviceEnvironments(1); executionEnvironment.initializeMemoryManager(); - MockSimulatedCsrHw csr(executionEnvironment, 0); + DeviceBitfield deviceBitfield(0b11); + MockSimulatedCsrHw csr(executionEnvironment, 0, deviceBitfield); auto osContext = executionEnvironment.memoryManager->createAndRegisterOsContext(&csr, aub_stream::EngineType::ENGINE_RCS, - 0b11, PreemptionMode::Disabled, + deviceBitfield, PreemptionMode::Disabled, false, false, false); csr.setupContext(*osContext); @@ -1273,9 +1289,10 @@ HWTEST_F(SimulatedCommandStreamReceiverTest, givenOsContextWithNoDeviceBitfieldW MockExecutionEnvironment executionEnvironment; executionEnvironment.prepareRootDeviceEnvironments(1); executionEnvironment.initializeMemoryManager(); - MockSimulatedCsrHw csr(executionEnvironment, 0); + DeviceBitfield deviceBitfield(0b00); + MockSimulatedCsrHw csr(executionEnvironment, 0, deviceBitfield); auto osContext = executionEnvironment.memoryManager->createAndRegisterOsContext(&csr, aub_stream::EngineType::ENGINE_RCS, - 0b00, PreemptionMode::Disabled, + deviceBitfield, PreemptionMode::Disabled, false, false, false); csr.setupContext(*osContext); @@ -1345,7 +1362,8 @@ using CommandStreamReceiverPageTableManagerTest = ::testing::Test; TEST_F(CommandStreamReceiverPageTableManagerTest, givenNonDefaultEngineTypeWhenNeedsPageTableManagerIsCalledThenFalseIsReturned) { MockExecutionEnvironment executionEnvironment; executionEnvironment.initializeMemoryManager(); - MockCommandStreamReceiver commandStreamReceiver(executionEnvironment, 0u); + DeviceBitfield deviceBitfield(1); + MockCommandStreamReceiver commandStreamReceiver(executionEnvironment, 0u, deviceBitfield); auto hwInfo = executionEnvironment.rootDeviceEnvironments[0]->getHardwareInfo(); auto defaultEngineType = getChosenEngineType(*hwInfo); auto engineType = aub_stream::EngineType::ENGINE_BCS; @@ -1357,7 +1375,8 @@ TEST_F(CommandStreamReceiverPageTableManagerTest, givenNonDefaultEngineTypeWhenN TEST_F(CommandStreamReceiverPageTableManagerTest, givenDefaultEngineTypeAndExistingPageTableManagerWhenNeedsPageTableManagerIsCalledThenFalseIsReturned) { MockExecutionEnvironment executionEnvironment; executionEnvironment.initializeMemoryManager(); - MockCommandStreamReceiver commandStreamReceiver(executionEnvironment, 0u); + DeviceBitfield deviceBitfield(1); + MockCommandStreamReceiver commandStreamReceiver(executionEnvironment, 0u, deviceBitfield); auto hwInfo = executionEnvironment.rootDeviceEnvironments[0]->getHardwareInfo(); auto defaultEngineType = getChosenEngineType(*hwInfo); @@ -1371,7 +1390,8 @@ TEST_F(CommandStreamReceiverPageTableManagerTest, givenDefaultEngineTypeAndExist TEST_F(CommandStreamReceiverPageTableManagerTest, givenDefaultEngineTypeAndNonExisitingPageTableManagerWhenNeedsPageTableManagerIsCalledThenSupportOfPageTableManagerIsReturned) { MockExecutionEnvironment executionEnvironment; executionEnvironment.initializeMemoryManager(); - MockCommandStreamReceiver commandStreamReceiver(executionEnvironment, 0u); + DeviceBitfield deviceBitfield(1); + MockCommandStreamReceiver commandStreamReceiver(executionEnvironment, 0u, deviceBitfield); auto hwInfo = executionEnvironment.rootDeviceEnvironments[0]->getHardwareInfo(); auto defaultEngineType = getChosenEngineType(*hwInfo); bool supportsPageTableManager = HwHelper::get(hwInfo->platform.eRenderCoreFamily).isPageTableManagerSupported(*hwInfo); diff --git a/opencl/test/unit_test/command_stream/command_stream_receiver_with_aub_dump_tests.cpp b/opencl/test/unit_test/command_stream/command_stream_receiver_with_aub_dump_tests.cpp index 7e9cb87512..27c85e97ba 100644 --- a/opencl/test/unit_test/command_stream/command_stream_receiver_with_aub_dump_tests.cpp +++ b/opencl/test/unit_test/command_stream/command_stream_receiver_with_aub_dump_tests.cpp @@ -33,8 +33,8 @@ using namespace NEO; struct MyMockCsr : UltCommandStreamReceiver { - MyMockCsr(ExecutionEnvironment &executionEnvironment, uint32_t rootDeviceIndex) - : UltCommandStreamReceiver(executionEnvironment, rootDeviceIndex) { + MyMockCsr(ExecutionEnvironment &executionEnvironment, uint32_t rootDeviceIndex, DeviceBitfield deviceBitfield) + : UltCommandStreamReceiver(executionEnvironment, rootDeviceIndex, deviceBitfield) { } bool flush(BatchBuffer &batchBuffer, ResidencyContainer &allocationsForResidency) override { @@ -103,8 +103,9 @@ struct MyMockCsr : UltCommandStreamReceiver { template struct MyMockCsrWithAubDump : CommandStreamReceiverWithAUBDump { - MyMockCsrWithAubDump(bool createAubCSR, ExecutionEnvironment &executionEnvironment) : CommandStreamReceiverWithAUBDump("aubfile", executionEnvironment, 0) { - this->aubCSR.reset(createAubCSR ? new MyMockCsr(executionEnvironment, 0) : nullptr); + MyMockCsrWithAubDump(bool createAubCSR, ExecutionEnvironment &executionEnvironment, DeviceBitfield deviceBitfield) + : CommandStreamReceiverWithAUBDump("aubfile", executionEnvironment, 0, deviceBitfield) { + this->aubCSR.reset(createAubCSR ? new MyMockCsr(executionEnvironment, 0, deviceBitfield) : nullptr); } MyMockCsr &getAubMockCsr() const { @@ -120,11 +121,13 @@ struct CommandStreamReceiverWithAubDumpTest : public ::testing::TestWithParammemoryManager.get(); ASSERT_NE(nullptr, memoryManager); createAubCSR = GetParam(); - csrWithAubDump = new MyMockCsrWithAubDump(createAubCSR, *executionEnvironment); + DeviceBitfield deviceBitfield(1); + csrWithAubDump = new MyMockCsrWithAubDump(createAubCSR, *executionEnvironment, deviceBitfield); ASSERT_NE(nullptr, csrWithAubDump); auto osContext = executionEnvironment->memoryManager->createAndRegisterOsContext(csrWithAubDump, - getChosenEngineType(DEFAULT_TEST_PLATFORM::hwInfo), 1, + getChosenEngineType(DEFAULT_TEST_PLATFORM::hwInfo), + deviceBitfield, PreemptionHelper::getDefaultPreemptionMode(DEFAULT_TEST_PLATFORM::hwInfo), false, false, false); csrWithAubDump->setupContext(*osContext); @@ -146,8 +149,8 @@ using CommandStreamReceiverWithAubDumpSimpleTest = Test; HWTEST_F(CommandStreamReceiverWithAubDumpSimpleTest, givenCsrWithAubDumpWhenSettingOsContextThenReplicateItToAubCsr) { ExecutionEnvironment *executionEnvironment = platform()->peekExecutionEnvironment(); executionEnvironment->initializeMemoryManager(); - - CommandStreamReceiverWithAUBDump> csrWithAubDump("aubfile", *executionEnvironment, 0); + DeviceBitfield deviceBitfield(1); + CommandStreamReceiverWithAUBDump> csrWithAubDump("aubfile", *executionEnvironment, 0, deviceBitfield); auto hwInfo = executionEnvironment->rootDeviceEnvironments[0]->getHardwareInfo(); MockOsContext osContext(0, 1, HwHelper::get(hwInfo->platform.eRenderCoreFamily).getGpgpuEngineInstances(*hwInfo)[0].first, @@ -166,8 +169,8 @@ HWTEST_F(CommandStreamReceiverWithAubDumpSimpleTest, givenAubManagerAvailableWhe MockAubCenter *mockAubCenter = new MockAubCenter(defaultHwInfo.get(), false, fileName, CommandStreamReceiverType::CSR_TBX_WITH_AUB); mockAubCenter->aubManager = std::unique_ptr(mockManager); executionEnvironment->rootDeviceEnvironments[0]->aubCenter = std::unique_ptr(mockAubCenter); - - CommandStreamReceiverWithAUBDump> csrWithAubDump("aubfile", *executionEnvironment, 0); + DeviceBitfield deviceBitfield(1); + CommandStreamReceiverWithAUBDump> csrWithAubDump("aubfile", *executionEnvironment, 0, deviceBitfield); ASSERT_EQ(nullptr, csrWithAubDump.aubCSR); EXPECT_EQ(CommandStreamReceiverType::CSR_TBX_WITH_AUB, csrWithAubDump.getType()); } @@ -181,8 +184,8 @@ HWTEST_F(CommandStreamReceiverWithAubDumpSimpleTest, givenAubManagerAvailableWhe ExecutionEnvironment *executionEnvironment = platform()->peekExecutionEnvironment(); executionEnvironment->initializeMemoryManager(); executionEnvironment->rootDeviceEnvironments[0]->aubCenter = std::unique_ptr(mockAubCenter); - - CommandStreamReceiverWithAUBDump> csrWithAubDump("aubfile", *executionEnvironment, 0); + DeviceBitfield deviceBitfield(1); + CommandStreamReceiverWithAUBDump> csrWithAubDump("aubfile", *executionEnvironment, 0, deviceBitfield); ASSERT_NE(nullptr, csrWithAubDump.aubCSR); EXPECT_EQ(CommandStreamReceiverType::CSR_HW_WITH_AUB, csrWithAubDump.getType()); } @@ -194,11 +197,11 @@ HWTEST_F(CommandStreamReceiverWithAubDumpSimpleTest, givenCsrWithAubDumpWhenWait auto executionEnvironment = platform()->peekExecutionEnvironment(); executionEnvironment->initializeMemoryManager(); executionEnvironment->rootDeviceEnvironments[0]->aubCenter = std::unique_ptr(mockAubCenter); - - CommandStreamReceiverWithAUBDump> csrWithAubDump("file_name.aub", *executionEnvironment, 0); + DeviceBitfield deviceBitfield(1); + CommandStreamReceiverWithAUBDump> csrWithAubDump("file_name.aub", *executionEnvironment, 0, deviceBitfield); csrWithAubDump.initializeTagAllocation(); - auto mockAubCsr = new MockAubCsr("file_name.aub", false, *executionEnvironment, 0); + auto mockAubCsr = new MockAubCsr("file_name.aub", false, *executionEnvironment, 0, deviceBitfield); mockAubCsr->initializeTagAllocation(); csrWithAubDump.aubCSR.reset(mockAubCsr); @@ -217,8 +220,8 @@ HWTEST_F(CommandStreamReceiverWithAubDumpSimpleTest, givenCsrWithAubDumpWhenCrea auto executionEnvironment = platform()->peekExecutionEnvironment(); executionEnvironment->initializeMemoryManager(); executionEnvironment->rootDeviceEnvironments[0]->aubCenter = std::unique_ptr(mockAubCenter); - - CommandStreamReceiverWithAUBDump> csrWithAubDump("file_name.aub", *executionEnvironment, 0); + DeviceBitfield deviceBitfield(1); + CommandStreamReceiverWithAUBDump> csrWithAubDump("file_name.aub", *executionEnvironment, 0, deviceBitfield); EXPECT_NE(nullptr, csrWithAubDump.aubCSR->getTagAllocation()); EXPECT_NE(nullptr, csrWithAubDump.aubCSR->getTagAddress()); @@ -235,7 +238,8 @@ HWTEST_F(CommandStreamReceiverWithAubDumpSimpleTest, givenAubCsrWithHwWhenAdding executionEnvironment->rootDeviceEnvironments[0]->aubCenter = std::unique_ptr(mockAubCenter); EXPECT_FALSE(mockAubManager->addCommentCalled); - CommandStreamReceiverWithAUBDump> csrWithAubDump("file_name.aub", *executionEnvironment, 0); + DeviceBitfield deviceBitfield(1); + CommandStreamReceiverWithAUBDump> csrWithAubDump("file_name.aub", *executionEnvironment, 0, deviceBitfield); csrWithAubDump.addAubComment("test"); EXPECT_TRUE(mockAubManager->addCommentCalled); } @@ -248,8 +252,8 @@ HWTEST_F(CommandStreamReceiverWithAubDumpSimpleTest, givenAubCsrWithTbxWhenAddin auto executionEnvironment = platform()->peekExecutionEnvironment(); executionEnvironment->initializeMemoryManager(); executionEnvironment->rootDeviceEnvironments[0]->aubCenter = std::unique_ptr(mockAubCenter); - - CommandStreamReceiverWithAUBDump> csrWithAubDump("file_name.aub", *executionEnvironment, 0); + DeviceBitfield deviceBitfield(1); + CommandStreamReceiverWithAUBDump> csrWithAubDump("file_name.aub", *executionEnvironment, 0, deviceBitfield); csrWithAubDump.addAubComment("test"); EXPECT_FALSE(mockAubManager->addCommentCalled); } @@ -306,17 +310,17 @@ struct CommandStreamReceiverTagTests : public ::testing::Test { }; HWTEST_F(CommandStreamReceiverTagTests, givenCsrTypeWhenCreatingTimestampPacketAllocatorThenSetDefaultCompletionCheckType) { - EXPECT_TRUE(isTimestampPacketNodeReleasable>(*executionEnvironment, 0)); - EXPECT_FALSE(isTimestampPacketNodeReleasable>(fileName, false, *executionEnvironment, 0)); - EXPECT_FALSE(isTimestampPacketNodeReleasable>(fileName, *executionEnvironment, 0)); - EXPECT_FALSE(isTimestampPacketNodeReleasable>(fileName, *executionEnvironment, 0)); + EXPECT_TRUE(isTimestampPacketNodeReleasable>(*executionEnvironment, 0, 1)); + EXPECT_FALSE(isTimestampPacketNodeReleasable>(fileName, false, *executionEnvironment, 0, 1)); + EXPECT_FALSE(isTimestampPacketNodeReleasable>(fileName, *executionEnvironment, 0, 1)); + EXPECT_FALSE(isTimestampPacketNodeReleasable>(fileName, *executionEnvironment, 0, 1)); } HWTEST_F(CommandStreamReceiverTagTests, givenCsrTypeWhenAskingForTagPoolSizeThenReturnOneForAubTbxMode) { - EXPECT_EQ(2048u, getPreferredTagPoolSize>(*executionEnvironment, 0)); - EXPECT_EQ(1u, getPreferredTagPoolSize>(fileName, false, *executionEnvironment, 0)); - EXPECT_EQ(1u, getPreferredTagPoolSize>(fileName, *executionEnvironment, 0)); - EXPECT_EQ(1u, getPreferredTagPoolSize>(fileName, *executionEnvironment, 0)); + EXPECT_EQ(2048u, getPreferredTagPoolSize>(*executionEnvironment, 0, 1)); + EXPECT_EQ(1u, getPreferredTagPoolSize>(fileName, false, *executionEnvironment, 0, 1)); + EXPECT_EQ(1u, getPreferredTagPoolSize>(fileName, *executionEnvironment, 0, 1)); + EXPECT_EQ(1u, getPreferredTagPoolSize>(fileName, *executionEnvironment, 0, 1)); } using SimulatedCsrTest = ::testing::Test; @@ -330,8 +334,8 @@ HWTEST_F(SimulatedCsrTest, givenHwWithAubDumpCsrTypeWhenCreateCommandStreamRecei EXPECT_EQ(nullptr, executionEnvironment.rootDeviceEnvironments[expectedRootDeviceIndex]->aubCenter.get()); EXPECT_FALSE(rootDeviceEnvironment->initAubCenterCalled); - - auto csr = std::make_unique>>("", executionEnvironment, expectedRootDeviceIndex); + DeviceBitfield deviceBitfield(1); + auto csr = std::make_unique>>("", executionEnvironment, expectedRootDeviceIndex, deviceBitfield); EXPECT_TRUE(rootDeviceEnvironment->initAubCenterCalled); EXPECT_NE(nullptr, rootDeviceEnvironment->aubCenter.get()); } @@ -346,8 +350,8 @@ HWTEST_F(SimulatedCsrTest, givenTbxWithAubDumpCsrTypeWhenCreateCommandStreamRece EXPECT_EQ(nullptr, executionEnvironment.rootDeviceEnvironments[expectedRootDeviceIndex]->aubCenter.get()); EXPECT_FALSE(rootDeviceEnvironment->initAubCenterCalled); - - auto csr = std::make_unique>>("", executionEnvironment, expectedRootDeviceIndex); + DeviceBitfield deviceBitfield(1); + auto csr = std::make_unique>>("", executionEnvironment, expectedRootDeviceIndex, deviceBitfield); EXPECT_TRUE(rootDeviceEnvironment->initAubCenterCalled); EXPECT_NE(nullptr, rootDeviceEnvironment->aubCenter.get()); } @@ -357,8 +361,8 @@ HWTEST_F(CommandStreamReceiverWithAubDumpSimpleTest, givenNullAubManagerAvailabl ExecutionEnvironment *executionEnvironment = platform()->peekExecutionEnvironment(); executionEnvironment->initializeMemoryManager(); executionEnvironment->rootDeviceEnvironments[0]->aubCenter = std::unique_ptr(mockAubCenter); - - CommandStreamReceiverWithAUBDump> csrWithAubDump("aubfile", *executionEnvironment, 0); + DeviceBitfield deviceBitfield(1); + CommandStreamReceiverWithAUBDump> csrWithAubDump("aubfile", *executionEnvironment, 0, deviceBitfield); EXPECT_NE(nullptr, csrWithAubDump.aubCSR); } @@ -367,7 +371,8 @@ HWTEST_F(CommandStreamReceiverWithAubDumpSimpleTest, givenAubManagerNotAvailable MockExecutionEnvironment executionEnvironment(defaultHwInfo.get()); executionEnvironment.initializeMemoryManager(); - CommandStreamReceiverWithAUBDump> csrWithAubDump("aubfile", executionEnvironment, 0); + DeviceBitfield deviceBitfield(1); + CommandStreamReceiverWithAUBDump> csrWithAubDump("aubfile", executionEnvironment, 0, deviceBitfield); ASSERT_NE(nullptr, csrWithAubDump.aubCSR); } diff --git a/opencl/test/unit_test/command_stream/compute_mode_tests.h b/opencl/test/unit_test/command_stream/compute_mode_tests.h index 131519b82c..87a0b65b4e 100644 --- a/opencl/test/unit_test/command_stream/compute_mode_tests.h +++ b/opencl/test/unit_test/command_stream/compute_mode_tests.h @@ -22,7 +22,8 @@ struct ComputeModeRequirements : public ::testing::Test { using CommandStreamReceiver::commandStream; using CommandStreamReceiverHw::lastSentThreadArbitrationPolicy; using CommandStreamReceiverHw::requiredThreadArbitrationPolicy; - myCsr(ExecutionEnvironment &executionEnvironment) : UltCommandStreamReceiver(executionEnvironment, 0){}; + myCsr(ExecutionEnvironment &executionEnvironment, DeviceBitfield deviceBitfield) + : UltCommandStreamReceiver(executionEnvironment, 0, deviceBitfield){}; CsrSizeRequestFlags *getCsrRequestFlags() { return &this->csrSizeRequestFlags; } }; void makeResidentSharedAlloc() { @@ -67,7 +68,7 @@ struct ComputeModeRequirements : public ::testing::Test { template void SetUpImpl(const NEO::HardwareInfo *hardwareInfo) { device.reset(MockDevice::createWithNewExecutionEnvironment(hardwareInfo)); - csr = new myCsr(*device->executionEnvironment); + csr = new myCsr(*device->executionEnvironment, device->getDeviceBitfield()); device->resetCommandStreamReceiver(csr); AllocationProperties properties(device->getRootDeviceIndex(), false, MemoryConstants::pageSize, GraphicsAllocation::AllocationType::SHARED_BUFFER, false, {}); diff --git a/opencl/test/unit_test/command_stream/create_command_stream_receiver_tests.cpp b/opencl/test/unit_test/command_stream/create_command_stream_receiver_tests.cpp index b1f519a812..d124797c15 100644 --- a/opencl/test/unit_test/command_stream/create_command_stream_receiver_tests.cpp +++ b/opencl/test/unit_test/command_stream/create_command_stream_receiver_tests.cpp @@ -33,7 +33,7 @@ HWTEST_P(CreateCommandStreamReceiverTest, givenCreateCommandStreamWhenCsrIsSetTo VariableBackup backup(&ultHwConfig); ultHwConfig.useHwCsr = true; DebugManager.flags.SetCommandStreamReceiver.set(csrType); - auto csr = std::unique_ptr(createCommandStream(*executionEnvironment, 0)); + auto csr = std::unique_ptr(createCommandStream(*executionEnvironment, 0, 1)); if (csrType < CommandStreamReceiverType::CSR_TYPES_NUM) { EXPECT_NE(nullptr, csr.get()); diff --git a/opencl/test/unit_test/command_stream/submissions_aggregator_tests.cpp b/opencl/test/unit_test/command_stream/submissions_aggregator_tests.cpp index 2f88a61e1a..8ecd604d51 100644 --- a/opencl/test/unit_test/command_stream/submissions_aggregator_tests.cpp +++ b/opencl/test/unit_test/command_stream/submissions_aggregator_tests.cpp @@ -593,7 +593,7 @@ HWTEST_F(SubmissionsAggregatorTests, givenMultipleQueuesWhenCmdBuffersAreRecorde MockKernelWithInternals kernel(*device.get()); CommandQueueHw cmdQ1(context.get(), device.get(), 0, false); CommandQueueHw cmdQ2(context.get(), device.get(), 0, false); - auto mockCsr = new MockCsrHw2(*device->executionEnvironment, device->getRootDeviceIndex()); + auto mockCsr = new MockCsrHw2(*device->executionEnvironment, device->getRootDeviceIndex(), device->getDeviceBitfield()); mockCsr->useNewResourceImplicitFlush = false; mockCsr->useGpuIdleImplicitFlush = false; size_t GWS = 1; @@ -627,7 +627,7 @@ HWTEST_F(SubmissionsAggregatorTests, givenMultipleQueuesWhenCmdBuffersAreRecorde HWTEST_F(SubmissionsAggregatorTests, givenCmdQueueWhenCmdBufferWithEventIsRecordedThenAssignFlushStampObjForEveryone) { MockKernelWithInternals kernel(*device.get()); CommandQueueHw cmdQ1(context.get(), device.get(), 0, false); - auto mockCsr = new MockCsrHw2(*device->executionEnvironment, device->getRootDeviceIndex()); + auto mockCsr = new MockCsrHw2(*device->executionEnvironment, device->getRootDeviceIndex(), device->getDeviceBitfield()); mockCsr->useNewResourceImplicitFlush = false; mockCsr->useGpuIdleImplicitFlush = false; size_t GWS = 1; @@ -655,7 +655,7 @@ HWTEST_F(SubmissionsAggregatorTests, givenMultipleCmdBuffersWhenFlushThenUpdateA MockKernelWithInternals kernel(*device.get()); CommandQueueHw cmdQ1(context.get(), device.get(), 0, false); CommandQueueHw cmdQ2(context.get(), device.get(), 0, false); - auto mockCsr = new MockCsrHw2(*device->executionEnvironment, device->getRootDeviceIndex()); + auto mockCsr = new MockCsrHw2(*device->executionEnvironment, device->getRootDeviceIndex(), device->getDeviceBitfield()); mockCsr->useNewResourceImplicitFlush = false; mockCsr->useGpuIdleImplicitFlush = false; size_t GWS = 1; @@ -684,7 +684,7 @@ HWTEST_F(SubmissionsAggregatorTests, givenMultipleCmdBuffersWhenNotAggregatedDur MockKernelWithInternals kernel(*device.get()); CommandQueueHw cmdQ1(context.get(), device.get(), 0, false); CommandQueueHw cmdQ2(context.get(), device.get(), 0, false); - auto mockCsr = new MockCsrHw2(*device->executionEnvironment, device->getRootDeviceIndex()); + auto mockCsr = new MockCsrHw2(*device->executionEnvironment, device->getRootDeviceIndex(), device->getDeviceBitfield()); size_t GWS = 1; overrideCsr(mockCsr); diff --git a/opencl/test/unit_test/command_stream/tbx_command_stream_fixture.cpp b/opencl/test/unit_test/command_stream/tbx_command_stream_fixture.cpp index 0622fbcc7e..0a11260d96 100644 --- a/opencl/test/unit_test/command_stream/tbx_command_stream_fixture.cpp +++ b/opencl/test/unit_test/command_stream/tbx_command_stream_fixture.cpp @@ -20,7 +20,7 @@ namespace NEO { void TbxCommandStreamFixture::SetUp(MockDevice *pDevice) { // Create our TBX command stream receiver based on HW type - pCommandStreamReceiver = TbxCommandStreamReceiver::create("", false, *pDevice->executionEnvironment, pDevice->getRootDeviceIndex()); + pCommandStreamReceiver = TbxCommandStreamReceiver::create("", false, *pDevice->executionEnvironment, pDevice->getRootDeviceIndex(), pDevice->getDeviceBitfield()); ASSERT_NE(nullptr, pCommandStreamReceiver); memoryManager = new OsAgnosticMemoryManager(*pDevice->executionEnvironment); pDevice->resetCommandStreamReceiver(pCommandStreamReceiver); diff --git a/opencl/test/unit_test/command_stream/tbx_command_stream_tests.cpp b/opencl/test/unit_test/command_stream/tbx_command_stream_tests.cpp index ed93e5aa21..e9315c03e4 100644 --- a/opencl/test/unit_test/command_stream/tbx_command_stream_tests.cpp +++ b/opencl/test/unit_test/command_stream/tbx_command_stream_tests.cpp @@ -145,7 +145,7 @@ TEST(TbxCommandStreamReceiverTest, givenNullFactoryEntryWhenTbxCsrIsCreatedThenN tbxCommandStreamReceiverFactory[family] = nullptr; - CommandStreamReceiver *csr = TbxCommandStreamReceiver::create("", false, *executionEnvironment, 0); + CommandStreamReceiver *csr = TbxCommandStreamReceiver::create("", false, *executionEnvironment, 0, 1); EXPECT_EQ(nullptr, csr); } @@ -156,14 +156,14 @@ TEST(TbxCommandStreamReceiverTest, givenTbxCommandStreamReceiverWhenItIsCreatedW hwInfo->platform.eRenderCoreFamily = GFXCORE_FAMILY_FORCE_ULONG; // wrong gfx core family - CommandStreamReceiver *csr = TbxCommandStreamReceiver::create("", false, *executionEnvironment, 0); + CommandStreamReceiver *csr = TbxCommandStreamReceiver::create("", false, *executionEnvironment, 0, 1); EXPECT_EQ(nullptr, csr); } TEST(TbxCommandStreamReceiverTest, givenTbxCommandStreamReceiverWhenTypeIsCheckedThenTbxCsrIsReturned) { ExecutionEnvironment *executionEnvironment = platform()->peekExecutionEnvironment(); executionEnvironment->initializeMemoryManager(); - std::unique_ptr csr(TbxCommandStreamReceiver::create("", false, *executionEnvironment, 0)); + std::unique_ptr csr(TbxCommandStreamReceiver::create("", false, *executionEnvironment, 0, 1)); EXPECT_NE(nullptr, csr); EXPECT_EQ(CommandStreamReceiverType::CSR_TBX, csr->getType()); } @@ -191,7 +191,7 @@ HWTEST_F(TbxCommandStreamTests, givenTbxCommandStreamReceiverWhenItIsCreatedWith using TbxCsrWithAubDump = CommandStreamReceiverWithAUBDump>; std::unique_ptr tbxCsrWithAubDump(static_cast( - TbxCommandStreamReceiverHw::create("aubfile", true, *pDevice->executionEnvironment, pDevice->getRootDeviceIndex()))); + TbxCommandStreamReceiverHw::create("aubfile", true, *pDevice->executionEnvironment, pDevice->getRootDeviceIndex(), pDevice->getDeviceBitfield()))); EXPECT_TRUE(tbxCsrWithAubDump->aubManager->isOpen()); EXPECT_STREQ("aubcapture_file_name.aub", tbxCsrWithAubDump->aubManager->getFileName().c_str()); @@ -368,13 +368,13 @@ HWTEST_F(TbxCommandStreamTests, givenNoDbgDeviceIdFlagWhenTbxCsrIsCreatedThenUse HWTEST_F(TbxCommandStreamTests, givenDbgDeviceIdFlagIsSetWhenTbxCsrIsCreatedThenUseDebugDeviceId) { DebugManagerStateRestore stateRestore; DebugManager.flags.OverrideAubDeviceId.set(9); //this is Hsw, not used - std::unique_ptr> tbxCsr(reinterpret_cast *>(TbxCommandStreamReceiver::create("", false, *pDevice->executionEnvironment, pDevice->getRootDeviceIndex()))); + std::unique_ptr> tbxCsr(reinterpret_cast *>(TbxCommandStreamReceiver::create("", false, *pDevice->executionEnvironment, pDevice->getRootDeviceIndex(), pDevice->getDeviceBitfield()))); EXPECT_EQ(9u, tbxCsr->aubDeviceId); } HWTEST_F(TbxCommandSteamSimpleTest, givenTbxCsrWhenCallingMakeSurfacePackNonResidentThenOnlyResidentAllocationsAddedAllocationsForDownload) { - MockTbxCsr tbxCsr{*pDevice->executionEnvironment}; - MockOsContext osContext(0, 1, aub_stream::ENGINE_RCS, PreemptionMode::Disabled, false, false, false); + MockTbxCsr tbxCsr{*pDevice->executionEnvironment, pDevice->getDeviceBitfield()}; + MockOsContext osContext(0, pDevice->getDeviceBitfield(), aub_stream::ENGINE_RCS, PreemptionMode::Disabled, false, false, false); tbxCsr.setupContext(osContext); EXPECT_EQ(0u, tbxCsr.allocationsForDownload.size()); @@ -394,8 +394,8 @@ HWTEST_F(TbxCommandSteamSimpleTest, givenTbxCsrWhenCallingMakeSurfacePackNonResi } HWTEST_F(TbxCommandSteamSimpleTest, givenTbxCsrWhenCallingWaitForTaskCountWithKmdNotifyFallbackThenTagAllocationAndScheduledAllocationsAreDownloaded) { - MockTbxCsrRegisterDownloadedAllocations tbxCsr{*pDevice->executionEnvironment, pDevice->getRootDeviceIndex()}; - MockOsContext osContext(0, 1, aub_stream::ENGINE_RCS, PreemptionMode::Disabled, false, false, false); + MockTbxCsrRegisterDownloadedAllocations tbxCsr{*pDevice->executionEnvironment, pDevice->getRootDeviceIndex(), pDevice->getDeviceBitfield()}; + MockOsContext osContext(0, pDevice->getDeviceBitfield(), aub_stream::ENGINE_RCS, PreemptionMode::Disabled, false, false, false); uint32_t tag = 0u; tbxCsr.setupContext(osContext); tbxCsr.setTagAllocation(pDevice->getMemoryManager()->allocateGraphicsMemoryWithProperties(MockAllocationProperties{pDevice->getRootDeviceIndex(), false, sizeof(tag), pDevice->getDeviceBitfield()}, &tag)); @@ -419,8 +419,8 @@ HWTEST_F(TbxCommandSteamSimpleTest, givenTbxCsrWhenCallingWaitForTaskCountWithKm } HWTEST_F(TbxCommandSteamSimpleTest, givenTbxCsrWhenCallingWaitForCompletionWithTimeoutThenFlushIsCalledAndTagAllocationAndScheduledAllocationsAreDownloaded) { - MockTbxCsrRegisterDownloadedAllocations tbxCsr{*pDevice->executionEnvironment, pDevice->getRootDeviceIndex()}; - MockOsContext osContext(0, 1, aub_stream::ENGINE_RCS, PreemptionMode::Disabled, false, false, false); + MockTbxCsrRegisterDownloadedAllocations tbxCsr{*pDevice->executionEnvironment, pDevice->getRootDeviceIndex(), pDevice->getDeviceBitfield()}; + MockOsContext osContext(0, pDevice->getDeviceBitfield(), aub_stream::ENGINE_RCS, PreemptionMode::Disabled, false, false, false); uint32_t tag = 0u; tbxCsr.setupContext(osContext); tbxCsr.setTagAllocation(pDevice->getMemoryManager()->allocateGraphicsMemoryWithProperties(MockAllocationProperties{pDevice->getRootDeviceIndex(), false, sizeof(tag), pDevice->getDeviceBitfield()}, &tag)); @@ -445,8 +445,8 @@ HWTEST_F(TbxCommandSteamSimpleTest, givenTbxCsrWhenCallingWaitForCompletionWithT } HWTEST_F(TbxCommandSteamSimpleTest, givenTbxCsrWhenDownloadAllocatoinsCalledThenTagAndScheduledAllocationsAreDownloadedAndRemovedFromContainer) { - MockTbxCsrRegisterDownloadedAllocations tbxCsr{*pDevice->executionEnvironment, pDevice->getRootDeviceIndex()}; - MockOsContext osContext(0, 1, aub_stream::ENGINE_RCS, PreemptionMode::Disabled, false, false, false); + MockTbxCsrRegisterDownloadedAllocations tbxCsr{*pDevice->executionEnvironment, pDevice->getRootDeviceIndex(), pDevice->getDeviceBitfield()}; + MockOsContext osContext(0, pDevice->getDeviceBitfield(), aub_stream::ENGINE_RCS, PreemptionMode::Disabled, false, false, false); uint32_t tag = 0u; tbxCsr.setupContext(osContext); tbxCsr.setTagAllocation(pDevice->getMemoryManager()->allocateGraphicsMemoryWithProperties(MockAllocationProperties{pDevice->getRootDeviceIndex(), false, sizeof(tag), pDevice->getDeviceBitfield()}, &tag)); @@ -461,7 +461,7 @@ HWTEST_F(TbxCommandSteamSimpleTest, givenTbxCsrWhenDownloadAllocatoinsCalledThen } HWTEST_F(TbxCommandSteamSimpleTest, whenTbxCommandStreamReceiverIsCreatedThenPPGTTAndGGTTCreatedHavePhysicalAddressAllocatorSet) { - MockTbxCsr tbxCsr(*pDevice->executionEnvironment); + MockTbxCsr tbxCsr(*pDevice->executionEnvironment, pDevice->getDeviceBitfield()); uintptr_t address = 0x20000; auto physicalAddress = tbxCsr.ppgtt->map(address, MemoryConstants::pageSize, 0, MemoryBanks::MainBank); @@ -472,7 +472,7 @@ HWTEST_F(TbxCommandSteamSimpleTest, whenTbxCommandStreamReceiverIsCreatedThenPPG } HWTEST_F(TbxCommandSteamSimpleTest, givenTbxCommandStreamReceiverWhenPhysicalAddressAllocatorIsCreatedThenItIsNotNull) { - MockTbxCsr tbxCsr(*pDevice->executionEnvironment); + MockTbxCsr tbxCsr(*pDevice->executionEnvironment, pDevice->getDeviceBitfield()); std::unique_ptr allocator(tbxCsr.createPhysicalAddressAllocator(&hardwareInfo)); ASSERT_NE(nullptr, allocator); } @@ -483,13 +483,13 @@ HWTEST_F(TbxCommandStreamTests, givenTbxCommandStreamReceiverWhenItIsCreatedWith MockExecutionEnvironment executionEnvironment(defaultHwInfo.get(), false, 1); executionEnvironment.initializeMemoryManager(); - auto tbxCsr = std::make_unique>(executionEnvironment, 0); + auto tbxCsr = std::make_unique>(executionEnvironment, 0, 1); EXPECT_EQ(nullptr, executionEnvironment.rootDeviceEnvironments[0]->aubCenter->getAubManager()); } HWTEST_F(TbxCommandStreamTests, givenTbxCommandStreamReceiverWhenFlushIsCalledThenItShouldCallTheExpectedHwContextFunctions) { - MockTbxCsr tbxCsr(*pDevice->executionEnvironment); - MockOsContext osContext(0, 1, aub_stream::ENGINE_RCS, PreemptionMode::Disabled, false, false, false); + MockTbxCsr tbxCsr(*pDevice->executionEnvironment, pDevice->getDeviceBitfield()); + MockOsContext osContext(0, pDevice->getDeviceBitfield(), aub_stream::ENGINE_RCS, PreemptionMode::Disabled, false, false, false); tbxCsr.setupContext(osContext); auto mockHardwareContext = static_cast(tbxCsr.hardwareContextController->hardwareContexts[0].get()); @@ -515,8 +515,8 @@ HWTEST_F(TbxCommandStreamTests, givenTbxCommandStreamReceiverInBatchedModeWhenFl DebugManagerStateRestore dbgRestore; DebugManager.flags.CsrDispatchMode.set(static_cast(DispatchMode::BatchedDispatch)); - MockTbxCsr tbxCsr(*pDevice->executionEnvironment); - MockOsContext osContext(0, 1, aub_stream::ENGINE_RCS, PreemptionMode::Disabled, false, false, false); + MockTbxCsr tbxCsr(*pDevice->executionEnvironment, pDevice->getDeviceBitfield()); + MockOsContext osContext(0, pDevice->getDeviceBitfield(), aub_stream::ENGINE_RCS, PreemptionMode::Disabled, false, false, false); tbxCsr.setupContext(osContext); auto commandBuffer = pDevice->executionEnvironment->memoryManager->allocateGraphicsMemoryWithProperties(MockAllocationProperties{pDevice->getRootDeviceIndex(), MemoryConstants::pageSize, pDevice->getDeviceBitfield()}); @@ -533,8 +533,8 @@ HWTEST_F(TbxCommandStreamTests, givenTbxCommandStreamReceiverInBatchedModeWhenFl } HWTEST_F(TbxCommandStreamTests, givenTbxCommandStreamReceiverWhenFlushIsCalledWithZeroSizedBufferThenSubmitIsNotCalledOnHwContext) { - MockTbxCsr tbxCsr(*pDevice->executionEnvironment); - MockOsContext osContext(0, 1, aub_stream::ENGINE_RCS, PreemptionMode::Disabled, false, false, false); + MockTbxCsr tbxCsr(*pDevice->executionEnvironment, pDevice->getDeviceBitfield()); + MockOsContext osContext(0, pDevice->getDeviceBitfield(), aub_stream::ENGINE_RCS, PreemptionMode::Disabled, false, false, false); tbxCsr.setupContext(osContext); auto mockHardwareContext = static_cast(tbxCsr.hardwareContextController->hardwareContexts[0].get()); @@ -551,8 +551,8 @@ HWTEST_F(TbxCommandStreamTests, givenTbxCommandStreamReceiverWhenFlushIsCalledWi } HWTEST_F(TbxCommandStreamTests, givenTbxCommandStreamReceiverWhenMakeResidentIsCalledThenItShouldCallTheExpectedHwContextFunctions) { - MockTbxCsr tbxCsr(*pDevice->executionEnvironment); - MockOsContext osContext(0, 1, aub_stream::ENGINE_RCS, PreemptionMode::Disabled, false, false, false); + MockTbxCsr tbxCsr(*pDevice->executionEnvironment, pDevice->getDeviceBitfield()); + MockOsContext osContext(0, pDevice->getDeviceBitfield(), aub_stream::ENGINE_RCS, PreemptionMode::Disabled, false, false, false); tbxCsr.setupContext(osContext); MockGraphicsAllocation allocation(reinterpret_cast(0x1000), 0x1000); @@ -563,8 +563,8 @@ HWTEST_F(TbxCommandStreamTests, givenTbxCommandStreamReceiverWhenMakeResidentIsC } HWTEST_F(TbxCommandStreamTests, givenTbxCommandStreamReceiverWhenDownloadAllocationIsCalledThenItShouldCallTheExpectedHwContextFunctions) { - MockTbxCsr tbxCsr(*pDevice->executionEnvironment); - MockOsContext osContext(0, 1, aub_stream::ENGINE_RCS, PreemptionMode::Disabled, false, false, false); + MockTbxCsr tbxCsr(*pDevice->executionEnvironment, pDevice->getDeviceBitfield()); + MockOsContext osContext(0, pDevice->getDeviceBitfield(), aub_stream::ENGINE_RCS, PreemptionMode::Disabled, false, false, false); tbxCsr.setupContext(osContext); auto mockHardwareContext = static_cast(tbxCsr.hardwareContextController->hardwareContexts[0].get()); @@ -581,14 +581,14 @@ HWTEST_F(TbxCommandStreamTests, givenTbxCsrWhenHardwareContextIsCreatedThenTbxSt pDevice->executionEnvironment->rootDeviceEnvironments[0]->aubCenter = std::unique_ptr(mockAubCenter); auto tbxCsr = std::unique_ptr>(reinterpret_cast *>( - TbxCommandStreamReceiverHw::create("", false, *pDevice->executionEnvironment, pDevice->getRootDeviceIndex()))); + TbxCommandStreamReceiverHw::create("", false, *pDevice->executionEnvironment, pDevice->getRootDeviceIndex(), pDevice->getDeviceBitfield()))); EXPECT_FALSE(tbxCsr->streamInitialized); } HWTEST_F(TbxCommandStreamTests, givenTbxCsrWhenOsContextIsSetThenCreateHardwareContext) { auto hwInfo = pDevice->getHardwareInfo(); - MockOsContext osContext(0, 1, HwHelper::get(hwInfo.platform.eRenderCoreFamily).getGpgpuEngineInstances(hwInfo)[0].first, + MockOsContext osContext(0, pDevice->getDeviceBitfield(), HwHelper::get(hwInfo.platform.eRenderCoreFamily).getGpgpuEngineInstances(hwInfo)[0].first, PreemptionMode::Disabled, false, false, false); std::string fileName = ""; MockAubManager *mockManager = new MockAubManager(); @@ -597,7 +597,7 @@ HWTEST_F(TbxCommandStreamTests, givenTbxCsrWhenOsContextIsSetThenCreateHardwareC pDevice->executionEnvironment->rootDeviceEnvironments[0]->aubCenter = std::unique_ptr(mockAubCenter); - std::unique_ptr> tbxCsr(reinterpret_cast *>(TbxCommandStreamReceiver::create(fileName, false, *pDevice->executionEnvironment, pDevice->getRootDeviceIndex()))); + std::unique_ptr> tbxCsr(reinterpret_cast *>(TbxCommandStreamReceiver::create(fileName, false, *pDevice->executionEnvironment, pDevice->getRootDeviceIndex(), pDevice->getDeviceBitfield()))); EXPECT_EQ(nullptr, tbxCsr->hardwareContextController.get()); tbxCsr->setupContext(osContext); @@ -605,11 +605,11 @@ HWTEST_F(TbxCommandStreamTests, givenTbxCsrWhenOsContextIsSetThenCreateHardwareC } HWTEST_F(TbxCommandStreamTests, givenTbxCsrWhenPollForCompletionImplIsCalledThenSimulatedCsrMethodIsCalled) { - std::unique_ptr> tbxCsr(reinterpret_cast *>(TbxCommandStreamReceiver::create("", false, *pDevice->executionEnvironment, pDevice->getRootDeviceIndex()))); + std::unique_ptr> tbxCsr(reinterpret_cast *>(TbxCommandStreamReceiver::create("", false, *pDevice->executionEnvironment, pDevice->getRootDeviceIndex(), pDevice->getDeviceBitfield()))); tbxCsr->pollForCompletionImpl(); } HWTEST_F(TbxCommandStreamTests, givenTbxCsrWhenItIsQueriedForPreferredTagPoolSizeThenOneIsReturned) { - std::unique_ptr> tbxCsr(reinterpret_cast *>(TbxCommandStreamReceiver::create("", false, *pDevice->executionEnvironment, pDevice->getRootDeviceIndex()))); + std::unique_ptr> tbxCsr(reinterpret_cast *>(TbxCommandStreamReceiver::create("", false, *pDevice->executionEnvironment, pDevice->getRootDeviceIndex(), pDevice->getDeviceBitfield()))); EXPECT_EQ(1u, tbxCsr->getPreferredTagPoolSize()); } @@ -623,7 +623,7 @@ HWTEST_F(TbxCommandStreamTests, givenTbxCsrWhenCreatedWithAubDumpThenFileNameIsE auto fullName = AUBCommandStreamReceiver::createFullFilePath(*defaultHwInfo, "aubfile"); - std::unique_ptr> tbxCsr(reinterpret_cast *>(TbxCommandStreamReceiver::create("aubfile", true, executionEnvironment, 0))); + std::unique_ptr> tbxCsr(reinterpret_cast *>(TbxCommandStreamReceiver::create("aubfile", true, executionEnvironment, 0, 1))); EXPECT_STREQ(fullName.c_str(), rootDeviceEnvironment->aubFileNameReceived.c_str()); } @@ -633,7 +633,7 @@ HWTEST_F(TbxCommandStreamTests, givenTbxCsrWhenCreatedWithAubDumpThenOpenIsCalle executionEnvironment.initializeMemoryManager(); std::unique_ptr> tbxCsrWithAubDump(reinterpret_cast *>( - TbxCommandStreamReceiver::create("aubfile", true, executionEnvironment, 0))); + TbxCommandStreamReceiver::create("aubfile", true, executionEnvironment, 0, 1))); EXPECT_TRUE(tbxCsrWithAubDump->aubManager->isOpen()); } @@ -651,7 +651,7 @@ HWTEST_F(SimulatedCsrTest, givenTbxCsrTypeWhenCreateCommandStreamReceiverThenPro EXPECT_EQ(nullptr, executionEnvironment.rootDeviceEnvironments[expectedRootDeviceIndex]->aubCenter.get()); EXPECT_FALSE(rootDeviceEnvironment->initAubCenterCalled); - auto csr = std::make_unique>(executionEnvironment, expectedRootDeviceIndex); + auto csr = std::make_unique>(executionEnvironment, expectedRootDeviceIndex, 1); EXPECT_NE(nullptr, executionEnvironment.rootDeviceEnvironments[expectedRootDeviceIndex]->aubCenter.get()); EXPECT_TRUE(rootDeviceEnvironment->initAubCenterCalled); } @@ -665,7 +665,7 @@ HWTEST_F(TbxCommandStreamTests, givenTbxCsrWhenCreatedWithAubDumpInSubCaptureMod executionEnvironment.initializeMemoryManager(); std::unique_ptr> tbxCsrWithAubDump(static_cast *>( - TbxCommandStreamReceiver::create("aubfile", true, executionEnvironment, 0))); + TbxCommandStreamReceiver::create("aubfile", true, executionEnvironment, 0, 1))); EXPECT_TRUE(tbxCsrWithAubDump->aubManager->isOpen()); auto subCaptureManager = tbxCsrWithAubDump->subCaptureManager.get(); @@ -680,18 +680,18 @@ HWTEST_F(TbxCommandStreamTests, givenTbxCsrWhenCreatedWithAubDumpSeveralTimesThe executionEnvironment.initializeMemoryManager(); auto tbxCsrWithAubDump1 = std::unique_ptr>(reinterpret_cast *>( - TbxCommandStreamReceiverHw::create("aubfile", true, executionEnvironment, 0))); + TbxCommandStreamReceiverHw::create("aubfile", true, executionEnvironment, 0, 1))); auto tbxCsrWithAubDump2 = std::unique_ptr>(reinterpret_cast *>( - TbxCommandStreamReceiverHw::create("aubfile", true, executionEnvironment, 0))); + TbxCommandStreamReceiverHw::create("aubfile", true, executionEnvironment, 0, 1))); auto mockManager = reinterpret_cast(executionEnvironment.rootDeviceEnvironments[0]->aubCenter->getAubManager()); EXPECT_EQ(1u, mockManager->openCalledCnt); } HWTEST_F(TbxCommandStreamTests, givenTbxCsrInSubCaptureModeWhenFlushIsCalledAndSubCaptureIsDisabledThenPauseShouldBeTurnedOn) { - MockTbxCsr tbxCsr{*pDevice->executionEnvironment}; - MockOsContext osContext(0, 1, aub_stream::ENGINE_RCS, PreemptionMode::Disabled, false, false, false); + MockTbxCsr tbxCsr{*pDevice->executionEnvironment, pDevice->getDeviceBitfield()}; + MockOsContext osContext(0, pDevice->getDeviceBitfield(), aub_stream::ENGINE_RCS, PreemptionMode::Disabled, false, false, false); tbxCsr.setupContext(osContext); AubSubCaptureCommon aubSubCaptureCommon; @@ -713,8 +713,8 @@ HWTEST_F(TbxCommandStreamTests, givenTbxCsrInSubCaptureModeWhenFlushIsCalledAndS } HWTEST_F(TbxCommandStreamTests, givenTbxCsrInSubCaptureModeWhenFlushIsCalledAndSubCaptureIsEnabledThenPauseShouldBeTurnedOff) { - MockTbxCsr tbxCsr{*pDevice->executionEnvironment}; - MockOsContext osContext(0, 1, aub_stream::ENGINE_RCS, PreemptionMode::Disabled, false, false, false); + MockTbxCsr tbxCsr{*pDevice->executionEnvironment, pDevice->getDeviceBitfield()}; + MockOsContext osContext(0, pDevice->getDeviceBitfield(), aub_stream::ENGINE_RCS, PreemptionMode::Disabled, false, false, false); tbxCsr.setupContext(osContext); AubSubCaptureCommon aubSubCaptureCommon; @@ -737,8 +737,8 @@ HWTEST_F(TbxCommandStreamTests, givenTbxCsrInSubCaptureModeWhenFlushIsCalledAndS } HWTEST_F(TbxCommandStreamTests, givenTbxCsrInSubCaptureModeWhenFlushIsCalledAndSubCaptureIsEnabledThenCallPollForCompletionAndDisableSubCapture) { - MockTbxCsr tbxCsr{*pDevice->executionEnvironment}; - MockOsContext osContext(0, 1, aub_stream::ENGINE_RCS, PreemptionMode::Disabled, false, false, false); + MockTbxCsr tbxCsr{*pDevice->executionEnvironment, pDevice->getDeviceBitfield()}; + MockOsContext osContext(0, pDevice->getDeviceBitfield(), aub_stream::ENGINE_RCS, PreemptionMode::Disabled, false, false, false); tbxCsr.setupContext(osContext); AubSubCaptureCommon aubSubCaptureCommon; @@ -761,8 +761,8 @@ HWTEST_F(TbxCommandStreamTests, givenTbxCsrInSubCaptureModeWhenFlushIsCalledAndS } HWTEST_F(TbxCommandStreamTests, givenTbxCsrInSubCaptureModeWhenFlushIsCalledAndSubCaptureGetsActivatedThenCallSubmitBatchBufferWithOverrideRingBufferSetToTrue) { - MockTbxCsr tbxCsr{*pDevice->executionEnvironment}; - MockOsContext osContext(0, 1, aub_stream::ENGINE_RCS, PreemptionMode::Disabled, false, false, false); + MockTbxCsr tbxCsr{*pDevice->executionEnvironment, pDevice->getDeviceBitfield()}; + MockOsContext osContext(0, pDevice->getDeviceBitfield(), aub_stream::ENGINE_RCS, PreemptionMode::Disabled, false, false, false); tbxCsr.setupContext(osContext); AubSubCaptureCommon aubSubCaptureCommon; @@ -786,8 +786,8 @@ HWTEST_F(TbxCommandStreamTests, givenTbxCsrInSubCaptureModeWhenFlushIsCalledAndS } HWTEST_F(TbxCommandStreamTests, givenTbxCsrInSubCaptureModeWhenFlushIsCalledAndSubCaptureRemainsActiveThenCallSubmitBatchBufferWithOverrideRingBufferSetToTrue) { - MockTbxCsr tbxCsr{*pDevice->executionEnvironment}; - MockOsContext osContext(0, 1, aub_stream::ENGINE_RCS, PreemptionMode::Disabled, false, false, false); + MockTbxCsr tbxCsr{*pDevice->executionEnvironment, pDevice->getDeviceBitfield()}; + MockOsContext osContext(0, pDevice->getDeviceBitfield(), aub_stream::ENGINE_RCS, PreemptionMode::Disabled, false, false, false); tbxCsr.setupContext(osContext); AubSubCaptureCommon aubSubCaptureCommon; @@ -813,7 +813,7 @@ HWTEST_F(TbxCommandStreamTests, givenTbxCsrInSubCaptureModeWhenFlushIsCalledAndS HWTEST_F(TbxCommandStreamTests, givenTbxCsrWhenProcessResidencyIsCalledWithDumpTbxNonWritableFlagThenAllocationsForResidencyShouldBeMadeTbxWritable) { std::unique_ptr memoryManager(nullptr); - std::unique_ptr> tbxCsr(new MockTbxCsrToTestDumpTbxNonWritable(*pDevice->executionEnvironment, pDevice->getRootDeviceIndex())); + std::unique_ptr> tbxCsr(new MockTbxCsrToTestDumpTbxNonWritable(*pDevice->executionEnvironment, pDevice->getRootDeviceIndex(), pDevice->getDeviceBitfield())); memoryManager.reset(new OsAgnosticMemoryManager(*pDevice->executionEnvironment)); tbxCsr->setupContext(*pDevice->getDefaultEngine().osContext); @@ -833,7 +833,7 @@ HWTEST_F(TbxCommandStreamTests, givenTbxCsrWhenProcessResidencyIsCalledWithDumpT HWTEST_F(TbxCommandStreamTests, givenTbxCsrWhenProcessResidencyIsCalledWithoutDumpTbxWritableFlagThenAllocationsForResidencyShouldBeKeptNonTbxWritable) { std::unique_ptr memoryManager(nullptr); - std::unique_ptr> tbxCsr(new MockTbxCsrToTestDumpTbxNonWritable(*pDevice->executionEnvironment, pDevice->getRootDeviceIndex())); + std::unique_ptr> tbxCsr(new MockTbxCsrToTestDumpTbxNonWritable(*pDevice->executionEnvironment, pDevice->getRootDeviceIndex(), pDevice->getDeviceBitfield())); memoryManager.reset(new OsAgnosticMemoryManager(*pDevice->executionEnvironment)); tbxCsr->setupContext(*pDevice->getDefaultEngine().osContext); @@ -852,8 +852,8 @@ HWTEST_F(TbxCommandStreamTests, givenTbxCsrWhenProcessResidencyIsCalledWithoutDu } HWTEST_F(TbxCommandStreamTests, givenTbxCsrInSubCaptureModeWhenCheckAndActivateAubSubCaptureIsCalledAndSubCaptureIsInactiveThenDontForceDumpingAllocationsTbxNonWritable) { - MockTbxCsr tbxCsr{*pDevice->executionEnvironment}; - MockOsContext osContext(0, 1, aub_stream::ENGINE_RCS, PreemptionMode::Disabled, false, false, false); + MockTbxCsr tbxCsr{*pDevice->executionEnvironment, pDevice->getDeviceBitfield()}; + MockOsContext osContext(0, pDevice->getDeviceBitfield(), aub_stream::ENGINE_RCS, PreemptionMode::Disabled, false, false, false); tbxCsr.setupContext(osContext); AubSubCaptureCommon aubSubCaptureCommon; @@ -875,8 +875,8 @@ HWTEST_F(TbxCommandStreamTests, givenTbxCsrInSubCaptureModeWhenCheckAndActivateA } HWTEST_F(TbxCommandStreamTests, givenTbxCsrInSubCaptureModeWhenCheckAndActivateAubSubCaptureIsCalledAndSubCaptureGetsActivatedThenForceDumpingAllocationsTbxNonWritable) { - MockTbxCsr tbxCsr{*pDevice->executionEnvironment}; - MockOsContext osContext(0, 1, aub_stream::ENGINE_RCS, PreemptionMode::Disabled, false, false, false); + MockTbxCsr tbxCsr{*pDevice->executionEnvironment, pDevice->getDeviceBitfield()}; + MockOsContext osContext(0, pDevice->getDeviceBitfield(), aub_stream::ENGINE_RCS, PreemptionMode::Disabled, false, false, false); tbxCsr.setupContext(osContext); AubSubCaptureCommon aubSubCaptureCommon; @@ -901,8 +901,8 @@ HWTEST_F(TbxCommandStreamTests, givenTbxCsrInSubCaptureModeWhenCheckAndActivateA } HWTEST_F(TbxCommandStreamTests, givenTbxCsrInSubCaptureModeWhenCheckAndActivateAubSubCaptureIsCalledAndSubCaptureRemainsActivatedThenDontForceDumpingAllocationsTbxNonWritable) { - MockTbxCsr tbxCsr{*pDevice->executionEnvironment}; - MockOsContext osContext(0, 1, aub_stream::ENGINE_RCS, PreemptionMode::Disabled, false, false, false); + MockTbxCsr tbxCsr{*pDevice->executionEnvironment, pDevice->getDeviceBitfield()}; + MockOsContext osContext(0, pDevice->getDeviceBitfield(), aub_stream::ENGINE_RCS, PreemptionMode::Disabled, false, false, false); tbxCsr.setupContext(osContext); AubSubCaptureCommon aubSubCaptureCommon; @@ -927,8 +927,8 @@ HWTEST_F(TbxCommandStreamTests, givenTbxCsrInSubCaptureModeWhenCheckAndActivateA } HWTEST_F(TbxCommandStreamTests, givenTbxCsrInNonSubCaptureModeWhenCheckAndActivateAubSubCaptureIsCalledThenReturnStatusInactive) { - MockTbxCsr tbxCsr{*pDevice->executionEnvironment}; - MockOsContext osContext(0, 1, aub_stream::ENGINE_RCS, PreemptionMode::Disabled, false, false, false); + MockTbxCsr tbxCsr{*pDevice->executionEnvironment, pDevice->getDeviceBitfield()}; + MockOsContext osContext(0, pDevice->getDeviceBitfield(), aub_stream::ENGINE_RCS, PreemptionMode::Disabled, false, false, false); tbxCsr.setupContext(osContext); MultiDispatchInfo dispatchInfo; @@ -944,16 +944,16 @@ HWTEST_F(TbxCommandStreamTests, givenTbxCsrWhenDispatchBlitEnqueueThenProcessCor MockContext context(pClDevice); - MockTbxCsr tbxCsr0{*pDevice->executionEnvironment}; + MockTbxCsr tbxCsr0{*pDevice->executionEnvironment, pDevice->getDeviceBitfield()}; tbxCsr0.initializeTagAllocation(); - MockTbxCsr tbxCsr1{*pDevice->executionEnvironment}; + MockTbxCsr tbxCsr1{*pDevice->executionEnvironment, pDevice->getDeviceBitfield()}; tbxCsr1.initializeTagAllocation(); - MockOsContext osContext0(0, 1, aub_stream::ENGINE_RCS, PreemptionMode::Disabled, false, false, false); + MockOsContext osContext0(0, pDevice->getDeviceBitfield(), aub_stream::ENGINE_RCS, PreemptionMode::Disabled, false, false, false); tbxCsr0.setupContext(osContext0); EngineControl engineControl0{&tbxCsr0, &osContext0}; - MockOsContext osContext1(1, 1, aub_stream::ENGINE_BCS, PreemptionMode::Disabled, false, false, false); + MockOsContext osContext1(1, pDevice->getDeviceBitfield(), aub_stream::ENGINE_BCS, PreemptionMode::Disabled, false, false, false); tbxCsr1.setupContext(osContext0); EngineControl engineControl1{&tbxCsr1, &osContext1}; @@ -970,8 +970,8 @@ HWTEST_F(TbxCommandStreamTests, givenTbxCsrWhenDispatchBlitEnqueueThenProcessCor } HWTEST_F(TbxCommandStreamTests, givenGraphicsAllocationWhenDumpAllocationIsCalledButBcsIsUsedThenGraphicsAllocationShouldNotBeDumped) { - MockTbxCsr tbxCsr(*pDevice->executionEnvironment); - MockOsContext osContext(0, 1, aub_stream::ENGINE_BCS, PreemptionMode::Disabled, false, false, false); + MockTbxCsr tbxCsr(*pDevice->executionEnvironment, pDevice->getDeviceBitfield()); + MockOsContext osContext(0, pDevice->getDeviceBitfield(), aub_stream::ENGINE_BCS, PreemptionMode::Disabled, false, false, false); tbxCsr.setupContext(osContext); auto mockHardwareContext = static_cast(tbxCsr.hardwareContextController->hardwareContexts[0].get()); @@ -986,8 +986,8 @@ HWTEST_F(TbxCommandStreamTests, givenGraphicsAllocationWhenDumpAllocationIsCalle } HWTEST_F(TbxCommandStreamTests, givenGraphicsAllocationWritableWhenDumpAllocationIsCalledButDumpFormatIsNotSpecifiedThenGraphicsAllocationShouldNotBeDumped) { - MockTbxCsr tbxCsr(*pDevice->executionEnvironment); - MockOsContext osContext(0, 1, aub_stream::ENGINE_RCS, PreemptionMode::Disabled, false, false, false); + MockTbxCsr tbxCsr(*pDevice->executionEnvironment, pDevice->getDeviceBitfield()); + MockOsContext osContext(0, pDevice->getDeviceBitfield(), aub_stream::ENGINE_RCS, PreemptionMode::Disabled, false, false, false); tbxCsr.setupContext(osContext); auto mockHardwareContext = static_cast(tbxCsr.hardwareContextController->hardwareContexts[0].get()); @@ -1008,8 +1008,8 @@ HWTEST_F(TbxCommandStreamTests, givenGraphicsAllocationWritableWhenDumpAllocatio DebugManagerStateRestore dbgRestore; DebugManager.flags.AUBDumpBufferFormat.set("BIN"); - MockTbxCsr tbxCsr(*pDevice->executionEnvironment); - MockOsContext osContext(0, 1, aub_stream::ENGINE_RCS, PreemptionMode::Disabled, false, false, false); + MockTbxCsr tbxCsr(*pDevice->executionEnvironment, pDevice->getDeviceBitfield()); + MockOsContext osContext(0, pDevice->getDeviceBitfield(), aub_stream::ENGINE_RCS, PreemptionMode::Disabled, false, false, false); tbxCsr.setupContext(osContext); auto mockHardwareContext = static_cast(tbxCsr.hardwareContextController->hardwareContexts[0].get()); @@ -1030,8 +1030,8 @@ HWTEST_F(TbxCommandStreamTests, givenGraphicsAllocationWhenDumpAllocationIsCalle DebugManager.flags.AUBDumpAllocsOnEnqueueReadOnly.set(true); DebugManager.flags.AUBDumpBufferFormat.set("BIN"); - MockTbxCsr tbxCsr(*pDevice->executionEnvironment); - MockOsContext osContext(0, 1, aub_stream::ENGINE_RCS, PreemptionMode::Disabled, false, false, false); + MockTbxCsr tbxCsr(*pDevice->executionEnvironment, pDevice->getDeviceBitfield()); + MockOsContext osContext(0, pDevice->getDeviceBitfield(), aub_stream::ENGINE_RCS, PreemptionMode::Disabled, false, false, false); tbxCsr.setupContext(osContext); auto mockHardwareContext = static_cast(tbxCsr.hardwareContextController->hardwareContexts[0].get()); @@ -1102,8 +1102,8 @@ HWTEST_F(TbxCommandStreamTests, givenGraphicsAllocationWhenDumpAllocationIsCalle DebugManager.flags.AUBDumpAllocsOnEnqueueSVMMemcpyOnly.set(true); DebugManager.flags.AUBDumpBufferFormat.set("BIN"); - MockTbxCsr tbxCsr(*pDevice->executionEnvironment); - MockOsContext osContext(0, 1, aub_stream::ENGINE_RCS, PreemptionMode::Disabled, false, false, false); + MockTbxCsr tbxCsr(*pDevice->executionEnvironment, pDevice->getDeviceBitfield()); + MockOsContext osContext(0, pDevice->getDeviceBitfield(), aub_stream::ENGINE_RCS, PreemptionMode::Disabled, false, false, false); tbxCsr.setupContext(osContext); auto mockHardwareContext = static_cast(tbxCsr.hardwareContextController->hardwareContexts[0].get()); @@ -1134,7 +1134,7 @@ HWTEST_F(TbxCommandStreamTests, givenGraphicsAllocationWhenDumpAllocationIsCalle MockExecutionEnvironment executionEnvironment(defaultHwInfo.get(), false, 1); executionEnvironment.initializeMemoryManager(); - MockTbxCsr tbxCsr(executionEnvironment); + MockTbxCsr tbxCsr(executionEnvironment, 1); EXPECT_EQ(nullptr, executionEnvironment.rootDeviceEnvironments[0]->aubCenter->getAubManager()); auto memoryManager = pDevice->getMemoryManager(); diff --git a/opencl/test/unit_test/device/device_tests.cpp b/opencl/test/unit_test/device/device_tests.cpp index 38f7e13966..d94a97bb5d 100644 --- a/opencl/test/unit_test/device/device_tests.cpp +++ b/opencl/test/unit_test/device/device_tests.cpp @@ -163,7 +163,7 @@ HWTEST_F(DeviceTest, WhenDeviceIsCreatedThenActualEngineTypeIsSameAsDefault) { HWTEST_F(DeviceTest, givenNoHwCsrTypeAndModifiedDefaultEngineIndexWhenIsSimulationIsCalledThenTrueIsReturned) { EXPECT_FALSE(pDevice->isSimulation()); - auto csr = TbxCommandStreamReceiver::create("", false, *pDevice->executionEnvironment, 0); + auto csr = TbxCommandStreamReceiver::create("", false, *pDevice->executionEnvironment, 0, 1); pDevice->defaultEngineIndex = 1; pDevice->resetCommandStreamReceiver(csr); @@ -181,7 +181,7 @@ HWTEST_F(DeviceTest, givenNoHwCsrTypeAndModifiedDefaultEngineIndexWhenIsSimulati TEST(DeviceCleanup, givenDeviceWhenItIsDestroyedThenFlushBatchedSubmissionsIsCalled) { auto mockDevice = std::unique_ptr(MockDevice::createWithNewExecutionEnvironment(nullptr)); - MockCommandStreamReceiver *csr = new MockCommandStreamReceiver(*mockDevice->getExecutionEnvironment(), mockDevice->getRootDeviceIndex()); + MockCommandStreamReceiver *csr = new MockCommandStreamReceiver(*mockDevice->getExecutionEnvironment(), mockDevice->getRootDeviceIndex(), mockDevice->getDeviceBitfield()); mockDevice->resetCommandStreamReceiver(csr); int flushedBatchedSubmissionsCalledCount = 0; csr->flushBatchedSubmissionsCallCounter = &flushedBatchedSubmissionsCalledCount; @@ -388,8 +388,8 @@ HWTEST_F(DeviceHwTest, givenHwHelperInputWhenInitializingCsrThenCreatePageTableM HWTEST_F(DeviceHwTest, givenDeviceCreationWhenCsrFailsToCreateGlobalSyncAllocationThenReturnNull) { class MockUltCsrThatFailsToCreateGlobalFenceAllocation : public UltCommandStreamReceiver { public: - MockUltCsrThatFailsToCreateGlobalFenceAllocation(ExecutionEnvironment &executionEnvironment) - : UltCommandStreamReceiver(executionEnvironment, 0) {} + MockUltCsrThatFailsToCreateGlobalFenceAllocation(ExecutionEnvironment &executionEnvironment, DeviceBitfield deviceBitfield) + : UltCommandStreamReceiver(executionEnvironment, 0, deviceBitfield) {} bool createGlobalFenceAllocation() override { return false; } @@ -399,7 +399,7 @@ HWTEST_F(DeviceHwTest, givenDeviceCreationWhenCsrFailsToCreateGlobalSyncAllocati MockDeviceThatFailsToCreateGlobalFenceAllocation(ExecutionEnvironment *executionEnvironment, uint32_t deviceIndex) : MockDevice(executionEnvironment, deviceIndex) {} std::unique_ptr createCommandStreamReceiver() const override { - return std::make_unique(*executionEnvironment); + return std::make_unique(*executionEnvironment, getDeviceBitfield()); } }; diff --git a/opencl/test/unit_test/event/event_tests.cpp b/opencl/test/unit_test/event/event_tests.cpp index 1dd0272f02..a4418f8d03 100644 --- a/opencl/test/unit_test/event/event_tests.cpp +++ b/opencl/test/unit_test/event/event_tests.cpp @@ -978,7 +978,7 @@ HWTEST_F(InternalsEventTest, GivenBufferWithoutZeroCopyOnCommandMapOrUnmapFlushe }; int32_t executionStamp = 0; - auto csr = new MockCsr(executionStamp, *pDevice->executionEnvironment, pDevice->getRootDeviceIndex()); + auto csr = new MockCsr(executionStamp, *pDevice->executionEnvironment, pDevice->getRootDeviceIndex(), pDevice->getDeviceBitfield()); pDevice->resetCommandStreamReceiver(csr); const cl_queue_properties props[3] = {CL_QUEUE_PROPERTIES, 0, 0}; @@ -1383,7 +1383,8 @@ TEST_F(EventTest, GivenCompletedEventWhenAddingChildThenNumEventsBlockingThisIsZ HWTEST_F(EventTest, givenQuickKmdSleepRequestWhenWaitIsCalledThenPassRequestToWaitingFunction) { struct MyCsr : public UltCommandStreamReceiver { - MyCsr(const ExecutionEnvironment &executionEnvironment) : UltCommandStreamReceiver(const_cast(executionEnvironment), 0) {} + MyCsr(const ExecutionEnvironment &executionEnvironment, DeviceBitfield deviceBitfield) + : UltCommandStreamReceiver(const_cast(executionEnvironment), 0, deviceBitfield) {} MOCK_METHOD3(waitForCompletionWithTimeout, bool(bool enableTimeout, int64_t timeoutMs, uint32_t taskCountToWait)); }; HardwareInfo localHwInfo = pDevice->getHardwareInfo(); @@ -1394,7 +1395,7 @@ HWTEST_F(EventTest, givenQuickKmdSleepRequestWhenWaitIsCalledThenPassRequestToWa pDevice->executionEnvironment->rootDeviceEnvironments[pDevice->getRootDeviceIndex()]->setHwInfo(&localHwInfo); - auto csr = new ::testing::NiceMock(*pDevice->executionEnvironment); + auto csr = new ::testing::NiceMock(*pDevice->executionEnvironment, pDevice->getDeviceBitfield()); pDevice->resetCommandStreamReceiver(csr); Event event(pCmdQ, CL_COMMAND_NDRANGE_KERNEL, 0, 0); @@ -1410,7 +1411,8 @@ HWTEST_F(EventTest, givenQuickKmdSleepRequestWhenWaitIsCalledThenPassRequestToWa HWTEST_F(EventTest, givenNonQuickKmdSleepRequestWhenWaitIsCalledThenPassRequestToWaitingFunction) { struct MyCsr : public UltCommandStreamReceiver { - MyCsr(const ExecutionEnvironment &executionEnvironment) : UltCommandStreamReceiver(const_cast(executionEnvironment), 0) {} + MyCsr(const ExecutionEnvironment &executionEnvironment, DeviceBitfield deviceBitfield) + : UltCommandStreamReceiver(const_cast(executionEnvironment), 0, deviceBitfield) {} MOCK_METHOD3(waitForCompletionWithTimeout, bool(bool enableTimeout, int64_t timeoutMs, uint32_t taskCountToWait)); }; HardwareInfo localHwInfo = pDevice->getHardwareInfo(); @@ -1422,7 +1424,7 @@ HWTEST_F(EventTest, givenNonQuickKmdSleepRequestWhenWaitIsCalledThenPassRequestT pDevice->executionEnvironment->rootDeviceEnvironments[pDevice->getRootDeviceIndex()]->setHwInfo(&localHwInfo); - auto csr = new ::testing::NiceMock(*pDevice->executionEnvironment); + auto csr = new ::testing::NiceMock(*pDevice->executionEnvironment, pDevice->getDeviceBitfield()); pDevice->resetCommandStreamReceiver(csr); Event event(pCmdQ, CL_COMMAND_NDRANGE_KERNEL, 0, 0); diff --git a/opencl/test/unit_test/execution_model/enqueue_execution_model_kernel_tests.cpp b/opencl/test/unit_test/execution_model/enqueue_execution_model_kernel_tests.cpp index b37dae609e..a881dcb8bd 100644 --- a/opencl/test/unit_test/execution_model/enqueue_execution_model_kernel_tests.cpp +++ b/opencl/test/unit_test/execution_model/enqueue_execution_model_kernel_tests.cpp @@ -125,7 +125,7 @@ HWCMDTEST_P(IGFX_GEN8_CORE, ParentKernelEnqueueTest, GivenBlockKernelWithPrivate size_t offset[3] = {0, 0, 0}; size_t gws[3] = {1, 1, 1}; int32_t executionStamp = 0; - auto mockCSR = new MockCsr(executionStamp, *pDevice->executionEnvironment, pDevice->getRootDeviceIndex()); + auto mockCSR = new MockCsr(executionStamp, *pDevice->executionEnvironment, pDevice->getRootDeviceIndex(), pDevice->getDeviceBitfield()); pDevice->resetCommandStreamReceiver(mockCSR); size_t kernelRequiringPrivateSurface = pKernel->getProgram()->getBlockKernelManager()->getCount(); @@ -394,7 +394,7 @@ HWCMDTEST_P(IGFX_GEN8_CORE, ParentKernelEnqueueTest, givenNonBlockedQueueWhenPar MockMultiDispatchInfo multiDispatchInfo(pKernel); int32_t executionStamp = 0; - auto mockCSR = new MockCsrBase(executionStamp, *pDevice->executionEnvironment, pDevice->getRootDeviceIndex()); + auto mockCSR = new MockCsrBase(executionStamp, *pDevice->executionEnvironment, pDevice->getRootDeviceIndex(), pDevice->getDeviceBitfield()); pDevice->resetCommandStreamReceiver(mockCSR); pCmdQ->enqueueKernel(pKernel, 1, globalOffsets, workItems, workItems, 0, nullptr, nullptr); @@ -550,7 +550,7 @@ HWCMDTEST_F(IGFX_GEN8_CORE, ParentKernelEnqueueFixture, GivenParentKernelWhenEnq size_t offset[3] = {0, 0, 0}; size_t gws[3] = {1, 1, 1}; int32_t execStamp; - auto mockCsr = new MockCsr(execStamp, *pDevice->executionEnvironment, pDevice->getRootDeviceIndex()); + auto mockCsr = new MockCsr(execStamp, *pDevice->executionEnvironment, pDevice->getRootDeviceIndex(), pDevice->getDeviceBitfield()); pDevice->resetCommandStreamReceiver(mockCsr); pCmdQ->enqueueKernel(parentKernel, 1, offset, gws, gws, 0, nullptr, nullptr); @@ -574,7 +574,7 @@ HWCMDTEST_F(IGFX_GEN8_CORE, ParentKernelEnqueueFixture, GivenParentKernelWhenEnq size_t offset[3] = {0, 0, 0}; size_t gws[3] = {1, 1, 1}; int32_t execStamp; - auto mockCsr = new MockCsr(execStamp, *pDevice->executionEnvironment, pDevice->getRootDeviceIndex()); + auto mockCsr = new MockCsr(execStamp, *pDevice->executionEnvironment, pDevice->getRootDeviceIndex(), pDevice->getDeviceBitfield()); BuiltinKernelsSimulation::SchedulerSimulation::enabled = false; @@ -591,7 +591,7 @@ HWCMDTEST_F(IGFX_GEN8_CORE, ParentKernelEnqueueFixture, GivenParentKernelWhenEnq HWCMDTEST_F(IGFX_GEN8_CORE, ParentKernelEnqueueFixture, givenCsrInBatchingModeWhenExecutionModelKernelIsSubmittedThenItIsFlushed) { if (pClDevice->areOcl21FeaturesSupported()) { - auto mockCsr = new MockCsrHw2(*pDevice->executionEnvironment, pDevice->getRootDeviceIndex()); + auto mockCsr = new MockCsrHw2(*pDevice->executionEnvironment, pDevice->getRootDeviceIndex(), pDevice->getDeviceBitfield()); mockCsr->overrideDispatchPolicy(DispatchMode::BatchedDispatch); pDevice->resetCommandStreamReceiver(mockCsr); @@ -617,7 +617,7 @@ HWCMDTEST_F(IGFX_GEN8_CORE, ParentKernelEnqueueFixture, GivenParentKernelWhenEnq size_t offset[3] = {0, 0, 0}; size_t gws[3] = {1, 1, 1}; int32_t execStamp; - auto mockCsr = new MockCsr(execStamp, *pDevice->executionEnvironment, pDevice->getRootDeviceIndex()); + auto mockCsr = new MockCsr(execStamp, *pDevice->executionEnvironment, pDevice->getRootDeviceIndex(), pDevice->getDeviceBitfield()); pDevice->resetCommandStreamReceiver(mockCsr); mockCsr->setMediaVFEStateDirty(false); diff --git a/opencl/test/unit_test/fixtures/memory_manager_fixture.cpp b/opencl/test/unit_test/fixtures/memory_manager_fixture.cpp index 0581363b76..3bd85374d3 100644 --- a/opencl/test/unit_test/fixtures/memory_manager_fixture.cpp +++ b/opencl/test/unit_test/fixtures/memory_manager_fixture.cpp @@ -19,7 +19,7 @@ using namespace NEO; void MemoryManagerWithCsrFixture::SetUp() { executionEnvironment.prepareRootDeviceEnvironments(1); executionEnvironment.rootDeviceEnvironments[0]->setHwInfo(defaultHwInfo.get()); - csr = std::make_unique(this->executionEnvironment, 0); + csr = std::make_unique(this->executionEnvironment, 0, 1); memoryManager = new MockMemoryManager(executionEnvironment); executionEnvironment.memoryManager.reset(memoryManager); csr->tagAddress = ¤tGpuTag; diff --git a/opencl/test/unit_test/gen11/coherency_tests_gen11.cpp b/opencl/test/unit_test/gen11/coherency_tests_gen11.cpp index e686db7a07..4f6c502fa4 100644 --- a/opencl/test/unit_test/gen11/coherency_tests_gen11.cpp +++ b/opencl/test/unit_test/gen11/coherency_tests_gen11.cpp @@ -22,7 +22,7 @@ struct Gen11CoherencyRequirements : public ::testing::Test { struct myCsr : public CommandStreamReceiverHw { using CommandStreamReceiver::commandStream; - myCsr(ExecutionEnvironment &executionEnvironment) : CommandStreamReceiverHw(executionEnvironment, 0){}; + myCsr(ExecutionEnvironment &executionEnvironment) : CommandStreamReceiverHw(executionEnvironment, 0, 1){}; CsrSizeRequestFlags *getCsrRequestFlags() { return &csrSizeRequestFlags; } }; diff --git a/opencl/test/unit_test/gen11/icllp/test_program_media_sampler_icllp.cpp b/opencl/test/unit_test/gen11/icllp/test_program_media_sampler_icllp.cpp index f7670cf2d1..ab5f4c8319 100644 --- a/opencl/test/unit_test/gen11/icllp/test_program_media_sampler_icllp.cpp +++ b/opencl/test/unit_test/gen11/icllp/test_program_media_sampler_icllp.cpp @@ -24,7 +24,7 @@ struct Gen11MediaSamplerProgramingTest : public ::testing::Test { struct myCsr : public CommandStreamReceiverHw { using CommandStreamReceiver::commandStream; using CommandStreamReceiverHw::programMediaSampler; - myCsr(ExecutionEnvironment &executionEnvironment) : CommandStreamReceiverHw(executionEnvironment, 0){}; + myCsr(ExecutionEnvironment &executionEnvironment) : CommandStreamReceiverHw(executionEnvironment, 0, 1){}; void overrideLastVmeSubliceConfig(bool value) { lastVmeSubslicesConfig = value; } diff --git a/opencl/test/unit_test/gen11/tbx_command_stream_receiver_tests_gen11.cpp b/opencl/test/unit_test/gen11/tbx_command_stream_receiver_tests_gen11.cpp index dd3b197211..aab948475a 100644 --- a/opencl/test/unit_test/gen11/tbx_command_stream_receiver_tests_gen11.cpp +++ b/opencl/test/unit_test/gen11/tbx_command_stream_receiver_tests_gen11.cpp @@ -17,7 +17,7 @@ GEN11TEST_F(Gen11TbxCommandStreamReceiverTests, whenAskedForPollForCompletionPar class MyMockTbxHw : public TbxCommandStreamReceiverHw { public: MyMockTbxHw(ExecutionEnvironment &executionEnvironment) - : TbxCommandStreamReceiverHw(executionEnvironment, 0) {} + : TbxCommandStreamReceiverHw(executionEnvironment, 0, 1) {} using TbxCommandStreamReceiverHw::getpollNotEqualValueForPollForCompletion; using TbxCommandStreamReceiverHw::getMaskAndValueForPollForCompletion; }; diff --git a/opencl/test/unit_test/gen12lp/aub_command_stream_receiver_tests_gen12lp.inl b/opencl/test/unit_test/gen12lp/aub_command_stream_receiver_tests_gen12lp.inl index 217568401e..0afb16bedc 100644 --- a/opencl/test/unit_test/gen12lp/aub_command_stream_receiver_tests_gen12lp.inl +++ b/opencl/test/unit_test/gen12lp/aub_command_stream_receiver_tests_gen12lp.inl @@ -22,7 +22,7 @@ using namespace NEO; using Gen12LPAubCommandStreamReceiverTests = Test; GEN12LPTEST_F(Gen12LPAubCommandStreamReceiverTests, givenAubCommandStreamReceiverWhenGetGUCWorkQueueItemHeaderIsCalledThenAppropriateValueDependingOnEngineTypeIsReturned) { - std::unique_ptr> aubCsr(new AUBCommandStreamReceiverHw("", true, *pDevice->executionEnvironment, pDevice->getRootDeviceIndex())); + std::unique_ptr> aubCsr(new AUBCommandStreamReceiverHw("", true, *pDevice->executionEnvironment, pDevice->getRootDeviceIndex(), pDevice->getDeviceBitfield())); MockOsContext rcsOsContext(0, 1, aub_stream::ENGINE_RCS, PreemptionMode::Disabled, false, false, false); MockOsContext ccsOsContext(0, 1, aub_stream::ENGINE_CCS, PreemptionMode::Disabled, false, false, false); @@ -36,7 +36,7 @@ GEN12LPTEST_F(Gen12LPAubCommandStreamReceiverTests, givenAubCommandStreamReceive } GEN12LPTEST_F(Gen12LPAubCommandStreamReceiverTests, givenGraphicsAlloctionWhenGetPPGTTAdditionalBitsIsCalledThenAppropriateValueIsReturned) { - std::unique_ptr> aubCsr(new AUBCommandStreamReceiverHw("", true, *pDevice->executionEnvironment, pDevice->getRootDeviceIndex())); + std::unique_ptr> aubCsr(new AUBCommandStreamReceiverHw("", true, *pDevice->executionEnvironment, pDevice->getRootDeviceIndex(), pDevice->getDeviceBitfield())); MockGraphicsAllocation allocation(nullptr, 0); auto bits = aubCsr->getPPGTTAdditionalBits(&allocation); constexpr uint64_t expectedBits = BIT(PageTableEntry::presentBit) | BIT(PageTableEntry::writableBit); @@ -46,7 +46,7 @@ GEN12LPTEST_F(Gen12LPAubCommandStreamReceiverTests, givenGraphicsAlloctionWhenGe GEN12LPTEST_F(Gen12LPAubCommandStreamReceiverTests, givenCCSEnabledWhenEngineMmiosAreInitializedThenExpectL3ConfigMmioIsWritten) { MockOsContext osContext(0, 1, aub_stream::ENGINE_CCS, PreemptionMode::Disabled, false, false, false); - AUBCommandStreamReceiverHw aubCsr("", true, *pDevice->executionEnvironment, pDevice->getRootDeviceIndex()); + AUBCommandStreamReceiverHw aubCsr("", true, *pDevice->executionEnvironment, pDevice->getRootDeviceIndex(), pDevice->getDeviceBitfield()); aubCsr.setupContext(osContext); auto stream = std::make_unique(); @@ -59,7 +59,7 @@ GEN12LPTEST_F(Gen12LPAubCommandStreamReceiverTests, givenCCSEnabledWhenEngineMmi GEN12LPTEST_F(Gen12LPAubCommandStreamReceiverTests, givenRCSEnabledWhenEngineMmiosAreInitializedThenExpectL3ConfigMmioIsWritten) { MockOsContext osContext(0, 1, aub_stream::ENGINE_RCS, PreemptionMode::Disabled, false, false, false); - AUBCommandStreamReceiverHw aubCsr("", true, *pDevice->executionEnvironment, pDevice->getRootDeviceIndex()); + AUBCommandStreamReceiverHw aubCsr("", true, *pDevice->executionEnvironment, pDevice->getRootDeviceIndex(), pDevice->getDeviceBitfield()); aubCsr.setupContext(osContext); auto stream = std::make_unique(); diff --git a/opencl/test/unit_test/gen12lp/coherency_tests_gen12lp.inl b/opencl/test/unit_test/gen12lp/coherency_tests_gen12lp.inl index 6a1cd6002a..2374c165eb 100644 --- a/opencl/test/unit_test/gen12lp/coherency_tests_gen12lp.inl +++ b/opencl/test/unit_test/gen12lp/coherency_tests_gen12lp.inl @@ -24,7 +24,7 @@ struct Gen12LpCoherencyRequirements : public ::testing::Test { struct myCsr : public CommandStreamReceiverHw { using CommandStreamReceiver::commandStream; - myCsr(ExecutionEnvironment &executionEnvironment) : CommandStreamReceiverHw(executionEnvironment, 0){}; + myCsr(ExecutionEnvironment &executionEnvironment) : CommandStreamReceiverHw(executionEnvironment, 0, 1){}; CsrSizeRequestFlags *getCsrRequestFlags() { return &csrSizeRequestFlags; } }; diff --git a/opencl/test/unit_test/gen12lp/command_stream_receiver_hw_tests_gen12lp.inl b/opencl/test/unit_test/gen12lp/command_stream_receiver_hw_tests_gen12lp.inl index dd73ebc172..ade3c6b2ff 100644 --- a/opencl/test/unit_test/gen12lp/command_stream_receiver_hw_tests_gen12lp.inl +++ b/opencl/test/unit_test/gen12lp/command_stream_receiver_hw_tests_gen12lp.inl @@ -34,7 +34,7 @@ GEN12LPTEST_F(CommandStreamReceiverHwTestGen12lp, givenPreambleSentWhenL3ConfigR MockContext ctx(pClDevice); MockKernelWithInternals kernel(*pClDevice); CommandQueueHw commandQueue(&ctx, pClDevice, 0, false); - auto commandStreamReceiver = new MockCsrHw(*pDevice->executionEnvironment, pDevice->getRootDeviceIndex()); + auto commandStreamReceiver = new MockCsrHw(*pDevice->executionEnvironment, pDevice->getRootDeviceIndex(), pDevice->getDeviceBitfield()); pDevice->resetCommandStreamReceiver(commandStreamReceiver); auto &commandStreamCSR = commandStreamReceiver->getCS(); diff --git a/opencl/test/unit_test/gen12lp/command_stream_receiver_simulated_common_hw_tests_gen12lp.inl b/opencl/test/unit_test/gen12lp/command_stream_receiver_simulated_common_hw_tests_gen12lp.inl index 8e53c30711..39e6732cac 100644 --- a/opencl/test/unit_test/gen12lp/command_stream_receiver_simulated_common_hw_tests_gen12lp.inl +++ b/opencl/test/unit_test/gen12lp/command_stream_receiver_simulated_common_hw_tests_gen12lp.inl @@ -29,7 +29,7 @@ class MockSimulatedCsrHw : public CommandStreamReceiverSimulatedHw { }; GEN12LPTEST_F(Gen12LPCommandStreamReceiverSimulatedCommonHwTests, givenAubCommandStreamReceiverWhewGlobalMmiosAreInitializedThenMOCSRegistersAreConfigured) { - MockSimulatedCsrHw csrSimulatedCommonHw(*pDevice->executionEnvironment, pDevice->getRootDeviceIndex()); + MockSimulatedCsrHw csrSimulatedCommonHw(*pDevice->executionEnvironment, pDevice->getRootDeviceIndex(), pDevice->getDeviceBitfield()); auto stream = std::make_unique(); csrSimulatedCommonHw.stream = stream.get(); @@ -103,7 +103,7 @@ GEN12LPTEST_F(Gen12LPCommandStreamReceiverSimulatedCommonHwTests, givenAubComman } GEN12LPTEST_F(Gen12LPCommandStreamReceiverSimulatedCommonHwTests, givenAubCommandStreamReceiverWhenGlobalMmiosAreInitializedThenLNCFRegistersAreConfigured) { - MockSimulatedCsrHw csrSimulatedCommonHw(*pDevice->executionEnvironment, pDevice->getRootDeviceIndex()); + MockSimulatedCsrHw csrSimulatedCommonHw(*pDevice->executionEnvironment, pDevice->getRootDeviceIndex(), pDevice->getDeviceBitfield()); auto stream = std::make_unique(); csrSimulatedCommonHw.stream = stream.get(); diff --git a/opencl/test/unit_test/gen12lp/tbx_command_stream_receiver_tests_gen12lp.inl b/opencl/test/unit_test/gen12lp/tbx_command_stream_receiver_tests_gen12lp.inl index 343772687e..a851078732 100644 --- a/opencl/test/unit_test/gen12lp/tbx_command_stream_receiver_tests_gen12lp.inl +++ b/opencl/test/unit_test/gen12lp/tbx_command_stream_receiver_tests_gen12lp.inl @@ -17,7 +17,7 @@ using namespace NEO; using Gen12LPTbxCommandStreamReceiverTests = Test; GEN12LPTEST_F(Gen12LPTbxCommandStreamReceiverTests, givenNullPtrGraphicsAlloctionWhenGetPPGTTAdditionalBitsIsCalledThenAppropriateValueIsReturned) { - auto tbxCsr = std::make_unique>(*pDevice->executionEnvironment, pDevice->getRootDeviceIndex()); + auto tbxCsr = std::make_unique>(*pDevice->executionEnvironment, pDevice->getRootDeviceIndex(), pDevice->getDeviceBitfield()); GraphicsAllocation *allocation = nullptr; auto bits = tbxCsr->getPPGTTAdditionalBits(allocation); constexpr uint64_t expectedBits = BIT(PageTableEntry::presentBit) | BIT(PageTableEntry::writableBit); @@ -26,7 +26,7 @@ GEN12LPTEST_F(Gen12LPTbxCommandStreamReceiverTests, givenNullPtrGraphicsAlloctio } GEN12LPTEST_F(Gen12LPTbxCommandStreamReceiverTests, givenGraphicsAlloctionWWhenGetPPGTTAdditionalBitsIsCalledThenAppropriateValueIsReturned) { - auto tbxCsr = std::make_unique>(*pDevice->executionEnvironment, pDevice->getRootDeviceIndex()); + auto tbxCsr = std::make_unique>(*pDevice->executionEnvironment, pDevice->getRootDeviceIndex(), pDevice->getDeviceBitfield()); MockGraphicsAllocation allocation(nullptr, 0); auto bits = tbxCsr->getPPGTTAdditionalBits(&allocation); constexpr uint64_t expectedBits = BIT(PageTableEntry::presentBit) | BIT(PageTableEntry::writableBit); @@ -38,7 +38,7 @@ GEN12LPTEST_F(Gen12LPTbxCommandStreamReceiverTests, whenAskedForPollForCompletio class MyMockTbxHw : public TbxCommandStreamReceiverHw { public: MyMockTbxHw(ExecutionEnvironment &executionEnvironment) - : TbxCommandStreamReceiverHw(executionEnvironment, 0) {} + : TbxCommandStreamReceiverHw(executionEnvironment, 0, 1) {} using TbxCommandStreamReceiverHw::getpollNotEqualValueForPollForCompletion; using TbxCommandStreamReceiverHw::getMaskAndValueForPollForCompletion; }; diff --git a/opencl/test/unit_test/gen12lp/windows/gmm_callbacks_tests_gen12lp.cpp b/opencl/test/unit_test/gen12lp/windows/gmm_callbacks_tests_gen12lp.cpp index 28592125bc..184024cd7d 100644 --- a/opencl/test/unit_test/gen12lp/windows/gmm_callbacks_tests_gen12lp.cpp +++ b/opencl/test/unit_test/gen12lp/windows/gmm_callbacks_tests_gen12lp.cpp @@ -36,7 +36,7 @@ GEN12LPTEST_F(Gen12LpGmmCallbacksTests, givenCsrWithoutAubDumpWhenNotifyAubCaptu HardwareInfo *hwInfo = nullptr; ExecutionEnvironment *executionEnvironment = getExecutionEnvironmentImpl(hwInfo, 1); executionEnvironment->initializeMemoryManager(); - auto csr = std::make_unique>(*executionEnvironment, 0); + auto csr = std::make_unique>(*executionEnvironment, 0, 1); uint64_t address = 0xFEDCBA9876543210; size_t size = 1024; @@ -49,7 +49,7 @@ GEN12LPTEST_F(Gen12LpGmmCallbacksTests, givenWddmCsrWhenWriteL3CalledThenWriteTw typedef typename FamilyType::MI_LOAD_REGISTER_IMM MI_LOAD_REGISTER_IMM; ExecutionEnvironment *executionEnvironment = platform()->peekExecutionEnvironment(); executionEnvironment->initializeMemoryManager(); - UltCommandStreamReceiver csr(*executionEnvironment, 0); + UltCommandStreamReceiver csr(*executionEnvironment, 0, 1); uint8_t buffer[128] = {}; csr.commandStream.replaceBuffer(buffer, 128); @@ -83,7 +83,7 @@ GEN12LPTEST_F(Gen12LpGmmCallbacksTests, givenCcsEnabledhenWriteL3CalledThenSetRe executionEnvironment.prepareRootDeviceEnvironments(1u); executionEnvironment.rootDeviceEnvironments[0]->setHwInfo(&localHwInfo); executionEnvironment.initializeMemoryManager(); - UltCommandStreamReceiver csr(executionEnvironment, 0); + UltCommandStreamReceiver csr(executionEnvironment, 0, 1); uint8_t buffer[128] = {}; csr.commandStream.replaceBuffer(buffer, 128); @@ -111,7 +111,7 @@ GEN12LPTEST_F(Gen12LpGmmCallbacksTests, givenCcsDisabledhenWriteL3CalledThenSetR executionEnvironment.prepareRootDeviceEnvironments(1u); executionEnvironment.rootDeviceEnvironments[0]->setHwInfo(&localHwInfo); executionEnvironment.initializeMemoryManager(); - UltCommandStreamReceiver csr(executionEnvironment, 0); + UltCommandStreamReceiver csr(executionEnvironment, 0, 1); uint8_t buffer[128] = {}; csr.commandStream.replaceBuffer(buffer, 128); diff --git a/opencl/test/unit_test/gen8/coherency_tests_gen8.cpp b/opencl/test/unit_test/gen8/coherency_tests_gen8.cpp index c48426aa5e..f00da32537 100644 --- a/opencl/test/unit_test/gen8/coherency_tests_gen8.cpp +++ b/opencl/test/unit_test/gen8/coherency_tests_gen8.cpp @@ -20,7 +20,7 @@ typedef ::testing::Test Gen8CoherencyRequirements; GEN8TEST_F(Gen8CoherencyRequirements, WhenMemoryManagerIsInitializedThenNoCoherencyProgramming) { ExecutionEnvironment *executionEnvironment = platform()->peekExecutionEnvironment(); executionEnvironment->initializeMemoryManager(); - CommandStreamReceiverHw csr(*executionEnvironment, 0); + CommandStreamReceiverHw csr(*executionEnvironment, 0, 1); LinearStream stream; DispatchFlags flags = DispatchFlagsHelper::createDefaultDispatchFlags(); diff --git a/opencl/test/unit_test/gen8/command_stream_receiver_hw_tests_gen8.cpp b/opencl/test/unit_test/gen8/command_stream_receiver_hw_tests_gen8.cpp index 286b0f8aae..7f7673dc95 100644 --- a/opencl/test/unit_test/gen8/command_stream_receiver_hw_tests_gen8.cpp +++ b/opencl/test/unit_test/gen8/command_stream_receiver_hw_tests_gen8.cpp @@ -37,7 +37,7 @@ GEN8TEST_F(CommandStreamReceiverHwTestGen8, GivenBlockedKernelWithSlmWhenPreviou } GEN8TEST_F(CommandStreamReceiverHwTestGen8, GivenChangedL3ConfigWhenL3IsProgrammedThenClearSLMWorkAroundIsAdded) { - MockCsrHw2 csr(*pDevice->executionEnvironment, pDevice->getRootDeviceIndex()); + MockCsrHw2 csr(*pDevice->executionEnvironment, pDevice->getRootDeviceIndex(), pDevice->getDeviceBitfield()); csr.csrSizeRequestFlags.l3ConfigChanged = true; csr.isPreambleSent = true; diff --git a/opencl/test/unit_test/gen8/test_preemption_gen8.cpp b/opencl/test/unit_test/gen8/test_preemption_gen8.cpp index 938122536f..265010e8f4 100644 --- a/opencl/test/unit_test/gen8/test_preemption_gen8.cpp +++ b/opencl/test/unit_test/gen8/test_preemption_gen8.cpp @@ -48,7 +48,7 @@ GEN8TEST_F(Gen8PreemptionEnqueueKernelTest, givenSecondEnqueueWithTheSamePreempt GEN8TEST_F(Gen8PreemptionEnqueueKernelTest, givenValidKernelForPreemptionWhenEnqueueKernelCalledThenPassDevicePreemptionMode) { pDevice->setPreemptionMode(PreemptionMode::ThreadGroup); - auto mockCsr = new MockCsrHw2(*pDevice->executionEnvironment, pDevice->getRootDeviceIndex()); + auto mockCsr = new MockCsrHw2(*pDevice->executionEnvironment, pDevice->getRootDeviceIndex(), pDevice->getDeviceBitfield()); pDevice->resetCommandStreamReceiver(mockCsr); MockKernelWithInternals mockKernel(*pClDevice); @@ -66,7 +66,7 @@ GEN8TEST_F(Gen8PreemptionEnqueueKernelTest, givenValidKernelForPreemptionWhenEnq GEN8TEST_F(Gen8PreemptionEnqueueKernelTest, givenValidKernelForPreemptionWhenEnqueueKernelCalledAndBlockedThenPassDevicePreemptionMode) { pDevice->setPreemptionMode(PreemptionMode::ThreadGroup); - auto mockCsr = new MockCsrHw2(*pDevice->executionEnvironment, pDevice->getRootDeviceIndex()); + auto mockCsr = new MockCsrHw2(*pDevice->executionEnvironment, pDevice->getRootDeviceIndex(), pDevice->getDeviceBitfield()); pDevice->resetCommandStreamReceiver(mockCsr); MockKernelWithInternals mockKernel(*pClDevice); @@ -89,7 +89,7 @@ GEN8TEST_F(Gen8PreemptionEnqueueKernelTest, givenValidKernelForPreemptionWhenEnq GEN8TEST_F(Gen8PreemptionEnqueueKernelTest, givenDisabledPreemptionWhenEnqueueKernelCalledThenPassDisabledPreemptionMode) { pDevice->setPreemptionMode(PreemptionMode::Disabled); - auto mockCsr = new MockCsrHw2(*pDevice->executionEnvironment, pDevice->getRootDeviceIndex()); + auto mockCsr = new MockCsrHw2(*pDevice->executionEnvironment, pDevice->getRootDeviceIndex(), pDevice->getDeviceBitfield()); pDevice->resetCommandStreamReceiver(mockCsr); MockKernelWithInternals mockKernel(*pClDevice); diff --git a/opencl/test/unit_test/gen9/coherency_tests_gen9.cpp b/opencl/test/unit_test/gen9/coherency_tests_gen9.cpp index e38d79b678..b038c9d57b 100644 --- a/opencl/test/unit_test/gen9/coherency_tests_gen9.cpp +++ b/opencl/test/unit_test/gen9/coherency_tests_gen9.cpp @@ -20,7 +20,7 @@ typedef ::testing::Test Gen9CoherencyRequirements; GEN9TEST_F(Gen9CoherencyRequirements, WhenMemoryManagerIsInitializedThenNoCoherencyProgramming) { ExecutionEnvironment *executionEnvironment = platform()->peekExecutionEnvironment(); executionEnvironment->initializeMemoryManager(); - CommandStreamReceiverHw csr(*executionEnvironment, 0); + CommandStreamReceiverHw csr(*executionEnvironment, 0, 1); LinearStream stream; DispatchFlags flags = DispatchFlagsHelper::createDefaultDispatchFlags(); diff --git a/opencl/test/unit_test/gen9/test_preemption_gen9.cpp b/opencl/test/unit_test/gen9/test_preemption_gen9.cpp index 88f5d7eef1..e65369855f 100644 --- a/opencl/test/unit_test/gen9/test_preemption_gen9.cpp +++ b/opencl/test/unit_test/gen9/test_preemption_gen9.cpp @@ -155,7 +155,7 @@ GEN9TEST_F(Gen9ThreadGroupPreemptionEnqueueKernelTest, givenSecondEnqueueWithThe GEN9TEST_F(Gen9PreemptionEnqueueKernelTest, givenValidKernelForPreemptionWhenEnqueueKernelCalledThenPassDevicePreemptionModeThreadGroup) { pDevice->setPreemptionMode(PreemptionMode::ThreadGroup); - auto mockCsr = new MockCsrHw2(*pDevice->executionEnvironment, pDevice->getRootDeviceIndex()); + auto mockCsr = new MockCsrHw2(*pDevice->executionEnvironment, pDevice->getRootDeviceIndex(), pDevice->getDeviceBitfield()); pDevice->resetCommandStreamReceiver(mockCsr); MockKernelWithInternals mockKernel(*pClDevice); @@ -173,7 +173,7 @@ GEN9TEST_F(Gen9PreemptionEnqueueKernelTest, givenValidKernelForPreemptionWhenEnq GEN9TEST_F(Gen9PreemptionEnqueueKernelTest, givenValidKernelForPreemptionWhenEnqueueKernelCalledAndBlockedThenPassDevicePreemptionModeThreadGroup) { pDevice->setPreemptionMode(PreemptionMode::ThreadGroup); - auto mockCsr = new MockCsrHw2(*pDevice->executionEnvironment, pDevice->getRootDeviceIndex()); + auto mockCsr = new MockCsrHw2(*pDevice->executionEnvironment, pDevice->getRootDeviceIndex(), pDevice->getDeviceBitfield()); pDevice->resetCommandStreamReceiver(mockCsr); MockKernelWithInternals mockKernel(*pClDevice); @@ -374,7 +374,7 @@ GEN9TEST_F(Gen9MidThreadPreemptionEnqueueKernelTest, givenSecondEnqueueWithTheSa GEN9TEST_F(Gen9PreemptionEnqueueKernelTest, givenDisabledPreemptionWhenEnqueueKernelCalledThenPassDisabledPreemptionMode) { pDevice->setPreemptionMode(PreemptionMode::Disabled); - auto mockCsr = new MockCsrHw2(*pDevice->executionEnvironment, pDevice->getRootDeviceIndex()); + auto mockCsr = new MockCsrHw2(*pDevice->executionEnvironment, pDevice->getRootDeviceIndex(), pDevice->getDeviceBitfield()); pDevice->resetCommandStreamReceiver(mockCsr); MockKernelWithInternals mockKernel(*pClDevice); diff --git a/opencl/test/unit_test/helpers/kmd_notify_tests.cpp b/opencl/test/unit_test/helpers/kmd_notify_tests.cpp index b46cf4181b..06cbbbbfe8 100644 --- a/opencl/test/unit_test/helpers/kmd_notify_tests.cpp +++ b/opencl/test/unit_test/helpers/kmd_notify_tests.cpp @@ -68,14 +68,15 @@ struct KmdNotifyTests : public ::testing::Test { template class MockKmdNotifyCsr : public UltCommandStreamReceiver { public: - MockKmdNotifyCsr(const ExecutionEnvironment &executionEnvironment) : UltCommandStreamReceiver(const_cast(executionEnvironment), 0) {} + MockKmdNotifyCsr(const ExecutionEnvironment &executionEnvironment, DeviceBitfield deviceBitfield) + : UltCommandStreamReceiver(const_cast(executionEnvironment), 0, deviceBitfield) {} MOCK_METHOD1(waitForFlushStamp, bool(FlushStamp &flushStampToWait)); MOCK_METHOD3(waitForCompletionWithTimeout, bool(bool enableTimeout, int64_t timeoutMs, uint32_t taskCountToWait)); }; template MockKmdNotifyCsr *createMockCsr() { - auto csr = new ::testing::NiceMock>(*device->executionEnvironment); + auto csr = new ::testing::NiceMock>(*device->executionEnvironment, device->getDeviceBitfield()); device->resetCommandStreamReceiver(csr); mockKmdNotifyHelper = new MockKmdNotifyHelper(&device->getHardwareInfo().capabilityTable.kmdNotifyProperties); diff --git a/opencl/test/unit_test/helpers/task_information_tests.cpp b/opencl/test/unit_test/helpers/task_information_tests.cpp index 985d823cc2..b0599ad6bb 100644 --- a/opencl/test/unit_test/helpers/task_information_tests.cpp +++ b/opencl/test/unit_test/helpers/task_information_tests.cpp @@ -24,7 +24,7 @@ using namespace NEO; TEST(CommandTest, GivenNoTerminateFlagWhenSubmittingMapUnmapThenCsrIsFlushed) { auto device = std::make_unique(MockDevice::createWithNewExecutionEnvironment(nullptr)); std::unique_ptr cmdQ(new MockCommandQueue(nullptr, device.get(), nullptr)); - MockCommandStreamReceiver csr(*device->getExecutionEnvironment(), device->getRootDeviceIndex()); + MockCommandStreamReceiver csr(*device->getExecutionEnvironment(), device->getRootDeviceIndex(), device->getDeviceBitfield()); MockBuffer buffer; auto initialTaskCount = csr.peekTaskCount(); @@ -41,7 +41,7 @@ TEST(CommandTest, GivenNoTerminateFlagWhenSubmittingMapUnmapThenCsrIsFlushed) { TEST(CommandTest, GivenTerminateFlagWhenSubmittingMapUnmapThenFlushIsAborted) { auto device = std::make_unique(MockDevice::createWithNewExecutionEnvironment(nullptr)); std::unique_ptr cmdQ(new MockCommandQueue(nullptr, device.get(), nullptr)); - MockCommandStreamReceiver csr(*device->getExecutionEnvironment(), device->getRootDeviceIndex()); + MockCommandStreamReceiver csr(*device->getExecutionEnvironment(), device->getRootDeviceIndex(), device->getDeviceBitfield()); MockBuffer buffer; auto initialTaskCount = csr.peekTaskCount(); @@ -61,7 +61,7 @@ TEST(CommandTest, GivenTerminateFlagWhenSubmittingMapUnmapThenFlushIsAborted) { TEST(CommandTest, GivenNoTerminateFlagWhenSubmittingMarkerThenCsrIsNotFlushed) { auto device = std::make_unique(MockDevice::createWithNewExecutionEnvironment(nullptr)); std::unique_ptr cmdQ(new MockCommandQueue(nullptr, device.get(), nullptr)); - MockCommandStreamReceiver csr(*device->getExecutionEnvironment(), device->getRootDeviceIndex()); + MockCommandStreamReceiver csr(*device->getExecutionEnvironment(), device->getRootDeviceIndex(), device->getDeviceBitfield()); MockBuffer buffer; auto initialTaskCount = csr.peekTaskCount(); @@ -75,7 +75,7 @@ TEST(CommandTest, GivenNoTerminateFlagWhenSubmittingMarkerThenCsrIsNotFlushed) { TEST(CommandTest, GivenTerminateFlagWhenSubmittingMarkerThenFlushIsAborted) { auto device = std::make_unique(MockDevice::createWithNewExecutionEnvironment(nullptr)); std::unique_ptr cmdQ(new MockCommandQueue(nullptr, device.get(), nullptr)); - MockCommandStreamReceiver csr(*device->getExecutionEnvironment(), device->getRootDeviceIndex()); + MockCommandStreamReceiver csr(*device->getExecutionEnvironment(), device->getRootDeviceIndex(), device->getDeviceBitfield()); MockBuffer buffer; auto initialTaskCount = csr.peekTaskCount(); @@ -165,7 +165,8 @@ class MockCsr1 : public CommandStreamReceiverHw { passedDispatchFlags = dispatchFlags; return CompletionStamp(); } - MockCsr1(ExecutionEnvironment &executionEnvironment, uint32_t rootDeviceIndex) : CommandStreamReceiverHw::CommandStreamReceiverHw(executionEnvironment, rootDeviceIndex) {} + MockCsr1(ExecutionEnvironment &executionEnvironment, uint32_t rootDeviceIndex, DeviceBitfield deviceBitfield) + : CommandStreamReceiverHw::CommandStreamReceiverHw(executionEnvironment, rootDeviceIndex, deviceBitfield) {} DispatchFlags passedDispatchFlags = DispatchFlagsHelper::createDefaultDispatchFlags(); using CommandStreamReceiver::timestampPacketWriteEnabled; }; diff --git a/opencl/test/unit_test/helpers/timestamp_packet_tests.cpp b/opencl/test/unit_test/helpers/timestamp_packet_tests.cpp index 6a9738e3b8..af53bebf50 100644 --- a/opencl/test/unit_test/helpers/timestamp_packet_tests.cpp +++ b/opencl/test/unit_test/helpers/timestamp_packet_tests.cpp @@ -345,16 +345,19 @@ TEST_F(TimestampPacketSimpleTests, whenObjectIsCreatedThenInitializeAllStamps) { } HWTEST_F(TimestampPacketTests, givenCommandStreamReceiverHwWhenObtainingPreferredTagPoolSizeThenReturnCorrectValue) { - CommandStreamReceiverHw csr(*executionEnvironment, 0); + OsContext &osContext = *executionEnvironment->memoryManager->getRegisteredEngines()[0].osContext; + + CommandStreamReceiverHw csr(*executionEnvironment, 0, osContext.getDeviceBitfield()); EXPECT_EQ(2048u, csr.getPreferredTagPoolSize()); } HWTEST_F(TimestampPacketTests, givenDebugFlagSetWhenCreatingTimestampPacketAllocatorThenDisableReusingAndLimitPoolSize) { DebugManagerStateRestore restore; DebugManager.flags.DisableTimestampPacketOptimizations.set(true); + OsContext &osContext = *executionEnvironment->memoryManager->getRegisteredEngines()[0].osContext; - CommandStreamReceiverHw csr(*executionEnvironment, 0); - csr.setupContext(*executionEnvironment->memoryManager->getRegisteredEngines()[0].osContext); + CommandStreamReceiverHw csr(*executionEnvironment, 0, osContext.getDeviceBitfield()); + csr.setupContext(osContext); EXPECT_EQ(1u, csr.getPreferredTagPoolSize()); auto tag = csr.getTimestampPacketAllocator()->getTag(); @@ -1635,7 +1638,7 @@ HWTEST_F(TimestampPacketTests, givenWaitlistAndOutputEventWhenEnqueueingWithoutK HWTEST_F(TimestampPacketTests, givenBlockedEnqueueWithoutKernelWhenSubmittingThenDispatchBlockedCommands) { using MI_SEMAPHORE_WAIT = typename FamilyType::MI_SEMAPHORE_WAIT; - auto mockCsr = new MockCsrHw2(*device->getExecutionEnvironment(), device->getRootDeviceIndex()); + auto mockCsr = new MockCsrHw2(*device->getExecutionEnvironment(), device->getRootDeviceIndex(), device->getDeviceBitfield()); device->resetCommandStreamReceiver(mockCsr); mockCsr->timestampPacketWriteEnabled = true; mockCsr->storeFlushedTaskStream = true; diff --git a/opencl/test/unit_test/kernel/kernel_image_arg_tests.cpp b/opencl/test/unit_test/kernel/kernel_image_arg_tests.cpp index 5ba9d3ecdf..44ee67eb67 100644 --- a/opencl/test/unit_test/kernel/kernel_image_arg_tests.cpp +++ b/opencl/test/unit_test/kernel/kernel_image_arg_tests.cpp @@ -232,7 +232,7 @@ HWTEST_F(KernelImageArgTest, givenImgWithMcsAllocWhenMakeResidentThenMakeMcsAllo cl_mem memObj = img; pKernel->setArg(0, sizeof(memObj), &memObj); - std::unique_ptr> csr(new MockCsr(execStamp, *pDevice->executionEnvironment, pDevice->getRootDeviceIndex())); + std::unique_ptr> csr(new MockCsr(execStamp, *pDevice->executionEnvironment, pDevice->getRootDeviceIndex(), pDevice->getDeviceBitfield())); csr->setupContext(*pDevice->getDefaultEngine().osContext); pKernel->makeResident(*csr.get()); diff --git a/opencl/test/unit_test/kernel/kernel_tests.cpp b/opencl/test/unit_test/kernel/kernel_tests.cpp index 9ebb68352f..54ff70b0fe 100644 --- a/opencl/test/unit_test/kernel/kernel_tests.cpp +++ b/opencl/test/unit_test/kernel/kernel_tests.cpp @@ -497,7 +497,7 @@ class CommandStreamReceiverMock : public CommandStreamReceiver { bool isMultiOsContextCapable() const override { return false; } - CommandStreamReceiverMock() : BaseClass(*(new ExecutionEnvironment), 0) { + CommandStreamReceiverMock() : BaseClass(*(new ExecutionEnvironment), 0, 1) { this->mockExecutionEnvironment.reset(&this->executionEnvironment); executionEnvironment.prepareRootDeviceEnvironments(1); executionEnvironment.rootDeviceEnvironments[0]->setHwInfo(defaultHwInfo.get()); @@ -586,7 +586,7 @@ TEST_F(KernelPrivateSurfaceTest, WhenChangingResidencyThenCsrResidencySizeIsUpda // Test it auto executionEnvironment = pDevice->getExecutionEnvironment(); - std::unique_ptr csr(new CommandStreamReceiverMock(*executionEnvironment, 0)); + std::unique_ptr csr(new CommandStreamReceiverMock(*executionEnvironment, 0, 1)); csr->setupContext(*pDevice->getDefaultEngine().osContext); csr->residency.clear(); EXPECT_EQ(0u, csr->residency.size()); diff --git a/opencl/test/unit_test/libult/create_command_stream.cpp b/opencl/test/unit_test/libult/create_command_stream.cpp index 936d0301bb..a52774505c 100644 --- a/opencl/test/unit_test/libult/create_command_stream.cpp +++ b/opencl/test/unit_test/libult/create_command_stream.cpp @@ -23,16 +23,16 @@ namespace NEO { extern CommandStreamReceiverCreateFunc commandStreamReceiverFactory[2 * IGFX_MAX_CORE]; -CommandStreamReceiver *createCommandStream(ExecutionEnvironment &executionEnvironment, uint32_t rootDeviceIndex) { +CommandStreamReceiver *createCommandStream(ExecutionEnvironment &executionEnvironment, uint32_t rootDeviceIndex, DeviceBitfield deviceBitfield) { auto hwInfo = executionEnvironment.rootDeviceEnvironments[rootDeviceIndex]->getHardwareInfo(); if (ultHwConfig.useHwCsr) { - return createCommandStreamImpl(executionEnvironment, rootDeviceIndex); + return createCommandStreamImpl(executionEnvironment, rootDeviceIndex, deviceBitfield); } auto funcCreate = commandStreamReceiverFactory[IGFX_MAX_CORE + hwInfo->platform.eRenderCoreFamily]; if (funcCreate) { - return funcCreate(false, executionEnvironment, rootDeviceIndex); + return funcCreate(false, executionEnvironment, rootDeviceIndex, deviceBitfield); } return nullptr; } diff --git a/opencl/test/unit_test/libult/create_command_stream.h b/opencl/test/unit_test/libult/create_command_stream.h index 8c6e66e309..200b7d3108 100644 --- a/opencl/test/unit_test/libult/create_command_stream.h +++ b/opencl/test/unit_test/libult/create_command_stream.h @@ -6,6 +6,8 @@ */ #pragma once + +#include #include #include @@ -13,6 +15,8 @@ namespace NEO { class CommandStreamReceiver; class ExecutionEnvironment; -extern CommandStreamReceiver *createCommandStream(ExecutionEnvironment &executionEnvironment, uint32_t rootDeviceIndex); +using DeviceBitfield = std::bitset<32>; + +extern CommandStreamReceiver *createCommandStream(ExecutionEnvironment &executionEnvironment, uint32_t rootDeviceIndex, DeviceBitfield deviceBitfield); extern bool prepareDeviceEnvironments(ExecutionEnvironment &executionEnvironment); } // namespace NEO diff --git a/opencl/test/unit_test/libult/ult_aub_command_stream_receiver.h b/opencl/test/unit_test/libult/ult_aub_command_stream_receiver.h index 1bd6d064cb..6aa0a3150c 100644 --- a/opencl/test/unit_test/libult/ult_aub_command_stream_receiver.h +++ b/opencl/test/unit_test/libult/ult_aub_command_stream_receiver.h @@ -23,16 +23,16 @@ class UltAubCommandStreamReceiver : public AUBCommandStreamReceiverHw using BaseClass::useGpuIdleImplicitFlush; using BaseClass::useNewResourceImplicitFlush; - UltAubCommandStreamReceiver(const std::string &fileName, bool standalone, ExecutionEnvironment &executionEnvironment, uint32_t rootDeviceIndex) - : BaseClass(fileName, standalone, executionEnvironment, rootDeviceIndex) { + UltAubCommandStreamReceiver(const std::string &fileName, bool standalone, ExecutionEnvironment &executionEnvironment, uint32_t rootDeviceIndex, DeviceBitfield deviceBitfield) + : BaseClass(fileName, standalone, executionEnvironment, rootDeviceIndex, deviceBitfield) { } - UltAubCommandStreamReceiver(ExecutionEnvironment &executionEnvironment, uint32_t rootDeviceIndex) - : BaseClass("aubfile", true, executionEnvironment, rootDeviceIndex) { + UltAubCommandStreamReceiver(ExecutionEnvironment &executionEnvironment, uint32_t rootDeviceIndex, DeviceBitfield deviceBitfield) + : BaseClass("aubfile", true, executionEnvironment, rootDeviceIndex, deviceBitfield) { } - static CommandStreamReceiver *create(bool withAubDump, ExecutionEnvironment &executionEnvironment, uint32_t rootDeviceIndex) { - auto csr = new UltAubCommandStreamReceiver("aubfile", true, executionEnvironment, rootDeviceIndex); + static CommandStreamReceiver *create(bool withAubDump, ExecutionEnvironment &executionEnvironment, uint32_t rootDeviceIndex, DeviceBitfield deviceBitfield) { + auto csr = new UltAubCommandStreamReceiver("aubfile", true, executionEnvironment, rootDeviceIndex, deviceBitfield); if (!csr->subCaptureManager->isSubCaptureMode()) { csr->openFile("aubfile"); diff --git a/opencl/test/unit_test/libult/ult_command_stream_receiver.h b/opencl/test/unit_test/libult/ult_command_stream_receiver.h index cabfbead4e..787958d2bb 100644 --- a/opencl/test/unit_test/libult/ult_command_stream_receiver.h +++ b/opencl/test/unit_test/libult/ult_command_stream_receiver.h @@ -55,6 +55,7 @@ class UltCommandStreamReceiver : public CommandStreamReceiverHw, publ using BaseClass::CommandStreamReceiver::commandStream; using BaseClass::CommandStreamReceiver::debugConfirmationFunction; using BaseClass::CommandStreamReceiver::debugPauseStateAddress; + using BaseClass::CommandStreamReceiver::deviceBitfield; using BaseClass::CommandStreamReceiver::dispatchMode; using BaseClass::CommandStreamReceiver::executionEnvironment; using BaseClass::CommandStreamReceiver::experimentalCmdBuffer; @@ -98,10 +99,15 @@ class UltCommandStreamReceiver : public CommandStreamReceiverHw, publ using BaseClass::CommandStreamReceiver::userPauseConfirmation; using BaseClass::CommandStreamReceiver::waitForTaskCountAndCleanAllocationList; - UltCommandStreamReceiver(ExecutionEnvironment &executionEnvironment, uint32_t rootDeviceIndex) : BaseClass(executionEnvironment, rootDeviceIndex), recursiveLockCounter(0), - recordedDispatchFlags(DispatchFlagsHelper::createDefaultDispatchFlags()) {} - static CommandStreamReceiver *create(bool withAubDump, ExecutionEnvironment &executionEnvironment, uint32_t rootDeviceIndex) { - return new UltCommandStreamReceiver(executionEnvironment, rootDeviceIndex); + UltCommandStreamReceiver(ExecutionEnvironment &executionEnvironment, + uint32_t rootDeviceIndex, + DeviceBitfield deviceBitfield) : BaseClass(executionEnvironment, rootDeviceIndex, deviceBitfield), recursiveLockCounter(0), + recordedDispatchFlags(DispatchFlagsHelper::createDefaultDispatchFlags()) {} + static CommandStreamReceiver *create(bool withAubDump, + ExecutionEnvironment &executionEnvironment, + uint32_t rootDeviceIndex, + DeviceBitfield deviceBitfield) { + return new UltCommandStreamReceiver(executionEnvironment, rootDeviceIndex, deviceBitfield); } GmmPageTableMngr *createPageTableManager() override { @@ -216,6 +222,9 @@ class UltCommandStreamReceiver : public CommandStreamReceiverHw, publ } bool isMultiOsContextCapable() const override { + if (callBaseIsMultiOsContextCapable) { + return BaseClass::isMultiOsContextCapable(); + } return multiOsContextCapable; } @@ -250,27 +259,32 @@ class UltCommandStreamReceiver : public CommandStreamReceiverHw, publ ensureCommandBufferAllocationCalled++; BaseClass::ensureCommandBufferAllocation(commandStream, minimumRequiredSize, additionalAllocationSize); } + std::vector aubCommentMessages; + + BatchBuffer latestFlushedBatchBuffer = {}; std::atomic recursiveLockCounter; + std::atomic latestWaitForCompletionWithTimeoutTaskCount{0}; + + LinearStream *lastFlushedCommandStream = nullptr; + + uint32_t makeSurfacePackNonResidentCalled = false; + uint32_t latestSentTaskCountValueDuringFlush = 0; + uint32_t blitBufferCalled = 0; + uint32_t createPerDssBackedBufferCalled = 0; + int ensureCommandBufferAllocationCalled = 0; + DispatchFlags recordedDispatchFlags; + bool createPageTableManagerCalled = false; bool recordFlusheBatchBuffer = false; bool checkAndActivateAubSubCaptureCalled = false; bool addAubCommentCalled = false; bool downloadAllocationCalled = false; - std::vector aubCommentMessages; bool flushBatchedSubmissionsCalled = false; - uint32_t makeSurfacePackNonResidentCalled = false; bool initProgrammingFlagsCalled = false; - LinearStream *lastFlushedCommandStream = nullptr; - BatchBuffer latestFlushedBatchBuffer = {}; - uint32_t latestSentTaskCountValueDuringFlush = 0; - uint32_t blitBufferCalled = 0; - uint32_t createPerDssBackedBufferCalled = 0; - std::atomic latestWaitForCompletionWithTimeoutTaskCount{0}; - DispatchFlags recordedDispatchFlags; bool multiOsContextCapable = false; bool directSubmissionAvailable = false; bool blitterDirectSubmissionAvailable = false; - int ensureCommandBufferAllocationCalled = 0; + bool callBaseIsMultiOsContextCapable = false; }; } // namespace NEO diff --git a/opencl/test/unit_test/mem_obj/buffer_bcs_tests.cpp b/opencl/test/unit_test/mem_obj/buffer_bcs_tests.cpp index 672a523f3d..53cab04156 100644 --- a/opencl/test/unit_test/mem_obj/buffer_bcs_tests.cpp +++ b/opencl/test/unit_test/mem_obj/buffer_bcs_tests.cpp @@ -33,7 +33,7 @@ struct BcsBufferTests : public ::testing::Test { BcsMockContext(ClDevice *device) : MockContext(device) { bcsOsContext.reset(OsContext::create(nullptr, 0, device->getDeviceBitfield(), aub_stream::ENGINE_BCS, PreemptionMode::Disabled, false, false, false)); - bcsCsr.reset(createCommandStream(*device->getExecutionEnvironment(), device->getRootDeviceIndex())); + bcsCsr.reset(createCommandStream(*device->getExecutionEnvironment(), device->getRootDeviceIndex(), device->getDeviceBitfield())); bcsCsr->setupContext(*bcsOsContext); bcsCsr->initializeTagAllocation(); bcsCsr->createGlobalFenceAllocation(); @@ -870,7 +870,7 @@ HWTEST_TEMPLATED_F(BcsBufferTests, givenInputAndOutputTimestampPacketWhenBlitCal } HWTEST_TEMPLATED_F(BcsBufferTests, givenBlockingWriteBufferWhenUsingBcsThenCallWait) { - auto myMockCsr = new MyMockCsr(*device->getExecutionEnvironment(), device->getRootDeviceIndex()); + auto myMockCsr = new MyMockCsr(*device->getExecutionEnvironment(), device->getRootDeviceIndex(), device->getDeviceBitfield()); myMockCsr->taskCount = 1234; myMockCsr->initializeTagAllocation(); myMockCsr->setupContext(*bcsMockContext->bcsOsContext); @@ -909,7 +909,7 @@ HWTEST_TEMPLATED_F(BcsBufferTests, givenBlockingWriteBufferWhenUsingBcsThenCallW } HWTEST_TEMPLATED_F(BcsBufferTests, givenBlockingReadBufferRectWhenUsingBcsThenCallWait) { - auto myMockCsr = new MyMockCsr(*device->getExecutionEnvironment(), device->getRootDeviceIndex()); + auto myMockCsr = new MyMockCsr(*device->getExecutionEnvironment(), device->getRootDeviceIndex(), device->getDeviceBitfield()); myMockCsr->taskCount = 1234; myMockCsr->initializeTagAllocation(); myMockCsr->setupContext(*bcsMockContext->bcsOsContext); @@ -956,7 +956,7 @@ HWTEST_TEMPLATED_F(BcsBufferTests, givenBlockingReadBufferRectWhenUsingBcsThenCa } HWTEST_TEMPLATED_F(BcsBufferTests, givenBlockingWriteBufferRectWhenUsingBcsThenCallWait) { - auto myMockCsr = new MyMockCsr(*device->getExecutionEnvironment(), device->getRootDeviceIndex()); + auto myMockCsr = new MyMockCsr(*device->getExecutionEnvironment(), device->getRootDeviceIndex(), device->getDeviceBitfield()); myMockCsr->taskCount = 1234; myMockCsr->initializeTagAllocation(); myMockCsr->setupContext(*bcsMockContext->bcsOsContext); @@ -1003,7 +1003,7 @@ HWTEST_TEMPLATED_F(BcsBufferTests, givenBlockingWriteBufferRectWhenUsingBcsThenC } HWTEST_TEMPLATED_F(BcsBufferTests, givenBlockingReadBufferWhenUsingBcsThenCallWait) { - auto myMockCsr = new MyMockCsr(*device->getExecutionEnvironment(), device->getRootDeviceIndex()); + auto myMockCsr = new MyMockCsr(*device->getExecutionEnvironment(), device->getRootDeviceIndex(), device->getDeviceBitfield()); myMockCsr->taskCount = 1234; myMockCsr->initializeTagAllocation(); myMockCsr->setupContext(*bcsMockContext->bcsOsContext); @@ -1042,7 +1042,7 @@ HWTEST_TEMPLATED_F(BcsBufferTests, givenBlockingReadBufferWhenUsingBcsThenCallWa } HWTEST_TEMPLATED_F(BcsBufferTests, givenBlockingSVMMemcpyAndEnqueuReadBufferIsCalledWhenUsingBcsThenCallWait) { - auto myMockCsr = new MyMockCsr(*device->getExecutionEnvironment(), device->getRootDeviceIndex()); + auto myMockCsr = new MyMockCsr(*device->getExecutionEnvironment(), device->getRootDeviceIndex(), device->getDeviceBitfield()); myMockCsr->taskCount = 1234; myMockCsr->initializeTagAllocation(); myMockCsr->setupContext(*bcsMockContext->bcsOsContext); @@ -1075,7 +1075,7 @@ HWTEST_TEMPLATED_F(BcsBufferTests, givenBlockingSVMMemcpyAndEnqueuReadBufferIsCa } HWTEST_TEMPLATED_F(BcsBufferTests, givenSrcHostPtrBlockingEnqueueSVMMemcpyAndEnqueuWriteBufferIsCalledWhenUsingBcsThenCallWait) { - auto myMockCsr = new MyMockCsr(*device->getExecutionEnvironment(), device->getRootDeviceIndex()); + auto myMockCsr = new MyMockCsr(*device->getExecutionEnvironment(), device->getRootDeviceIndex(), device->getDeviceBitfield()); myMockCsr->taskCount = 1234; myMockCsr->initializeTagAllocation(); myMockCsr->setupContext(*bcsMockContext->bcsOsContext); @@ -1108,7 +1108,7 @@ HWTEST_TEMPLATED_F(BcsBufferTests, givenSrcHostPtrBlockingEnqueueSVMMemcpyAndEnq } HWTEST_TEMPLATED_F(BcsBufferTests, givenDstHostPtrAndSrcHostPtrBlockingEnqueueSVMMemcpyAndEnqueuWriteBufferIsCalledWhenUsingBcsThenCallWait) { - auto myMockCsr = new MyMockCsr(*device->getExecutionEnvironment(), device->getRootDeviceIndex()); + auto myMockCsr = new MyMockCsr(*device->getExecutionEnvironment(), device->getRootDeviceIndex(), device->getDeviceBitfield()); myMockCsr->taskCount = 1234; myMockCsr->initializeTagAllocation(); myMockCsr->setupContext(*bcsMockContext->bcsOsContext); @@ -1162,7 +1162,7 @@ HWTEST_TEMPLATED_F(BcsBufferTests, givenSvmToSvmCopyWhenEnqueueSVMMemcpyThenSvmM } HWTEST_TEMPLATED_F(BcsBufferTests, givenSvmToSvmCopyTypeWhenEnqueueNonBlockingSVMMemcpyThenSvmMemcpyCommandIsEnqueuedWhenUsingBcsThenCallWait) { - auto myMockCsr = new MyMockCsr(*device->getExecutionEnvironment(), device->getRootDeviceIndex()); + auto myMockCsr = new MyMockCsr(*device->getExecutionEnvironment(), device->getRootDeviceIndex(), device->getDeviceBitfield()); myMockCsr->taskCount = 1234; myMockCsr->initializeTagAllocation(); myMockCsr->setupContext(*bcsMockContext->bcsOsContext); @@ -1290,7 +1290,7 @@ HWTEST_TEMPLATED_F(BcsSvmTests, givenSVMMAllocationWithOffsetWhenUsingBcsThenPro } HWTEST_TEMPLATED_F(BcsBufferTests, givenBlockedEnqueueWhenUsingBcsThenWaitForValidTaskCountOnBlockingCall) { - auto myMockCsr = new MyMockCsr(*device->getExecutionEnvironment(), device->getRootDeviceIndex()); + auto myMockCsr = new MyMockCsr(*device->getExecutionEnvironment(), device->getRootDeviceIndex(), device->getDeviceBitfield()); myMockCsr->taskCount = 1234; myMockCsr->initializeTagAllocation(); myMockCsr->setupContext(*bcsMockContext->bcsOsContext); diff --git a/opencl/test/unit_test/mem_obj/mem_obj_destruction_tests.cpp b/opencl/test/unit_test/mem_obj/mem_obj_destruction_tests.cpp index 9b77d37c35..0bdba12362 100644 --- a/opencl/test/unit_test/mem_obj/mem_obj_destruction_tests.cpp +++ b/opencl/test/unit_test/mem_obj/mem_obj_destruction_tests.cpp @@ -27,7 +27,8 @@ using namespace NEO; template class MyCsr : public UltCommandStreamReceiver { public: - MyCsr(const ExecutionEnvironment &executionEnvironment) : UltCommandStreamReceiver(const_cast(executionEnvironment), 0) {} + MyCsr(const ExecutionEnvironment &executionEnvironment, DeviceBitfield deviceBitfield) + : UltCommandStreamReceiver(const_cast(executionEnvironment), 0, deviceBitfield) {} MOCK_METHOD3(waitForCompletionWithTimeout, bool(bool enableTimeout, int64_t timeoutMs, uint32_t taskCountToWait)); }; @@ -140,8 +141,8 @@ HWTEST_P(MemObjAsyncDestructionTest, givenUsedMemObjWithAsyncDestructionsEnabled auto rootDeviceIndex = device->getRootDeviceIndex(); - auto mockCsr0 = new ::testing::NiceMock>(*device->executionEnvironment); - auto mockCsr1 = new ::testing::NiceMock>(*device->executionEnvironment); + auto mockCsr0 = new ::testing::NiceMock>(*device->executionEnvironment, device->getDeviceBitfield()); + auto mockCsr1 = new ::testing::NiceMock>(*device->executionEnvironment, device->getDeviceBitfield()); device->resetCommandStreamReceiver(mockCsr0, 0); device->resetCommandStreamReceiver(mockCsr1, 1); *mockCsr0->getTagAddress() = 0; @@ -192,7 +193,7 @@ HWTEST_P(MemObjAsyncDestructionTest, givenUsedMemObjWithAsyncDestructionsEnabled memObj->setAllocatedMapPtr(allocatedPtr); } - auto mockCsr = new ::testing::NiceMock>(*device->executionEnvironment); + auto mockCsr = new ::testing::NiceMock>(*device->executionEnvironment, device->getDeviceBitfield()); device->resetCommandStreamReceiver(mockCsr); *mockCsr->getTagAddress() = 0; auto osContextId = mockCsr->getOsContext().getContextId(); @@ -235,7 +236,7 @@ HWTEST_P(MemObjAsyncDestructionTest, givenUsedMemObjWithAsyncDestructionsEnabled } makeMemObjUsed(); - auto mockCsr = new ::testing::NiceMock>(*device->executionEnvironment); + auto mockCsr = new ::testing::NiceMock>(*device->executionEnvironment, device->getDeviceBitfield()); device->resetCommandStreamReceiver(mockCsr); *mockCsr->getTagAddress() = 0; @@ -270,7 +271,7 @@ HWTEST_P(MemObjSyncDestructionTest, givenMemObjWithDestructableAllocationWhenAsy } else { makeMemObjNotReady(); } - auto mockCsr = new ::testing::NiceMock>(*device->executionEnvironment); + auto mockCsr = new ::testing::NiceMock>(*device->executionEnvironment, device->getDeviceBitfield()); device->resetCommandStreamReceiver(mockCsr); *mockCsr->getTagAddress() = 0; @@ -297,7 +298,7 @@ HWTEST_P(MemObjSyncDestructionTest, givenMemObjWithDestructableAllocationWhenAsy } else { makeMemObjNotReady(); } - auto mockCsr = new ::testing::NiceMock>(*device->executionEnvironment); + auto mockCsr = new ::testing::NiceMock>(*device->executionEnvironment, device->getDeviceBitfield()); device->resetCommandStreamReceiver(mockCsr); *mockCsr->getTagAddress() = 0; @@ -316,7 +317,7 @@ HWTEST_P(MemObjSyncDestructionTest, givenMemObjWithDestructableAllocationWhenAsy HWTEST_P(MemObjSyncDestructionTest, givenMemObjWithMapAllocationWhenAsyncDestructionsAreDisabledThenWaitForCompletionWithTimeoutOnMapAllocation) { auto isMapAllocationUsed = GetParam(); - auto mockCsr = new ::testing::NiceMock>(*device->executionEnvironment); + auto mockCsr = new ::testing::NiceMock>(*device->executionEnvironment, device->getDeviceBitfield()); device->resetCommandStreamReceiver(mockCsr); *mockCsr->getTagAddress() = 0; @@ -354,7 +355,7 @@ HWTEST_P(MemObjSyncDestructionTest, givenMemObjWithMapAllocationWhenAsyncDestruc HWTEST_P(MemObjSyncDestructionTest, givenMemObjWithMapAllocationWhenAsyncDestructionsAreDisabledThenMapAllocationIsNotDeferred) { auto hasMapAllocation = GetParam(); - auto mockCsr = new ::testing::NiceMock>(*device->executionEnvironment); + auto mockCsr = new ::testing::NiceMock>(*device->executionEnvironment, device->getDeviceBitfield()); device->resetCommandStreamReceiver(mockCsr); *mockCsr->getTagAddress() = 0; @@ -385,7 +386,7 @@ HWTEST_P(MemObjSyncDestructionTest, givenMemObjWithMapAllocationWhenAsyncDestruc HWTEST_P(MemObjAsyncDestructionTest, givenMemObjWithMapAllocationWithoutMemUseHostPtrFlagWhenAsyncDestructionsAreEnabledThenMapAllocationIsDeferred) { auto hasMapAllocation = GetParam(); - auto mockCsr = new ::testing::NiceMock>(*device->executionEnvironment); + auto mockCsr = new ::testing::NiceMock>(*device->executionEnvironment, device->getDeviceBitfield()); device->resetCommandStreamReceiver(mockCsr); *mockCsr->getTagAddress() = 0; @@ -424,7 +425,7 @@ HWTEST_P(MemObjAsyncDestructionTest, givenMemObjWithMapAllocationWithoutMemUseHo HWTEST_P(MemObjAsyncDestructionTest, givenMemObjWithMapAllocationWithMemUseHostPtrFlagWhenAsyncDestructionsAreEnabledThenMapAllocationIsNotDeferred) { auto hasMapAllocation = GetParam(); - auto mockCsr = new ::testing::NiceMock>(*device->executionEnvironment); + auto mockCsr = new ::testing::NiceMock>(*device->executionEnvironment, device->getDeviceBitfield()); device->resetCommandStreamReceiver(mockCsr); *mockCsr->getTagAddress() = 0; @@ -485,9 +486,9 @@ HWTEST_F(UsmDestructionTests, givenSharedUsmAllocationWhenBlockingFreeIsCalledTh GTEST_SKIP(); } - auto mockCsr = new ::testing::NiceMock>(*mockDevice.executionEnvironment); + auto mockCsr = new ::testing::NiceMock>(*mockDevice.executionEnvironment, 1); auto osContext = mockDevice.executionEnvironment->memoryManager->createAndRegisterOsContext(mockDevice.engines[0].commandStreamReceiver, - aub_stream::ENGINE_RCS, {}, + aub_stream::ENGINE_RCS, 1, PreemptionMode::Disabled, false, false, false); mockDevice.engines[0].osContext = osContext; @@ -524,9 +525,9 @@ HWTEST_F(UsmDestructionTests, givenUsmAllocationWhenBlockingFreeIsCalledThenWait GTEST_SKIP(); } - auto mockCsr = new ::testing::NiceMock>(*mockDevice.executionEnvironment); + auto mockCsr = new ::testing::NiceMock>(*mockDevice.executionEnvironment, 1); auto osContext = mockDevice.executionEnvironment->memoryManager->createAndRegisterOsContext(mockDevice.engines[0].commandStreamReceiver, - aub_stream::ENGINE_RCS, {}, + aub_stream::ENGINE_RCS, 1, PreemptionMode::Disabled, false, false, false); mockDevice.engines[0].osContext = osContext; diff --git a/opencl/test/unit_test/memory_manager/host_ptr_manager_tests.cpp b/opencl/test/unit_test/memory_manager/host_ptr_manager_tests.cpp index 364a6212c1..b6a9093345 100644 --- a/opencl/test/unit_test/memory_manager/host_ptr_manager_tests.cpp +++ b/opencl/test/unit_test/memory_manager/host_ptr_manager_tests.cpp @@ -914,7 +914,7 @@ HWTEST_F(HostPtrAllocationTest, givenOverlappingFragmentsWhenCheckIsCalledThenWa EXPECT_EQ(1u, engines.size()); auto csr0 = static_cast(engines[0].commandStreamReceiver); - auto csr1 = std::make_unique(executionEnvironment, 0); + auto csr1 = std::make_unique(executionEnvironment, 0, 1); uint32_t csr0GpuTag = taskCountNotReady; uint32_t csr1GpuTag = taskCountNotReady; csr0->tagAddress = &csr0GpuTag; diff --git a/opencl/test/unit_test/memory_manager/memory_manager_tests.cpp b/opencl/test/unit_test/memory_manager/memory_manager_tests.cpp index 0b3ce7e577..639b2fa975 100644 --- a/opencl/test/unit_test/memory_manager/memory_manager_tests.cpp +++ b/opencl/test/unit_test/memory_manager/memory_manager_tests.cpp @@ -1406,12 +1406,13 @@ TEST(OsAgnosticMemoryManager, givenOsAgnosticMemoryManagerWhenVerifyHandleThenRe TEST(OsAgnosticMemoryManager, givenMemoryManagerWhenGpuAddressIsSetThenAllocationWithSpecifiedGpuAddressInSystemMemoryIsCreated) { MockExecutionEnvironment executionEnvironment(defaultHwInfo.get()); auto memoryManager = new OsAgnosticMemoryManager(executionEnvironment); - - std::unique_ptr csr(createCommandStream(executionEnvironment, 0u)); + DeviceBitfield deviceBitfield(1); + std::unique_ptr csr(createCommandStream(executionEnvironment, 0u, deviceBitfield)); executionEnvironment.memoryManager.reset(memoryManager); auto osContext = memoryManager->createAndRegisterOsContext(csr.get(), HwHelper::get(defaultHwInfo->platform.eRenderCoreFamily).getGpgpuEngineInstances(*defaultHwInfo)[0].first, - 1, PreemptionHelper::getDefaultPreemptionMode(*defaultHwInfo), + deviceBitfield, + PreemptionHelper::getDefaultPreemptionMode(*defaultHwInfo), false, false, false); MockAllocationProperties properties = {0, MemoryConstants::pageSize}; @@ -1827,10 +1828,11 @@ TEST(ResidencyDataTest, givenOsContextWhenItIsRegisteredToMemoryManagerThenRefCo MockExecutionEnvironment executionEnvironment(defaultHwInfo.get()); auto memoryManager = new MockMemoryManager(false, false, executionEnvironment); executionEnvironment.memoryManager.reset(memoryManager); - std::unique_ptr csr(createCommandStream(executionEnvironment, 0u)); + DeviceBitfield deviceBitfield(1); + std::unique_ptr csr(createCommandStream(executionEnvironment, 0u, deviceBitfield)); memoryManager->createAndRegisterOsContext(csr.get(), HwHelper::get(defaultHwInfo->platform.eRenderCoreFamily).getGpgpuEngineInstances(*defaultHwInfo)[0].first, - 1, PreemptionHelper::getDefaultPreemptionMode(*defaultHwInfo), + deviceBitfield, PreemptionHelper::getDefaultPreemptionMode(*defaultHwInfo), false, false, false); EXPECT_EQ(1u, memoryManager->getRegisteredEnginesCount()); EXPECT_EQ(1, memoryManager->registeredEngines[0].osContext->getRefInternalCount()); @@ -1854,8 +1856,8 @@ TEST(ResidencyDataTest, givenDeviceBitfieldWhenCreatingOsContextThenSetValidValu MockExecutionEnvironment executionEnvironment(defaultHwInfo.get()); auto memoryManager = new MockMemoryManager(false, false, executionEnvironment); executionEnvironment.memoryManager.reset(memoryManager); - std::unique_ptr csr(createCommandStream(executionEnvironment, 0u)); - DeviceBitfield deviceBitfield = 0b11; + DeviceBitfield deviceBitfield(0b11); + std::unique_ptr csr(createCommandStream(executionEnvironment, 0u, deviceBitfield)); PreemptionMode preemptionMode = PreemptionMode::MidThread; memoryManager->createAndRegisterOsContext(csr.get(), HwHelper::get(defaultHwInfo->platform.eRenderCoreFamily).getGpgpuEngineInstances(*defaultHwInfo)[0].first, @@ -1870,15 +1872,16 @@ TEST(ResidencyDataTest, givenTwoOsContextsWhenTheyAreRegisteredFromHigherToLower MockExecutionEnvironment executionEnvironment(defaultHwInfo.get(), true, 2u); auto memoryManager = new MockMemoryManager(false, false, executionEnvironment); executionEnvironment.memoryManager.reset(memoryManager); - std::unique_ptr csr(createCommandStream(executionEnvironment, 0u)); - std::unique_ptr csr1(createCommandStream(executionEnvironment, 1u)); + DeviceBitfield deviceBitfield(1); + std::unique_ptr csr(createCommandStream(executionEnvironment, 0u, deviceBitfield)); + std::unique_ptr csr1(createCommandStream(executionEnvironment, 1u, deviceBitfield)); memoryManager->createAndRegisterOsContext(csr.get(), HwHelper::get(defaultHwInfo->platform.eRenderCoreFamily).getGpgpuEngineInstances(*defaultHwInfo)[0].first, - 1, PreemptionHelper::getDefaultPreemptionMode(*defaultHwInfo), + deviceBitfield, PreemptionHelper::getDefaultPreemptionMode(*defaultHwInfo), false, false, false); memoryManager->createAndRegisterOsContext(csr1.get(), HwHelper::get(defaultHwInfo->platform.eRenderCoreFamily).getGpgpuEngineInstances(*defaultHwInfo)[1].first, - 1, PreemptionHelper::getDefaultPreemptionMode(*defaultHwInfo), + deviceBitfield, PreemptionHelper::getDefaultPreemptionMode(*defaultHwInfo), false, false, false); EXPECT_EQ(2u, memoryManager->getRegisteredEnginesCount()); EXPECT_EQ(1, memoryManager->registeredEngines[0].osContext->getRefInternalCount()); diff --git a/opencl/test/unit_test/memory_manager/surface_tests.cpp b/opencl/test/unit_test/memory_manager/surface_tests.cpp index fd902c3248..cf856d6cf2 100644 --- a/opencl/test/unit_test/memory_manager/surface_tests.cpp +++ b/opencl/test/unit_test/memory_manager/surface_tests.cpp @@ -64,10 +64,11 @@ HWTEST_TYPED_TEST(SurfaceTest, GivenSurfaceWhenInterfaceIsUsedThenSurfaceBehaves ExecutionEnvironment *executionEnvironment = platform()->peekExecutionEnvironment(); executionEnvironment->initializeMemoryManager(); - auto csr = std::make_unique>(execStamp, *executionEnvironment, 0); + DeviceBitfield deviceBitfield(1); + auto csr = std::make_unique>(execStamp, *executionEnvironment, 0, deviceBitfield); auto hwInfo = *defaultHwInfo; auto engine = HwHelper::get(hwInfo.platform.eRenderCoreFamily).getGpgpuEngineInstances(hwInfo)[0].first; - auto osContext = executionEnvironment->memoryManager->createAndRegisterOsContext(csr.get(), engine, 1, + auto osContext = executionEnvironment->memoryManager->createAndRegisterOsContext(csr.get(), engine, deviceBitfield, PreemptionHelper::getDefaultPreemptionMode(hwInfo), false, false, false); csr->setupContext(*osContext); diff --git a/opencl/test/unit_test/mocks/linux/mock_drm_command_stream_receiver.h b/opencl/test/unit_test/mocks/linux/mock_drm_command_stream_receiver.h index b34c3044f2..2ad26788cd 100644 --- a/opencl/test/unit_test/mocks/linux/mock_drm_command_stream_receiver.h +++ b/opencl/test/unit_test/mocks/linux/mock_drm_command_stream_receiver.h @@ -23,11 +23,11 @@ class TestedDrmCommandStreamReceiver : public DrmCommandStreamReceiver::blitterDirectSubmission; using CommandStreamReceiverHw::CommandStreamReceiver::lastSentSliceCount; - TestedDrmCommandStreamReceiver(gemCloseWorkerMode mode, ExecutionEnvironment &executionEnvironment) - : DrmCommandStreamReceiver(executionEnvironment, 0, mode) { + TestedDrmCommandStreamReceiver(gemCloseWorkerMode mode, ExecutionEnvironment &executionEnvironment, DeviceBitfield deviceBitfield) + : DrmCommandStreamReceiver(executionEnvironment, 0, deviceBitfield, mode) { } - TestedDrmCommandStreamReceiver(ExecutionEnvironment &executionEnvironment, uint32_t rootDeviceIndex) - : DrmCommandStreamReceiver(executionEnvironment, rootDeviceIndex, gemCloseWorkerMode::gemCloseWorkerInactive) { + TestedDrmCommandStreamReceiver(ExecutionEnvironment &executionEnvironment, uint32_t rootDeviceIndex, DeviceBitfield deviceBitfield) + : DrmCommandStreamReceiver(executionEnvironment, rootDeviceIndex, deviceBitfield, gemCloseWorkerMode::gemCloseWorkerInactive) { } void overrideDispatchPolicy(DispatchMode overrideValue) { diff --git a/opencl/test/unit_test/mocks/mock_aub_csr.h b/opencl/test/unit_test/mocks/mock_aub_csr.h index 72f50ae3f1..f494c4ba98 100644 --- a/opencl/test/unit_test/mocks/mock_aub_csr.h +++ b/opencl/test/unit_test/mocks/mock_aub_csr.h @@ -176,16 +176,17 @@ struct AubExecutionEnvironment { template std::unique_ptr getEnvironment(bool createTagAllocation, bool allocateCommandBuffer, bool standalone) { std::unique_ptr executionEnvironment(new ExecutionEnvironment); + DeviceBitfield deviceBitfield(1); executionEnvironment->prepareRootDeviceEnvironments(1); uint32_t rootDeviceIndex = 0u; executionEnvironment->rootDeviceEnvironments[rootDeviceIndex]->setHwInfo(defaultHwInfo.get()); executionEnvironment->rootDeviceEnvironments[rootDeviceIndex]->aubCenter.reset(new AubCenter()); executionEnvironment->initializeMemoryManager(); - auto commandStreamReceiver = std::make_unique("", standalone, *executionEnvironment, rootDeviceIndex); + auto commandStreamReceiver = std::make_unique("", standalone, *executionEnvironment, rootDeviceIndex, deviceBitfield); auto osContext = executionEnvironment->memoryManager->createAndRegisterOsContext(commandStreamReceiver.get(), - getChosenEngineType(*defaultHwInfo), 1, + getChosenEngineType(*defaultHwInfo), deviceBitfield, PreemptionHelper::getDefaultPreemptionMode(*defaultHwInfo), false, false, false); commandStreamReceiver->setupContext(*osContext); diff --git a/opencl/test/unit_test/mocks/mock_cl_device.h b/opencl/test/unit_test/mocks/mock_cl_device.h index 1ca40d7435..ecf3e0a99e 100644 --- a/opencl/test/unit_test/mocks/mock_cl_device.h +++ b/opencl/test/unit_test/mocks/mock_cl_device.h @@ -20,7 +20,7 @@ template class UltCommandStreamReceiver; struct HardwareInfo; -extern CommandStreamReceiver *createCommandStream(ExecutionEnvironment &executionEnvironment, uint32_t rootDeviceIndex); +extern CommandStreamReceiver *createCommandStream(ExecutionEnvironment &executionEnvironment, uint32_t rootDeviceIndex, DeviceBitfield deviceBitfield); class MockClDevice : public ClDevice { public: diff --git a/opencl/test/unit_test/mocks/mock_csr.h b/opencl/test/unit_test/mocks/mock_csr.h index c76d5dbd45..75e19bfeba 100644 --- a/opencl/test/unit_test/mocks/mock_csr.h +++ b/opencl/test/unit_test/mocks/mock_csr.h @@ -24,8 +24,8 @@ class MockCsrBase : public UltCommandStreamReceiver { MockCsrBase() = delete; - MockCsrBase(int32_t &execStamp, ExecutionEnvironment &executionEnvironment, uint32_t rootDeviceIndex) - : BaseUltCsrClass(executionEnvironment, rootDeviceIndex), executionStamp(&execStamp), flushTaskStamp(-1) { + MockCsrBase(int32_t &execStamp, ExecutionEnvironment &executionEnvironment, uint32_t rootDeviceIndex, DeviceBitfield deviceBitfield) + : BaseUltCsrClass(executionEnvironment, rootDeviceIndex, deviceBitfield), executionStamp(&execStamp), flushTaskStamp(-1) { } void makeResident(GraphicsAllocation &gfxAllocation) override { @@ -78,7 +78,8 @@ using MockCsrHw = MockCsrBase; template class MockCsrAub : public MockCsrBase { public: - MockCsrAub(int32_t &execStamp, ExecutionEnvironment &executionEnvironment, uint32_t rootDeviceIndex) : MockCsrBase(execStamp, executionEnvironment, rootDeviceIndex) {} + MockCsrAub(int32_t &execStamp, ExecutionEnvironment &executionEnvironment, uint32_t rootDeviceIndex, DeviceBitfield deviceBitfield) + : MockCsrBase(execStamp, executionEnvironment, rootDeviceIndex, deviceBitfield) {} CommandStreamReceiverType getType() override { return CommandStreamReceiverType::CSR_AUB; } @@ -93,7 +94,8 @@ class MockCsr : public MockCsrBase { MockCsr() = delete; MockCsr(const HardwareInfo &hwInfoIn) = delete; - MockCsr(int32_t &execStamp, ExecutionEnvironment &executionEnvironment, uint32_t rootDeviceIndex) : BaseClass(execStamp, executionEnvironment, rootDeviceIndex) { + MockCsr(int32_t &execStamp, ExecutionEnvironment &executionEnvironment, uint32_t rootDeviceIndex, DeviceBitfield deviceBitfield) + : BaseClass(execStamp, executionEnvironment, rootDeviceIndex, deviceBitfield) { } bool flush(BatchBuffer &batchBuffer, ResidencyContainer &allocationsForResidency) override { diff --git a/opencl/test/unit_test/mocks/mock_tbx_csr.h b/opencl/test/unit_test/mocks/mock_tbx_csr.h index fb708cd49a..289031ac52 100644 --- a/opencl/test/unit_test/mocks/mock_tbx_csr.h +++ b/opencl/test/unit_test/mocks/mock_tbx_csr.h @@ -25,8 +25,8 @@ class MockTbxCsr : public TbxCommandStreamReceiverHw { public: using TbxCommandStreamReceiverHw::writeMemory; using TbxCommandStreamReceiverHw::allocationsForDownload; - MockTbxCsr(ExecutionEnvironment &executionEnvironment) - : TbxCommandStreamReceiverHw(executionEnvironment, 0) {} + MockTbxCsr(ExecutionEnvironment &executionEnvironment, DeviceBitfield deviceBitfield) + : TbxCommandStreamReceiverHw(executionEnvironment, 0, deviceBitfield) {} void initializeEngine() { TbxCommandStreamReceiverHw::initializeEngine(); diff --git a/opencl/test/unit_test/os_interface/linux/device_command_stream_tests.cpp b/opencl/test/unit_test/os_interface/linux/device_command_stream_tests.cpp index 2f47f36b88..0daa85a233 100644 --- a/opencl/test/unit_test/os_interface/linux/device_command_stream_tests.cpp +++ b/opencl/test/unit_test/os_interface/linux/device_command_stream_tests.cpp @@ -36,19 +36,19 @@ struct DeviceCommandStreamLeaksTest : ::testing::Test { }; HWTEST_F(DeviceCommandStreamLeaksTest, Create) { - std::unique_ptr ptr(DeviceCommandStreamReceiver::create(false, *executionEnvironment, 0)); + std::unique_ptr ptr(DeviceCommandStreamReceiver::create(false, *executionEnvironment, 0, 1)); DrmMockSuccess mockDrm; EXPECT_NE(nullptr, ptr); } HWTEST_F(DeviceCommandStreamLeaksTest, givenDefaultDrmCsrWhenItIsCreatedThenGemCloseWorkerInactiveModeIsSelected) { - std::unique_ptr ptr(DeviceCommandStreamReceiver::create(false, *executionEnvironment, 0)); + std::unique_ptr ptr(DeviceCommandStreamReceiver::create(false, *executionEnvironment, 0, 1)); auto drmCsr = (DrmCommandStreamReceiver *)ptr.get(); EXPECT_EQ(drmCsr->peekGemCloseWorkerOperationMode(), gemCloseWorkerMode::gemCloseWorkerActive); } HWTEST_F(DeviceCommandStreamLeaksTest, givenDefaultDrmCsrWithAubDumWhenItIsCreatedThenGemCloseWorkerInactiveModeIsSelected) { - std::unique_ptr ptr(DeviceCommandStreamReceiver::create(true, *executionEnvironment, 0)); + std::unique_ptr ptr(DeviceCommandStreamReceiver::create(true, *executionEnvironment, 0, 1)); auto drmCsrWithAubDump = (CommandStreamReceiverWithAUBDump> *)ptr.get(); EXPECT_EQ(drmCsrWithAubDump->peekGemCloseWorkerOperationMode(), gemCloseWorkerMode::gemCloseWorkerActive); auto aubCSR = static_cast> *>(ptr.get())->aubCSR.get(); @@ -56,7 +56,7 @@ HWTEST_F(DeviceCommandStreamLeaksTest, givenDefaultDrmCsrWithAubDumWhenItIsCreat } HWTEST_F(DeviceCommandStreamLeaksTest, givenDefaultDrmCsrWhenOsInterfaceIsNullptrThenValidateDrm) { - std::unique_ptr ptr(DeviceCommandStreamReceiver::create(false, *executionEnvironment, 0)); + std::unique_ptr ptr(DeviceCommandStreamReceiver::create(false, *executionEnvironment, 0, 1)); auto drmCsr = (DrmCommandStreamReceiver *)ptr.get(); EXPECT_NE(nullptr, executionEnvironment->rootDeviceEnvironments[0]->osInterface); EXPECT_EQ(drmCsr->getOSInterface()->get()->getDrm(), executionEnvironment->rootDeviceEnvironments[0]->osInterface->get()->getDrm()); @@ -66,7 +66,7 @@ HWTEST_F(DeviceCommandStreamLeaksTest, givenDisabledGemCloseWorkerWhenCsrIsCreat DebugManagerStateRestore restorer; DebugManager.flags.EnableGemCloseWorker.set(0u); - std::unique_ptr ptr(DeviceCommandStreamReceiver::create(false, *executionEnvironment, 0)); + std::unique_ptr ptr(DeviceCommandStreamReceiver::create(false, *executionEnvironment, 0, 1)); auto drmCsr = (DrmCommandStreamReceiver *)ptr.get(); EXPECT_EQ(drmCsr->peekGemCloseWorkerOperationMode(), gemCloseWorkerMode::gemCloseWorkerInactive); @@ -76,14 +76,14 @@ HWTEST_F(DeviceCommandStreamLeaksTest, givenEnabledGemCloseWorkerWhenCsrIsCreate DebugManagerStateRestore restorer; DebugManager.flags.EnableGemCloseWorker.set(1u); - std::unique_ptr ptr(DeviceCommandStreamReceiver::create(false, *executionEnvironment, 0)); + std::unique_ptr ptr(DeviceCommandStreamReceiver::create(false, *executionEnvironment, 0, 1)); auto drmCsr = (DrmCommandStreamReceiver *)ptr.get(); EXPECT_EQ(drmCsr->peekGemCloseWorkerOperationMode(), gemCloseWorkerMode::gemCloseWorkerActive); } HWTEST_F(DeviceCommandStreamLeaksTest, givenDefaultGemCloseWorkerWhenCsrIsCreatedThenGemCloseWorkerActiveModeIsSelected) { - std::unique_ptr ptr(DeviceCommandStreamReceiver::create(false, *executionEnvironment, 0)); + std::unique_ptr ptr(DeviceCommandStreamReceiver::create(false, *executionEnvironment, 0, 1)); auto drmCsr = (DrmCommandStreamReceiver *)ptr.get(); EXPECT_EQ(drmCsr->peekGemCloseWorkerOperationMode(), gemCloseWorkerMode::gemCloseWorkerActive); @@ -92,7 +92,7 @@ HWTEST_F(DeviceCommandStreamLeaksTest, givenDefaultGemCloseWorkerWhenCsrIsCreate using DeviceCommandStreamSetInternalUsageTests = DeviceCommandStreamLeaksTest; HWTEST_F(DeviceCommandStreamSetInternalUsageTests, givenValidDrmCsrThenGemCloseWorkerOperationModeIsSetToInactiveWhenInternalUsageIsSet) { - std::unique_ptr ptr(DeviceCommandStreamReceiver::create(false, *executionEnvironment, 0)); + std::unique_ptr ptr(DeviceCommandStreamReceiver::create(false, *executionEnvironment, 0, 1)); auto drmCsr = (DrmCommandStreamReceiver *)ptr.get(); EXPECT_EQ(drmCsr->peekGemCloseWorkerOperationMode(), gemCloseWorkerMode::gemCloseWorkerActive); diff --git a/opencl/test/unit_test/os_interface/linux/drm_command_stream_fixture.h b/opencl/test/unit_test/os_interface/linux/drm_command_stream_fixture.h index 02842a2761..fab431d132 100644 --- a/opencl/test/unit_test/os_interface/linux/drm_command_stream_fixture.h +++ b/opencl/test/unit_test/os_interface/linux/drm_command_stream_fixture.h @@ -43,7 +43,7 @@ class DrmCommandStreamTest : public ::testing::Test { PreemptionHelper::getDefaultPreemptionMode(*hwInfo), false, false, false); - csr = new DrmCommandStreamReceiver(executionEnvironment, 0, gemCloseWorkerMode::gemCloseWorkerActive); + csr = new DrmCommandStreamReceiver(executionEnvironment, 0, 1, gemCloseWorkerMode::gemCloseWorkerActive); ASSERT_NE(nullptr, csr); csr->setupContext(*osContext); @@ -108,7 +108,7 @@ class DrmCommandStreamEnhancedTemplate : public ::testing::Test { executionEnvironment->rootDeviceEnvironments[rootDeviceIndex]->osInterface->get()->setDrm(mock); executionEnvironment->rootDeviceEnvironments[rootDeviceIndex]->memoryOperationsInterface = DrmMemoryOperationsHandler::create(*mock, rootDeviceIndex); - csr = new TestedDrmCommandStreamReceiver(*executionEnvironment, rootDeviceIndex); + csr = new TestedDrmCommandStreamReceiver(*executionEnvironment, rootDeviceIndex, 1); ASSERT_NE(nullptr, csr); mm = new DrmMemoryManager(gemCloseWorkerMode::gemCloseWorkerInactive, DebugManager.flags.EnableForcePin.get(), diff --git a/opencl/test/unit_test/os_interface/linux/drm_command_stream_mm_tests.cpp b/opencl/test/unit_test/os_interface/linux/drm_command_stream_mm_tests.cpp index a5528883c5..075d3215c7 100644 --- a/opencl/test/unit_test/os_interface/linux/drm_command_stream_mm_tests.cpp +++ b/opencl/test/unit_test/os_interface/linux/drm_command_stream_mm_tests.cpp @@ -34,7 +34,7 @@ HWTEST_F(DrmCommandStreamMMTest, MMwithPinBB) { executionEnvironment.rootDeviceEnvironments[0]->osInterface->get()->setDrm(drm); executionEnvironment.rootDeviceEnvironments[0]->memoryOperationsInterface = DrmMemoryOperationsHandler::create(*drm, 0u); - DrmCommandStreamReceiver csr(executionEnvironment, 0, gemCloseWorkerMode::gemCloseWorkerInactive); + DrmCommandStreamReceiver csr(executionEnvironment, 0, 1, gemCloseWorkerMode::gemCloseWorkerInactive); auto memoryManager = new TestedDrmMemoryManager(false, true, false, executionEnvironment); executionEnvironment.memoryManager.reset(memoryManager); @@ -53,7 +53,7 @@ HWTEST_F(DrmCommandStreamMMTest, givenForcePinDisabledWhenMemoryManagerIsCreated executionEnvironment.rootDeviceEnvironments[0]->osInterface = std::make_unique(); executionEnvironment.rootDeviceEnvironments[0]->osInterface->get()->setDrm(drm); - DrmCommandStreamReceiver csr(executionEnvironment, 0, gemCloseWorkerMode::gemCloseWorkerInactive); + DrmCommandStreamReceiver csr(executionEnvironment, 0, 1, gemCloseWorkerMode::gemCloseWorkerInactive); auto memoryManager = new TestedDrmMemoryManager(false, true, false, executionEnvironment); executionEnvironment.memoryManager.reset(memoryManager); diff --git a/opencl/test/unit_test/os_interface/linux/drm_command_stream_tests.cpp b/opencl/test/unit_test/os_interface/linux/drm_command_stream_tests.cpp index a0b69826a0..5f31fee962 100644 --- a/opencl/test/unit_test/os_interface/linux/drm_command_stream_tests.cpp +++ b/opencl/test/unit_test/os_interface/linux/drm_command_stream_tests.cpp @@ -649,7 +649,8 @@ HWTEST_TEMPLATED_F(DrmCommandStreamEnhancedTest, givenCommandStreamWithDuplicate HWTEST_TEMPLATED_F(DrmCommandStreamEnhancedTest, givenDrmCsrCreatedWithInactiveGemCloseWorkerPolicyThenThreadIsNotCreated) { TestedDrmCommandStreamReceiver testedCsr(gemCloseWorkerMode::gemCloseWorkerInactive, - *this->executionEnvironment); + *this->executionEnvironment, + 1); EXPECT_EQ(gemCloseWorkerMode::gemCloseWorkerInactive, testedCsr.peekGemCloseWorkerOperationMode()); } @@ -1578,7 +1579,7 @@ HWTEST_TEMPLATED_F(DrmCommandStreamTest, givenDrmCommandStreamReceiverWhenCreate executionEnvironment.rootDeviceEnvironments[1]->initGmm(); executionEnvironment.rootDeviceEnvironments[1]->osInterface = std::make_unique(); executionEnvironment.rootDeviceEnvironments[1]->osInterface->get()->setDrm(new DrmMockCustom()); - auto csr = std::make_unique>(executionEnvironment, 1, gemCloseWorkerMode::gemCloseWorkerActive); + auto csr = std::make_unique>(executionEnvironment, 1, 1, gemCloseWorkerMode::gemCloseWorkerActive); auto pageTableManager = csr->createPageTableManager(); EXPECT_EQ(executionEnvironment.rootDeviceEnvironments[1]->pageTableManager.get(), pageTableManager); } @@ -1589,11 +1590,11 @@ HWTEST_TEMPLATED_F(DrmCommandStreamTest, givenLocalMemoryEnabledWhenCreatingDrmC DebugManagerStateRestore restore; DebugManager.flags.EnableLocalMemory.set(1); - MockDrmCsr csr1(executionEnvironment, 0, gemCloseWorkerMode::gemCloseWorkerInactive); + MockDrmCsr csr1(executionEnvironment, 0, 1, gemCloseWorkerMode::gemCloseWorkerInactive); EXPECT_EQ(DispatchMode::BatchedDispatch, csr1.dispatchMode); DebugManager.flags.CsrDispatchMode.set(static_cast(DispatchMode::ImmediateDispatch)); - MockDrmCsr csr2(executionEnvironment, 0, gemCloseWorkerMode::gemCloseWorkerInactive); + MockDrmCsr csr2(executionEnvironment, 0, 1, gemCloseWorkerMode::gemCloseWorkerInactive); EXPECT_EQ(DispatchMode::ImmediateDispatch, csr2.dispatchMode); } @@ -1601,11 +1602,11 @@ HWTEST_TEMPLATED_F(DrmCommandStreamTest, givenLocalMemoryEnabledWhenCreatingDrmC DebugManagerStateRestore restore; DebugManager.flags.EnableLocalMemory.set(0); - MockDrmCsr csr1(executionEnvironment, 0, gemCloseWorkerMode::gemCloseWorkerInactive); + MockDrmCsr csr1(executionEnvironment, 0, 1, gemCloseWorkerMode::gemCloseWorkerInactive); EXPECT_EQ(DispatchMode::ImmediateDispatch, csr1.dispatchMode); DebugManager.flags.CsrDispatchMode.set(static_cast(DispatchMode::BatchedDispatch)); - MockDrmCsr csr2(executionEnvironment, 0, gemCloseWorkerMode::gemCloseWorkerInactive); + MockDrmCsr csr2(executionEnvironment, 0, 1, gemCloseWorkerMode::gemCloseWorkerInactive); EXPECT_EQ(DispatchMode::BatchedDispatch, csr2.dispatchMode); } } diff --git a/opencl/test/unit_test/os_interface/linux/drm_memory_manager_allocate_in_device_pool_tests.cpp b/opencl/test/unit_test/os_interface/linux/drm_memory_manager_allocate_in_device_pool_tests.cpp index 483909f819..548c2d1745 100644 --- a/opencl/test/unit_test/os_interface/linux/drm_memory_manager_allocate_in_device_pool_tests.cpp +++ b/opencl/test/unit_test/os_interface/linux/drm_memory_manager_allocate_in_device_pool_tests.cpp @@ -127,7 +127,7 @@ HWTEST_TEMPLATED_F(DrmCommandStreamEnhancedTest, givenMakeAllBuffersResidentSetW CommandStreamReceiverHw::alignToCacheLine(cs); BatchBuffer batchBuffer{cs.getGraphicsAllocation(), 0, 0, nullptr, false, false, QueueThrottle::MEDIUM, QueueSliceCount::defaultSliceCount, cs.getUsed(), &cs, nullptr}; - MockDrmCsr mockCsr(*executionEnvironment, rootDeviceIndex, gemCloseWorkerMode::gemCloseWorkerInactive); + MockDrmCsr mockCsr(*executionEnvironment, rootDeviceIndex, 1, gemCloseWorkerMode::gemCloseWorkerInactive); mockCsr.flush(batchBuffer, mockCsr.getResidencyAllocations()); mm->freeGraphicsMemory(commandBuffer); diff --git a/opencl/test/unit_test/os_interface/linux/linux_create_command_queue_with_properties_tests.cpp b/opencl/test/unit_test/os_interface/linux/linux_create_command_queue_with_properties_tests.cpp index 54413e0fd3..6fc552ac0f 100644 --- a/opencl/test/unit_test/os_interface/linux/linux_create_command_queue_with_properties_tests.cpp +++ b/opencl/test/unit_test/os_interface/linux/linux_create_command_queue_with_properties_tests.cpp @@ -115,7 +115,7 @@ HWTEST_F(clCreateCommandQueueWithPropertiesLinux, givenPropertiesWithClQueueSlic cl_queue_properties properties[] = {CL_QUEUE_SLICE_COUNT_INTEL, newSliceCount, 0}; - auto mockCsr = new TestedDrmCommandStreamReceiver(*mdevice->executionEnvironment, rootDeviceIndex); + auto mockCsr = new TestedDrmCommandStreamReceiver(*mdevice->executionEnvironment, rootDeviceIndex, 1); mdevice->resetCommandStreamReceiver(mockCsr); cl_command_queue cmdQ = clCreateCommandQueueWithProperties(context.get(), clDevice, properties, &retVal); @@ -160,7 +160,7 @@ HWTEST_F(clCreateCommandQueueWithPropertiesLinux, givenSameSliceCountAsRecentlyS cl_queue_properties properties[] = {CL_QUEUE_SLICE_COUNT_INTEL, newSliceCount, 0}; - auto mockCsr = new TestedDrmCommandStreamReceiver(*mdevice->executionEnvironment, rootDeviceIndex); + auto mockCsr = new TestedDrmCommandStreamReceiver(*mdevice->executionEnvironment, rootDeviceIndex, 1); mdevice->resetCommandStreamReceiver(mockCsr); cl_command_queue cmdQ = clCreateCommandQueueWithProperties(context.get(), clDevice, properties, &retVal); @@ -204,7 +204,7 @@ HWTEST_F(clCreateCommandQueueWithPropertiesLinux, givenPropertiesWithClQueueSlic cl_queue_properties properties[] = {CL_QUEUE_SLICE_COUNT_INTEL, newSliceCount, 0}; - auto mockCsr = new TestedDrmCommandStreamReceiver(*mdevice->executionEnvironment, rootDeviceIndex); + auto mockCsr = new TestedDrmCommandStreamReceiver(*mdevice->executionEnvironment, rootDeviceIndex, 1); mdevice->resetCommandStreamReceiver(mockCsr); cl_command_queue cmdQ = clCreateCommandQueueWithProperties(context.get(), clDevice, properties, &retVal); diff --git a/opencl/test/unit_test/os_interface/windows/device_command_stream_tests.cpp b/opencl/test/unit_test/os_interface/windows/device_command_stream_tests.cpp index dd5eeb75b6..64b9404292 100644 --- a/opencl/test/unit_test/os_interface/windows/device_command_stream_tests.cpp +++ b/opencl/test/unit_test/os_interface/windows/device_command_stream_tests.cpp @@ -77,7 +77,7 @@ class WddmCommandStreamFixture { 0, device->getDeviceBitfield(), aub_stream::ENGINE_RCS, PreemptionMode::ThreadGroup, false, false, false)); osContext->setDefaultContext(true); - csr = new WddmCommandStreamReceiver(*executionEnvironment, 0); + csr = new WddmCommandStreamReceiver(*executionEnvironment, 0, device->getDeviceBitfield()); device->resetCommandStreamReceiver(csr); ASSERT_NE(nullptr, device); @@ -162,7 +162,7 @@ class WddmCommandStreamWithMockGdiFixture { wddm->resetGdi(gdi); ASSERT_NE(wddm, nullptr); DebugManager.flags.CsrDispatchMode.set(static_cast(DispatchMode::ImmediateDispatch)); - this->csr = new MockWddmCsr(*executionEnvironment, 0); + this->csr = new MockWddmCsr(*executionEnvironment, 0, 1); memoryManager = new WddmMemoryManager(*executionEnvironment); ASSERT_NE(nullptr, memoryManager); executionEnvironment->memoryManager.reset(memoryManager); @@ -188,7 +188,7 @@ TEST_F(DeviceCommandStreamTest, WhenCreatingWddmCsrThenWddmPointerIsSetCorrectly executionEnvironment->rootDeviceEnvironments[0]->osInterface = std::make_unique(); executionEnvironment->rootDeviceEnvironments[0]->osInterface->get()->setWddm(static_cast(wddm)); executionEnvironment->initializeMemoryManager(); - std::unique_ptr> csr(static_cast *>(WddmCommandStreamReceiver::create(false, *executionEnvironment, 0))); + std::unique_ptr> csr(static_cast *>(WddmCommandStreamReceiver::create(false, *executionEnvironment, 0, 1))); EXPECT_NE(nullptr, csr); auto wddmFromCsr = csr->peekWddm(); EXPECT_NE(nullptr, wddmFromCsr); @@ -200,7 +200,7 @@ TEST_F(DeviceCommandStreamTest, WhenCreatingWddmCsrWithAubDumpThenAubCsrIsCreate executionEnvironment->rootDeviceEnvironments[0]->osInterface = std::make_unique(); executionEnvironment->rootDeviceEnvironments[0]->osInterface->get()->setWddm(static_cast(wddm)); executionEnvironment->initializeMemoryManager(); - std::unique_ptr> csr(static_cast *>(WddmCommandStreamReceiver::create(true, *executionEnvironment, 0))); + std::unique_ptr> csr(static_cast *>(WddmCommandStreamReceiver::create(true, *executionEnvironment, 0, 1))); EXPECT_NE(nullptr, csr); auto wddmFromCsr = csr->peekWddm(); EXPECT_NE(nullptr, wddmFromCsr); @@ -298,7 +298,7 @@ TEST(WddmPreemptionHeaderTests, givenWddmCommandStreamReceiverWhenPreemptionIsOf hwInfo->capabilityTable.defaultPreemptionMode = PreemptionMode::Disabled; executionEnvironment->rootDeviceEnvironments[0]->setHwInfo(hwInfo); auto wddm = static_cast(executionEnvironment->rootDeviceEnvironments[0]->osInterface->get()->getWddm()); - auto csr = std::make_unique>(*executionEnvironment, 0); + auto csr = std::make_unique>(*executionEnvironment, 0, 1); executionEnvironment->memoryManager.reset(new MemoryManagerCreate(false, false, *executionEnvironment)); csr->overrideDispatchPolicy(DispatchMode::ImmediateDispatch); OsContextWin osContext(*wddm, 0u, 1, HwHelper::get(hwInfo->platform.eRenderCoreFamily).getGpgpuEngineInstances(*hwInfo)[0].first, @@ -324,7 +324,7 @@ TEST(WddmPreemptionHeaderTests, givenWddmCommandStreamReceiverWhenPreemptionIsOn hwInfo->capabilityTable.defaultPreemptionMode = PreemptionMode::MidThread; executionEnvironment->rootDeviceEnvironments[0]->setHwInfo(hwInfo); auto wddm = static_cast(executionEnvironment->rootDeviceEnvironments[0]->osInterface->get()->getWddm()); - auto csr = std::make_unique>(*executionEnvironment, 0); + auto csr = std::make_unique>(*executionEnvironment, 0, 1); executionEnvironment->memoryManager.reset(new MemoryManagerCreate(false, false, *executionEnvironment)); csr->overrideDispatchPolicy(DispatchMode::ImmediateDispatch); OsContextWin osContext(*wddm, 0u, 1, HwHelper::get(hwInfo->platform.eRenderCoreFamily).getGpgpuEngineInstances(*hwInfo)[0].first, @@ -350,7 +350,7 @@ TEST(WddmPreemptionHeaderTests, givenDeviceSupportingPreemptionWhenCommandStream ExecutionEnvironment *executionEnvironment = getExecutionEnvironmentImpl(hwInfo, 1); hwInfo->capabilityTable.defaultPreemptionMode = PreemptionMode::MidThread; executionEnvironment->rootDeviceEnvironments[0]->setHwInfo(hwInfo); - auto commandStreamReceiver = std::make_unique>(*executionEnvironment, 0); + auto commandStreamReceiver = std::make_unique>(*executionEnvironment, 0, 1); auto commandHeader = commandStreamReceiver->commandBufferHeader; auto header = reinterpret_cast(commandHeader); EXPECT_TRUE(header->NeedsMidBatchPreEmptionSupport); @@ -361,7 +361,7 @@ TEST(WddmPreemptionHeaderTests, givenDevicenotSupportingPreemptionWhenCommandStr ExecutionEnvironment *executionEnvironment = getExecutionEnvironmentImpl(hwInfo, 1); hwInfo->capabilityTable.defaultPreemptionMode = PreemptionMode::Disabled; executionEnvironment->rootDeviceEnvironments[0]->setHwInfo(hwInfo); - auto commandStreamReceiver = std::make_unique>(*executionEnvironment, 0); + auto commandStreamReceiver = std::make_unique>(*executionEnvironment, 0, 1); auto commandHeader = commandStreamReceiver->commandBufferHeader; auto header = reinterpret_cast(commandHeader); EXPECT_FALSE(header->NeedsMidBatchPreEmptionSupport); @@ -906,7 +906,7 @@ HWTEST_F(WddmSimpleTest, givenDefaultWddmCsrWhenItIsCreatedThenBatchingIsTurnedO executionEnvironment->rootDeviceEnvironments[0]->osInterface = std::make_unique(); executionEnvironment->rootDeviceEnvironments[0]->osInterface->get()->setWddm(wddm); executionEnvironment->rootDeviceEnvironments[0]->memoryOperationsInterface = std::make_unique(wddm); - std::unique_ptr> mockCsr(new MockWddmCsr(*executionEnvironment, 0)); + std::unique_ptr> mockCsr(new MockWddmCsr(*executionEnvironment, 0, 1)); EXPECT_EQ(DispatchMode::BatchedDispatch, mockCsr->dispatchMode); } @@ -915,7 +915,7 @@ HWTEST_F(WddmDefaultTest, givenFtrWddmHwQueuesFlagWhenCreatingCsrThenPickWddmVer pDevice->executionEnvironment->rootDeviceEnvironments[0]->osInterface = std::make_unique(); pDevice->executionEnvironment->rootDeviceEnvironments[0]->osInterface->get()->setWddm(wddm); pDevice->executionEnvironment->rootDeviceEnvironments[0]->memoryOperationsInterface = std::make_unique(wddm); - WddmCommandStreamReceiver wddmCsr(*pDevice->executionEnvironment, 0); + WddmCommandStreamReceiver wddmCsr(*pDevice->executionEnvironment, 0, 1); auto wddmFromCsr = wddmCsr.peekWddm(); EXPECT_EQ(typeid(*wddmFromCsr), typeid(WddmMock)); @@ -949,7 +949,7 @@ HWTEST_P(WddmCsrCompressionParameterizedTest, givenEnabledCompressionWhenInitial myMockWddm = static_cast(executionEnvironment->rootDeviceEnvironments[0]->osInterface->get()->getWddm()); EXPECT_EQ(nullptr, executionEnvironment->rootDeviceEnvironments[index]->pageTableManager.get()); - MockWddmCsr mockWddmCsr(*executionEnvironment, index); + MockWddmCsr mockWddmCsr(*executionEnvironment, index, 1); mockWddmCsr.createPageTableManager(); ASSERT_NE(nullptr, executionEnvironment->rootDeviceEnvironments[index]->pageTableManager.get()); @@ -971,7 +971,7 @@ HWTEST_F(WddmCsrCompressionTests, givenDisabledCompressionWhenInitializedThenDon std::unique_ptr device(Device::create(executionEnvironment, 1u)); setCompressionEnabled(false, false); myMockWddm = static_cast(executionEnvironment->rootDeviceEnvironments[0]->osInterface->get()->getWddm()); - MockWddmCsr mockWddmCsr(*executionEnvironment, 1); + MockWddmCsr mockWddmCsr(*executionEnvironment, 1, device->getDeviceBitfield()); EXPECT_EQ(nullptr, executionEnvironment->rootDeviceEnvironments[1]->pageTableManager.get()); } @@ -985,11 +985,12 @@ HWTEST_F(WddmCsrCompressionTests, givenDisabledCompressionWhenFlushingThenDontIn setCompressionEnabled(false, false); myMockWddm = static_cast(executionEnvironment->rootDeviceEnvironments[0]->osInterface->get()->getWddm()); - auto mockWddmCsr = new MockWddmCsr(*executionEnvironment, 1); - mockWddmCsr->overrideDispatchPolicy(DispatchMode::BatchedDispatch); executionEnvironment->memoryManager.reset(new WddmMemoryManager(*executionEnvironment)); std::unique_ptr device(Device::create(executionEnvironment, 1u)); + + auto mockWddmCsr = new MockWddmCsr(*executionEnvironment, 1, device->getDeviceBitfield()); + mockWddmCsr->overrideDispatchPolicy(DispatchMode::BatchedDispatch); device->resetCommandStreamReceiver(mockWddmCsr); auto memoryManager = executionEnvironment->memoryManager.get(); diff --git a/opencl/test/unit_test/os_interface/windows/driver_info_tests.cpp b/opencl/test/unit_test/os_interface/windows/driver_info_tests.cpp index 277e91695e..d98321fc19 100644 --- a/opencl/test/unit_test/os_interface/windows/driver_info_tests.cpp +++ b/opencl/test/unit_test/os_interface/windows/driver_info_tests.cpp @@ -34,7 +34,10 @@ extern const wchar_t *currentLibraryPath; extern CommandStreamReceiverCreateFunc commandStreamReceiverFactory[IGFX_MAX_CORE]; -CommandStreamReceiver *createMockCommandStreamReceiver(bool withAubDump, ExecutionEnvironment &executionEnvironment, uint32_t rootDeviceIndex); +CommandStreamReceiver *createMockCommandStreamReceiver(bool withAubDump, + ExecutionEnvironment &executionEnvironment, + uint32_t rootDeviceIndex, + DeviceBitfield deviceBitfield); class DriverInfoDeviceTest : public ::testing::Test { public: @@ -52,8 +55,8 @@ class DriverInfoDeviceTest : public ::testing::Test { const HardwareInfo *hwInfo; }; -CommandStreamReceiver *createMockCommandStreamReceiver(bool withAubDump, ExecutionEnvironment &executionEnvironment, uint32_t rootDeviceIndex) { - auto csr = new MockCommandStreamReceiver(executionEnvironment, rootDeviceIndex); +CommandStreamReceiver *createMockCommandStreamReceiver(bool withAubDump, ExecutionEnvironment &executionEnvironment, uint32_t rootDeviceIndex, DeviceBitfield deviceBitfield) { + auto csr = new MockCommandStreamReceiver(executionEnvironment, rootDeviceIndex, deviceBitfield); if (!executionEnvironment.rootDeviceEnvironments[rootDeviceIndex]->osInterface) { auto wddm = new WddmMock(*executionEnvironment.rootDeviceEnvironments[0]); wddm->init(); diff --git a/opencl/test/unit_test/os_interface/windows/wddm_memory_manager_tests.cpp b/opencl/test/unit_test/os_interface/windows/wddm_memory_manager_tests.cpp index 8983a85a8d..7f281f2019 100644 --- a/opencl/test/unit_test/os_interface/windows/wddm_memory_manager_tests.cpp +++ b/opencl/test/unit_test/os_interface/windows/wddm_memory_manager_tests.cpp @@ -375,7 +375,8 @@ TEST_F(WddmMemoryManagerSimpleTest, givenNonZeroFenceValuesOnMultipleEnginesRegi executionEnvironment->rootDeviceEnvironments[i]->setHwInfo(defaultHwInfo.get()); } const uint32_t rootDeviceIndex = 1; - std::unique_ptr csr(createCommandStream(*executionEnvironment, rootDeviceIndex)); + DeviceBitfield deviceBitfield(2); + std::unique_ptr csr(createCommandStream(*executionEnvironment, rootDeviceIndex, deviceBitfield)); auto wddm2 = static_cast(Wddm::createWddm(nullptr, *executionEnvironment->rootDeviceEnvironments[rootDeviceIndex].get())); wddm2->init(); @@ -383,7 +384,8 @@ TEST_F(WddmMemoryManagerSimpleTest, givenNonZeroFenceValuesOnMultipleEnginesRegi auto hwInfo = executionEnvironment->rootDeviceEnvironments[rootDeviceIndex]->getHardwareInfo(); memoryManager->createAndRegisterOsContext(csr.get(), HwHelper::get(hwInfo->platform.eRenderCoreFamily).getGpgpuEngineInstances(*hwInfo)[1].first, - 2, PreemptionHelper::getDefaultPreemptionMode(*hwInfo), false, false, false); + deviceBitfield, PreemptionHelper::getDefaultPreemptionMode(*hwInfo), + false, false, false); ASSERT_EQ(2u, memoryManager->getRegisteredEnginesCount()); auto allocation = static_cast(memoryManager->allocateGraphicsMemoryWithProperties({0u, 32, GraphicsAllocation::AllocationType::BUFFER, mockDeviceBitfield})); @@ -407,7 +409,8 @@ TEST_F(WddmMemoryManagerSimpleTest, givenNonZeroFenceValueOnSomeOfMultipleEngine for (auto i = 0u; i < executionEnvironment->rootDeviceEnvironments.size(); i++) { executionEnvironment->rootDeviceEnvironments[i]->setHwInfo(defaultHwInfo.get()); } - std::unique_ptr csr(createCommandStream(*executionEnvironment, rootDeviceIndex)); + DeviceBitfield deviceBitfield(2); + std::unique_ptr csr(createCommandStream(*executionEnvironment, rootDeviceIndex, deviceBitfield)); auto wddm2 = static_cast(Wddm::createWddm(nullptr, *executionEnvironment->rootDeviceEnvironments[rootDeviceIndex].get())); wddm2->init(); @@ -415,7 +418,8 @@ TEST_F(WddmMemoryManagerSimpleTest, givenNonZeroFenceValueOnSomeOfMultipleEngine auto hwInfo = executionEnvironment->rootDeviceEnvironments[rootDeviceIndex]->getHardwareInfo(); memoryManager->createAndRegisterOsContext(csr.get(), HwHelper::get(hwInfo->platform.eRenderCoreFamily).getGpgpuEngineInstances(*hwInfo)[1].first, - 2, PreemptionHelper::getDefaultPreemptionMode(*hwInfo), false, false, false); + deviceBitfield, PreemptionHelper::getDefaultPreemptionMode(*hwInfo), + false, false, false); ASSERT_EQ(2u, memoryManager->getRegisteredEnginesCount()); auto allocation = static_cast(memoryManager->allocateGraphicsMemoryWithProperties({0u, 32, GraphicsAllocation::AllocationType::BUFFER, mockDeviceBitfield})); @@ -1603,9 +1607,9 @@ TEST_F(WddmMemoryManagerTest, givenWddmMemoryManagerWithRegisteredOsContextWhenC wddm->init(); executionEnvironment->rootDeviceEnvironments[i]->memoryOperationsInterface = std::make_unique(wddm); } - std::unique_ptr csr(createCommandStream(*executionEnvironment, 0u)); - std::unique_ptr csr1(createCommandStream(*executionEnvironment, 1u)); - std::unique_ptr csr2(createCommandStream(*executionEnvironment, 2u)); + std::unique_ptr csr(createCommandStream(*executionEnvironment, 0u, 1)); + std::unique_ptr csr1(createCommandStream(*executionEnvironment, 1u, 2)); + std::unique_ptr csr2(createCommandStream(*executionEnvironment, 2u, 3)); memoryManager->createAndRegisterOsContext(csr.get(), aub_stream::ENGINE_RCS, 1, PreemptionHelper::getDefaultPreemptionMode(*defaultHwInfo), false, false, false); memoryManager->createAndRegisterOsContext(csr1.get(), aub_stream::ENGINE_RCS, 2, @@ -1627,9 +1631,9 @@ TEST_F(WddmMemoryManagerTest, givenWddmMemoryManagerWithRegisteredOsContextWithE wddm->init(); executionEnvironment->rootDeviceEnvironments[i]->memoryOperationsInterface = std::make_unique(wddm); } - std::unique_ptr csr(createCommandStream(*executionEnvironment, 0u)); - std::unique_ptr csr1(createCommandStream(*executionEnvironment, 1u)); - std::unique_ptr csr2(createCommandStream(*executionEnvironment, 2u)); + std::unique_ptr csr(createCommandStream(*executionEnvironment, 0u, 1)); + std::unique_ptr csr1(createCommandStream(*executionEnvironment, 1u, 2)); + std::unique_ptr csr2(createCommandStream(*executionEnvironment, 2u, 3)); memoryManager->createAndRegisterOsContext(csr.get(), aub_stream::ENGINE_RCS, 1, PreemptionHelper::getDefaultPreemptionMode(*defaultHwInfo), false, false, false); memoryManager->createAndRegisterOsContext(csr1.get(), aub_stream::ENGINE_RCS, 2, @@ -1874,7 +1878,7 @@ TEST_F(WddmMemoryManagerTest2, givenReadOnlyMemoryPassedToPopulateOsHandlesWhenC TEST(WddmMemoryManagerCleanupTest, givenUsedTagAllocationInWddmMemoryManagerWhenCleanupMemoryManagerThenDontAccessCsr) { ExecutionEnvironment &executionEnvironment = *platform()->peekExecutionEnvironment(); - auto csr = std::unique_ptr(createCommandStream(executionEnvironment, 0)); + auto csr = std::unique_ptr(createCommandStream(executionEnvironment, 0, 1)); auto wddm = new WddmMock(*executionEnvironment.rootDeviceEnvironments[0].get()); auto preemptionMode = PreemptionHelper::getDefaultPreemptionMode(*defaultHwInfo); wddm->init(); diff --git a/opencl/test/unit_test/os_interface/windows/wddm_memory_manager_tests.h b/opencl/test/unit_test/os_interface/windows/wddm_memory_manager_tests.h index 505635f7d4..cfdd0f1edf 100644 --- a/opencl/test/unit_test/os_interface/windows/wddm_memory_manager_tests.h +++ b/opencl/test/unit_test/os_interface/windows/wddm_memory_manager_tests.h @@ -65,7 +65,7 @@ class MockWddmMemoryManagerFixture { executionEnvironment->initializeMemoryManager(); memoryManager = std::make_unique(*executionEnvironment); - csr.reset(createCommandStream(*executionEnvironment, 0u)); + csr.reset(createCommandStream(*executionEnvironment, 0u, 1)); auto hwInfo = rootDeviceEnvironment->getHardwareInfo(); osContext = memoryManager->createAndRegisterOsContext(csr.get(), HwHelper::get(hwInfo->platform.eRenderCoreFamily).getGpgpuEngineInstances(*hwInfo)[0].first, @@ -117,7 +117,7 @@ class WddmMemoryManagerFixtureWithGmockWddm : public ExecutionEnvironmentFixture executionEnvironment->memoryManager.reset(memoryManager); //assert we have memory manager ASSERT_NE(nullptr, memoryManager); - csr.reset(createCommandStream(*executionEnvironment, 0u)); + csr.reset(createCommandStream(*executionEnvironment, 0u, 1)); auto hwInfo = executionEnvironment->rootDeviceEnvironments[0]->getHardwareInfo(); osContext = memoryManager->createAndRegisterOsContext(csr.get(), HwHelper::get(hwInfo->platform.eRenderCoreFamily).getGpgpuEngineInstances(*hwInfo)[0].first, diff --git a/opencl/test/unit_test/os_interface/windows/wddm_residency_controller_tests.cpp b/opencl/test/unit_test/os_interface/windows/wddm_residency_controller_tests.cpp index 36aef93b6d..cb36bc9b1d 100644 --- a/opencl/test/unit_test/os_interface/windows/wddm_residency_controller_tests.cpp +++ b/opencl/test/unit_test/os_interface/windows/wddm_residency_controller_tests.cpp @@ -76,7 +76,7 @@ struct WddmResidencyControllerTest : ::testing::Test { rootDeviceEnvironment = std::make_unique(*executionEnvironment); wddm = static_cast(Wddm::createWddm(nullptr, *rootDeviceEnvironment)); wddm->init(); - mockOsContextWin = std::make_unique(*wddm, osContextId, 0, aub_stream::ENGINE_RCS, + mockOsContextWin = std::make_unique(*wddm, osContextId, 1, aub_stream::ENGINE_RCS, PreemptionMode::Disabled, false, false, false); wddm->getWddmInterface()->createMonitoredFence(*mockOsContextWin); residencyController = &mockOsContextWin->mockResidencyController; @@ -129,7 +129,7 @@ struct WddmResidencyControllerWithMockWddmTest : public WddmResidencyControllerT memoryManager = std::make_unique(*executionEnvironment); - csr.reset(createCommandStream(*executionEnvironment, 0u)); + csr.reset(createCommandStream(*executionEnvironment, 0u, 1)); auto hwInfo = executionEnvironment->rootDeviceEnvironments[0]->getHardwareInfo(); osContext = memoryManager->createAndRegisterOsContext(csr.get(), HwHelper::get(hwInfo->platform.eRenderCoreFamily).getGpgpuEngineInstances(*hwInfo)[0].first, 1, preemptionMode, @@ -165,7 +165,7 @@ struct WddmResidencyControllerWithGdiAndMemoryManagerTest : ::testing::Test { executionEnvironment->initializeMemoryManager(); memoryManager = std::make_unique(*executionEnvironment); - csr.reset(createCommandStream(*executionEnvironment, 0u)); + csr.reset(createCommandStream(*executionEnvironment, 0u, 1)); auto hwInfo = executionEnvironment->rootDeviceEnvironments[0]->getHardwareInfo(); osContext = memoryManager->createAndRegisterOsContext(csr.get(), HwHelper::get(hwInfo->platform.eRenderCoreFamily).getGpgpuEngineInstances(*hwInfo)[0].first, diff --git a/opencl/test/unit_test/platform/platform_tests.cpp b/opencl/test/unit_test/platform/platform_tests.cpp index ed1952517e..5fb761e95b 100644 --- a/opencl/test/unit_test/platform/platform_tests.cpp +++ b/opencl/test/unit_test/platform/platform_tests.cpp @@ -257,7 +257,7 @@ namespace NEO { extern CommandStreamReceiverCreateFunc commandStreamReceiverFactory[IGFX_MAX_CORE]; } -CommandStreamReceiver *createMockCommandStreamReceiver(bool withAubDump, ExecutionEnvironment &executionEnvironment, uint32_t rootDeviceIndex) { +CommandStreamReceiver *createMockCommandStreamReceiver(bool withAubDump, ExecutionEnvironment &executionEnvironment, uint32_t rootDeviceIndex, DeviceBitfield deviceBitfield) { return nullptr; }; diff --git a/opencl/test/unit_test/program/program_tests.cpp b/opencl/test/unit_test/program/program_tests.cpp index bbaef6a0d0..f302923c1c 100644 --- a/opencl/test/unit_test/program/program_tests.cpp +++ b/opencl/test/unit_test/program/program_tests.cpp @@ -1439,7 +1439,7 @@ HWTEST_F(PatchTokenTests, givenKernelRequiringConstantAllocationWhenMakeResident ASSERT_EQ(CL_SUCCESS, retVal); ASSERT_NE(nullptr, pKernel); - auto pCommandStreamReceiver = new CommandStreamReceiverMock(*pDevice->executionEnvironment, pDevice->getRootDeviceIndex()); + auto pCommandStreamReceiver = new CommandStreamReceiverMock(*pDevice->executionEnvironment, pDevice->getRootDeviceIndex(), pDevice->getDeviceBitfield()); ASSERT_NE(nullptr, pCommandStreamReceiver); pDevice->resetCommandStreamReceiver(pCommandStreamReceiver); diff --git a/opencl/test/unit_test/sharings/gl/windows/gl_arb_sync_event_tests.cpp b/opencl/test/unit_test/sharings/gl/windows/gl_arb_sync_event_tests.cpp index 8bfa46f88d..26ca40e267 100644 --- a/opencl/test/unit_test/sharings/gl/windows/gl_arb_sync_event_tests.cpp +++ b/opencl/test/unit_test/sharings/gl/windows/gl_arb_sync_event_tests.cpp @@ -68,9 +68,9 @@ struct GlArbSyncEventTest : public ::testing::Test { void SetUp() override { executionEnvironment = platform()->peekExecutionEnvironment(); - auto mockCsr = new MockCommandStreamReceiver(*executionEnvironment, 0); executionEnvironment->memoryManager = std::make_unique(*executionEnvironment); device = std::make_unique(MockDevice::create(executionEnvironment, 0u)); + auto mockCsr = new MockCommandStreamReceiver(*executionEnvironment, 0, device->getDeviceBitfield()); device->resetCommandStreamReceiver(mockCsr); ctx.reset(new MockContext); cmdQ.reset(new MockCommandQueue(ctx.get(), device.get(), nullptr)); diff --git a/shared/source/command_stream/command_stream_receiver.cpp b/shared/source/command_stream/command_stream_receiver.cpp index 01832b16c1..ddc7785164 100644 --- a/shared/source/command_stream/command_stream_receiver.cpp +++ b/shared/source/command_stream/command_stream_receiver.cpp @@ -32,8 +32,8 @@ namespace NEO { // Global table of CommandStreamReceiver factories for HW and tests CommandStreamReceiverCreateFunc commandStreamReceiverFactory[2 * IGFX_MAX_CORE] = {}; -CommandStreamReceiver::CommandStreamReceiver(ExecutionEnvironment &executionEnvironment, uint32_t rootDeviceIndex) - : executionEnvironment(executionEnvironment), rootDeviceIndex(rootDeviceIndex) { +CommandStreamReceiver::CommandStreamReceiver(ExecutionEnvironment &executionEnvironment, uint32_t rootDeviceIndex, DeviceBitfield deviceBitfield) + : executionEnvironment(executionEnvironment), rootDeviceIndex(rootDeviceIndex), deviceBitfield(deviceBitfield) { residencyAllocations.reserve(20); latestSentStatelessMocsConfig = CacheSettings::unknownMocs; diff --git a/shared/source/command_stream/command_stream_receiver.h b/shared/source/command_stream/command_stream_receiver.h index 80781c6d0a..8dc313bb54 100644 --- a/shared/source/command_stream/command_stream_receiver.h +++ b/shared/source/command_stream/command_stream_receiver.h @@ -13,6 +13,7 @@ #include "shared/source/command_stream/thread_arbitration_policy.h" #include "shared/source/helpers/aligned_memory.h" #include "shared/source/helpers/blit_commands_helper.h" +#include "shared/source/helpers/common_types.h" #include "shared/source/helpers/completion_stamp.h" #include "shared/source/helpers/flat_batch_buffer_helper.h" #include "shared/source/helpers/options.h" @@ -64,7 +65,7 @@ class CommandStreamReceiver { }; using MutexType = std::recursive_mutex; - CommandStreamReceiver(ExecutionEnvironment &executionEnvironment, uint32_t rootDeviceIndex); + CommandStreamReceiver(ExecutionEnvironment &executionEnvironment, uint32_t rootDeviceIndex, DeviceBitfield deviceBitfield); virtual ~CommandStreamReceiver(); virtual bool flush(BatchBuffer &batchBuffer, ResidencyContainer &allocationsForResidency) = 0; @@ -234,6 +235,7 @@ class CommandStreamReceiver { std::unique_ptr> profilingTimeStampAllocator; std::unique_ptr> perfCounterAllocator; std::unique_ptr> timestampPacketAllocator; + std::unique_ptr userPauseConfirmation; ResidencyContainer residencyAllocations; ResidencyContainer evictionAllocations; @@ -242,14 +244,13 @@ class CommandStreamReceiver { LinearStream commandStream; - volatile uint32_t *tagAddress = nullptr; - volatile DebugPauseState *debugPauseStateAddress = nullptr; - // offset for debug state must be 8 bytes, if only 4 bytes are used tag writes overwrite it const uint64_t debugPauseStateAddressOffset = 8; + uint64_t totalMemoryUsed = 0u; + volatile uint32_t *tagAddress = nullptr; + volatile DebugPauseState *debugPauseStateAddress = nullptr; static void *asyncDebugBreakConfirmation(void *arg); - std::unique_ptr userPauseConfirmation; std::function debugConfirmationFunction = []() { std::cin.get(); }; GraphicsAllocation *tagAllocation = nullptr; @@ -259,20 +260,18 @@ class CommandStreamReceiver { GraphicsAllocation *perDssBackedBuffer = nullptr; IndirectHeap *indirectHeap[IndirectHeap::NUM_TYPES]; + OsContext *osContext = nullptr; // current taskLevel. Used for determining if a PIPE_CONTROL is needed. std::atomic taskLevel{0}; std::atomic latestSentTaskCount{0}; std::atomic latestFlushedTaskCount{0}; + // taskCount - # of tasks submitted + std::atomic taskCount{0}; - OsContext *osContext = nullptr; DispatchMode dispatchMode = DispatchMode::ImmediateDispatch; SamplerCacheFlushState samplerCacheFlushRequired = SamplerCacheFlushState::samplerCacheFlushNotRequired; PreemptionMode lastPreemptionMode = PreemptionMode::Initial; - uint64_t totalMemoryUsed = 0u; - - // taskCount - # of tasks submitted - std::atomic taskCount{0}; uint32_t lastSentL3Config = 0; uint32_t latestSentStatelessMocsConfig = 0; @@ -283,8 +282,10 @@ class CommandStreamReceiver { uint32_t requiredScratchSize = 0; uint32_t requiredPrivateScratchSize = 0; + uint32_t lastAdditionalKernelExecInfo = AdditionalKernelExecInfo::NotSet; const uint32_t rootDeviceIndex; + DeviceBitfield deviceBitfield; int8_t lastSentCoherencyRequest = -1; int8_t lastMediaSamplerConfig = -1; @@ -304,12 +305,11 @@ class CommandStreamReceiver { bool localMemoryEnabled = false; bool pageTableManagerInitialized = false; - uint32_t lastAdditionalKernelExecInfo = AdditionalKernelExecInfo::NotSet; bool useNewResourceImplicitFlush = false; bool newResources = false; bool useGpuIdleImplicitFlush = false; }; -typedef CommandStreamReceiver *(*CommandStreamReceiverCreateFunc)(bool withAubDump, ExecutionEnvironment &executionEnvironment, uint32_t rootDeviceIndex); +typedef CommandStreamReceiver *(*CommandStreamReceiverCreateFunc)(bool withAubDump, ExecutionEnvironment &executionEnvironment, uint32_t rootDeviceIndex, DeviceBitfield deviceBitfield); } // namespace NEO diff --git a/shared/source/command_stream/command_stream_receiver_hw.h b/shared/source/command_stream/command_stream_receiver_hw.h index 2366c61284..3e7e3c7221 100644 --- a/shared/source/command_stream/command_stream_receiver_hw.h +++ b/shared/source/command_stream/command_stream_receiver_hw.h @@ -27,11 +27,11 @@ class CommandStreamReceiverHw : public CommandStreamReceiver { typedef typename GfxFamily::PIPE_CONTROL PIPE_CONTROL; public: - static CommandStreamReceiver *create(ExecutionEnvironment &executionEnvironment, uint32_t rootDeviceIndex) { - return new CommandStreamReceiverHw(executionEnvironment, rootDeviceIndex); + static CommandStreamReceiver *create(ExecutionEnvironment &executionEnvironment, uint32_t rootDeviceIndex, DeviceBitfield deviceBitfield) { + return new CommandStreamReceiverHw(executionEnvironment, rootDeviceIndex, deviceBitfield); } - CommandStreamReceiverHw(ExecutionEnvironment &executionEnvironment, uint32_t rootDeviceIndex); + CommandStreamReceiverHw(ExecutionEnvironment &executionEnvironment, uint32_t rootDeviceIndex, DeviceBitfield deviceBitfield); ~CommandStreamReceiverHw() override; bool flush(BatchBuffer &batchBuffer, ResidencyContainer &allocationsForResidency) override; diff --git a/shared/source/command_stream/command_stream_receiver_hw_base.inl b/shared/source/command_stream/command_stream_receiver_hw_base.inl index 27c5c5d88d..c09eb8b68a 100644 --- a/shared/source/command_stream/command_stream_receiver_hw_base.inl +++ b/shared/source/command_stream/command_stream_receiver_hw_base.inl @@ -40,8 +40,10 @@ template CommandStreamReceiverHw::~CommandStreamReceiverHw() = default; template -CommandStreamReceiverHw::CommandStreamReceiverHw(ExecutionEnvironment &executionEnvironment, uint32_t rootDeviceIndex) - : CommandStreamReceiver(executionEnvironment, rootDeviceIndex) { +CommandStreamReceiverHw::CommandStreamReceiverHw(ExecutionEnvironment &executionEnvironment, + uint32_t rootDeviceIndex, + DeviceBitfield deviceBitfield) + : CommandStreamReceiver(executionEnvironment, rootDeviceIndex, deviceBitfield) { auto &hwHelper = HwHelper::get(peekHwInfo().platform.eRenderCoreFamily); localMemoryEnabled = hwHelper.getEnableLocalMemory(peekHwInfo()); diff --git a/shared/source/command_stream/device_command_stream.h b/shared/source/command_stream/device_command_stream.h index 9b4c26cc44..be94123a71 100644 --- a/shared/source/command_stream/device_command_stream.h +++ b/shared/source/command_stream/device_command_stream.h @@ -15,11 +15,11 @@ class DeviceCommandStreamReceiver : public CommandStreamReceiverHw { typedef CommandStreamReceiverHw BaseClass; protected: - DeviceCommandStreamReceiver(ExecutionEnvironment &executionEnvironment, uint32_t rootDeviceIndex) - : BaseClass(executionEnvironment, rootDeviceIndex) { + DeviceCommandStreamReceiver(ExecutionEnvironment &executionEnvironment, uint32_t rootDeviceIndex, DeviceBitfield deviceBitfield) + : BaseClass(executionEnvironment, rootDeviceIndex, deviceBitfield) { } public: - static CommandStreamReceiver *create(bool withAubDump, ExecutionEnvironment &executionEnvironment, uint32_t rootDeviceIndex); + static CommandStreamReceiver *create(bool withAubDump, ExecutionEnvironment &executionEnvironment, uint32_t rootDeviceIndex, DeviceBitfield deviceBitfield); }; } // namespace NEO diff --git a/shared/source/device/device.cpp b/shared/source/device/device.cpp index 942c19697e..8810a3efd1 100644 --- a/shared/source/device/device.cpp +++ b/shared/source/device/device.cpp @@ -23,7 +23,7 @@ namespace NEO { decltype(&PerformanceCounters::create) Device::createPerformanceCountersFunc = PerformanceCounters::create; -extern CommandStreamReceiver *createCommandStream(ExecutionEnvironment &executionEnvironment, uint32_t rootDeviceIndex); +extern CommandStreamReceiver *createCommandStream(ExecutionEnvironment &executionEnvironment, uint32_t rootDeviceIndex, DeviceBitfield deviceBitfield); Device::Device(ExecutionEnvironment *executionEnvironment) : executionEnvironment(executionEnvironment) { @@ -112,7 +112,7 @@ bool Device::createEngines() { } std::unique_ptr Device::createCommandStreamReceiver() const { - return std::unique_ptr(createCommandStream(*executionEnvironment, getRootDeviceIndex())); + return std::unique_ptr(createCommandStream(*executionEnvironment, getRootDeviceIndex(), getDeviceBitfield())); } bool Device::createEngine(uint32_t deviceCsrIndex, EngineTypeUsage engineTypeUsage) { diff --git a/shared/source/device/root_device.cpp b/shared/source/device/root_device.cpp index f73d15886e..5cbe68b08a 100644 --- a/shared/source/device/root_device.cpp +++ b/shared/source/device/root_device.cpp @@ -15,7 +15,7 @@ #include "shared/source/memory_manager/memory_manager.h" namespace NEO { -extern CommandStreamReceiver *createCommandStream(ExecutionEnvironment &executionEnvironment, uint32_t rootDeviceIndex); +extern CommandStreamReceiver *createCommandStream(ExecutionEnvironment &executionEnvironment, uint32_t rootDeviceIndex, DeviceBitfield deviceBitfield); RootDevice::RootDevice(ExecutionEnvironment *executionEnvironment, uint32_t rootDeviceIndex) : Device(executionEnvironment), rootDeviceIndex(rootDeviceIndex) {} @@ -95,7 +95,7 @@ bool RootDevice::createEngines() { } void RootDevice::initializeRootCommandStreamReceiver() { - std::unique_ptr rootCommandStreamReceiver(createCommandStream(*executionEnvironment, rootDeviceIndex)); + std::unique_ptr rootCommandStreamReceiver(createCommandStream(*executionEnvironment, rootDeviceIndex, getDeviceBitfield())); auto &hwInfo = getHardwareInfo(); auto defaultEngineType = getChosenEngineType(hwInfo); diff --git a/shared/source/helpers/engine_control.h b/shared/source/helpers/engine_control.h index 46173f37e8..4abe966ae3 100644 --- a/shared/source/helpers/engine_control.h +++ b/shared/source/helpers/engine_control.h @@ -18,6 +18,7 @@ struct EngineControl { EngineControl(CommandStreamReceiver *commandStreamReceiver, OsContext *osContext) : commandStreamReceiver(commandStreamReceiver), osContext(osContext){}; + CommandStreamReceiver *commandStreamReceiver = nullptr; OsContext *osContext = nullptr; diff --git a/shared/test/unit_test/direct_submission/direct_submission_tests.cpp b/shared/test/unit_test/direct_submission/direct_submission_tests.cpp index b96d6463fe..8726369995 100644 --- a/shared/test/unit_test/direct_submission/direct_submission_tests.cpp +++ b/shared/test/unit_test/direct_submission/direct_submission_tests.cpp @@ -830,7 +830,7 @@ HWTEST_F(DirectSubmissionTest, givenSuperBaseCsrWhenCheckingDirectSubmissionAvai int32_t executionStamp = 0; std::unique_ptr> mockCsr = - std::make_unique>(executionStamp, *pDevice->executionEnvironment, pDevice->getRootDeviceIndex()); + std::make_unique>(executionStamp, *pDevice->executionEnvironment, pDevice->getRootDeviceIndex(), pDevice->getDeviceBitfield()); bool ret = mockCsr->isDirectSubmissionEnabled(); EXPECT_FALSE(ret); @@ -845,7 +845,7 @@ HWTEST_F(DirectSubmissionTest, givenBaseCsrWhenCheckingDirectSubmissionAvailable int32_t executionStamp = 0; std::unique_ptr> mockCsr = - std::make_unique>(executionStamp, *pDevice->executionEnvironment, pDevice->getRootDeviceIndex()); + std::make_unique>(executionStamp, *pDevice->executionEnvironment, pDevice->getRootDeviceIndex(), pDevice->getDeviceBitfield()); bool ret = mockCsr->isDirectSubmissionEnabled(); EXPECT_FALSE(ret); @@ -857,7 +857,7 @@ HWTEST_F(DirectSubmissionTest, givenDirectSubmissionAvailableWhenProgrammingEndi using MI_BATCH_BUFFER_START = typename FamilyType::MI_BATCH_BUFFER_START; int32_t executionStamp = 0; std::unique_ptr> mockCsr = - std::make_unique>(executionStamp, *pDevice->executionEnvironment, pDevice->getRootDeviceIndex()); + std::make_unique>(executionStamp, *pDevice->executionEnvironment, pDevice->getRootDeviceIndex(), pDevice->getDeviceBitfield()); mockCsr->directSubmissionAvailable = true; bool ret = mockCsr->isDirectSubmissionEnabled(); EXPECT_TRUE(ret); diff --git a/shared/test/unit_test/mocks/mock_command_stream_receiver.h b/shared/test/unit_test/mocks/mock_command_stream_receiver.h index 879fb81ad9..4775594c54 100644 --- a/shared/test/unit_test/mocks/mock_command_stream_receiver.h +++ b/shared/test/unit_test/mocks/mock_command_stream_receiver.h @@ -125,7 +125,8 @@ class MockCsrHw2 : public CommandStreamReceiverHw { using CommandStreamReceiver::useGpuIdleImplicitFlush; using CommandStreamReceiver::useNewResourceImplicitFlush; - MockCsrHw2(ExecutionEnvironment &executionEnvironment, uint32_t rootDeviceIndex) : CommandStreamReceiverHw::CommandStreamReceiverHw(executionEnvironment, rootDeviceIndex) {} + MockCsrHw2(ExecutionEnvironment &executionEnvironment, uint32_t rootDeviceIndex, DeviceBitfield deviceBitfield) + : CommandStreamReceiverHw::CommandStreamReceiverHw(executionEnvironment, rootDeviceIndex, deviceBitfield) {} SubmissionAggregator *peekSubmissionAggregator() { return this->submissionAggregator.get(); diff --git a/shared/test/unit_test/mocks/mock_device.cpp b/shared/test/unit_test/mocks/mock_device.cpp index 0bcc21fa6b..6ce4fc37dc 100644 --- a/shared/test/unit_test/mocks/mock_device.cpp +++ b/shared/test/unit_test/mocks/mock_device.cpp @@ -25,7 +25,7 @@ decltype(&createCommandStream) MockDevice::createCommandStreamReceiverFunc = cre MockDevice::MockDevice() : MockDevice(new MockExecutionEnvironment(), 0u) { - CommandStreamReceiver *commandStreamReceiver = createCommandStream(*this->executionEnvironment, this->getRootDeviceIndex()); + CommandStreamReceiver *commandStreamReceiver = createCommandStream(*this->executionEnvironment, this->getRootDeviceIndex(), this->getDeviceBitfield()); commandStreamReceivers.resize(1); commandStreamReceivers[0].reset(commandStreamReceiver); this->executionEnvironment->memoryManager = std::move(this->mockMemoryManager); diff --git a/shared/test/unit_test/mocks/mock_device.h b/shared/test/unit_test/mocks/mock_device.h index a295b40fd1..60d596e2cb 100644 --- a/shared/test/unit_test/mocks/mock_device.h +++ b/shared/test/unit_test/mocks/mock_device.h @@ -23,14 +23,14 @@ class OSTime; template class UltCommandStreamReceiver; -extern CommandStreamReceiver *createCommandStream(ExecutionEnvironment &executionEnvironment, uint32_t rootDeviceIndex); +extern CommandStreamReceiver *createCommandStream(ExecutionEnvironment &executionEnvironment, uint32_t rootDeviceIndex, DeviceBitfield deviceBitfield); struct MockSubDevice : public SubDevice { using SubDevice::getGlobalMemorySize; using SubDevice::SubDevice; std::unique_ptr createCommandStreamReceiver() const override { - return std::unique_ptr(createCommandStreamReceiverFunc(*executionEnvironment, getRootDeviceIndex())); + return std::unique_ptr(createCommandStreamReceiverFunc(*executionEnvironment, getRootDeviceIndex(), getDeviceBitfield())); } static decltype(&createCommandStream) createCommandStreamReceiverFunc; }; @@ -121,7 +121,7 @@ class MockDevice : public RootDevice { } std::unique_ptr createCommandStreamReceiver() const override { - return std::unique_ptr(createCommandStreamReceiverFunc(*executionEnvironment, getRootDeviceIndex())); + return std::unique_ptr(createCommandStreamReceiverFunc(*executionEnvironment, getRootDeviceIndex(), getDeviceBitfield())); } static decltype(&createCommandStream) createCommandStreamReceiverFunc; @@ -172,8 +172,8 @@ struct EnvironmentWithCsrWrapper { } template - static CommandStreamReceiver *createCommandStreamReceiver(ExecutionEnvironment &executionEnvironment, uint32_t rootDeviceIndex) { - return new CsrType(executionEnvironment, rootDeviceIndex); + static CommandStreamReceiver *createCommandStreamReceiver(ExecutionEnvironment &executionEnvironment, uint32_t rootDeviceIndex, DeviceBitfield deviceBitfield) { + return new CsrType(executionEnvironment, rootDeviceIndex, deviceBitfield); } VariableBackup createSubDeviceCsrFuncBackup{&MockSubDevice::createCommandStreamReceiverFunc}; diff --git a/shared/test/unit_test/preemption/preemption_tests.cpp b/shared/test/unit_test/preemption/preemption_tests.cpp index 3544bfc677..7243c4f448 100644 --- a/shared/test/unit_test/preemption/preemption_tests.cpp +++ b/shared/test/unit_test/preemption/preemption_tests.cpp @@ -244,7 +244,8 @@ HWTEST_P(PreemptionTest, whenFailToCreatePreemptionAllocationThenFailToCreateDev class MockUltCsr : public UltCommandStreamReceiver { public: - MockUltCsr(ExecutionEnvironment &executionEnvironment) : UltCommandStreamReceiver(executionEnvironment, 0) { + MockUltCsr(ExecutionEnvironment &executionEnvironment, DeviceBitfield deviceBitfield) + : UltCommandStreamReceiver(executionEnvironment, 0, deviceBitfield) { } bool createPreemptionAllocation() override { @@ -260,7 +261,7 @@ HWTEST_P(PreemptionTest, whenFailToCreatePreemptionAllocationThenFailToCreateDev return true; } std::unique_ptr createCommandStreamReceiver() const override { - return std::make_unique(*executionEnvironment); + return std::make_unique(*executionEnvironment, getDeviceBitfield()); } };