From 5be85293d6a9085ed193baeae0b93f087da305fb Mon Sep 17 00:00:00 2001 From: Filip Hazubski Date: Fri, 20 Mar 2020 12:40:02 +0100 Subject: [PATCH] Remove getSupportedClVersion function from Device Related-To: NEO-3938 Change-Id: Ida4e0d8b3a758376ea433960c8a329c061b15666 Signed-off-by: Filip Hazubski --- opencl/source/device/cl_device.cpp | 4 ++- .../unit_test/built_ins/built_in_tests.cpp | 4 +-- .../command_queue/enqueue_kernel_2_tests.cpp | 4 +-- opencl/test/unit_test/device/device_tests.cpp | 2 +- .../enqueue_execution_model_kernel_tests.cpp | 26 +++++++++---------- .../parent_kernel_dispatch_tests.cpp | 8 +++--- .../scheduler_dispatch_tests.cpp | 6 ++--- .../unit_test/gen8/bdw/device_tests_bdw.cpp | 2 +- .../gen8/scheduler_dispatch_tests_gen8.cpp | 2 +- .../unit_test/gen9/bxt/device_tests_bxt.cpp | 2 +- .../unit_test/gen9/skl/device_tests_skl.cpp | 2 +- opencl/test/unit_test/kernel/kernel_tests.cpp | 2 +- shared/source/device/device.cpp | 4 --- shared/source/device/device.h | 2 -- 14 files changed, 33 insertions(+), 37 deletions(-) diff --git a/opencl/source/device/cl_device.cpp b/opencl/source/device/cl_device.cpp index 7d172a6754..56d3c5e983 100644 --- a/opencl/source/device/cl_device.cpp +++ b/opencl/source/device/cl_device.cpp @@ -77,7 +77,9 @@ void ClDevice::allocateSyncBufferHandler() { } } -unsigned int ClDevice::getSupportedClVersion() const { return device.getSupportedClVersion(); } +unsigned int ClDevice::getSupportedClVersion() const { + return device.getHardwareInfo().capabilityTable.clVersionSupport; +} void ClDevice::retainApi() { auto parentDeviceId = deviceInfo.parentDevice; diff --git a/opencl/test/unit_test/built_ins/built_in_tests.cpp b/opencl/test/unit_test/built_ins/built_in_tests.cpp index a0fc73f9b9..14c3843ea1 100644 --- a/opencl/test/unit_test/built_ins/built_in_tests.cpp +++ b/opencl/test/unit_test/built_ins/built_in_tests.cpp @@ -912,7 +912,7 @@ TEST_F(BuiltInTests, BuiltinDispatchInfoBuilderGetBuilderForUnknownBuiltInOp) { } HWCMDTEST_F(IGFX_GEN8_CORE, BuiltInTests, getSchedulerKernel) { - if (pDevice->getSupportedClVersion() >= 20) { + if (pClDevice->getSupportedClVersion() >= 20) { SchedulerKernel &schedulerKernel = pContext->getSchedulerKernel(); std::string name = SchedulerKernel::schedulerName; EXPECT_EQ(name, schedulerKernel.getKernelInfo().name); @@ -920,7 +920,7 @@ HWCMDTEST_F(IGFX_GEN8_CORE, BuiltInTests, getSchedulerKernel) { } HWCMDTEST_F(IGFX_GEN8_CORE, BuiltInTests, getSchedulerKernelForSecondTimeDoesNotCreateNewKernel) { - if (pDevice->getSupportedClVersion() >= 20) { + if (pClDevice->getSupportedClVersion() >= 20) { SchedulerKernel &schedulerKernel = pContext->getSchedulerKernel(); Program *program = schedulerKernel.getProgram(); 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 309c743767..af02129576 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 @@ -904,7 +904,7 @@ HWCMDTEST_F(IGFX_GEN8_CORE, EnqueueKernelTest, givenCacheFlushAfterWalkerEnabled } HWCMDTEST_F(IGFX_GEN8_CORE, EnqueueAuxKernelTests, givenParentKernelWhenAuxTranslationIsRequiredThenMakeEnqueueBlocking) { - if (pDevice->getSupportedClVersion() >= 20) { + if (pClDevice->getSupportedClVersion() >= 20) { MyCmdQ cmdQ(context, pClDevice); size_t gws[3] = {1, 0, 0}; @@ -926,7 +926,7 @@ HWCMDTEST_F(IGFX_GEN8_CORE, EnqueueAuxKernelTests, givenParentKernelWhenAuxTrans } HWCMDTEST_F(IGFX_GEN8_CORE, EnqueueAuxKernelTests, givenParentKernelButNoDeviceQueueWhenEnqueueIsCalledItReturnsInvalidOperation) { - if (pDevice->getSupportedClVersion() >= 20) { + if (pClDevice->getSupportedClVersion() >= 20) { MyCmdQ cmdQ(context, pClDevice); size_t gws[3] = {1, 0, 0}; diff --git a/opencl/test/unit_test/device/device_tests.cpp b/opencl/test/unit_test/device/device_tests.cpp index 054ff63084..e05a77310c 100644 --- a/opencl/test/unit_test/device/device_tests.cpp +++ b/opencl/test/unit_test/device/device_tests.cpp @@ -39,7 +39,7 @@ TEST_F(DeviceTest, WhenDeviceIsCreatedThenCommandStreamReceiverIsNotNull) { } TEST_F(DeviceTest, WhenDeviceIsCreatedThenSupportedClVersionMatchesHardwareInfo) { - auto version = pDevice->getSupportedClVersion(); + auto version = pClDevice->getSupportedClVersion(); auto version2 = pDevice->getHardwareInfo().capabilityTable.clVersionSupport; EXPECT_EQ(version, version2); 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 7fad849622..b4a3a1d866 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 @@ -124,7 +124,7 @@ HWCMDTEST_P(IGFX_GEN8_CORE, ParentKernelEnqueueTest, givenParentKernelWhenEnqueu } HWCMDTEST_P(IGFX_GEN8_CORE, ParentKernelEnqueueTest, GivenBlockKernelWithPrivateSurfaceWhenParentKernelIsEnqueuedThenPrivateSurfaceIsMadeResident) { - if (pDevice->getSupportedClVersion() >= 20) { + if (pClDevice->getSupportedClVersion() >= 20) { size_t offset[3] = {0, 0, 0}; size_t gws[3] = {1, 1, 1}; int32_t executionStamp = 0; @@ -155,7 +155,7 @@ HWCMDTEST_P(IGFX_GEN8_CORE, ParentKernelEnqueueTest, GivenBlockKernelWithPrivate } HWCMDTEST_P(IGFX_GEN8_CORE, ParentKernelEnqueueTest, GivenBlocksWithPrivateMemoryWhenEnqueueKernelThatIsBlockedByUserEventIsCalledThenPrivateAllocationIsMadeResidentWhenEventUnblocks) { - if (pDevice->getSupportedClVersion() >= 20) { + if (pClDevice->getSupportedClVersion() >= 20) { size_t offset[3] = {0, 0, 0}; size_t gws[3] = {1, 1, 1}; @@ -192,7 +192,7 @@ HWCMDTEST_P(IGFX_GEN8_CORE, ParentKernelEnqueueTest, GivenBlocksWithPrivateMemor } HWCMDTEST_P(IGFX_GEN8_CORE, ParentKernelEnqueueTest, GivenParentKernelWithBlocksWhenEnqueueKernelIsCalledThenBlockKernelIsaAllocationIsMadeResident) { - if (pDevice->getSupportedClVersion() >= 20) { + if (pClDevice->getSupportedClVersion() >= 20) { size_t offset[3] = {0, 0, 0}; size_t gws[3] = {1, 1, 1}; @@ -210,7 +210,7 @@ HWCMDTEST_P(IGFX_GEN8_CORE, ParentKernelEnqueueTest, GivenParentKernelWithBlocks } HWCMDTEST_P(IGFX_GEN8_CORE, ParentKernelEnqueueTest, GivenBlockKernelManagerFilledWithBlocksWhenMakeInternalAllocationsResidentIsCalledThenAllSurfacesAreMadeResident) { - if (pDevice->getSupportedClVersion() >= 20) { + if (pClDevice->getSupportedClVersion() >= 20) { auto blockKernelManager = pKernel->getProgram()->getBlockKernelManager(); auto &csr = pDevice->getUltCommandStreamReceiver(); csr.storeMakeResidentAllocations = true; @@ -225,7 +225,7 @@ HWCMDTEST_P(IGFX_GEN8_CORE, ParentKernelEnqueueTest, GivenBlockKernelManagerFill } HWCMDTEST_P(IGFX_GEN8_CORE, ParentKernelEnqueueTest, GivenParentKernelWithBlocksWhenEnqueueKernelThatIsBlockedByUserEventIsCalledThenBlockKernelIsaAllocationIsMadeResidentWhenEventUnblocks) { - if (pDevice->getSupportedClVersion() >= 20) { + if (pClDevice->getSupportedClVersion() >= 20) { size_t offset[3] = {0, 0, 0}; size_t gws[3] = {1, 1, 1}; @@ -455,7 +455,7 @@ class ParentKernelEnqueueFixture : public ExecutionModelSchedulerTest, HWCMDTEST_F(IGFX_GEN8_CORE, ParentKernelEnqueueFixture, GivenParentKernelWhenEnqueuedTheDefaultDeviceQueueAndEventPoolIsPatched) { - if (pDevice->getSupportedClVersion() >= 20) { + if (pClDevice->getSupportedClVersion() >= 20) { size_t offset[3] = {0, 0, 0}; size_t gws[3] = {1, 1, 1}; @@ -481,7 +481,7 @@ HWCMDTEST_F(IGFX_GEN8_CORE, ParentKernelEnqueueFixture, GivenParentKernelWhenEnq HWCMDTEST_F(IGFX_GEN8_CORE, ParentKernelEnqueueFixture, GivenParentKernelWhenEnqueuedThenBlocksDSHOnReflectionSurfaceArePatchedWithDeviceQueueAndEventPoolAddresses) { - if (pDevice->getSupportedClVersion() >= 20) { + if (pClDevice->getSupportedClVersion() >= 20) { size_t offset[3] = {0, 0, 0}; size_t gws[3] = {1, 1, 1}; DeviceQueueHw *pDevQueueHw = castToObject>(pDevQueue); @@ -521,7 +521,7 @@ HWCMDTEST_F(IGFX_GEN8_CORE, ParentKernelEnqueueFixture, GivenParentKernelWhenEnq HWCMDTEST_F(IGFX_GEN8_CORE, ParentKernelEnqueueFixture, GivenParentKernelWhenEnqueuedToNonBlockedQueueThenDeviceQueueCriticalSetionIsAcquired) { - if (pDevice->getSupportedClVersion() >= 20) { + if (pClDevice->getSupportedClVersion() >= 20) { size_t offset[3] = {0, 0, 0}; size_t gws[3] = {1, 1, 1}; DeviceQueueHw *pDevQueueHw = castToObject>(pDevQueue); @@ -536,7 +536,7 @@ HWCMDTEST_F(IGFX_GEN8_CORE, ParentKernelEnqueueFixture, GivenParentKernelWhenEnq HWCMDTEST_F(IGFX_GEN8_CORE, ParentKernelEnqueueFixture, GivenParentKernelWhenEnqueuedToBlockedQueueThenDeviceQueueCriticalSetionIsNotAcquired) { - if (pDevice->getSupportedClVersion() >= 20) { + if (pClDevice->getSupportedClVersion() >= 20) { size_t offset[3] = {0, 0, 0}; size_t gws[3] = {1, 1, 1}; DeviceQueueHw *pDevQueueHw = castToObject>(pDevQueue); @@ -555,7 +555,7 @@ HWCMDTEST_F(IGFX_GEN8_CORE, ParentKernelEnqueueFixture, GivenParentKernelWhenEnq HWCMDTEST_F(IGFX_GEN8_CORE, ParentKernelEnqueueFixture, ParentKernelEnqueuedToNonBlockedQueueFlushesCSRWithSLM) { - if (pDevice->getSupportedClVersion() >= 20) { + if (pClDevice->getSupportedClVersion() >= 20) { size_t offset[3] = {0, 0, 0}; size_t gws[3] = {1, 1, 1}; int32_t execStamp; @@ -570,7 +570,7 @@ HWCMDTEST_F(IGFX_GEN8_CORE, ParentKernelEnqueueFixture, ParentKernelEnqueuedToNo HWCMDTEST_F(IGFX_GEN8_CORE, ParentKernelEnqueueFixture, ParentKernelEnqueuedWithSchedulerReturnInstanceRunsSimulation) { - if (pDevice->getSupportedClVersion() >= 20) { + if (pClDevice->getSupportedClVersion() >= 20) { DebugManagerStateRestore dbgRestorer; DebugManager.flags.SchedulerSimulationReturnInstance.set(1); @@ -599,7 +599,7 @@ HWCMDTEST_F(IGFX_GEN8_CORE, ParentKernelEnqueueFixture, ParentKernelEnqueuedWith } HWCMDTEST_F(IGFX_GEN8_CORE, ParentKernelEnqueueFixture, givenCsrInBatchingModeWhenExecutionModelKernelIsSubmittedThenItIsFlushed) { - if (pDevice->getSupportedClVersion() >= 20) { + if (pClDevice->getSupportedClVersion() >= 20) { auto mockCsr = new MockCsrHw2(*pDevice->executionEnvironment, pDevice->getRootDeviceIndex()); mockCsr->overrideDispatchPolicy(DispatchMode::BatchedDispatch); pDevice->resetCommandStreamReceiver(mockCsr); @@ -622,7 +622,7 @@ HWCMDTEST_F(IGFX_GEN8_CORE, ParentKernelEnqueueFixture, givenCsrInBatchingModeWh HWCMDTEST_F(IGFX_GEN8_CORE, ParentKernelEnqueueFixture, ParentKernelEnqueueMarksCSRMediaVFEStateDirty) { - if (pDevice->getSupportedClVersion() >= 20) { + if (pClDevice->getSupportedClVersion() >= 20) { size_t offset[3] = {0, 0, 0}; size_t gws[3] = {1, 1, 1}; int32_t execStamp; diff --git a/opencl/test/unit_test/execution_model/parent_kernel_dispatch_tests.cpp b/opencl/test/unit_test/execution_model/parent_kernel_dispatch_tests.cpp index c9a228ba58..abf8d1a22a 100644 --- a/opencl/test/unit_test/execution_model/parent_kernel_dispatch_tests.cpp +++ b/opencl/test/unit_test/execution_model/parent_kernel_dispatch_tests.cpp @@ -261,7 +261,7 @@ class MockParentKernelDispatch : public ExecutionModelSchedulerTest, HWCMDTEST_F(IGFX_GEN8_CORE, MockParentKernelDispatch, GivenBlockedQueueWhenParentKernelIsDispatchedThenDshHeapForIndirectObjectHeapIsUsed) { - if (pDevice->getSupportedClVersion() >= 20) { + if (pClDevice->getSupportedClVersion() >= 20) { MockParentKernel *mockParentKernel = MockParentKernel::create(*context); auto blockedCommandsData = createBlockedCommandsData(*pCmdQ); @@ -293,7 +293,7 @@ HWCMDTEST_F(IGFX_GEN8_CORE, MockParentKernelDispatch, GivenParentKernelWhenDispa typedef typename FamilyType::MEDIA_INTERFACE_DESCRIPTOR_LOAD MEDIA_INTERFACE_DESCRIPTOR_LOAD; typedef typename FamilyType::INTERFACE_DESCRIPTOR_DATA INTERFACE_DESCRIPTOR_DATA; - if (pDevice->getSupportedClVersion() >= 20) { + if (pClDevice->getSupportedClVersion() >= 20) { MockParentKernel *mockParentKernel = MockParentKernel::create(*context); KernelOperation *blockedCommandsData = nullptr; @@ -338,7 +338,7 @@ HWCMDTEST_F(IGFX_GEN8_CORE, MockParentKernelDispatch, GivenParentKernelWhenDispa HWCMDTEST_F(IGFX_GEN8_CORE, MockParentKernelDispatch, GivenUsedSSHHeapWhenParentKernelIsDispatchedThenNewSSHIsAllocated) { - if (pDevice->getSupportedClVersion() >= 20) { + if (pClDevice->getSupportedClVersion() >= 20) { MockParentKernel *mockParentKernel = MockParentKernel::create(*context); KernelOperation *blockedCommandsData = nullptr; @@ -379,7 +379,7 @@ HWCMDTEST_F(IGFX_GEN8_CORE, MockParentKernelDispatch, GivenUsedSSHHeapWhenParent HWCMDTEST_F(IGFX_GEN8_CORE, MockParentKernelDispatch, GivenNotUsedSSHHeapWhenParentKernelIsDispatchedThenExistingSSHIsUsed) { - if (pDevice->getSupportedClVersion() >= 20) { + if (pClDevice->getSupportedClVersion() >= 20) { MockParentKernel *mockParentKernel = MockParentKernel::create(*context); KernelOperation *blockedCommandsData = nullptr; diff --git a/opencl/test/unit_test/execution_model/scheduler_dispatch_tests.cpp b/opencl/test/unit_test/execution_model/scheduler_dispatch_tests.cpp index 1a14a3f0f7..aba83dd3d8 100644 --- a/opencl/test/unit_test/execution_model/scheduler_dispatch_tests.cpp +++ b/opencl/test/unit_test/execution_model/scheduler_dispatch_tests.cpp @@ -43,7 +43,7 @@ HWCMDTEST_F(IGFX_GEN8_CORE, ExecutionModelSchedulerFixture, dispatchScheduler) { using PIPE_CONTROL = typename FamilyType::PIPE_CONTROL; using MI_BATCH_BUFFER_START = typename FamilyType::MI_BATCH_BUFFER_START; - if (pDevice->getSupportedClVersion() >= 20) { + if (pClDevice->getSupportedClVersion() >= 20) { DeviceQueueHw *pDevQueueHw = castToObject>(pDevQueue); SchedulerKernel &scheduler = context->getSchedulerKernel(); @@ -172,7 +172,7 @@ HWCMDTEST_F(IGFX_GEN8_CORE, ExecutionModelSchedulerFixture, dispatchSchedulerDoe using MEDIA_VFE_STATE = typename FamilyType::MEDIA_VFE_STATE; using PIPE_CONTROL = typename FamilyType::PIPE_CONTROL; - if (pDevice->getSupportedClVersion() >= 20) { + if (pClDevice->getSupportedClVersion() >= 20) { DeviceQueueHw *pDevQueueHw = castToObject>(pDevQueue); SchedulerKernel &scheduler = context->getSchedulerKernel(); @@ -241,7 +241,7 @@ HWCMDTEST_F(IGFX_GEN8_CORE, ParentKernelCommandQueueFixture, dispatchSchedulerWi HWCMDTEST_F(IGFX_GEN8_CORE, ExecutionModelSchedulerFixture, ForceDispatchSchedulerEnqueuesSchedulerKernel) { - if (pDevice->getSupportedClVersion() >= 20) { + if (pClDevice->getSupportedClVersion() >= 20) { DebugManagerStateRestore dbgRestorer; DebugManager.flags.ForceDispatchScheduler.set(true); diff --git a/opencl/test/unit_test/gen8/bdw/device_tests_bdw.cpp b/opencl/test/unit_test/gen8/bdw/device_tests_bdw.cpp index 83260be914..ef9db08912 100644 --- a/opencl/test/unit_test/gen8/bdw/device_tests_bdw.cpp +++ b/opencl/test/unit_test/gen8/bdw/device_tests_bdw.cpp @@ -23,6 +23,6 @@ struct BdwDeviceTest : public DeviceFixture, }; BDWTEST_F(BdwDeviceTest, givenBdwDeviceWhenAskedForClVersionThenReport21) { - auto version = pDevice->getSupportedClVersion(); + auto version = pClDevice->getSupportedClVersion(); EXPECT_EQ(21u, version); } diff --git a/opencl/test/unit_test/gen8/scheduler_dispatch_tests_gen8.cpp b/opencl/test/unit_test/gen8/scheduler_dispatch_tests_gen8.cpp index b8d0767214..09a83bd293 100644 --- a/opencl/test/unit_test/gen8/scheduler_dispatch_tests_gen8.cpp +++ b/opencl/test/unit_test/gen8/scheduler_dispatch_tests_gen8.cpp @@ -27,7 +27,7 @@ BDWTEST_F(BdwSchedulerTest, givenCallToDispatchSchedulerWhenPipeControlWithCSSta using PIPE_CONTROL = typename FamilyType::PIPE_CONTROL; - if (pDevice->getSupportedClVersion() >= 20) { + if (pClDevice->getSupportedClVersion() >= 20) { DeviceQueueHw *pDevQueueHw = castToObject>(pDevQueue); SchedulerKernel &scheduler = context->getSchedulerKernel(); diff --git a/opencl/test/unit_test/gen9/bxt/device_tests_bxt.cpp b/opencl/test/unit_test/gen9/bxt/device_tests_bxt.cpp index f0b86a3aed..95ee3ea2eb 100644 --- a/opencl/test/unit_test/gen9/bxt/device_tests_bxt.cpp +++ b/opencl/test/unit_test/gen9/bxt/device_tests_bxt.cpp @@ -13,7 +13,7 @@ using namespace NEO; typedef Test DeviceTest; BXTTEST_F(DeviceTest, getSupportedClVersion12Device) { - auto version = pDevice->getSupportedClVersion(); + auto version = pClDevice->getSupportedClVersion(); EXPECT_EQ(12u, version); } diff --git a/opencl/test/unit_test/gen9/skl/device_tests_skl.cpp b/opencl/test/unit_test/gen9/skl/device_tests_skl.cpp index bfe5931730..0bb06ed58a 100644 --- a/opencl/test/unit_test/gen9/skl/device_tests_skl.cpp +++ b/opencl/test/unit_test/gen9/skl/device_tests_skl.cpp @@ -13,7 +13,7 @@ using namespace NEO; typedef Test DeviceTest; SKLTEST_F(DeviceTest, getSupportedClVersion21Device) { - auto version = pDevice->getSupportedClVersion(); + auto version = pClDevice->getSupportedClVersion(); EXPECT_EQ(21u, version); } diff --git a/opencl/test/unit_test/kernel/kernel_tests.cpp b/opencl/test/unit_test/kernel/kernel_tests.cpp index 03094e3942..67fc0acc6d 100644 --- a/opencl/test/unit_test/kernel/kernel_tests.cpp +++ b/opencl/test/unit_test/kernel/kernel_tests.cpp @@ -1362,7 +1362,7 @@ HWCMDTEST_F(IGFX_GEN8_CORE, KernelEventPoolSurfaceTest, givenStatelessKernelWhen pKernelInfo->requiresSshForBuffers = false; ASSERT_EQ(CL_SUCCESS, pKernel->initialize()); - if (pDevice->getSupportedClVersion() < 20) { + if (pClDevice->getSupportedClVersion() < 20) { EXPECT_EQ(0u, pKernel->getSurfaceStateHeapSize()); } else { } diff --git a/shared/source/device/device.cpp b/shared/source/device/device.cpp index 97f077124e..797611da7b 100644 --- a/shared/source/device/device.cpp +++ b/shared/source/device/device.cpp @@ -167,10 +167,6 @@ double Device::getProfilingTimerResolution() { return osTime->getDynamicDeviceTimerResolution(getHardwareInfo()); } -unsigned int Device::getSupportedClVersion() const { - return getHardwareInfo().capabilityTable.clVersionSupport; -} - bool Device::isSimulation() const { auto &hwInfo = getHardwareInfo(); diff --git a/shared/source/device/device.h b/shared/source/device/device.h index 36ff2fbb00..a9799ab6b0 100644 --- a/shared/source/device/device.h +++ b/shared/source/device/device.h @@ -24,8 +24,6 @@ class Device : public ReferenceTrackedObject { Device(const Device &) = delete; ~Device() override; - unsigned int getSupportedClVersion() const; - template static DeviceT *create(ArgsT &&... args) { DeviceT *device = new DeviceT(std::forward(args)...);