diff --git a/opencl/source/cl_device/cl_device.cpp b/opencl/source/cl_device/cl_device.cpp index ae4205a271..d06ad7d24d 100644 --- a/opencl/source/cl_device/cl_device.cpp +++ b/opencl/source/cl_device/cl_device.cpp @@ -287,5 +287,11 @@ const ProductHelper &ClDevice::getProductHelper() const { const GTPinGfxCoreHelper &ClDevice::getGTPinGfxCoreHelper() const { return *gtpinGfxCoreHelper; } +cl_version ClDevice::getExtensionVersion(std::string name) { + if (name.compare("cl_khr_integer_dot_product") == 0) + return CL_MAKE_VERSION(2u, 0, 0); + else + return CL_MAKE_VERSION(1u, 0, 0); +} } // namespace NEO diff --git a/opencl/source/cl_device/cl_device.h b/opencl/source/cl_device/cl_device.h index 4f60ca6334..24252a78f4 100644 --- a/opencl/source/cl_device/cl_device.h +++ b/opencl/source/cl_device/cl_device.h @@ -136,6 +136,7 @@ class ClDevice : public BaseObject<_cl_device_id> { const GTPinGfxCoreHelper &getGTPinGfxCoreHelper() const; std::unique_ptr gtpinGfxCoreHelper; + cl_version getExtensionVersion(std::string name); protected: void initializeCaps(); diff --git a/opencl/source/cl_device/cl_device_caps.cpp b/opencl/source/cl_device/cl_device_caps.cpp index c7c5f2a6d6..237bafc2ce 100644 --- a/opencl/source/cl_device/cl_device_caps.cpp +++ b/opencl/source/cl_device/cl_device_caps.cpp @@ -405,8 +405,26 @@ void ClDevice::initializeCaps() { deviceInfo.crossDeviceSharedMemCapabilities = productHelper.getCrossDeviceSharedMemCapabilities(); deviceInfo.sharedSystemMemCapabilities = productHelper.getSharedSystemMemCapabilities(&hwInfo); + if (compilerProductHelper.isDotIntegerProductExtensionSupported()) { + deviceInfo.integerDotCapabilities = CL_DEVICE_INTEGER_DOT_PRODUCT_INPUT_4x8BIT_KHR | CL_DEVICE_INTEGER_DOT_PRODUCT_INPUT_4x8BIT_PACKED_KHR; + deviceInfo.integerDotAccelerationProperties8Bit = { + CL_TRUE, // signed_accelerated; + CL_TRUE, // unsigned_accelerated; + CL_TRUE, // mixed_signedness_accelerated; + CL_TRUE, // accumulating_saturating_signed_accelerated; + CL_TRUE, // accumulating_saturating_unsigned_accelerated; + CL_TRUE}; // accumulating_saturating_mixed_signedness_accelerated; + deviceInfo.integerDotAccelerationProperties4x8BitPacked = { + CL_TRUE, // signed_accelerated; + CL_TRUE, // unsigned_accelerated; + CL_TRUE, // mixed_signedness_accelerated; + CL_TRUE, // accumulating_saturating_signed_accelerated; + CL_TRUE, // accumulating_saturating_unsigned_accelerated; + CL_TRUE}; // accumulating_saturating_mixed_signedness_accelerated; + } + initializeOsSpecificCaps(); - getOpenclCFeaturesList(hwInfo, deviceInfo.openclCFeatures); + getOpenclCFeaturesList(hwInfo, deviceInfo.openclCFeatures, getDevice().getCompilerProductHelper()); } void ClDevice::initializeExtensionsWithVersion() { @@ -416,7 +434,7 @@ void ClDevice::initializeExtensionsWithVersion() { deviceInfo.extensionsWithVersion.reserve(deviceExtensionsVector.size()); for (auto deviceExtension : deviceExtensionsVector) { cl_name_version deviceExtensionWithVersion; - deviceExtensionWithVersion.version = CL_MAKE_VERSION(1, 0, 0); + deviceExtensionWithVersion.version = getExtensionVersion(deviceExtension); strcpy_s(deviceExtensionWithVersion.name, CL_NAME_VERSION_MAX_NAME_SIZE, deviceExtension.c_str()); deviceInfo.extensionsWithVersion.push_back(deviceExtensionWithVersion); } diff --git a/opencl/source/cl_device/cl_device_info.cpp b/opencl/source/cl_device/cl_device_info.cpp index 1f8e3fa94b..3e53326489 100644 --- a/opencl/source/cl_device/cl_device_info.cpp +++ b/opencl/source/cl_device/cl_device_info.cpp @@ -180,6 +180,9 @@ cl_int ClDevice::getDeviceInfo(cl_device_info paramName, case CL_DEVICE_VENDOR_ID: getCap(src, srcSize, retSize); break; case CL_DEVICE_VERSION: getStr(src, srcSize, retSize); break; case CL_DEVICE_WORK_GROUP_COLLECTIVE_FUNCTIONS_SUPPORT: getCap(src, srcSize, retSize); break; + case CL_DEVICE_INTEGER_DOT_PRODUCT_CAPABILITIES_KHR: getCap(src, srcSize, retSize); break; + case CL_DEVICE_INTEGER_DOT_PRODUCT_ACCELERATION_PROPERTIES_4x8BIT_PACKED_KHR: getCap(src, srcSize, retSize); break; + case CL_DEVICE_INTEGER_DOT_PRODUCT_ACCELERATION_PROPERTIES_8BIT_KHR: getCap(src, srcSize, retSize); break; case CL_DRIVER_VERSION: getStr(src, srcSize, retSize); break; // clang-format on case CL_DEVICE_DEVICE_ENQUEUE_CAPABILITIES: if (paramValueSize == sizeof(cl_bool)) { diff --git a/opencl/source/cl_device/cl_device_info.h b/opencl/source/cl_device/cl_device_info.h index 0ada443123..124a6f1fc2 100644 --- a/opencl/source/cl_device/cl_device_info.h +++ b/opencl/source/cl_device/cl_device_info.h @@ -142,6 +142,9 @@ struct ClDeviceInfo { cl_unified_shared_memory_capabilities_intel crossDeviceSharedMemCapabilities; cl_unified_shared_memory_capabilities_intel sharedSystemMemCapabilities; StackVec supportedThreadArbitrationPolicies; + cl_device_integer_dot_product_capabilities_khr integerDotCapabilities; + cl_device_integer_dot_product_acceleration_properties_khr integerDotAccelerationProperties8Bit; + cl_device_integer_dot_product_acceleration_properties_khr integerDotAccelerationProperties4x8BitPacked; }; // clang-format on diff --git a/opencl/source/cl_device/cl_device_info_map.h b/opencl/source/cl_device/cl_device_info_map.h index 36c6b3301f..c36624da06 100644 --- a/opencl/source/cl_device/cl_device_info_map.h +++ b/opencl/source/cl_device/cl_device_info_map.h @@ -77,7 +77,6 @@ template<> struct Map : public MapBa template<> struct Map : public MapBase {}; template<> struct Map : public MapBase {}; template<> struct Map : public MapBase {}; - template<> struct Map : public ClMapBase {}; template<> struct Map : public ClMapBase {}; template<> struct Map : public ClMapBase {}; @@ -175,6 +174,10 @@ template<> struct Map : template<> struct Map : public ClMapBase {}; template<> struct Map : public ClMapBase {}; template<> struct Map : public ClMapBase {}; +template<> struct Map : public ClMapBase {}; +template<> struct Map : public ClMapBase {}; +template<> struct Map : public ClMapBase {}; + // clang-format on } // namespace ClDeviceInfoTable 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 0fb6038c73..bc7e06bef3 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 @@ -5,6 +5,7 @@ * */ +#include "shared/source/helpers/compiler_product_helper.h" #include "shared/source/helpers/hw_info.h" #include "opencl/source/helpers/cl_gfx_core_helper.h" @@ -454,4 +455,55 @@ INSTANTIATE_TEST_CASE_P( GetDeviceInfoVectorWidth, testing::ValuesIn(devicePreferredVector)); +TEST_F(clGetDeviceInfoTests, givenClDeviceWhenGetInfoForIntegerDotCapsThenCorrectValuesAreSet) { + size_t paramRetSize = 0; + cl_device_integer_dot_product_capabilities_khr integerDotCapabilities{}; + + clGetDeviceInfo( + testedClDevice, + CL_DEVICE_INTEGER_DOT_PRODUCT_CAPABILITIES_KHR, + sizeof(integerDotCapabilities), + &integerDotCapabilities, + ¶mRetSize); + auto &compilerHelper = pDevice->getDevice().getCompilerProductHelper(); + EXPECT_EQ(((integerDotCapabilities & CL_DEVICE_INTEGER_DOT_PRODUCT_INPUT_4x8BIT_KHR) && (integerDotCapabilities & CL_DEVICE_INTEGER_DOT_PRODUCT_INPUT_4x8BIT_PACKED_KHR)), compilerHelper.isDotIntegerProductExtensionSupported()); +} + +TEST_F(clGetDeviceInfoTests, givenClDeviceWhenGetInfoForIntegerDot8BitPropertiesThenCorrectValuesAreSet) { + size_t paramRetSize = 0; + cl_device_integer_dot_product_acceleration_properties_khr integerDotAccelerationProperties8Bit{}; + + clGetDeviceInfo( + testedClDevice, + CL_DEVICE_INTEGER_DOT_PRODUCT_ACCELERATION_PROPERTIES_8BIT_KHR, + sizeof(integerDotAccelerationProperties8Bit), + &integerDotAccelerationProperties8Bit, + ¶mRetSize); + auto &compilerHelper = pDevice->getDevice().getCompilerProductHelper(); + EXPECT_EQ(integerDotAccelerationProperties8Bit.accumulating_saturating_mixed_signedness_accelerated, compilerHelper.isDotIntegerProductExtensionSupported()); + EXPECT_EQ(integerDotAccelerationProperties8Bit.accumulating_saturating_signed_accelerated, compilerHelper.isDotIntegerProductExtensionSupported()); + EXPECT_EQ(integerDotAccelerationProperties8Bit.accumulating_saturating_unsigned_accelerated, compilerHelper.isDotIntegerProductExtensionSupported()); + EXPECT_EQ(integerDotAccelerationProperties8Bit.mixed_signedness_accelerated, compilerHelper.isDotIntegerProductExtensionSupported()); + EXPECT_EQ(integerDotAccelerationProperties8Bit.signed_accelerated, compilerHelper.isDotIntegerProductExtensionSupported()); + EXPECT_EQ(integerDotAccelerationProperties8Bit.unsigned_accelerated, compilerHelper.isDotIntegerProductExtensionSupported()); +} + +TEST_F(clGetDeviceInfoTests, givenClDeviceWhenGetInfoForIntegerDot8BitPackedPropertiesThenCorrectValuesAreSet) { + size_t paramRetSize = 0; + cl_device_integer_dot_product_acceleration_properties_khr integerDotAccelerationProperties8BitPacked{}; + + clGetDeviceInfo( + testedClDevice, + CL_DEVICE_INTEGER_DOT_PRODUCT_ACCELERATION_PROPERTIES_4x8BIT_PACKED_KHR, + sizeof(integerDotAccelerationProperties8BitPacked), + &integerDotAccelerationProperties8BitPacked, + ¶mRetSize); + auto &compilerHelper = pDevice->getDevice().getCompilerProductHelper(); + EXPECT_EQ(integerDotAccelerationProperties8BitPacked.accumulating_saturating_mixed_signedness_accelerated, compilerHelper.isDotIntegerProductExtensionSupported()); + EXPECT_EQ(integerDotAccelerationProperties8BitPacked.accumulating_saturating_signed_accelerated, compilerHelper.isDotIntegerProductExtensionSupported()); + EXPECT_EQ(integerDotAccelerationProperties8BitPacked.accumulating_saturating_unsigned_accelerated, compilerHelper.isDotIntegerProductExtensionSupported()); + EXPECT_EQ(integerDotAccelerationProperties8BitPacked.mixed_signedness_accelerated, compilerHelper.isDotIntegerProductExtensionSupported()); + EXPECT_EQ(integerDotAccelerationProperties8BitPacked.signed_accelerated, compilerHelper.isDotIntegerProductExtensionSupported()); + EXPECT_EQ(integerDotAccelerationProperties8BitPacked.unsigned_accelerated, compilerHelper.isDotIntegerProductExtensionSupported()); +} } // namespace ULT diff --git a/opencl/test/unit_test/api/cl_get_platform_info_tests.inl b/opencl/test/unit_test/api/cl_get_platform_info_tests.inl index 9c26cdb56c..741ceb2b07 100644 --- a/opencl/test/unit_test/api/cl_get_platform_info_tests.inl +++ b/opencl/test/unit_test/api/cl_get_platform_info_tests.inl @@ -204,7 +204,11 @@ TEST_F(clGetPlatformInfoTests, WhenCheckingPlatformExtensionsWithVersionThenThey std::string allExtensions; for (size_t i = 0; i < extensionsCount; i++) { - EXPECT_EQ(CL_MAKE_VERSION(1u, 0u, 0u), platformExtensionsWithVersion[i].version); + if (strcmp(platformExtensionsWithVersion[i].name, "cl_khr_integer_dot_product") == 0) { + EXPECT_EQ(CL_MAKE_VERSION(2u, 0, 0), platformExtensionsWithVersion[i].version); + } else { + EXPECT_EQ(CL_MAKE_VERSION(1u, 0, 0), platformExtensionsWithVersion[i].version); + } allExtensions += platformExtensionsWithVersion[i].name; allExtensions += " "; } diff --git a/opencl/test/unit_test/device/device_caps_tests.cpp b/opencl/test/unit_test/device/device_caps_tests.cpp index 9bcea11109..0eb38678a0 100644 --- a/opencl/test/unit_test/device/device_caps_tests.cpp +++ b/opencl/test/unit_test/device/device_caps_tests.cpp @@ -10,6 +10,7 @@ #include "shared/source/helpers/aligned_memory.h" #include "shared/source/helpers/basic_math.h" #include "shared/source/helpers/bit_helpers.h" +#include "shared/source/helpers/compiler_product_helper.h" #include "shared/source/helpers/gfx_core_helper.h" #include "shared/source/memory_manager/os_agnostic_memory_manager.h" #include "shared/source/os_interface/os_interface.h" @@ -118,6 +119,10 @@ struct DeviceGetCapsTest : public ::testing::Test { EXPECT_STREQ("__opencl_c_ext_fp64_local_atomic_min_max", (++openclCFeatureIterator)->name); } } + if (clDevice.getDevice().getCompilerProductHelper().isDotIntegerProductExtensionSupported()) { + EXPECT_STREQ("__opencl_c_integer_dot_product_input_4x8bit", (++openclCFeatureIterator)->name); + EXPECT_STREQ("__opencl_c_integer_dot_product_input_4x8bit_packed", (++openclCFeatureIterator)->name); + } EXPECT_EQ(clDevice.getDeviceInfo().openclCFeatures.end(), ++openclCFeatureIterator); } @@ -965,7 +970,11 @@ TEST_F(DeviceGetCapsTest, givenDefaultDeviceWhenQueriedForExtensionsWithVersionT EXPECT_FALSE(pClDevice->getDeviceInfo().extensionsWithVersion.empty()); for (auto extensionWithVersion : pClDevice->getDeviceInfo().extensionsWithVersion) { - EXPECT_EQ(CL_MAKE_VERSION(1u, 0u, 0u), extensionWithVersion.version); + if (strcmp(extensionWithVersion.name, "cl_khr_integer_dot_product") == 0) { + EXPECT_EQ(CL_MAKE_VERSION(2u, 0, 0), extensionWithVersion.version); + } else { + EXPECT_EQ(CL_MAKE_VERSION(1u, 0, 0), extensionWithVersion.version); + } allExtensions += extensionWithVersion.name; allExtensions += " "; } @@ -973,6 +982,74 @@ TEST_F(DeviceGetCapsTest, givenDefaultDeviceWhenQueriedForExtensionsWithVersionT EXPECT_STREQ(pClDevice->deviceExtensions.c_str(), allExtensions.c_str()); } +TEST_F(DeviceGetCapsTest, givenClDeviceWhenGetExtensionsVersionCalledThenCorrectVersionIsSet) { + UltClDeviceFactory deviceFactory{1, 0}; + auto pClDevice = deviceFactory.rootDevices[0]; + pClDevice->getDeviceInfo(CL_DEVICE_EXTENSIONS_WITH_VERSION, 0, nullptr, nullptr); + for (auto extensionWithVersion : pClDevice->getDeviceInfo().extensionsWithVersion) { + if (strcmp(extensionWithVersion.name, "cl_khr_integer_dot_product") == 0) { + EXPECT_EQ(CL_MAKE_VERSION(2u, 0, 0), pClDevice->getExtensionVersion(std::string(extensionWithVersion.name))); + } else { + EXPECT_EQ(CL_MAKE_VERSION(1u, 0, 0), pClDevice->getExtensionVersion(std::string(extensionWithVersion.name))); + } + } +} + +TEST_F(DeviceGetCapsTest, givenClDeviceWhenCapsInitializedThenIntegerDotInput4xBitCapIsSet) { + UltClDeviceFactory deviceFactory{1, 0}; + auto pClDevice = deviceFactory.rootDevices[0]; + pClDevice->initializeCaps(); + auto &compilerHelper = pClDevice->getDevice().getCompilerProductHelper(); + EXPECT_EQ((pClDevice->deviceInfo.integerDotCapabilities & CL_DEVICE_INTEGER_DOT_PRODUCT_INPUT_4x8BIT_KHR) != 0, compilerHelper.isDotIntegerProductExtensionSupported()); +} + +TEST_F(DeviceGetCapsTest, givenClDeviceWhenCapsInitializedThenIntegerDotInput4xBitPackedCapIsSet) { + UltClDeviceFactory deviceFactory{1, 0}; + auto pClDevice = deviceFactory.rootDevices[0]; + pClDevice->initializeCaps(); + auto &compilerHelper = pClDevice->getDevice().getCompilerProductHelper(); + EXPECT_EQ((pClDevice->deviceInfo.integerDotCapabilities & CL_DEVICE_INTEGER_DOT_PRODUCT_INPUT_4x8BIT_PACKED_KHR) != 0, compilerHelper.isDotIntegerProductExtensionSupported()); +} + +TEST_F(DeviceGetCapsTest, givenClDeviceWhenCapsInitializedThenAllFieldsInIntegerDotAccPropertiesAreTrue) { + UltClDeviceFactory deviceFactory{1, 0}; + auto pClDevice = deviceFactory.rootDevices[0]; + pClDevice->initializeCaps(); + auto &compilerHelper = pClDevice->getDevice().getCompilerProductHelper(); + EXPECT_EQ(pClDevice->deviceInfo.integerDotAccelerationProperties8Bit.accumulating_saturating_mixed_signedness_accelerated, compilerHelper.isDotIntegerProductExtensionSupported()); + EXPECT_EQ(pClDevice->deviceInfo.integerDotAccelerationProperties8Bit.accumulating_saturating_signed_accelerated, compilerHelper.isDotIntegerProductExtensionSupported()); + EXPECT_EQ(pClDevice->deviceInfo.integerDotAccelerationProperties8Bit.accumulating_saturating_unsigned_accelerated, compilerHelper.isDotIntegerProductExtensionSupported()); + EXPECT_EQ(pClDevice->deviceInfo.integerDotAccelerationProperties8Bit.mixed_signedness_accelerated, compilerHelper.isDotIntegerProductExtensionSupported()); + EXPECT_EQ(pClDevice->deviceInfo.integerDotAccelerationProperties8Bit.signed_accelerated, compilerHelper.isDotIntegerProductExtensionSupported()); + EXPECT_EQ(pClDevice->deviceInfo.integerDotAccelerationProperties8Bit.unsigned_accelerated, compilerHelper.isDotIntegerProductExtensionSupported()); +} + +TEST_F(DeviceGetCapsTest, givenClDeviceWhenCapsInitializedThenAllFieldsInIntegerDotAccPackedPropertiesAreTrue) { + UltClDeviceFactory deviceFactory{1, 0}; + auto pClDevice = deviceFactory.rootDevices[0]; + pClDevice->initializeCaps(); + auto &compilerHelper = pClDevice->getDevice().getCompilerProductHelper(); + EXPECT_EQ(pClDevice->deviceInfo.integerDotAccelerationProperties4x8BitPacked.accumulating_saturating_mixed_signedness_accelerated, compilerHelper.isDotIntegerProductExtensionSupported()); + EXPECT_EQ(pClDevice->deviceInfo.integerDotAccelerationProperties4x8BitPacked.accumulating_saturating_signed_accelerated, compilerHelper.isDotIntegerProductExtensionSupported()); + EXPECT_EQ(pClDevice->deviceInfo.integerDotAccelerationProperties4x8BitPacked.accumulating_saturating_unsigned_accelerated, compilerHelper.isDotIntegerProductExtensionSupported()); + EXPECT_EQ(pClDevice->deviceInfo.integerDotAccelerationProperties4x8BitPacked.mixed_signedness_accelerated, compilerHelper.isDotIntegerProductExtensionSupported()); + EXPECT_EQ(pClDevice->deviceInfo.integerDotAccelerationProperties4x8BitPacked.signed_accelerated, compilerHelper.isDotIntegerProductExtensionSupported()); + EXPECT_EQ(pClDevice->deviceInfo.integerDotAccelerationProperties4x8BitPacked.unsigned_accelerated, compilerHelper.isDotIntegerProductExtensionSupported()); +} + +TEST_F(DeviceGetCapsTest, givenClDeviceWhenEnableIntegerDotExtensionEnalbedThenDotIntegerExtensionIsInExtensionString) { + UltClDeviceFactory deviceFactory{1, 0}; + auto pClDevice = deviceFactory.rootDevices[0]; + pClDevice->initializeCaps(); + auto &compilerHelper = pClDevice->getDevice().getCompilerProductHelper(); + static const char *const supportedExtensions[] = { + "cl_khr_integer_dot_product "}; + for (auto extension : supportedExtensions) { + auto foundOffset = pClDevice->deviceExtensions.find(extension); + EXPECT_EQ(foundOffset != std::string::npos, compilerHelper.isDotIntegerProductExtensionSupported()); + } +} + TEST_F(DeviceGetCapsTest, givenFp64SupportForcedWhenCheckingFp64SupportThenFp64IsCorrectlyReported) { DebugManagerStateRestore dbgRestorer; int32_t overrideDefaultFP64SettingsValues[] = {-1, 0, 1}; diff --git a/opencl/test/unit_test/offline_compiler/offline_compiler_tests.cpp b/opencl/test/unit_test/offline_compiler/offline_compiler_tests.cpp index d606eea96a..50aeafc810 100644 --- a/opencl/test/unit_test/offline_compiler/offline_compiler_tests.cpp +++ b/opencl/test/unit_test/offline_compiler/offline_compiler_tests.cpp @@ -1748,7 +1748,8 @@ TEST_F(OfflineCompilerTests, givenVariousClStdValuesWhenCompilingSourceThenCorre } OpenClCFeaturesContainer openclCFeatures; - getOpenclCFeaturesList(mockOfflineCompiler->hwInfo, openclCFeatures); + auto compilerProductHelper = CompilerProductHelper::create(mockOfflineCompiler->hwInfo.platform.eProductFamily); + getOpenclCFeaturesList(mockOfflineCompiler->hwInfo, openclCFeatures, *compilerProductHelper.get()); for (auto &feature : openclCFeatures) { if (clStdOptionValue == "-cl-std=CL3.0") { EXPECT_TRUE(hasSubstr(internalOptions, std::string{feature.name})); diff --git a/opencl/test/unit_test/platform/platform_tests.cpp b/opencl/test/unit_test/platform/platform_tests.cpp index 8bbddb1726..d5daccf628 100644 --- a/opencl/test/unit_test/platform/platform_tests.cpp +++ b/opencl/test/unit_test/platform/platform_tests.cpp @@ -278,7 +278,7 @@ TEST_F(PlatformTest, givenSupportingCl21WhenPlatformSupportsFp64ThenFillMatching hwInfo = defaultHwInfo.get(); std::string extensionsList = compilerProductHelper->getDeviceExtensions(*hwInfo); OpenClCFeaturesContainer features; - getOpenclCFeaturesList(*hwInfo, features); + getOpenclCFeaturesList(*hwInfo, features, *compilerProductHelper.get()); std::string compilerExtensions = convertEnabledExtensionsToCompilerInternalOptions(extensionsList.c_str(), features); EXPECT_TRUE(hasSubstr(compilerExtensions, std::string(" -cl-ext=-all,+cl"))); @@ -317,7 +317,7 @@ TEST_F(PlatformTest, givenNotSupportingCl21WhenPlatformNotSupportFp64ThenNotFill std::string extensionsList = compilerProductHelper->getDeviceExtensions(testHwInfo); OpenClCFeaturesContainer features; - getOpenclCFeaturesList(*defaultHwInfo, features); + getOpenclCFeaturesList(*defaultHwInfo, features, *compilerProductHelper.get()); if (testHwInfo.capabilityTable.supportsImages) { EXPECT_TRUE(hasSubstr(extensionsList, std::string("cl_khr_3d_image_writes"))); } @@ -335,7 +335,7 @@ TEST_F(PlatformTest, givenFtrSupportAtomicsWhenCreateExtentionsListThenGetMatchi hwInfo = defaultHwInfo.get(); std::string extensionsList = compilerProductHelper->getDeviceExtensions(*hwInfo); OpenClCFeaturesContainer features; - getOpenclCFeaturesList(*hwInfo, features); + getOpenclCFeaturesList(*hwInfo, features, *compilerProductHelper.get()); std::string compilerExtensions = convertEnabledExtensionsToCompilerInternalOptions(extensionsList.c_str(), features); if (hwInfo->capabilityTable.ftrSupportsInteger64BitAtomics) { @@ -354,7 +354,7 @@ TEST_F(PlatformTest, givenSupportedMediaBlockAndClVersion21WhenCreateExtentionsL hwInfo.capabilityTable.supportsOcl21Features = true; std::string extensionsList = compilerProductHelper->getDeviceExtensions(hwInfo); OpenClCFeaturesContainer features; - getOpenclCFeaturesList(*defaultHwInfo, features); + getOpenclCFeaturesList(*defaultHwInfo, features, *compilerProductHelper.get()); std::string compilerExtensions = convertEnabledExtensionsToCompilerInternalOptions(extensionsList.c_str(), features); EXPECT_TRUE(hasSubstr(compilerExtensions, std::string("cl_intel_spirv_media_block_io"))); @@ -366,7 +366,7 @@ TEST_F(PlatformTest, givenNotSupportedMediaBlockAndClVersion21WhenCreateExtentio hwInfo.capabilityTable.clVersionSupport = 21; std::string extensionsList = compilerProductHelper->getDeviceExtensions(hwInfo); OpenClCFeaturesContainer features; - getOpenclCFeaturesList(*defaultHwInfo, features); + getOpenclCFeaturesList(*defaultHwInfo, features, *compilerProductHelper.get()); std::string compilerExtensions = convertEnabledExtensionsToCompilerInternalOptions(extensionsList.c_str(), features); EXPECT_FALSE(hasSubstr(compilerExtensions, std::string("cl_intel_spirv_media_block_io"))); @@ -377,7 +377,7 @@ TEST_F(PlatformTest, givenSupportedImagesWhenCreateExtentionsListThenDeviceNotRe hwInfo.capabilityTable.supportsImages = true; std::string extensionsList = compilerProductHelper->getDeviceExtensions(hwInfo); OpenClCFeaturesContainer features; - getOpenclCFeaturesList(*defaultHwInfo, features); + getOpenclCFeaturesList(*defaultHwInfo, features, *compilerProductHelper.get()); std::string compilerExtensions = convertEnabledExtensionsToCompilerInternalOptions(extensionsList.c_str(), features); EXPECT_TRUE(hasSubstr(compilerExtensions, std::string("cl_khr_3d_image_writes"))); @@ -388,7 +388,7 @@ TEST_F(PlatformTest, givenNotSupportedImagesWhenCreateExtentionsListThenDeviceNo hwInfo.capabilityTable.supportsImages = false; std::string extensionsList = compilerProductHelper->getDeviceExtensions(hwInfo); OpenClCFeaturesContainer features; - getOpenclCFeaturesList(*defaultHwInfo, features); + getOpenclCFeaturesList(*defaultHwInfo, features, *compilerProductHelper.get()); std::string compilerExtensions = convertEnabledExtensionsToCompilerInternalOptions(extensionsList.c_str(), features); EXPECT_FALSE(hasSubstr(compilerExtensions, std::string("cl_khr_3d_image_writes"))); diff --git a/shared/source/compiler_interface/oclc_extensions.cpp b/shared/source/compiler_interface/oclc_extensions.cpp index 8079fb738e..7452d9815c 100644 --- a/shared/source/compiler_interface/oclc_extensions.cpp +++ b/shared/source/compiler_interface/oclc_extensions.cpp @@ -8,6 +8,7 @@ #include "shared/source/compiler_interface/oclc_extensions.h" #include "shared/source/debug_settings/debug_settings_manager.h" +#include "shared/source/helpers/compiler_product_helper.h" #include "shared/source/helpers/hw_info.h" #include "shared/source/helpers/string.h" @@ -16,7 +17,7 @@ namespace NEO { -void getOpenclCFeaturesList(const HardwareInfo &hwInfo, OpenClCFeaturesContainer &openclCFeatures) { +void getOpenclCFeaturesList(const HardwareInfo &hwInfo, OpenClCFeaturesContainer &openclCFeatures, const CompilerProductHelper &compilerProductHelper) { cl_name_version openClCFeature; openClCFeature.version = CL_MAKE_VERSION(3, 0, 0); @@ -113,6 +114,13 @@ void getOpenclCFeaturesList(const HardwareInfo &hwInfo, OpenClCFeaturesContainer openclCFeatures.push_back(openClCFeature); } } + if (compilerProductHelper.isDotIntegerProductExtensionSupported()) { + strcpy_s(openClCFeature.name, CL_NAME_VERSION_MAX_NAME_SIZE, "__opencl_c_integer_dot_product_input_4x8bit"); + openclCFeatures.push_back(openClCFeature); + + strcpy_s(openClCFeature.name, CL_NAME_VERSION_MAX_NAME_SIZE, "__opencl_c_integer_dot_product_input_4x8bit_packed"); + openclCFeatures.push_back(openClCFeature); + } } std::string convertEnabledExtensionsToCompilerInternalOptions(const char *enabledExtensions, diff --git a/shared/source/compiler_interface/oclc_extensions.h b/shared/source/compiler_interface/oclc_extensions.h index 88296597b4..24818ccbfa 100644 --- a/shared/source/compiler_interface/oclc_extensions.h +++ b/shared/source/compiler_interface/oclc_extensions.h @@ -17,12 +17,13 @@ using OpenClCFeaturesContainer = StackVec; namespace NEO { struct HardwareInfo; +class CompilerProductHelper; namespace Extensions { inline constexpr const char *const sharingFormatQuery = "cl_intel_sharing_format_query "; } -void getOpenclCFeaturesList(const HardwareInfo &hwInfo, OpenClCFeaturesContainer &openclCFeatures); +void getOpenclCFeaturesList(const HardwareInfo &hwInfo, OpenClCFeaturesContainer &openclCFeatures, const CompilerProductHelper &compilerProductHelper); std::string convertEnabledExtensionsToCompilerInternalOptions(const char *deviceExtensions, OpenClCFeaturesContainer &openclCFeatures); std::string getOclVersionCompilerInternalOption(unsigned int oclVersion); diff --git a/shared/source/gen11/enable_compiler_product_helper_ehl.cpp b/shared/source/gen11/enable_compiler_product_helper_ehl.cpp index 3d17263312..c6b7e9150b 100644 --- a/shared/source/gen11/enable_compiler_product_helper_ehl.cpp +++ b/shared/source/gen11/enable_compiler_product_helper_ehl.cpp @@ -9,6 +9,7 @@ #include "shared/source/helpers/compiler_product_helper.h" #include "shared/source/helpers/compiler_product_helper_base.inl" #include "shared/source/helpers/compiler_product_helper_bdw_and_later.inl" +#include "shared/source/helpers/compiler_product_helper_bdw_to_icllp.inl" #include "shared/source/helpers/compiler_product_helper_before_xe_hp.inl" #include "shared/source/helpers/compiler_product_helper_before_xe_hpc.inl" #include "shared/source/helpers/compiler_product_helper_disable_split_matrix_multiply_accumulate.inl" diff --git a/shared/source/gen11/enable_compiler_product_helper_icllp.cpp b/shared/source/gen11/enable_compiler_product_helper_icllp.cpp index 977a46ba10..4245e468d0 100644 --- a/shared/source/gen11/enable_compiler_product_helper_icllp.cpp +++ b/shared/source/gen11/enable_compiler_product_helper_icllp.cpp @@ -9,6 +9,7 @@ #include "shared/source/helpers/compiler_product_helper.h" #include "shared/source/helpers/compiler_product_helper_base.inl" #include "shared/source/helpers/compiler_product_helper_bdw_and_later.inl" +#include "shared/source/helpers/compiler_product_helper_bdw_to_icllp.inl" #include "shared/source/helpers/compiler_product_helper_before_xe_hp.inl" #include "shared/source/helpers/compiler_product_helper_before_xe_hpc.inl" #include "shared/source/helpers/compiler_product_helper_disable_split_matrix_multiply_accumulate.inl" diff --git a/shared/source/gen11/enable_compiler_product_helper_lkf.cpp b/shared/source/gen11/enable_compiler_product_helper_lkf.cpp index c49584855c..093eddf7cb 100644 --- a/shared/source/gen11/enable_compiler_product_helper_lkf.cpp +++ b/shared/source/gen11/enable_compiler_product_helper_lkf.cpp @@ -9,6 +9,7 @@ #include "shared/source/helpers/compiler_product_helper.h" #include "shared/source/helpers/compiler_product_helper_base.inl" #include "shared/source/helpers/compiler_product_helper_bdw_and_later.inl" +#include "shared/source/helpers/compiler_product_helper_bdw_to_icllp.inl" #include "shared/source/helpers/compiler_product_helper_before_xe_hp.inl" #include "shared/source/helpers/compiler_product_helper_before_xe_hpc.inl" #include "shared/source/helpers/compiler_product_helper_disable_split_matrix_multiply_accumulate.inl" diff --git a/shared/source/gen12lp/enable_compiler_product_helper_adln.cpp b/shared/source/gen12lp/enable_compiler_product_helper_adln.cpp index 3913f35d08..1ff0e38563 100644 --- a/shared/source/gen12lp/enable_compiler_product_helper_adln.cpp +++ b/shared/source/gen12lp/enable_compiler_product_helper_adln.cpp @@ -13,6 +13,7 @@ #include "shared/source/helpers/compiler_product_helper_before_xe_hpc.inl" #include "shared/source/helpers/compiler_product_helper_disable_split_matrix_multiply_accumulate.inl" #include "shared/source/helpers/compiler_product_helper_enable_subgroup_local_block_io.inl" +#include "shared/source/helpers/compiler_product_helper_tgllp_and_later.inl" #include "compiler_product_helper_adln.inl" diff --git a/shared/source/gen12lp/enable_compiler_product_helper_adlp.cpp b/shared/source/gen12lp/enable_compiler_product_helper_adlp.cpp index 416f439890..e952624787 100644 --- a/shared/source/gen12lp/enable_compiler_product_helper_adlp.cpp +++ b/shared/source/gen12lp/enable_compiler_product_helper_adlp.cpp @@ -13,6 +13,7 @@ #include "shared/source/helpers/compiler_product_helper_before_xe_hpc.inl" #include "shared/source/helpers/compiler_product_helper_disable_split_matrix_multiply_accumulate.inl" #include "shared/source/helpers/compiler_product_helper_enable_subgroup_local_block_io.inl" +#include "shared/source/helpers/compiler_product_helper_tgllp_and_later.inl" #include "compiler_product_helper_adlp.inl" diff --git a/shared/source/gen12lp/enable_compiler_product_helper_adls.cpp b/shared/source/gen12lp/enable_compiler_product_helper_adls.cpp index 480d652737..97b380e747 100644 --- a/shared/source/gen12lp/enable_compiler_product_helper_adls.cpp +++ b/shared/source/gen12lp/enable_compiler_product_helper_adls.cpp @@ -13,6 +13,7 @@ #include "shared/source/helpers/compiler_product_helper_before_xe_hpc.inl" #include "shared/source/helpers/compiler_product_helper_disable_split_matrix_multiply_accumulate.inl" #include "shared/source/helpers/compiler_product_helper_enable_subgroup_local_block_io.inl" +#include "shared/source/helpers/compiler_product_helper_tgllp_and_later.inl" namespace NEO { template <> diff --git a/shared/source/gen12lp/enable_compiler_product_helper_dg1.cpp b/shared/source/gen12lp/enable_compiler_product_helper_dg1.cpp index 32570b5894..a7902510b6 100644 --- a/shared/source/gen12lp/enable_compiler_product_helper_dg1.cpp +++ b/shared/source/gen12lp/enable_compiler_product_helper_dg1.cpp @@ -13,6 +13,7 @@ #include "shared/source/helpers/compiler_product_helper_before_xe_hpc.inl" #include "shared/source/helpers/compiler_product_helper_disable_split_matrix_multiply_accumulate.inl" #include "shared/source/helpers/compiler_product_helper_enable_subgroup_local_block_io.inl" +#include "shared/source/helpers/compiler_product_helper_tgllp_and_later.inl" namespace NEO { template <> diff --git a/shared/source/gen12lp/enable_compiler_product_helper_rkl.cpp b/shared/source/gen12lp/enable_compiler_product_helper_rkl.cpp index c162e438f3..51a912cbec 100644 --- a/shared/source/gen12lp/enable_compiler_product_helper_rkl.cpp +++ b/shared/source/gen12lp/enable_compiler_product_helper_rkl.cpp @@ -13,6 +13,7 @@ #include "shared/source/helpers/compiler_product_helper_before_xe_hpc.inl" #include "shared/source/helpers/compiler_product_helper_disable_split_matrix_multiply_accumulate.inl" #include "shared/source/helpers/compiler_product_helper_enable_subgroup_local_block_io.inl" +#include "shared/source/helpers/compiler_product_helper_tgllp_and_later.inl" namespace NEO { diff --git a/shared/source/gen12lp/enable_compiler_product_helper_tgllp.cpp b/shared/source/gen12lp/enable_compiler_product_helper_tgllp.cpp index 8b8d8e6599..1c36e7db65 100644 --- a/shared/source/gen12lp/enable_compiler_product_helper_tgllp.cpp +++ b/shared/source/gen12lp/enable_compiler_product_helper_tgllp.cpp @@ -13,6 +13,7 @@ #include "shared/source/helpers/compiler_product_helper_before_xe_hpc.inl" #include "shared/source/helpers/compiler_product_helper_disable_split_matrix_multiply_accumulate.inl" #include "shared/source/helpers/compiler_product_helper_enable_subgroup_local_block_io.inl" +#include "shared/source/helpers/compiler_product_helper_tgllp_and_later.inl" namespace NEO { template <> diff --git a/shared/source/gen8/enable_compiler_product_helper_bdw.cpp b/shared/source/gen8/enable_compiler_product_helper_bdw.cpp index 293ffe3318..b168570989 100644 --- a/shared/source/gen8/enable_compiler_product_helper_bdw.cpp +++ b/shared/source/gen8/enable_compiler_product_helper_bdw.cpp @@ -9,6 +9,7 @@ #include "shared/source/helpers/compiler_product_helper.h" #include "shared/source/helpers/compiler_product_helper_base.inl" #include "shared/source/helpers/compiler_product_helper_bdw_and_later.inl" +#include "shared/source/helpers/compiler_product_helper_bdw_to_icllp.inl" #include "shared/source/helpers/compiler_product_helper_before_xe_hp.inl" #include "shared/source/helpers/compiler_product_helper_before_xe_hpc.inl" #include "shared/source/helpers/compiler_product_helper_disable_split_matrix_multiply_accumulate.inl" diff --git a/shared/source/gen9/enable_compiler_product_helper_bxt.cpp b/shared/source/gen9/enable_compiler_product_helper_bxt.cpp index 29847e4eb6..5060189b75 100644 --- a/shared/source/gen9/enable_compiler_product_helper_bxt.cpp +++ b/shared/source/gen9/enable_compiler_product_helper_bxt.cpp @@ -9,6 +9,7 @@ #include "shared/source/helpers/compiler_product_helper.h" #include "shared/source/helpers/compiler_product_helper_base.inl" #include "shared/source/helpers/compiler_product_helper_bdw_and_later.inl" +#include "shared/source/helpers/compiler_product_helper_bdw_to_icllp.inl" #include "shared/source/helpers/compiler_product_helper_before_xe_hp.inl" #include "shared/source/helpers/compiler_product_helper_before_xe_hpc.inl" #include "shared/source/helpers/compiler_product_helper_disable_split_matrix_multiply_accumulate.inl" diff --git a/shared/source/gen9/enable_compiler_product_helper_cfl.cpp b/shared/source/gen9/enable_compiler_product_helper_cfl.cpp index 5a1ea6c164..1ea2bf7f54 100644 --- a/shared/source/gen9/enable_compiler_product_helper_cfl.cpp +++ b/shared/source/gen9/enable_compiler_product_helper_cfl.cpp @@ -9,6 +9,7 @@ #include "shared/source/helpers/compiler_product_helper.h" #include "shared/source/helpers/compiler_product_helper_base.inl" #include "shared/source/helpers/compiler_product_helper_bdw_and_later.inl" +#include "shared/source/helpers/compiler_product_helper_bdw_to_icllp.inl" #include "shared/source/helpers/compiler_product_helper_before_xe_hp.inl" #include "shared/source/helpers/compiler_product_helper_before_xe_hpc.inl" #include "shared/source/helpers/compiler_product_helper_disable_split_matrix_multiply_accumulate.inl" diff --git a/shared/source/gen9/enable_compiler_product_helper_glk.cpp b/shared/source/gen9/enable_compiler_product_helper_glk.cpp index a22b6c0c2c..4419aa0b31 100644 --- a/shared/source/gen9/enable_compiler_product_helper_glk.cpp +++ b/shared/source/gen9/enable_compiler_product_helper_glk.cpp @@ -9,6 +9,7 @@ #include "shared/source/helpers/compiler_product_helper.h" #include "shared/source/helpers/compiler_product_helper_base.inl" #include "shared/source/helpers/compiler_product_helper_bdw_and_later.inl" +#include "shared/source/helpers/compiler_product_helper_bdw_to_icllp.inl" #include "shared/source/helpers/compiler_product_helper_before_xe_hp.inl" #include "shared/source/helpers/compiler_product_helper_before_xe_hpc.inl" #include "shared/source/helpers/compiler_product_helper_disable_split_matrix_multiply_accumulate.inl" diff --git a/shared/source/gen9/enable_compiler_product_helper_kbl.cpp b/shared/source/gen9/enable_compiler_product_helper_kbl.cpp index b579d8da03..5e97411dc6 100644 --- a/shared/source/gen9/enable_compiler_product_helper_kbl.cpp +++ b/shared/source/gen9/enable_compiler_product_helper_kbl.cpp @@ -9,6 +9,7 @@ #include "shared/source/helpers/compiler_product_helper.h" #include "shared/source/helpers/compiler_product_helper_base.inl" #include "shared/source/helpers/compiler_product_helper_bdw_and_later.inl" +#include "shared/source/helpers/compiler_product_helper_bdw_to_icllp.inl" #include "shared/source/helpers/compiler_product_helper_before_xe_hp.inl" #include "shared/source/helpers/compiler_product_helper_before_xe_hpc.inl" #include "shared/source/helpers/compiler_product_helper_disable_split_matrix_multiply_accumulate.inl" diff --git a/shared/source/gen9/enable_compiler_product_helper_skl.cpp b/shared/source/gen9/enable_compiler_product_helper_skl.cpp index 8cc2d38f62..d6c1a56a14 100644 --- a/shared/source/gen9/enable_compiler_product_helper_skl.cpp +++ b/shared/source/gen9/enable_compiler_product_helper_skl.cpp @@ -9,6 +9,7 @@ #include "shared/source/helpers/compiler_product_helper.h" #include "shared/source/helpers/compiler_product_helper_base.inl" #include "shared/source/helpers/compiler_product_helper_bdw_and_later.inl" +#include "shared/source/helpers/compiler_product_helper_bdw_to_icllp.inl" #include "shared/source/helpers/compiler_product_helper_before_xe_hp.inl" #include "shared/source/helpers/compiler_product_helper_before_xe_hpc.inl" #include "shared/source/helpers/compiler_product_helper_disable_split_matrix_multiply_accumulate.inl" diff --git a/shared/source/helpers/CMakeLists.txt b/shared/source/helpers/CMakeLists.txt index 4419babd00..a635e14ae2 100644 --- a/shared/source/helpers/CMakeLists.txt +++ b/shared/source/helpers/CMakeLists.txt @@ -43,12 +43,14 @@ set(NEO_CORE_HELPERS ${CMAKE_CURRENT_SOURCE_DIR}/compiler_product_helper_base.inl ${CMAKE_CURRENT_SOURCE_DIR}/compiler_aot_config_bdw_and_later.inl ${CMAKE_CURRENT_SOURCE_DIR}/compiler_product_helper_bdw_and_later.inl + ${CMAKE_CURRENT_SOURCE_DIR}/compiler_product_helper_bdw_to_icllp.inl ${CMAKE_CURRENT_SOURCE_DIR}/compiler_product_helper_before_xe_hp.inl ${CMAKE_CURRENT_SOURCE_DIR}/compiler_product_helper_before_xe_hpc.inl ${CMAKE_CURRENT_SOURCE_DIR}/compiler_product_helper_disable_split_matrix_multiply_accumulate.inl ${CMAKE_CURRENT_SOURCE_DIR}/compiler_product_helper_disable_subgroup_local_block_io.inl ${CMAKE_CURRENT_SOURCE_DIR}/compiler_product_helper_enable_split_matrix_multiply_accumulate.inl ${CMAKE_CURRENT_SOURCE_DIR}/compiler_product_helper_enable_subgroup_local_block_io.inl + ${CMAKE_CURRENT_SOURCE_DIR}/compiler_product_helper_tgllp_and_later.inl ${CMAKE_CURRENT_SOURCE_DIR}/compiler_product_helper_xe_hp_and_later.inl ${CMAKE_CURRENT_SOURCE_DIR}/compiler_product_helper_xe_hpc_and_later.inl ${CMAKE_CURRENT_SOURCE_DIR}/compiler_options_parser.cpp diff --git a/shared/source/helpers/compiler_options_parser.cpp b/shared/source/helpers/compiler_options_parser.cpp index 604aa610b9..8e24da1a43 100644 --- a/shared/source/helpers/compiler_options_parser.cpp +++ b/shared/source/helpers/compiler_options_parser.cpp @@ -46,7 +46,7 @@ void appendExtensionsToInternalOptions(const HardwareInfo &hwInfo, const std::st } OpenClCFeaturesContainer openclCFeatures; if (requiresOpenClCFeatures(options)) { - getOpenclCFeaturesList(hwInfo, openclCFeatures); + getOpenclCFeaturesList(hwInfo, openclCFeatures, *compilerProductHelper.get()); } auto compilerExtensions = convertEnabledExtensionsToCompilerInternalOptions(extensionsList.c_str(), openclCFeatures); diff --git a/shared/source/helpers/compiler_product_helper.h b/shared/source/helpers/compiler_product_helper.h index 4a99d8f471..494fa7c156 100644 --- a/shared/source/helpers/compiler_product_helper.h +++ b/shared/source/helpers/compiler_product_helper.h @@ -46,6 +46,7 @@ class CompilerProductHelper { virtual bool isSubgroupExtendedBlockReadSupported() const = 0; virtual bool isForceToStatelessRequired() const = 0; virtual bool failBuildProgramWithStatefulAccessPreference() const = 0; + virtual bool isDotIntegerProductExtensionSupported() const = 0; virtual void setProductConfigForHwInfo(HardwareInfo &hwInfo, HardwareIpVersion config) const = 0; virtual const char *getCachingPolicyOptions(bool isDebuggerActive) const = 0; virtual uint64_t getHwInfoConfig(const HardwareInfo &hwInfo) const = 0; @@ -79,6 +80,7 @@ class CompilerProductHelperHw : public CompilerProductHelper { bool isSubgroupExtendedBlockReadSupported() const override; bool isForceToStatelessRequired() const override; bool failBuildProgramWithStatefulAccessPreference() const override; + bool isDotIntegerProductExtensionSupported() const override; void setProductConfigForHwInfo(HardwareInfo &hwInfo, HardwareIpVersion config) const override; const char *getCachingPolicyOptions(bool isDebuggerActive) const override; uint64_t getHwInfoConfig(const HardwareInfo &hwInfo) const override; diff --git a/shared/source/helpers/compiler_product_helper_base.inl b/shared/source/helpers/compiler_product_helper_base.inl index c63039c363..fc2cde271e 100644 --- a/shared/source/helpers/compiler_product_helper_base.inl +++ b/shared/source/helpers/compiler_product_helper_base.inl @@ -180,6 +180,9 @@ std::string CompilerProductHelperHw::getDeviceExtensions(const Hardw if (isSubgroupExtendedBlockReadSupported()) { extensions += "cl_intel_subgroup_extended_block_read "; } + if (isDotIntegerProductExtensionSupported()) { + extensions += "cl_khr_integer_dot_product "; + } return extensions; } diff --git a/shared/source/helpers/compiler_product_helper_bdw_to_icllp.inl b/shared/source/helpers/compiler_product_helper_bdw_to_icllp.inl new file mode 100644 index 0000000000..b2a755f4ac --- /dev/null +++ b/shared/source/helpers/compiler_product_helper_bdw_to_icllp.inl @@ -0,0 +1,18 @@ +/* + * Copyright (C) 2023 Intel Corporation + * + * SPDX-License-Identifier: MIT + * + */ + +#pragma once + +#include "shared/source/helpers/compiler_product_helper.h" + +namespace NEO { +template +bool CompilerProductHelperHw::isDotIntegerProductExtensionSupported() const { + return false; +} + +} // namespace NEO diff --git a/shared/source/helpers/compiler_product_helper_tgllp_and_later.inl b/shared/source/helpers/compiler_product_helper_tgllp_and_later.inl new file mode 100644 index 0000000000..72c35152eb --- /dev/null +++ b/shared/source/helpers/compiler_product_helper_tgllp_and_later.inl @@ -0,0 +1,18 @@ +/* + * Copyright (C) 2023 Intel Corporation + * + * SPDX-License-Identifier: MIT + * + */ + +#pragma once + +#include "shared/source/helpers/compiler_product_helper.h" + +namespace NEO { +template +bool CompilerProductHelperHw::isDotIntegerProductExtensionSupported() const { + return true; +} + +} // namespace NEO diff --git a/shared/source/xe_hpc_core/enable_compiler_product_helper_pvc.cpp b/shared/source/xe_hpc_core/enable_compiler_product_helper_pvc.cpp index 4d5388fbf5..6988969598 100644 --- a/shared/source/xe_hpc_core/enable_compiler_product_helper_pvc.cpp +++ b/shared/source/xe_hpc_core/enable_compiler_product_helper_pvc.cpp @@ -11,6 +11,7 @@ #include "shared/source/helpers/compiler_product_helper_bdw_and_later.inl" #include "shared/source/helpers/compiler_product_helper_enable_split_matrix_multiply_accumulate.inl" #include "shared/source/helpers/compiler_product_helper_enable_subgroup_local_block_io.inl" +#include "shared/source/helpers/compiler_product_helper_tgllp_and_later.inl" #include "shared/source/helpers/compiler_product_helper_xe_hp_and_later.inl" #include "shared/source/helpers/compiler_product_helper_xe_hpc_and_later.inl" diff --git a/shared/source/xe_hpg_core/enable_compiler_product_helper_dg2.cpp b/shared/source/xe_hpg_core/enable_compiler_product_helper_dg2.cpp index 9cd9a9267c..e5de04d34b 100644 --- a/shared/source/xe_hpg_core/enable_compiler_product_helper_dg2.cpp +++ b/shared/source/xe_hpg_core/enable_compiler_product_helper_dg2.cpp @@ -12,6 +12,7 @@ #include "shared/source/helpers/compiler_product_helper_before_xe_hpc.inl" #include "shared/source/helpers/compiler_product_helper_enable_split_matrix_multiply_accumulate.inl" #include "shared/source/helpers/compiler_product_helper_enable_subgroup_local_block_io.inl" +#include "shared/source/helpers/compiler_product_helper_tgllp_and_later.inl" #include "shared/source/helpers/compiler_product_helper_xe_hp_and_later.inl" #include "compiler_product_helper_dg2.inl" diff --git a/shared/source/xe_hpg_core/enable_compiler_product_helper_mtl.cpp b/shared/source/xe_hpg_core/enable_compiler_product_helper_mtl.cpp index bf424ff7dd..60045e16dd 100644 --- a/shared/source/xe_hpg_core/enable_compiler_product_helper_mtl.cpp +++ b/shared/source/xe_hpg_core/enable_compiler_product_helper_mtl.cpp @@ -11,6 +11,7 @@ #include "shared/source/helpers/compiler_product_helper_bdw_and_later.inl" #include "shared/source/helpers/compiler_product_helper_before_xe_hpc.inl" #include "shared/source/helpers/compiler_product_helper_enable_subgroup_local_block_io.inl" +#include "shared/source/helpers/compiler_product_helper_tgllp_and_later.inl" #include "shared/source/helpers/compiler_product_helper_xe_hp_and_later.inl" #include "shared/source/xe_hpg_core/hw_cmds_mtl.h" diff --git a/shared/test/unit_test/helpers/compiler_product_helper_tests.cpp b/shared/test/unit_test/helpers/compiler_product_helper_tests.cpp index 1f990977eb..2510f5a45d 100644 --- a/shared/test/unit_test/helpers/compiler_product_helper_tests.cpp +++ b/shared/test/unit_test/helpers/compiler_product_helper_tests.cpp @@ -235,3 +235,15 @@ TEST_F(CompilerProductHelperFixture, givenHwInfoWithCLVersionAtLeast20ThenReport extensions = compilerProductHelper.getDeviceExtensions(hwInfo); EXPECT_FALSE(hasSubstr(extensions, std::string("cl_ext_float_atomics"))); } + +HWTEST2_F(CompilerProductHelperFixture, GivenAtMostGen11DeviceWhenCheckingIfIntegerDotExtensionIsSupportedThenFalseReturned, IsAtMostGen11) { + auto &compilerProductHelper = pDevice->getCompilerProductHelper(); + + EXPECT_FALSE(compilerProductHelper.isDotIntegerProductExtensionSupported()); +} + +HWTEST2_F(CompilerProductHelperFixture, GivenAtLeastGen12lpDeviceWhenCheckingIfIntegerDotExtensionIsSupportedThenTrueReturned, IsAtLeastGen12lp) { + auto &compilerProductHelper = pDevice->getCompilerProductHelper(); + + EXPECT_TRUE(compilerProductHelper.isDotIntegerProductExtensionSupported()); +} \ No newline at end of file