diff --git a/level_zero/core/test/unit_tests/sources/kernel/test_kernel.cpp b/level_zero/core/test/unit_tests/sources/kernel/test_kernel.cpp index 9493ea2ff9..4bb44bfd85 100644 --- a/level_zero/core/test/unit_tests/sources/kernel/test_kernel.cpp +++ b/level_zero/core/test/unit_tests/sources/kernel/test_kernel.cpp @@ -994,7 +994,7 @@ TEST_F(KernelIsaTests, givenKernelAllocationInLocalMemoryWhenCreatingWithoutAllo KernelImmutableData kernelImmutableData(device); - auto bcsCsr = device->getNEODevice()->getEngine(aub_stream::EngineType::ENGINE_BCS, false, false).commandStreamReceiver; + auto bcsCsr = device->getNEODevice()->getEngine(aub_stream::EngineType::ENGINE_BCS, EngineUsage::Regular).commandStreamReceiver; auto initialTaskCount = bcsCsr->peekTaskCount(); kernelImmutableData.initialize(&kernelInfo, device, 0, nullptr, nullptr, false); @@ -1020,7 +1020,7 @@ TEST_F(KernelIsaTests, givenKernelAllocationInLocalMemoryWhenCreatingWithAllowed KernelImmutableData kernelImmutableData(device); - auto bcsCsr = device->getNEODevice()->getEngine(aub_stream::EngineType::ENGINE_BCS, false, false).commandStreamReceiver; + auto bcsCsr = device->getNEODevice()->getEngine(aub_stream::EngineType::ENGINE_BCS, EngineUsage::Regular).commandStreamReceiver; auto initialTaskCount = bcsCsr->peekTaskCount(); kernelImmutableData.initialize(&kernelInfo, device, 0, nullptr, nullptr, false); @@ -1044,7 +1044,7 @@ TEST_F(KernelIsaTests, givenKernelAllocationInLocalMemoryWhenCreatingWithDisallo KernelImmutableData kernelImmutableData(device); - auto bcsCsr = device->getNEODevice()->getEngine(aub_stream::EngineType::ENGINE_BCS, false, false).commandStreamReceiver; + auto bcsCsr = device->getNEODevice()->getEngine(aub_stream::EngineType::ENGINE_BCS, EngineUsage::Regular).commandStreamReceiver; auto initialTaskCount = bcsCsr->peekTaskCount(); kernelImmutableData.initialize(&kernelInfo, device, 0, nullptr, nullptr, false); diff --git a/opencl/source/cl_device/cl_device.cpp b/opencl/source/cl_device/cl_device.cpp index 21bb12e212..857edd11be 100644 --- a/opencl/source/cl_device/cl_device.cpp +++ b/opencl/source/cl_device/cl_device.cpp @@ -139,7 +139,7 @@ ClDevice *ClDevice::getDeviceById(uint32_t deviceId) { bool ClDevice::getDeviceAndHostTimer(uint64_t *deviceTimestamp, uint64_t *hostTimestamp) const { return device.getDeviceAndHostTimer(deviceTimestamp, hostTimestamp); } bool ClDevice::getHostTimer(uint64_t *hostTimestamp) const { return device.getHostTimer(hostTimestamp); } const HardwareInfo &ClDevice::getHardwareInfo() const { return device.getHardwareInfo(); } -EngineControl &ClDevice::getEngine(aub_stream::EngineType engineType, bool lowPriority, bool internalUsage) { return device.getEngine(engineType, lowPriority, internalUsage); } +EngineControl &ClDevice::getEngine(aub_stream::EngineType engineType, EngineUsage engineUsage) { return device.getEngine(engineType, engineUsage); } EngineControl &ClDevice::getDefaultEngine() { return device.getDefaultEngine(); } EngineControl &ClDevice::getInternalEngine() { return device.getInternalEngine(); } std::atomic &ClDevice::getSelectorCopyEngine() { return device.getSelectorCopyEngine(); } diff --git a/opencl/source/cl_device/cl_device.h b/opencl/source/cl_device/cl_device.h index be96f8fb8d..95f7430400 100644 --- a/opencl/source/cl_device/cl_device.h +++ b/opencl/source/cl_device/cl_device.h @@ -8,6 +8,7 @@ #pragma once #include "shared/source/command_stream/preemption_mode.h" #include "shared/source/helpers/common_types.h" +#include "shared/source/helpers/engine_node_helper.h" #include "shared/source/utilities/reference_tracked_object.h" #include "opencl/source/api/cl_types.h" @@ -65,7 +66,7 @@ class ClDevice : public BaseObject<_cl_device_id> { bool getDeviceAndHostTimer(uint64_t *deviceTimestamp, uint64_t *hostTimestamp) const; bool getHostTimer(uint64_t *hostTimestamp) const; const HardwareInfo &getHardwareInfo() const; - EngineControl &getEngine(aub_stream::EngineType engineType, bool lowPriority, bool internalUsage); + EngineControl &getEngine(aub_stream::EngineType engineType, EngineUsage engineUsage); EngineControl &getDefaultEngine(); EngineControl &getInternalEngine(); std::atomic &getSelectorCopyEngine(); diff --git a/opencl/source/command_queue/command_queue.cpp b/opencl/source/command_queue/command_queue.cpp index e1caca5bf9..1054915503 100644 --- a/opencl/source/command_queue/command_queue.cpp +++ b/opencl/source/command_queue/command_queue.cpp @@ -81,7 +81,7 @@ CommandQueue::CommandQueue(Context *context, ClDevice *device, const cl_queue_pr } if (bcsAllowed) { auto &selectorCopyEngine = device->getDeviceById(0)->getSelectorCopyEngine(); - bcsEngine = &device->getDeviceById(0)->getEngine(EngineHelpers::getBcsEngineType(hwInfo, selectorCopyEngine), false, false); + bcsEngine = &device->getDeviceById(0)->getEngine(EngineHelpers::getBcsEngineType(hwInfo, selectorCopyEngine), EngineUsage::Regular); } } @@ -870,11 +870,11 @@ void CommandQueue::overrideEngine(aub_stream::EngineType engineType) { const bool isEngineCopyOnly = hwHelper.isCopyOnlyEngineType(engineGroupType); if (isEngineCopyOnly) { - bcsEngine = &device->getEngine(engineType, false, false); + bcsEngine = &device->getEngine(engineType, EngineUsage::Regular); timestampPacketContainer = std::make_unique(); isCopyOnly = true; } else { - gpgpuEngine = &device->getEngine(engineType, false, false); + gpgpuEngine = &device->getEngine(engineType, EngineUsage::Regular); } } diff --git a/opencl/source/command_queue/command_queue_hw.h b/opencl/source/command_queue/command_queue_hw.h index 21b8488660..9cc010dc07 100644 --- a/opencl/source/command_queue/command_queue_hw.h +++ b/opencl/source/command_queue/command_queue_hw.h @@ -42,7 +42,7 @@ class CommandQueueHw : public CommandQueue { if (clPriority & static_cast(CL_QUEUE_PRIORITY_LOW_KHR)) { priority = QueuePriority::LOW; - this->gpgpuEngine = &device->getDeviceById(0)->getEngine(getChosenEngineType(device->getHardwareInfo()), true, false); + this->gpgpuEngine = &device->getDeviceById(0)->getEngine(getChosenEngineType(device->getHardwareInfo()), EngineUsage::LowPriority); } else if (clPriority & static_cast(CL_QUEUE_PRIORITY_MED_KHR)) { priority = QueuePriority::MEDIUM; } else if (clPriority & static_cast(CL_QUEUE_PRIORITY_HIGH_KHR)) { diff --git a/opencl/test/unit_test/api/cl_create_command_queue_with_properties_tests.cpp b/opencl/test/unit_test/api/cl_create_command_queue_with_properties_tests.cpp index 49deb8790a..e8ba5e6665 100644 --- a/opencl/test/unit_test/api/cl_create_command_queue_with_properties_tests.cpp +++ b/opencl/test/unit_test/api/cl_create_command_queue_with_properties_tests.cpp @@ -562,7 +562,7 @@ HWTEST_F(LowPriorityCommandQueueTest, GivenDeviceWithSubdevicesWhenCreatingLowPr auto commandQueueObj = castToObject(cmdQ); auto subDevice = context.getDevice(0)->getDeviceById(0); - auto engine = subDevice->getEngine(getChosenEngineType(subDevice->getHardwareInfo()), true, false); + auto engine = subDevice->getEngine(getChosenEngineType(subDevice->getHardwareInfo()), EngineUsage::LowPriority); EXPECT_EQ(engine.commandStreamReceiver, &commandQueueObj->getGpgpuCommandStreamReceiver()); EXPECT_EQ(engine.osContext, &commandQueueObj->getGpgpuCommandStreamReceiver().getOsContext()); 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 183345981a..0b43b40f24 100644 --- a/opencl/test/unit_test/command_queue/blit_enqueue_tests.cpp +++ b/opencl/test/unit_test/command_queue/blit_enqueue_tests.cpp @@ -88,7 +88,7 @@ struct BlitEnqueueTests : public ::testing::Test { capabilityTable.blitterOperationsSupported = true; if (createBcsEngine) { - auto &engine = device->getEngine(getChosenEngineType(device->getHardwareInfo()), true, false); + auto &engine = device->getEngine(getChosenEngineType(device->getHardwareInfo()), EngineUsage::LowPriority); bcsOsContext.reset(OsContext::create(nullptr, 1, device->getDeviceBitfield(), EngineTypeUsage{aub_stream::ENGINE_BCS, EngineUsage::Regular}, PreemptionMode::Disabled, false)); engine.osContext = bcsOsContext.get(); engine.commandStreamReceiver->setupContext(*bcsOsContext); diff --git a/opencl/test/unit_test/command_queue/command_queue_tests.cpp b/opencl/test/unit_test/command_queue/command_queue_tests.cpp index c0ae36609e..e291fbca91 100644 --- a/opencl/test/unit_test/command_queue/command_queue_tests.cpp +++ b/opencl/test/unit_test/command_queue/command_queue_tests.cpp @@ -256,7 +256,7 @@ HWTEST_P(CommandQueueWithBlitOperationsTests, givenDeviceWithSubDevicesSupportin std::unique_ptr bcsOsContext; auto subDevice = device->getDeviceById(0); - auto bcsEngine = subDevice->getEngine(aub_stream::EngineType::ENGINE_BCS, false, false); + auto bcsEngine = subDevice->getEngine(aub_stream::EngineType::ENGINE_BCS, EngineUsage::Regular); MockCommandQueue cmdQ(nullptr, device.get(), 0); auto cmdType = GetParam(); @@ -1552,7 +1552,7 @@ HWTEST_F(CommandQueueOnSpecificEngineTests, givenMultipleFamiliesWhenCreatingQue cl_command_queue_properties properties[5] = {}; fillProperties(properties, 0, 0); - EngineControl &engineCcs = context.getDevice(0)->getEngine(aub_stream::ENGINE_CCS, false, false); + EngineControl &engineCcs = context.getDevice(0)->getEngine(aub_stream::ENGINE_CCS, EngineUsage::Regular); MockCommandQueue queueRcs(&context, context.getDevice(0), properties); EXPECT_EQ(&engineCcs, &queueRcs.getGpgpuEngine()); EXPECT_FALSE(queueRcs.isCopyOnly); @@ -1561,7 +1561,7 @@ HWTEST_F(CommandQueueOnSpecificEngineTests, givenMultipleFamiliesWhenCreatingQue EXPECT_EQ(properties[3], queueRcs.getQueueIndexWithinFamily()); fillProperties(properties, 1, 0); - EngineControl &engineBcs = context.getDevice(0)->getEngine(aub_stream::ENGINE_BCS, false, false); + EngineControl &engineBcs = context.getDevice(0)->getEngine(aub_stream::ENGINE_BCS, EngineUsage::Regular); MockCommandQueue queueBcs(&context, context.getDevice(0), properties); EXPECT_EQ(engineBcs.commandStreamReceiver, queueBcs.getBcsCommandStreamReceiver()); EXPECT_TRUE(queueBcs.isCopyOnly); @@ -1594,7 +1594,7 @@ HWTEST_F(CommandQueueOnSpecificEngineTests, givenSubDeviceAndMultipleFamiliesWhe cl_command_queue_properties properties[5] = {}; fillProperties(properties, 0, 0); - EngineControl &engineCcs = context.getDevice(0)->getEngine(aub_stream::ENGINE_CCS, false, false); + EngineControl &engineCcs = context.getDevice(0)->getEngine(aub_stream::ENGINE_CCS, EngineUsage::Regular); MockCommandQueue queueRcs(&context, context.getDevice(0), properties); EXPECT_EQ(&engineCcs, &queueRcs.getGpgpuEngine()); EXPECT_FALSE(queueRcs.isCopyOnly); @@ -1603,7 +1603,7 @@ HWTEST_F(CommandQueueOnSpecificEngineTests, givenSubDeviceAndMultipleFamiliesWhe EXPECT_EQ(properties[3], queueRcs.getQueueIndexWithinFamily()); fillProperties(properties, 1, 0); - EngineControl &engineBcs = context.getDevice(0)->getEngine(aub_stream::ENGINE_BCS, false, false); + EngineControl &engineBcs = context.getDevice(0)->getEngine(aub_stream::ENGINE_BCS, EngineUsage::Regular); MockCommandQueue queueBcs(&context, context.getDevice(0), properties); EXPECT_EQ(engineBcs.commandStreamReceiver, queueBcs.getBcsCommandStreamReceiver()); EXPECT_TRUE(queueBcs.isCopyOnly); @@ -1619,7 +1619,7 @@ HWTEST_F(CommandQueueOnSpecificEngineTests, givenBcsFamilySelectedWhenCreatingQu cl_command_queue_properties properties[5] = {}; fillProperties(properties, 0, 0); - EngineControl &engineBcs = context.getDevice(0)->getEngine(aub_stream::ENGINE_BCS, false, false); + EngineControl &engineBcs = context.getDevice(0)->getEngine(aub_stream::ENGINE_BCS, EngineUsage::Regular); MockCommandQueue queueBcs(&context, context.getDevice(0), properties); EXPECT_EQ(engineBcs.commandStreamReceiver, queueBcs.getBcsCommandStreamReceiver()); EXPECT_TRUE(queueBcs.isCopyOnly); 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 0540cef536..7fbfd7a3bc 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 @@ -249,7 +249,7 @@ TEST_F(EnqueueKernelTest, givenKernelWhenAllArgsAreSetThenClEnqueueNDCountKernel HwHelper &hwHelper = HwHelper::get(pClDevice->getDevice().getHardwareInfo().platform.eRenderCoreFamily); if (!hwHelper.isCooperativeDispatchSupported(pCmdQ2->getGpgpuEngine().getEngineType(), pClDevice->getDevice().getHardwareInfo().platform.eProductFamily)) { - pCmdQ2->getGpgpuEngine().osContext = pCmdQ2->getDevice().getEngine(aub_stream::ENGINE_CCS, true, false).osContext; + pCmdQ2->getGpgpuEngine().osContext = pCmdQ2->getDevice().getEngine(aub_stream::ENGINE_CCS, EngineUsage::LowPriority).osContext; } auto kernel = Kernel::create(pProgram, pProgram->getKernelInfosForKernel("CopyBuffer"), &retVal); @@ -294,7 +294,7 @@ TEST_F(EnqueueKernelTest, givenKernelWhenNotAllArgsAreSetButSetKernelArgIsCalled HwHelper &hwHelper = HwHelper::get(pClDevice->getDevice().getHardwareInfo().platform.eRenderCoreFamily); if (!hwHelper.isCooperativeDispatchSupported(pCmdQ2->getGpgpuEngine().getEngineType(), pClDevice->getDevice().getHardwareInfo().platform.eProductFamily)) { - pCmdQ2->getGpgpuEngine().osContext = pCmdQ2->getDevice().getEngine(aub_stream::ENGINE_CCS, true, false).osContext; + pCmdQ2->getGpgpuEngine().osContext = pCmdQ2->getDevice().getEngine(aub_stream::ENGINE_CCS, EngineUsage::LowPriority).osContext; } auto kernel = Kernel::create(pProgram, pProgram->getKernelInfosForKernel("CopyBuffer"), &retVal); @@ -339,7 +339,7 @@ TEST_F(EnqueueKernelTest, givenKernelWhenSetKernelArgIsCalledForEachArgButAtLeas HwHelper &hwHelper = HwHelper::get(pClDevice->getDevice().getHardwareInfo().platform.eRenderCoreFamily); if (!hwHelper.isCooperativeDispatchSupported(pCmdQ2->getGpgpuEngine().getEngineType(), pClDevice->getDevice().getHardwareInfo().platform.eProductFamily)) { - pCmdQ2->getGpgpuEngine().osContext = pCmdQ2->getDevice().getEngine(aub_stream::ENGINE_CCS, true, false).osContext; + pCmdQ2->getGpgpuEngine().osContext = pCmdQ2->getDevice().getEngine(aub_stream::ENGINE_CCS, EngineUsage::LowPriority).osContext; } auto kernel = Kernel::create(pProgram, pProgram->getKernelInfosForKernel("CopyBuffer"), &retVal); 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 6fb98e164d..85b2081a3a 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 @@ -1218,9 +1218,9 @@ HWTEST_F(CommandStreamReceiverTest, whenCreatingWorkPartitionAllocationThenIniti rootDevice.getRootDeviceEnvironment().getMutableHardwareInfo()->featureTable.ftrBcsInfo = 1; UltCommandStreamReceiver &csr = rootDevice.getUltCommandStreamReceiver(); UltCommandStreamReceiver *bcsCsrs[] = { - reinterpret_cast *>(rootDevice.getDeviceById(0)->getEngine(aub_stream::ENGINE_BCS, false, false).commandStreamReceiver), - reinterpret_cast *>(rootDevice.getDeviceById(1)->getEngine(aub_stream::ENGINE_BCS, false, false).commandStreamReceiver), - reinterpret_cast *>(rootDevice.getDeviceById(2)->getEngine(aub_stream::ENGINE_BCS, false, false).commandStreamReceiver), + reinterpret_cast *>(rootDevice.getDeviceById(0)->getEngine(aub_stream::ENGINE_BCS, EngineUsage::Regular).commandStreamReceiver), + reinterpret_cast *>(rootDevice.getDeviceById(1)->getEngine(aub_stream::ENGINE_BCS, EngineUsage::Regular).commandStreamReceiver), + reinterpret_cast *>(rootDevice.getDeviceById(2)->getEngine(aub_stream::ENGINE_BCS, EngineUsage::Regular).commandStreamReceiver), }; const size_t bcsStarts[] = { bcsCsrs[0]->commandStream.getUsed(), diff --git a/opencl/test/unit_test/device/device_tests.cpp b/opencl/test/unit_test/device/device_tests.cpp index 30f707e776..f8ab965d6d 100644 --- a/opencl/test/unit_test/device/device_tests.cpp +++ b/opencl/test/unit_test/device/device_tests.cpp @@ -85,16 +85,16 @@ TEST_F(DeviceTest, givenDeviceWhenAskedForSpecificEngineThenReturnIt) { auto &engines = HwHelper::get(hwInfo.platform.eRenderCoreFamily).getGpgpuEngineInstances(hwInfo); for (uint32_t i = 0; i < engines.size(); i++) { - auto &deviceEngine = mockClDevice.getEngine(engines[i].first, false, false); + auto &deviceEngine = mockClDevice.getEngine(engines[i].first, EngineUsage::Regular); EXPECT_EQ(deviceEngine.osContext->getEngineType(), engines[i].first); EXPECT_EQ(deviceEngine.osContext->isLowPriority(), false); } - auto &deviceEngine = mockClDevice.getEngine(hwInfo.capabilityTable.defaultEngineType, true, false); + auto &deviceEngine = mockClDevice.getEngine(hwInfo.capabilityTable.defaultEngineType, EngineUsage::LowPriority); EXPECT_EQ(deviceEngine.osContext->getEngineType(), hwInfo.capabilityTable.defaultEngineType); EXPECT_EQ(deviceEngine.osContext->isLowPriority(), true); - EXPECT_THROW(mockClDevice.getEngine(aub_stream::ENGINE_VCS, false, false), std::exception); + EXPECT_THROW(mockClDevice.getEngine(aub_stream::ENGINE_VCS, EngineUsage::Regular), std::exception); } TEST_F(DeviceTest, givenDeviceWhenAskedForEngineWithValidIndexThenReturnIt) { @@ -109,8 +109,8 @@ TEST_F(DeviceTest, givenDebugVariableToAlwaysChooseEngineZeroWhenNotExistingEngi DebugManagerStateRestore restore; DebugManager.flags.OverrideInvalidEngineWithDefault.set(true); auto &engines = HwHelper::get(defaultHwInfo->platform.eRenderCoreFamily).getGpgpuEngineInstances(*defaultHwInfo); - auto &deviceEngine = pDevice->getEngine(engines[0].first, false, false); - auto ¬ExistingEngine = pDevice->getEngine(aub_stream::ENGINE_VCS, false, false); + auto &deviceEngine = pDevice->getEngine(engines[0].first, EngineUsage::Regular); + auto ¬ExistingEngine = pDevice->getEngine(aub_stream::ENGINE_VCS, EngineUsage::Regular); EXPECT_EQ(¬ExistingEngine, &deviceEngine); } diff --git a/opencl/test/unit_test/gtpin/gtpin_tests.cpp b/opencl/test/unit_test/gtpin/gtpin_tests.cpp index 40f265a696..adc1483c48 100644 --- a/opencl/test/unit_test/gtpin/gtpin_tests.cpp +++ b/opencl/test/unit_test/gtpin/gtpin_tests.cpp @@ -923,7 +923,7 @@ TEST_F(GTPinTests, givenInitializedGTPinInterfaceWhenKernelINTELIsExecutedThenGT WithCastToInternal(cmdQ, &commandQueue); HwHelper &hwHelper = HwHelper::get(pDevice->getDevice().getHardwareInfo().platform.eRenderCoreFamily); if (!hwHelper.isCooperativeDispatchSupported(commandQueue->getGpgpuEngine().getEngineType(), pDevice->getDevice().getHardwareInfo().platform.eProductFamily)) { - commandQueue->getGpgpuEngine().osContext = commandQueue->getDevice().getEngine(aub_stream::ENGINE_CCS, true, false).osContext; + commandQueue->getGpgpuEngine().osContext = commandQueue->getDevice().getEngine(aub_stream::ENGINE_CCS, EngineUsage::LowPriority).osContext; } size_t n = pKernel1->getMaxWorkGroupCount(workDim, localWorkSize, commandQueue); auto buff10 = clCreateBuffer(context, 0, n * sizeof(unsigned int), nullptr, nullptr); diff --git a/opencl/test/unit_test/helpers/timestamp_packet_tests.cpp b/opencl/test/unit_test/helpers/timestamp_packet_tests.cpp index b049cee70e..e1e822aa7b 100644 --- a/opencl/test/unit_test/helpers/timestamp_packet_tests.cpp +++ b/opencl/test/unit_test/helpers/timestamp_packet_tests.cpp @@ -1647,7 +1647,7 @@ HWTEST_F(TimestampPacketTests, givenBlockedEnqueueWithoutKernelWhenSubmittingThe auto cmdQ0 = clUniquePtr(new MockCommandQueueHw(context, device.get(), nullptr)); - auto &secondEngine = device->getEngine(getChosenEngineType(device->getHardwareInfo()), true, false); + auto &secondEngine = device->getEngine(getChosenEngineType(device->getHardwareInfo()), EngineUsage::LowPriority); static_cast *>(secondEngine.commandStreamReceiver)->timestampPacketWriteEnabled = true; auto cmdQ1 = clUniquePtr(new MockCommandQueueHw(context, device.get(), nullptr)); 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 959fa3d0fa..3975d755b5 100644 --- a/opencl/test/unit_test/mem_obj/buffer_bcs_tests.cpp +++ b/opencl/test/unit_test/mem_obj/buffer_bcs_tests.cpp @@ -103,7 +103,7 @@ struct BcsBufferTests : public ::testing::Test { capabilityTable.blitterOperationsSupported = true; if (createBcsEngine) { - auto &engine = device->getEngine(getChosenEngineType(device->getHardwareInfo()), true, false); + auto &engine = device->getEngine(getChosenEngineType(device->getHardwareInfo()), EngineUsage::LowPriority); bcsOsContext.reset(OsContext::create(nullptr, 1, device->getDeviceBitfield(), EngineTypeUsage{aub_stream::ENGINE_BCS, EngineUsage::Regular}, PreemptionMode::Disabled, false)); engine.osContext = bcsOsContext.get(); engine.commandStreamReceiver->setupContext(*bcsOsContext); 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 29b30f1e87..6f725a7be8 100644 --- a/opencl/test/unit_test/memory_manager/memory_manager_tests.cpp +++ b/opencl/test/unit_test/memory_manager/memory_manager_tests.cpp @@ -1826,7 +1826,7 @@ using GraphicsAllocationTests = ::testing::Test; HWTEST_F(GraphicsAllocationTests, givenAllocationUsedOnlyByNonDefaultCsrWhenCheckingUsageBeforeDestroyThenStoreItAsTemporaryAllocation) { auto device = std::unique_ptr(MockDevice::createWithNewExecutionEnvironment(defaultHwInfo.get())); - auto &lowPriorityEngine = device->getEngine(device->getHardwareInfo().capabilityTable.defaultEngineType, true, false); + auto &lowPriorityEngine = device->getEngine(device->getHardwareInfo().capabilityTable.defaultEngineType, EngineUsage::LowPriority); auto nonDefaultOsContext = lowPriorityEngine.osContext; auto nonDefaultCsr = static_cast *>(lowPriorityEngine.commandStreamReceiver); @@ -1876,7 +1876,7 @@ HWTEST_F(GraphicsAllocationTests, givenAllocationUsedByManyOsContextsWhenCheckin auto device = std::unique_ptr(MockDevice::create(executionEnvironment, 0u)); - auto &lowPriorityEngine = device->getEngine(device->getHardwareInfo().capabilityTable.defaultEngineType, true, false); + auto &lowPriorityEngine = device->getEngine(device->getHardwareInfo().capabilityTable.defaultEngineType, EngineUsage::LowPriority); auto nonDefaultOsContext = lowPriorityEngine.osContext; auto nonDefaultCsr = static_cast *>(lowPriorityEngine.commandStreamReceiver); diff --git a/shared/source/device/device.cpp b/shared/source/device/device.cpp index a9225e1490..32f256f8e6 100644 --- a/shared/source/device/device.cpp +++ b/shared/source/device/device.cpp @@ -270,11 +270,11 @@ size_t Device::getIndexOfNonEmptyEngineGroup(EngineGroupType engineGroupType) co return result; } -EngineControl &Device::getEngine(aub_stream::EngineType engineType, bool lowPriority, bool internalUsage) { +EngineControl &Device::getEngine(aub_stream::EngineType engineType, EngineUsage engineUsage) { for (auto &engine : engines) { if (engine.osContext->getEngineType() == engineType && - engine.osContext->isLowPriority() == lowPriority && - engine.osContext->isInternalEngine() == internalUsage) { + engine.osContext->isLowPriority() == (engineUsage == EngineUsage::LowPriority) && + engine.osContext->isInternalEngine() == (engineUsage == EngineUsage::Internal)) { return engine; } } diff --git a/shared/source/device/device.h b/shared/source/device/device.h index d50e09197f..e2dbd6edd2 100644 --- a/shared/source/device/device.h +++ b/shared/source/device/device.h @@ -47,7 +47,7 @@ class Device : public ReferenceTrackedObject { bool getHostTimer(uint64_t *hostTimestamp) const; const HardwareInfo &getHardwareInfo() const; const DeviceInfo &getDeviceInfo() const; - EngineControl &getEngine(aub_stream::EngineType engineType, bool lowPriority, bool internalUsage); + EngineControl &getEngine(aub_stream::EngineType engineType, EngineUsage engineUsage); std::vector> &getEngineGroups() { return this->engineGroups; } diff --git a/shared/source/device/device_get_engine.cpp b/shared/source/device/device_get_engine.cpp index 398260abbc..f4dea03611 100644 --- a/shared/source/device/device_get_engine.cpp +++ b/shared/source/device/device_get_engine.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2020 Intel Corporation + * Copyright (C) 2020-2021 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -18,6 +18,6 @@ EngineControl &Device::getInternalEngine() { auto engineType = getChosenEngineType(getHardwareInfo()); - return this->getDeviceById(0)->getEngine(engineType, false, true); + return this->getDeviceById(0)->getEngine(engineType, EngineUsage::Internal); } } // namespace NEO