diff --git a/opencl/extensions/public/cl_ext_private.h b/opencl/extensions/public/cl_ext_private.h index ae52c0a8ab..8d5e84c5ba 100644 --- a/opencl/extensions/public/cl_ext_private.h +++ b/opencl/extensions/public/cl_ext_private.h @@ -118,20 +118,6 @@ using cl_unified_shared_memory_capabilities_intel = cl_bitfield; #define CL_MEM_TYPE_DEVICE_INTEL 0x4198 #define CL_MEM_TYPE_SHARED_INTEL 0x4199 -/* cl_command_type */ -#define CL_COMMAND_MEMSET_INTEL 0x4204 -#define CL_COMMAND_MEMFILL_INTEL 0x4204 -#define CL_COMMAND_MEMCPY_INTEL 0x4205 -#define CL_COMMAND_MIGRATEMEM_INTEL 0x4206 -#define CL_COMMAND_MEMADVISE_INTEL 0x4207 - -/****************************** -* THREAD ARBITRATION POLICY * -*******************************/ - -/* cl_device_info */ -#define CL_DEVICE_SUPPORTED_THREAD_ARBITRATION_POLICY_INTEL 0x4208 - /* cl_kernel_exec_info */ #define CL_KERNEL_EXEC_INFO_INDIRECT_HOST_ACCESS_INTEL 0x4200 #define CL_KERNEL_EXEC_INFO_INDIRECT_DEVICE_ACCESS_INTEL 0x4201 @@ -143,6 +129,13 @@ using cl_unified_shared_memory_capabilities_intel = cl_bitfield; #define CL_KERNEL_EXEC_INFO_THREAD_ARBITRATION_POLICY_AFTER_DEPENDENCY_ROUND_ROBIN_INTEL 0x10024 #define CL_KERNEL_EXEC_INFO_THREAD_ARBITRATION_POLICY_INTEL 0x10025 +/* cl_command_type */ +#define CL_COMMAND_MEMSET_INTEL 0x4204 +#define CL_COMMAND_MEMFILL_INTEL 0x4204 +#define CL_COMMAND_MEMCPY_INTEL 0x4205 +#define CL_COMMAND_MIGRATEMEM_INTEL 0x4206 +#define CL_COMMAND_MEMADVISE_INTEL 0x4207 + /****************************** * SLICE COUNT SELECTING * *******************************/ diff --git a/opencl/source/cl_device/cl_device_caps.cpp b/opencl/source/cl_device/cl_device_caps.cpp index bbfb19c13c..52ac4c02a4 100644 --- a/opencl/source/cl_device/cl_device_caps.cpp +++ b/opencl/source/cl_device/cl_device_caps.cpp @@ -15,7 +15,6 @@ #include "shared/source/os_interface/hw_info_config.h" #include "opencl/source/cl_device/cl_device.h" -#include "opencl/source/helpers/cl_hw_helper.h" #include "opencl/source/platform/extensions.h" #include "opencl/source/sharings/sharing_factory.h" @@ -374,12 +373,7 @@ void ClDevice::initializeCaps() { deviceInfo.queueFamilyProperties.push_back(properties); } } - auto &clHwHelper = NEO::ClHwHelper::get(hwInfo.platform.eRenderCoreFamily); - const std::vector &supportedThreadArbitrationPolicies = clHwHelper.getSupportedThreadArbitrationPolicies(); - deviceInfo.supportedThreadArbitrationPolicies.resize(supportedThreadArbitrationPolicies.size()); - for (size_t policy = 0u; policy < supportedThreadArbitrationPolicies.size(); policy++) { - deviceInfo.supportedThreadArbitrationPolicies[policy] = supportedThreadArbitrationPolicies[policy]; - } + deviceInfo.preemptionSupported = false; deviceInfo.maxGlobalVariableSize = ocl21FeaturesEnabled ? 64 * KB : 0; deviceInfo.globalVariablePreferredTotalSize = ocl21FeaturesEnabled ? static_cast(sharedDeviceInfo.maxMemAllocSize) : 0; diff --git a/opencl/source/cl_device/cl_device_info.cpp b/opencl/source/cl_device/cl_device_info.cpp index b9cd7a27c1..eeaed1d2e5 100644 --- a/opencl/source/cl_device/cl_device_info.cpp +++ b/opencl/source/cl_device/cl_device_info.cpp @@ -17,7 +17,6 @@ #include "opencl/source/cl_device/cl_device_info_map.h" #include "opencl/source/cl_device/cl_device_vector.h" #include "opencl/source/helpers/cl_device_helpers.h" -#include "opencl/source/helpers/cl_hw_helper.h" #include "opencl/source/helpers/get_info_status_mapper.h" #include "opencl/source/platform/platform.h" @@ -238,10 +237,6 @@ cl_int ClDevice::getDeviceInfo(cl_device_info paramName, src = deviceInfo.extensionsWithVersion.data(); retSize = srcSize = deviceInfo.extensionsWithVersion.size() * sizeof(cl_name_version); break; - case CL_DEVICE_SUPPORTED_THREAD_ARBITRATION_POLICY_INTEL: - src = deviceInfo.supportedThreadArbitrationPolicies.data(); - retSize = srcSize = deviceInfo.supportedThreadArbitrationPolicies.size() * sizeof(cl_uint); - break; default: if (getDeviceInfoForImage(paramName, src, srcSize, retSize) && !getSharedDeviceInfo().imageSupport) { src = &value; diff --git a/opencl/source/cl_device/cl_device_info.h b/opencl/source/cl_device/cl_device_info.h index 6e1ba20545..dc523ce556 100644 --- a/opencl/source/cl_device/cl_device_info.h +++ b/opencl/source/cl_device/cl_device_info.h @@ -132,7 +132,6 @@ struct ClDeviceInfo { cl_unified_shared_memory_capabilities_intel singleDeviceSharedMemCapabilities; cl_unified_shared_memory_capabilities_intel crossDeviceSharedMemCapabilities; cl_unified_shared_memory_capabilities_intel sharedSystemMemCapabilities; - StackVec supportedThreadArbitrationPolicies; }; // clang-format on diff --git a/opencl/source/helpers/cl_hw_helper.h b/opencl/source/helpers/cl_hw_helper.h index 603fa66acd..4ddfc98cc4 100644 --- a/opencl/source/helpers/cl_hw_helper.h +++ b/opencl/source/helpers/cl_hw_helper.h @@ -13,7 +13,6 @@ #include "igfxfmid.h" #include -#include namespace NEO { @@ -32,8 +31,6 @@ class ClHwHelper { virtual bool getQueueFamilyName(std::string &name, EngineGroupType type) const = 0; virtual cl_ulong getKernelPrivateMemSize(const KernelInfo &kernelInfo) const = 0; virtual bool preferBlitterForLocalToLocalTransfers() const = 0; - virtual bool isSupportedKernelThreadArbitrationPolicy() const = 0; - virtual std::vector getSupportedThreadArbitrationPolicies() const = 0; protected: virtual bool hasStatelessAccessToBuffer(const KernelInfo &kernelInfo) const = 0; @@ -55,11 +52,10 @@ class ClHwHelperHw : public ClHwHelper { bool getQueueFamilyName(std::string &name, EngineGroupType type) const override; cl_ulong getKernelPrivateMemSize(const KernelInfo &kernelInfo) const override; bool preferBlitterForLocalToLocalTransfers() const override; - bool isSupportedKernelThreadArbitrationPolicy() const override; - std::vector getSupportedThreadArbitrationPolicies() const override; protected: bool hasStatelessAccessToBuffer(const KernelInfo &kernelInfo) const override; + ClHwHelperHw() = default; }; diff --git a/opencl/source/helpers/cl_hw_helper_base.inl b/opencl/source/helpers/cl_hw_helper_base.inl index a9a7e20dfe..9444396862 100644 --- a/opencl/source/helpers/cl_hw_helper_base.inl +++ b/opencl/source/helpers/cl_hw_helper_base.inl @@ -43,12 +43,5 @@ template inline bool ClHwHelperHw::preferBlitterForLocalToLocalTransfers() const { return false; } -template -bool ClHwHelperHw::isSupportedKernelThreadArbitrationPolicy() const { return true; } - -template -std::vector ClHwHelperHw::getSupportedThreadArbitrationPolicies() const { - return std::vector{CL_KERNEL_EXEC_INFO_THREAD_ARBITRATION_POLICY_OLDEST_FIRST_INTEL, CL_KERNEL_EXEC_INFO_THREAD_ARBITRATION_POLICY_ROUND_ROBIN_INTEL, CL_KERNEL_EXEC_INFO_THREAD_ARBITRATION_POLICY_AFTER_DEPENDENCY_ROUND_ROBIN_INTEL}; -} } // namespace NEO diff --git a/opencl/source/kernel/kernel_extra.cpp b/opencl/source/kernel/kernel_extra.cpp index 380481eac2..eaaf2adfb7 100644 --- a/opencl/source/kernel/kernel_extra.cpp +++ b/opencl/source/kernel/kernel_extra.cpp @@ -7,7 +7,6 @@ #include "shared/source/debug_settings/debug_settings_manager.h" -#include "opencl/source/helpers/cl_hw_helper.h" #include "opencl/source/kernel/kernel.h" namespace NEO { @@ -17,12 +16,7 @@ bool Kernel::requiresCacheFlushCommand(const CommandQueue &commandQueue) const { void Kernel::reconfigureKernel() { } int Kernel::setKernelThreadArbitrationPolicy(uint32_t policy) { - auto hwInfo = clDevice.getHardwareInfo(); - auto &hwHelper = NEO::ClHwHelper::get(hwInfo.platform.eRenderCoreFamily); - if (!hwHelper.isSupportedKernelThreadArbitrationPolicy()) { - this->threadArbitrationPolicy = ThreadArbitrationPolicy::NotPresent; - return CL_INVALID_DEVICE; - } else if (policy == CL_KERNEL_EXEC_INFO_THREAD_ARBITRATION_POLICY_ROUND_ROBIN_INTEL) { + if (policy == CL_KERNEL_EXEC_INFO_THREAD_ARBITRATION_POLICY_ROUND_ROBIN_INTEL) { this->threadArbitrationPolicy = ThreadArbitrationPolicy::RoundRobin; } else if (policy == CL_KERNEL_EXEC_INFO_THREAD_ARBITRATION_POLICY_OLDEST_FIRST_INTEL) { this->threadArbitrationPolicy = ThreadArbitrationPolicy::AgeBased; diff --git a/opencl/test/unit_test/api/cl_get_device_info_tests.inl b/opencl/test/unit_test/api/cl_get_device_info_tests.inl index 95c414ae99..e6b2675f23 100644 --- a/opencl/test/unit_test/api/cl_get_device_info_tests.inl +++ b/opencl/test/unit_test/api/cl_get_device_info_tests.inl @@ -8,8 +8,6 @@ #include "shared/source/device/device.h" #include "shared/source/helpers/hw_info.h" -#include "opencl/source/helpers/cl_hw_helper.h" - #include "cl_api_tests.h" #include @@ -275,49 +273,6 @@ TEST_F(clGetDeviceInfoTests, GivenClDeviceIlVersionParamWhenGettingDeviceInfoThe EXPECT_EQ(CL_SUCCESS, retVal); EXPECT_STREQ("SPIR-V_1.2 ", paramValue.get()); } -using matcherAtMostGen12lp = IsAtMostGfxCore; -HWTEST2_F(clGetDeviceInfoTests, givenClDeviceSupportedThreadArbitrationPolicyIntelWhenCallClGetDeviceInfoThenProperArrayIsReturned, matcherAtMostGen12lp) { - cl_device_info paramName = 0; - cl_uint paramValue[3]; - size_t paramSize = sizeof(paramValue); - size_t paramRetSize = 0; - - paramName = CL_DEVICE_SUPPORTED_THREAD_ARBITRATION_POLICY_INTEL; - cl_uint expectedRetValue[] = {CL_KERNEL_EXEC_INFO_THREAD_ARBITRATION_POLICY_OLDEST_FIRST_INTEL, CL_KERNEL_EXEC_INFO_THREAD_ARBITRATION_POLICY_ROUND_ROBIN_INTEL, CL_KERNEL_EXEC_INFO_THREAD_ARBITRATION_POLICY_AFTER_DEPENDENCY_ROUND_ROBIN_INTEL}; - - retVal = clGetDeviceInfo( - testedClDevice, - paramName, - paramSize, - paramValue, - ¶mRetSize); - EXPECT_EQ(CL_SUCCESS, retVal); - EXPECT_EQ(sizeof(expectedRetValue), paramRetSize); - EXPECT_TRUE(memcmp(expectedRetValue, paramValue, sizeof(expectedRetValue)) == 0); -} - -HWTEST_F(clGetDeviceInfoTests, givenClDeviceSupportedThreadArbitrationPolicyIntelWhenThreadArbitrationPolicyChangeNotSupportedAndCallClGetDeviceInfoThenParamRetSizeIsZero) { - auto &hwHelper = NEO::ClHwHelper::get(defaultHwInfo->platform.eRenderCoreFamily); - if (hwHelper.isSupportedKernelThreadArbitrationPolicy()) { - GTEST_SKIP(); - } - cl_device_info paramName = 0; - cl_uint paramValue[3]; - size_t paramSize = sizeof(paramValue); - size_t paramRetSize = 0; - - paramName = CL_DEVICE_SUPPORTED_THREAD_ARBITRATION_POLICY_INTEL; - - retVal = clGetDeviceInfo( - testedClDevice, - paramName, - paramSize, - paramValue, - ¶mRetSize); - - EXPECT_EQ(CL_SUCCESS, retVal); - EXPECT_EQ(0u, paramRetSize); -} //------------------------------------------------------------------------------ struct GetDeviceInfoP : public ApiFixture<>, diff --git a/opencl/test/unit_test/api/cl_set_kernel_exec_info_tests.inl b/opencl/test/unit_test/api/cl_set_kernel_exec_info_tests.inl index 94036157ea..0a7527979b 100644 --- a/opencl/test/unit_test/api/cl_set_kernel_exec_info_tests.inl +++ b/opencl/test/unit_test/api/cl_set_kernel_exec_info_tests.inl @@ -5,7 +5,6 @@ * */ -#include "opencl/source/helpers/cl_hw_helper.h" #include "opencl/test/unit_test/command_stream/thread_arbitration_policy_helper.h" #include "opencl/test/unit_test/mocks/mock_kernel.h" #include "test.h" @@ -67,10 +66,6 @@ TEST_F(clSetKernelExecInfoTests, GivenNullKernelWhenSettingAdditionalKernelInfoT } TEST_F(clSetKernelExecInfoTests, GivenDeviceNotSupportingSvmWhenSettingKernelExecInfoThenErrorIsReturnedOnSvmRelatedParams) { - auto &hwHelper = NEO::ClHwHelper::get(pDevice->getHardwareInfo().platform.eRenderCoreFamily); - if (!hwHelper.isSupportedKernelThreadArbitrationPolicy()) { - GTEST_SKIP(); - } auto hwInfo = executionEnvironment->rootDeviceEnvironments[ApiFixture::testedRootDeviceIndex]->getMutableHardwareInfo(); VariableBackup ftrSvm{&hwInfo->capabilityTable.ftrSvm, false}; @@ -303,10 +298,6 @@ TEST_F(clSetKernelExecInfoTests, givenNonExistingParamNameWithValuesWhenSettingA } HWTEST_F(clSetKernelExecInfoTests, givenKernelExecInfoThreadArbitrationPolicyWhenSettingAdditionalKernelInfoThenSuccessIsReturned) { - auto &hwHelper = NEO::ClHwHelper::get(pDevice->getHardwareInfo().platform.eRenderCoreFamily); - if (!hwHelper.isSupportedKernelThreadArbitrationPolicy()) { - GTEST_SKIP(); - } uint32_t newThreadArbitrationPolicy = CL_KERNEL_EXEC_INFO_THREAD_ARBITRATION_POLICY_ROUND_ROBIN_INTEL; size_t ptrSizeInBytes = sizeof(uint32_t *); @@ -321,28 +312,7 @@ HWTEST_F(clSetKernelExecInfoTests, givenKernelExecInfoThreadArbitrationPolicyWhe EXPECT_EQ(getNewKernelArbitrationPolicy(newThreadArbitrationPolicy), pMockKernel->getThreadArbitrationPolicy()); } -HWTEST_F(clSetKernelExecInfoTests, givenKernelExecInfoThreadArbitrationPolicyWhenNotSupportedAndSettingAdditionalKernelInfoThenClInvalidDeviceIsReturned) { - auto &hwHelper = NEO::ClHwHelper::get(pDevice->getHardwareInfo().platform.eRenderCoreFamily); - if (hwHelper.isSupportedKernelThreadArbitrationPolicy()) { - GTEST_SKIP(); - } - uint32_t newThreadArbitrationPolicy = CL_KERNEL_EXEC_INFO_THREAD_ARBITRATION_POLICY_ROUND_ROBIN_INTEL; - size_t ptrSizeInBytes = sizeof(uint32_t *); - - retVal = clSetKernelExecInfo( - pMockMultiDeviceKernel, // cl_kernel kernel - CL_KERNEL_EXEC_INFO_THREAD_ARBITRATION_POLICY_INTEL, // cl_kernel_exec_info param_name - ptrSizeInBytes, // size_t param_value_size - &newThreadArbitrationPolicy // const void *param_value - ); - EXPECT_EQ(CL_INVALID_DEVICE, retVal); -} - HWTEST_F(clSetKernelExecInfoTests, givenInvalidThreadArbitrationPolicyWhenSettingAdditionalKernelInfoThenClInvalidValueIsReturned) { - auto &hwHelper = NEO::ClHwHelper::get(pDevice->getHardwareInfo().platform.eRenderCoreFamily); - if (!hwHelper.isSupportedKernelThreadArbitrationPolicy()) { - GTEST_SKIP(); - } uint32_t invalidThreadArbitrationPolicy = 0; size_t ptrSizeInBytes = 1 * sizeof(uint32_t *); 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 4cc9267ba8..38bb94aac1 100644 --- a/opencl/test/unit_test/command_queue/enqueue_handler_tests.cpp +++ b/opencl/test/unit_test/command_queue/enqueue_handler_tests.cpp @@ -12,7 +12,6 @@ #include "shared/test/unit_test/utilities/base_object_utils.h" #include "opencl/source/event/user_event.h" -#include "opencl/source/helpers/cl_hw_helper.h" #include "opencl/source/platform/platform.h" #include "opencl/test/unit_test/command_stream/thread_arbitration_policy_helper.h" #include "opencl/test/unit_test/fixtures/enqueue_handler_fixture.h" @@ -499,12 +498,8 @@ HWTEST_F(EnqueueHandlerTest, givenEnqueueHandlerWhenSubCaptureIsOnThenActivateSu mockCmdQ->release(); } -HWTEST_F(EnqueueHandlerTest, givenEnqueueHandlerWhenClSetKernelExecInfoAlreadySetKernelThreadArbitrationPolicyThenRequiredThreadArbitrationPolicyIsSetProperly) { +HWTEST_F(EnqueueHandlerTest, givenEnqueueHandlerWhenClSetKernelExecInfoAlreadysetKernelThreadArbitrationPolicyThenRequiredThreadArbitrationPolicyIsSetProperly) { REQUIRE_SVM_OR_SKIP(pClDevice); - auto &hwHelper = NEO::ClHwHelper::get(pClDevice->getHardwareInfo().platform.eRenderCoreFamily); - if (!hwHelper.isSupportedKernelThreadArbitrationPolicy()) { - GTEST_SKIP(); - } DebugManagerStateRestore stateRestore; DebugManager.flags.AUBDumpSubCaptureMode.set(static_cast(AubSubCaptureManager::SubCaptureMode::Filter)); @@ -534,42 +529,6 @@ HWTEST_F(EnqueueHandlerTest, givenEnqueueHandlerWhenClSetKernelExecInfoAlreadySe mockCmdQ->release(); } -HWTEST_F(EnqueueHandlerTest, givenEnqueueHandlerWhenNotSupportedPolicyChangeThenRequiredThreadArbitrationPolicyNotChangedAndIsSetAsDefault) { - auto &hwHelper = NEO::ClHwHelper::get(pClDevice->getHardwareInfo().platform.eRenderCoreFamily); - if (hwHelper.isSupportedKernelThreadArbitrationPolicy()) { - GTEST_SKIP(); - } - DebugManagerStateRestore stateRestore; - DebugManager.flags.AUBDumpSubCaptureMode.set(static_cast(AubSubCaptureManager::SubCaptureMode::Filter)); - - MockKernelWithInternals kernelInternals(*pClDevice, context); - Kernel *kernel = kernelInternals.mockKernel; - MockMultiDispatchInfo multiDispatchInfo(pClDevice, kernel); - - uint32_t euThreadSetting = CL_KERNEL_EXEC_INFO_THREAD_ARBITRATION_POLICY_ROUND_ROBIN_INTEL; - size_t ptrSizeInBytes = 1 * sizeof(uint32_t *); - auto retVal = clSetKernelExecInfo( - kernelInternals.mockMultiDeviceKernel, // cl_kernel kernel - CL_KERNEL_EXEC_INFO_THREAD_ARBITRATION_POLICY_INTEL, // cl_kernel_exec_info param_name - ptrSizeInBytes, // size_t param_value_size - &euThreadSetting // const void *param_value - ); - EXPECT_EQ(CL_INVALID_DEVICE, retVal); - auto mockCmdQ = new MockCommandQueueHw(context, pClDevice, 0); - - mockCmdQ->template enqueueHandler(nullptr, - 0, - false, - multiDispatchInfo, - 0, - nullptr, - nullptr); - EXPECT_NE(getNewKernelArbitrationPolicy(euThreadSetting), pDevice->getUltCommandStreamReceiver().requiredThreadArbitrationPolicy); - EXPECT_EQ(0u, pDevice->getUltCommandStreamReceiver().requiredThreadArbitrationPolicy); - - mockCmdQ->release(); -} - HWTEST_F(EnqueueHandlerTest, givenKernelUsingSyncBufferWhenEnqueuingKernelThenSshIsCorrectlyProgrammed) { using BINDING_TABLE_STATE = typename FamilyType::BINDING_TABLE_STATE; using RENDER_SURFACE_STATE = typename FamilyType::RENDER_SURFACE_STATE; diff --git a/opencl/test/unit_test/kernel/kernel_tests.cpp b/opencl/test/unit_test/kernel/kernel_tests.cpp index f21fca9714..fd59690809 100644 --- a/opencl/test/unit_test/kernel/kernel_tests.cpp +++ b/opencl/test/unit_test/kernel/kernel_tests.cpp @@ -3211,11 +3211,7 @@ TEST(KernelTest, givenDefaultKernelWhenItIsCreatedThenItReportsStatelessWrites) } TEST(KernelTest, givenPolicyWhensetKernelThreadArbitrationPolicyThenExpectedClValueIsReturned) { - auto &hwHelper = NEO::ClHwHelper::get(defaultHwInfo->platform.eRenderCoreFamily); - if (!hwHelper.isSupportedKernelThreadArbitrationPolicy()) { - GTEST_SKIP(); - } - auto device = std::make_unique(MockDevice::createWithNewExecutionEnvironment(defaultHwInfo.get())); + auto device = clUniquePtr(new MockClDevice(MockDevice::createWithNewExecutionEnvironment(defaultHwInfo.get()))); MockKernelWithInternals kernel(*device); EXPECT_EQ(CL_SUCCESS, kernel.mockKernel->setKernelThreadArbitrationPolicy(CL_KERNEL_EXEC_INFO_THREAD_ARBITRATION_POLICY_ROUND_ROBIN_INTEL)); EXPECT_EQ(CL_SUCCESS, kernel.mockKernel->setKernelThreadArbitrationPolicy(CL_KERNEL_EXEC_INFO_THREAD_ARBITRATION_POLICY_OLDEST_FIRST_INTEL));