diff --git a/level_zero/api/core/ze_core_loader.cpp b/level_zero/api/core/ze_core_loader.cpp index 3a751def0b..9635dd37dd 100644 --- a/level_zero/api/core/ze_core_loader.cpp +++ b/level_zero/api/core/ze_core_loader.cpp @@ -20,13 +20,22 @@ #include "level_zero/experimental/source/tracing/tracing_module_imp.h" #include "level_zero/experimental/source/tracing/tracing_residency_imp.h" #include "level_zero/experimental/source/tracing/tracing_sampler_imp.h" -#include "level_zero/source/inc/ze_intel_gpu.h" #include #include #include "ze_core_all_api_entrypoints.h" #include "ze_ddi_tables.h" +#include +#include + +inline bool getEnvToBool(const char *name) { + const char *env = getenv(name); + if ((nullptr == env) || (0 == strcmp("0", env))) + return false; + return (0 == strcmp("1", env)); +} + ze_gpu_driver_dditable_t driverDdiTable; ZE_APIEXPORT ze_result_t ZE_APICALL diff --git a/level_zero/api/sysman/ze_sysman_loader.cpp b/level_zero/api/sysman/ze_sysman_loader.cpp index 1bca294fd0..3e718b002c 100644 --- a/level_zero/api/sysman/ze_sysman_loader.cpp +++ b/level_zero/api/sysman/ze_sysman_loader.cpp @@ -5,7 +5,6 @@ * */ -#include "level_zero/source/inc/ze_intel_gpu.h" #include #include #include diff --git a/level_zero/api/tools/ze_tools_loader.cpp b/level_zero/api/tools/ze_tools_loader.cpp index 7a48c1c2ab..e1d20aef5c 100644 --- a/level_zero/api/tools/ze_tools_loader.cpp +++ b/level_zero/api/tools/ze_tools_loader.cpp @@ -7,7 +7,6 @@ #include "level_zero/api/driver_experimental/tracing/zet_tracing.h" #include "level_zero/api/extensions/public/ze_exp_ext.h" -#include "level_zero/source/inc/ze_intel_gpu.h" #include #include #include diff --git a/level_zero/core/source/device/device_imp.cpp b/level_zero/core/source/device/device_imp.cpp index 1821897267..caeb9713e4 100644 --- a/level_zero/core/source/device/device_imp.cpp +++ b/level_zero/core/source/device/device_imp.cpp @@ -53,6 +53,7 @@ #include "level_zero/core/source/printf_handler/printf_handler.h" #include "level_zero/core/source/rtas/rtas.h" #include "level_zero/core/source/sampler/sampler.h" +#include "level_zero/include/ze_intel_gpu.h" #include "level_zero/tools/source/debug/debug_session.h" #include "level_zero/tools/source/debug/debug_session_imp.h" #include "level_zero/tools/source/metrics/metric.h" @@ -784,6 +785,17 @@ ze_result_t DeviceImp::getKernelProperties(ze_device_module_properties_t *pKerne rtProperties->flags = 0; rtProperties->maxBVHLevels = 0; } + } else if (extendedProperties->stype == ZE_STRUCTURE_INTEL_DEVICE_MODULE_DP_EXP_PROPERTIES) { + ze_intel_device_module_dp_exp_properties_t *dpProperties = + reinterpret_cast(extendedProperties); + dpProperties->flags = 0u; + if (productHelper.isPlatformDp4aSupported()) { + dpProperties->flags |= ZE_INTEL_DEVICE_MODULE_EXP_FLAG_DP4A; + } + + if (productHelper.isPlatformDpasSupported()) { + dpProperties->flags |= ZE_INTEL_DEVICE_MODULE_EXP_FLAG_DPAS; + } } getExtendedDeviceModuleProperties(extendedProperties); diff --git a/level_zero/core/source/driver/driver_handle_imp.h b/level_zero/core/source/driver/driver_handle_imp.h index 73054b3cca..73234cc4a7 100644 --- a/level_zero/core/source/driver/driver_handle_imp.h +++ b/level_zero/core/source/driver/driver_handle_imp.h @@ -14,6 +14,7 @@ #include "level_zero/api/extensions/public/ze_exp_ext.h" #include "level_zero/core/source/driver/driver_handle.h" #include "level_zero/core/source/get_extension_function_lookup_map.h" +#include "level_zero/include/ze_intel_gpu.h" #include #include @@ -156,7 +157,10 @@ struct DriverHandleImp : public DriverHandle { {ZE_IMAGE_VIEW_EXT_NAME, ZE_IMAGE_VIEW_EXP_VERSION_CURRENT}, {ZE_IMAGE_VIEW_PLANAR_EXT_NAME, ZE_IMAGE_VIEW_PLANAR_EXP_VERSION_CURRENT}, {ZE_EVENT_QUERY_KERNEL_TIMESTAMPS_EXT_NAME, ZE_EVENT_QUERY_KERNEL_TIMESTAMPS_EXT_VERSION_CURRENT}, - {ZE_RTAS_BUILDER_EXP_NAME, ZE_RTAS_BUILDER_EXP_VERSION_CURRENT}}; + {ZE_RTAS_BUILDER_EXP_NAME, ZE_RTAS_BUILDER_EXP_VERSION_CURRENT}, + + // Driver experimental extensions + {ZE_INTEL_DEVICE_MODULE_DP_PROPERTIES_EXP_NAME, ZE_INTEL_DEVICE_MODULE_DP_PROPERTIES_EXP_VERSION_CURRENT}}; uint64_t uuidTimestamp = 0u; diff --git a/level_zero/core/test/black_box_tests/CMakeLists.txt b/level_zero/core/test/black_box_tests/CMakeLists.txt index 5bf15898f1..fa43038fea 100644 --- a/level_zero/core/test/black_box_tests/CMakeLists.txt +++ b/level_zero/core/test/black_box_tests/CMakeLists.txt @@ -37,6 +37,7 @@ set(TEST_TARGETS zello_bindless_kernel zello_commandlist_immediate zello_copy + zello_dp_support zello_copy_fence zello_copy_image zello_copy_kernel_printf diff --git a/level_zero/core/test/black_box_tests/zello_dp_support.cpp b/level_zero/core/test/black_box_tests/zello_dp_support.cpp new file mode 100644 index 0000000000..f721bd58c9 --- /dev/null +++ b/level_zero/core/test/black_box_tests/zello_dp_support.cpp @@ -0,0 +1,50 @@ +/* + * Copyright (C) 2023 Intel Corporation + * + * SPDX-License-Identifier: MIT + * + */ + +#include "../../../include/ze_intel_gpu.h" +#include "zello_common.h" + +#include +#include + +int main(int argc, char *argv[]) { + const std::string blackBoxName = "Zello DP Support"; + verbose = isVerbose(argc, argv); + bool aubMode = isAubMode(argc, argv); + + ze_context_handle_t context = {}; + ze_driver_handle_t driverHandle = {}; + auto devices = zelloInitContextAndGetDevices(context, driverHandle); + auto device = devices[0]; + + bool outputValidationSuccessful = true; + + ze_device_properties_t deviceProperties = {ZE_STRUCTURE_TYPE_DEVICE_PROPERTIES}; + SUCCESS_OR_TERMINATE(zeDeviceGetProperties(device, &deviceProperties)); + printDeviceProperties(deviceProperties); + + // Gather Dot Product (DP) support from driver + ze_device_module_properties_t deviceModProps = {ZE_STRUCTURE_TYPE_DEVICE_MODULE_PROPERTIES}; + ze_intel_device_module_dp_exp_properties_t moduleDpProps = {ZE_STRUCTURE_INTEL_DEVICE_MODULE_DP_EXP_PROPERTIES}; + deviceModProps.pNext = &moduleDpProps; + + SUCCESS_OR_TERMINATE(zeDeviceGetModuleProperties(device, &deviceModProps)); + + if (moduleDpProps.flags & ZE_INTEL_DEVICE_MODULE_EXP_FLAG_DP4A) { + printf("DP4A supported\n"); + } + + if (moduleDpProps.flags & ZE_INTEL_DEVICE_MODULE_EXP_FLAG_DPAS) { + printf("DPAS supported\n"); + } + + SUCCESS_OR_TERMINATE(zeContextDestroy(context)); + + printResult(aubMode, outputValidationSuccessful, blackBoxName); + outputValidationSuccessful = aubMode ? true : outputValidationSuccessful; + return (outputValidationSuccessful ? 0 : 1); +} \ No newline at end of file diff --git a/level_zero/core/test/unit_tests/gen12lp/test_device_gen12lp.cpp b/level_zero/core/test/unit_tests/gen12lp/test_device_gen12lp.cpp index a84ec89f84..ab4c50a3fb 100644 --- a/level_zero/core/test/unit_tests/gen12lp/test_device_gen12lp.cpp +++ b/level_zero/core/test/unit_tests/gen12lp/test_device_gen12lp.cpp @@ -10,6 +10,7 @@ #include "level_zero/core/source/cmdlist/cmdlist.h" #include "level_zero/core/test/unit_tests/fixtures/device_fixture.h" +#include "level_zero/include/ze_intel_gpu.h" namespace L0 { namespace ult { @@ -25,6 +26,21 @@ HWTEST2_F(DeviceFixtureGen12LP, GivenTargetGen12LPaWhenGettingMemoryPropertiesTh EXPECT_EQ(0u, memProperties.maxClockRate); } +HWTEST2_F(DeviceFixtureGen12LP, GivenTargetGen12LPWhenGettingDpSupportThenReturnsTrue, IsXeLpg) { + ze_device_module_properties_t deviceModProps = {ZE_STRUCTURE_TYPE_DEVICE_MODULE_PROPERTIES}; + ze_intel_device_module_dp_exp_properties_t moduleDpProps = {ZE_STRUCTURE_INTEL_DEVICE_MODULE_DP_EXP_PROPERTIES}; + moduleDpProps.flags = 0u; + deviceModProps.pNext = &moduleDpProps; + + ze_result_t res = device->getKernelProperties(&deviceModProps); + EXPECT_EQ(res, ZE_RESULT_SUCCESS); + + bool dp4a = moduleDpProps.flags & ZE_INTEL_DEVICE_MODULE_EXP_FLAG_DP4A; + bool dpas = moduleDpProps.flags & ZE_INTEL_DEVICE_MODULE_EXP_FLAG_DPAS; + EXPECT_TRUE(dp4a); + EXPECT_TRUE(dpas); +} + using CommandQueueGroupTest = Test; HWTEST2_F(CommandQueueGroupTest, diff --git a/level_zero/core/test/unit_tests/gen9/test_device_gen9.cpp b/level_zero/core/test/unit_tests/gen9/test_device_gen9.cpp index 27d36f4949..6928d1f5c8 100644 --- a/level_zero/core/test/unit_tests/gen9/test_device_gen9.cpp +++ b/level_zero/core/test/unit_tests/gen9/test_device_gen9.cpp @@ -9,6 +9,7 @@ #include "level_zero/core/source/cmdlist/cmdlist.h" #include "level_zero/core/test/unit_tests/fixtures/device_fixture.h" +#include "level_zero/include/ze_intel_gpu.h" namespace L0 { namespace ult { @@ -25,6 +26,23 @@ HWTEST2_F(DevicePropertyTest, givenReturnedDevicePropertiesThenExpectedPropertie EXPECT_EQ(ZE_DEVICE_PROPERTY_FLAG_INTEGRATED, deviceProps.flags & ZE_DEVICE_PROPERTY_FLAG_INTEGRATED); } +using DeviceTestGen9 = Test; + +HWTEST2_F(DeviceTestGen9, GivenTargetGen9WhenGettingDpSupportThenReturnsFalseAndFlagsSetCorrectly, IsAtMostGen9) { + ze_device_module_properties_t deviceModProps = {ZE_STRUCTURE_TYPE_DEVICE_MODULE_PROPERTIES}; + ze_intel_device_module_dp_exp_properties_t moduleDpProps = {ZE_STRUCTURE_INTEL_DEVICE_MODULE_DP_EXP_PROPERTIES}; + moduleDpProps.flags = 0u; + deviceModProps.pNext = &moduleDpProps; + + ze_result_t res = device->getKernelProperties(&deviceModProps); + EXPECT_EQ(res, ZE_RESULT_SUCCESS); + + bool dp4a = moduleDpProps.flags & ZE_INTEL_DEVICE_MODULE_EXP_FLAG_DP4A; + bool dpas = moduleDpProps.flags & ZE_INTEL_DEVICE_MODULE_EXP_FLAG_DPAS; + EXPECT_FALSE(dp4a); + EXPECT_FALSE(dpas); +} + using CommandQueueGroupTest = Test; HWTEST2_F(CommandQueueGroupTest, givenCommandQueuePropertiesCallThenCorrectNumberOfGroupsIsReturned, IsGen9) { diff --git a/level_zero/core/test/unit_tests/xe_hpc_core/test_device_xe_hpc_core.cpp b/level_zero/core/test/unit_tests/xe_hpc_core/test_device_xe_hpc_core.cpp index 6efd46e355..0035e0e275 100644 --- a/level_zero/core/test/unit_tests/xe_hpc_core/test_device_xe_hpc_core.cpp +++ b/level_zero/core/test/unit_tests/xe_hpc_core/test_device_xe_hpc_core.cpp @@ -16,6 +16,7 @@ #include "level_zero/core/source/cmdqueue/cmdqueue.h" #include "level_zero/core/source/gfx_core_helpers/l0_gfx_core_helper.h" #include "level_zero/core/test/unit_tests/fixtures/device_fixture.h" +#include "level_zero/include/ze_intel_gpu.h" namespace L0 { namespace ult { @@ -90,6 +91,21 @@ HWTEST2_F(DeviceTestXeHpc, givenXeHpcBStepWhenCreatingMultiTileDeviceThenExpectI delete device; } +HWTEST2_F(DeviceTestXeHpc, GivenTargetXeHPCWhenGettingDpSupportThenReturnsTrue, IsXeHpcCore) { + ze_device_module_properties_t deviceModProps = {ZE_STRUCTURE_TYPE_DEVICE_MODULE_PROPERTIES}; + ze_intel_device_module_dp_exp_properties_t moduleDpProps = {ZE_STRUCTURE_INTEL_DEVICE_MODULE_DP_EXP_PROPERTIES}; + moduleDpProps.flags = 0u; + deviceModProps.pNext = &moduleDpProps; + + ze_result_t res = device->getKernelProperties(&deviceModProps); + EXPECT_EQ(res, ZE_RESULT_SUCCESS); + + bool dp4a = moduleDpProps.flags & ZE_INTEL_DEVICE_MODULE_EXP_FLAG_DP4A; + bool dpas = moduleDpProps.flags & ZE_INTEL_DEVICE_MODULE_EXP_FLAG_DPAS; + EXPECT_TRUE(dp4a); + EXPECT_TRUE(dpas); +} + using MultiDeviceCommandQueueGroupWithNineCopyEnginesTest = Test>; HWTEST2_F(MultiDeviceCommandQueueGroupWithNineCopyEnginesTest, givenMainAndLinkCopyEngineSupportAndCCSAndImplicitScalingThenExpectedQueueGroupsAreReturned, IsXeHpcCore) { diff --git a/level_zero/doc/experimental_extensions/MODULE_DP_SUPPORT.md b/level_zero/doc/experimental_extensions/MODULE_DP_SUPPORT.md new file mode 100644 index 0000000000..d2ade30734 --- /dev/null +++ b/level_zero/doc/experimental_extensions/MODULE_DP_SUPPORT.md @@ -0,0 +1,73 @@ + + +# Device Module Dot Product Properties Extension + +* [Overview](#Overview) +* [Definitions](#Definitions) +* [Known Issues and Limitations](#Known-Issues-and-Limitations) + +# Overview + +Users often need information regarding Dot Product (DP) support available in platform prior to adding reliable GPU support. This extension provides a new property to gather the required platform support information from driver. + +# Definitions + +## Interfaces + +```cpp +/////////////////////////////////////////////////////////////////////////////// +/// @brief Supported Dot Product flags +typedef uint32_t ze_intel_device_module_dp_exp_flags_t; +typedef enum _ze_intel_device_module_dp_exp_flag_t { + ZE_INTEL_DEVICE_MODULE_EXP_FLAG_DP4A = ZE_BIT(0), ///< Supports DP4A operation + ZE_INTEL_DEVICE_MODULE_EXP_FLAG_DPAS = ZE_BIT(1), ///< Supports DPAS operation + ZE_INTEL_DEVICE_MODULE_EXP_FLAG_FORCE_UINT32 = 0x7fffffff + +} ze_intel_device_module_dp_exp_flag_t; + +/////////////////////////////////////////////////////////////////////////////// +#define ZE_STRUCTURE_INTEL_DEVICE_MODULE_DP_EXP_PROPERTIES (ze_structure_type_t)0x00030013 +/////////////////////////////////////////////////////////////////////////////// +/// @brief Device Module dot product properties queried using +/// ::zeDeviceGetModuleProperties +/// +/// @details +/// - This structure may be passed to ::zeDeviceGetModuleProperties, via +/// `pNext` member of ::ze_device_module_properties_t. +/// @brief Device module dot product properties +typedef struct _ze_intel_device_module_dp_exp_properties_t { + ze_structure_type_t stype = ZE_STRUCTURE_INTEL_DEVICE_MODULE_DP_EXP_PROPERTIES; ///< [in] type of this structure + void *pNext; ///< [in,out][optional] must be null or a pointer to an extension-specific + ///< structure (i.e. contains sType and pNext). + ze_intel_device_module_dp_exp_flags_t flags; ///< [out] 0 (none) or a valid combination of ::ze_intel_device_module_dp_flag_t +} ze_intel_device_module_dp_exp_properties_t; +``` + +## Programming example + +```cpp + + ze_device_module_properties_t deviceModProps = {ZE_STRUCTURE_TYPE_DEVICE_MODULE_PROPERTIES}; + ze_intel_device_module_dp_exp_properties_t moduleDpProps = {ZE_STRUCTURE_INTEL_DEVICE_MODULE_DP_EXP_PROPERTIES}; + deviceModProps.pNext = &moduleDpProps; + + SUCCESS_OR_TERMINATE(zeDeviceGetModuleProperties(device, &deviceModProps)); + + if (moduleDpProps.flags & ZE_INTEL_DEVICE_MODULE_EXP_FLAG_DP4A) { + printf("DP4A supported\n"); + } + + if (moduleDpProps.flags & ZE_INTEL_DEVICE_MODULE_EXP_FLAG_DPAS) { + printf("DPAS supported\n"); + } + +``` + +# Known Issues and Limitations + diff --git a/level_zero/include/ze_intel_gpu.h b/level_zero/include/ze_intel_gpu.h new file mode 100644 index 0000000000..019790b160 --- /dev/null +++ b/level_zero/include/ze_intel_gpu.h @@ -0,0 +1,69 @@ +/* + * Copyright (C) 2020-2023 Intel Corporation + * + * SPDX-License-Identifier: MIT + * + */ + +#ifndef _ZE_INTEL_GPU_H +#define _ZE_INTEL_GPU_H + +#include + +#if defined(__cplusplus) +#pragma once +extern "C" { +#endif + +#include + +#define ZE_INTEL_GPU_VERSION_MAJOR 0 +#define ZE_INTEL_GPU_VERSION_MINOR 1 + +/////////////////////////////////////////////////////////////////////////////// +#ifndef ZE_INTEL_DEVICE_MODULE_DP_PROPERTIES_EXP_NAME +/// @brief Module DP properties driver extension name +#define ZE_INTEL_DEVICE_MODULE_DP_PROPERTIES_EXP_NAME "ZE_intel_experimental_device_module_dp_properties" +#endif // ZE_INTEL_DEVICE_MODULE_DP_PROPERTIES_EXP_NAME + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Module DP properties driver extension Version(s) +typedef enum _ze_intel_device_module_dp_properties_exp_version_t { + ZE_INTEL_DEVICE_MODULE_DP_PROPERTIES_EXP_VERSION_1_0 = ZE_MAKE_VERSION(1, 0), ///< version 1.0 + ZE_INTEL_DEVICE_MODULE_DP_PROPERTIES_EXP_VERSION_CURRENT = ZE_MAKE_VERSION(1, 0), ///< latest known version + ZE_INTEL_DEVICE_MODULE_DP_PROPERTIES_EXP_VERSION_FORCE_UINT32 = 0x7fffffff + +} ze_intel_device_module_dp_properties_exp_version_t; + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Supported Dot Product flags +typedef uint32_t ze_intel_device_module_dp_exp_flags_t; +typedef enum _ze_intel_device_module_dp_exp_flag_t { + ZE_INTEL_DEVICE_MODULE_EXP_FLAG_DP4A = ZE_BIT(0), ///< Supports DP4A operation + ZE_INTEL_DEVICE_MODULE_EXP_FLAG_DPAS = ZE_BIT(1), ///< Supports DPAS operation + ZE_INTEL_DEVICE_MODULE_EXP_FLAG_FORCE_UINT32 = 0x7fffffff + +} ze_intel_device_module_dp_exp_flag_t; + +/////////////////////////////////////////////////////////////////////////////// +#define ZE_STRUCTURE_INTEL_DEVICE_MODULE_DP_EXP_PROPERTIES (ze_structure_type_t)0x00030013 +/////////////////////////////////////////////////////////////////////////////// +/// @brief Device Module dot product properties queried using +/// ::zeDeviceGetModuleProperties +/// +/// @details +/// - This structure may be passed to ::zeDeviceGetModuleProperties, via +/// `pNext` member of ::ze_device_module_properties_t. +/// @brief Device module dot product properties +typedef struct _ze_intel_device_module_dp_exp_properties_t { + ze_structure_type_t stype = ZE_STRUCTURE_INTEL_DEVICE_MODULE_DP_EXP_PROPERTIES; ///< [in] type of this structure + void *pNext; ///< [in,out][optional] must be null or a pointer to an extension-specific + ///< structure (i.e. contains sType and pNext). + ze_intel_device_module_dp_exp_flags_t flags; ///< [out] 0 (none) or a valid combination of ::ze_intel_device_module_dp_flag_t +} ze_intel_device_module_dp_exp_properties_t; + +#if defined(__cplusplus) +} // extern "C" +#endif + +#endif // _ZE_INTEL_GPU_H \ No newline at end of file diff --git a/level_zero/source/inc/ze_intel_gpu.h b/level_zero/source/inc/ze_intel_gpu.h deleted file mode 100644 index dac5b961c5..0000000000 --- a/level_zero/source/inc/ze_intel_gpu.h +++ /dev/null @@ -1,19 +0,0 @@ -/* - * Copyright (C) 2020-2023 Intel Corporation - * - * SPDX-License-Identifier: MIT - * - */ - -#pragma once - -#include -#include -#include - -inline bool getEnvToBool(const char *name) { - const char *env = getenv(name); - if ((nullptr == env) || (0 == strcmp("0", env))) - return false; - return (0 == strcmp("1", env)); -} diff --git a/level_zero/tools/source/metrics/metric.cpp b/level_zero/tools/source/metrics/metric.cpp index 9f8cef74be..9d38c0f597 100644 --- a/level_zero/tools/source/metrics/metric.cpp +++ b/level_zero/tools/source/metrics/metric.cpp @@ -14,7 +14,6 @@ #include "level_zero/core/source/device/device_imp.h" #include "level_zero/core/source/driver/driver.h" #include "level_zero/core/source/driver/driver_handle_imp.h" -#include "level_zero/source/inc/ze_intel_gpu.h" #include "level_zero/tools/source/metrics/metric_ip_sampling_source.h" #include "level_zero/tools/source/metrics/metric_oa_source.h" diff --git a/shared/source/os_interface/product_helper.h b/shared/source/os_interface/product_helper.h index 8b2304078e..81e10a3543 100644 --- a/shared/source/os_interface/product_helper.h +++ b/shared/source/os_interface/product_helper.h @@ -166,6 +166,8 @@ class ProductHelper { virtual bool isTranslationExceptionSupported() const = 0; virtual uint32_t getMaxNumSamplers() const = 0; virtual uint32_t getCommandBuffersPreallocatedPerCommandQueue() const = 0; + virtual bool isPlatformDpasSupported() const = 0; + virtual bool isPlatformDp4aSupported() const = 0; virtual bool getFrontEndPropertyScratchSizeSupport() const = 0; virtual bool getFrontEndPropertyPrivateScratchSizeSupport() const = 0; diff --git a/shared/source/os_interface/product_helper.inl b/shared/source/os_interface/product_helper.inl index d0311007fe..93f9d3daf0 100644 --- a/shared/source/os_interface/product_helper.inl +++ b/shared/source/os_interface/product_helper.inl @@ -166,6 +166,16 @@ uint64_t ProductHelperHw::getDeviceMemoryMaxBandWidthInBytesPerSecon return 0; } +template +bool ProductHelperHw::isPlatformDpasSupported() const { + return false; +} + +template +bool ProductHelperHw::isPlatformDp4aSupported() const { + return false; +} + template bool ProductHelperHw::isAdditionalStateBaseAddressWARequired(const HardwareInfo &hwInfo) const { return false; diff --git a/shared/source/os_interface/product_helper_hw.h b/shared/source/os_interface/product_helper_hw.h index 8c05edc056..9c7dc5bbf1 100644 --- a/shared/source/os_interface/product_helper_hw.h +++ b/shared/source/os_interface/product_helper_hw.h @@ -120,6 +120,8 @@ class ProductHelperHw : public ProductHelper { bool isTranslationExceptionSupported() const override; uint32_t getMaxNumSamplers() const override; uint32_t getCommandBuffersPreallocatedPerCommandQueue() const override; + bool isPlatformDpasSupported() const override; + bool isPlatformDp4aSupported() const override; bool getFrontEndPropertyScratchSizeSupport() const override; bool getFrontEndPropertyPrivateScratchSizeSupport() const override; diff --git a/shared/source/xe_hpc_core/os_agnostic_product_helper_xe_hpc_core.inl b/shared/source/xe_hpc_core/os_agnostic_product_helper_xe_hpc_core.inl index 0e804ec762..251d1e0b9c 100644 --- a/shared/source/xe_hpc_core/os_agnostic_product_helper_xe_hpc_core.inl +++ b/shared/source/xe_hpc_core/os_agnostic_product_helper_xe_hpc_core.inl @@ -51,4 +51,14 @@ uint32_t ProductHelperHw::getMaxNumSamplers() const { return 0u; } +template <> +bool ProductHelperHw::isPlatformDpasSupported() const { + return true; +} + +template <> +bool ProductHelperHw::isPlatformDp4aSupported() const { + return true; +} + } // namespace NEO diff --git a/shared/source/xe_hpg_core/xe_lpg/os_agnostic_product_helper_xe_lpg.inl b/shared/source/xe_hpg_core/xe_lpg/os_agnostic_product_helper_xe_lpg.inl index 49d533ef1d..b9e2fdfe13 100644 --- a/shared/source/xe_hpg_core/xe_lpg/os_agnostic_product_helper_xe_lpg.inl +++ b/shared/source/xe_hpg_core/xe_lpg/os_agnostic_product_helper_xe_lpg.inl @@ -81,4 +81,14 @@ uint64_t ProductHelperHw::overridePatIndex(bool isUncachedType, uint return patIndex; } +template <> +bool ProductHelperHw::isPlatformDpasSupported() const { + return true; +} + +template <> +bool ProductHelperHw::isPlatformDp4aSupported() const { + return true; +} + } // namespace NEO diff --git a/shared/test/common/mocks/mock_product_helper.cpp b/shared/test/common/mocks/mock_product_helper.cpp index 4693981f93..3076a7f96f 100644 --- a/shared/test/common/mocks/mock_product_helper.cpp +++ b/shared/test/common/mocks/mock_product_helper.cpp @@ -337,6 +337,16 @@ bool ProductHelperHw::isTimestampWaitSupportedForEvents() const { return false; } +template <> +bool ProductHelperHw::isPlatformDpasSupported() const { + return false; +} + +template <> +bool ProductHelperHw::isPlatformDp4aSupported() const { + return false; +} + template <> uint64_t ProductHelperHw::getHostMemCapabilitiesValue() const { return 0; diff --git a/shared/test/unit_test/os_interface/product_helper_tests.cpp b/shared/test/unit_test/os_interface/product_helper_tests.cpp index 1292fb7eb5..d8e97eae9a 100644 --- a/shared/test/unit_test/os_interface/product_helper_tests.cpp +++ b/shared/test/unit_test/os_interface/product_helper_tests.cpp @@ -380,6 +380,12 @@ HWTEST2_F(ProductHelperTest, givenProductHelperWhenSettingCapabilityCoherencyFla EXPECT_TRUE(coherency); } +HWTEST2_F(ProductHelperTest, givenProductHelperWhenDotProductSupportThenReturnsFalse, IsAtMostGen11) { + + EXPECT_FALSE(productHelper->isPlatformDp4aSupported()); + EXPECT_FALSE(productHelper->isPlatformDpasSupported()); +} + HWTEST_F(ProductHelperTest, givenProductHelperWhenAskedIfAdditionalMediaSamplerProgrammingIsRequiredThenFalseIsReturned) { EXPECT_FALSE(productHelper->isAdditionalMediaSamplerProgrammingRequired()); diff --git a/shared/test/unit_test/xe_hpc_core/gfx_core_helper_xe_hpc_core_tests.cpp b/shared/test/unit_test/xe_hpc_core/gfx_core_helper_xe_hpc_core_tests.cpp index fec769a9f6..d1dfb620be 100644 --- a/shared/test/unit_test/xe_hpc_core/gfx_core_helper_xe_hpc_core_tests.cpp +++ b/shared/test/unit_test/xe_hpc_core/gfx_core_helper_xe_hpc_core_tests.cpp @@ -74,6 +74,16 @@ XE_HPC_CORETEST_F(ProductHelperTestXeHpcCore, givenProductHelperWhenCheckTimesta EXPECT_TRUE(helper.isTimestampWaitSupportedForEvents()); } +XE_HPC_CORETEST_F(ProductHelperTestXeHpcCore, givenProductHelperWhenCheckDpasSupportThenReturnTrue) { + auto &helper = getHelper(); + EXPECT_TRUE(helper.isPlatformDpasSupported()); +} + +XE_HPC_CORETEST_F(ProductHelperTestXeHpcCore, givenProductHelperWhenCheckDp4aSupportThenReturnTrue) { + auto &helper = getHelper(); + EXPECT_TRUE(helper.isPlatformDp4aSupported()); +} + XE_HPC_CORETEST_F(GfxCoreHelperTest, givenGfxCoreHelperWhenCallCopyThroughLockedPtrEnabledThenReturnTrue) { const auto &gfxCoreHelper = getHelper(); const auto &productHelper = getHelper(); diff --git a/shared/test/unit_test/xe_hpg_core/os_agnostic_product_helper_xe_lpg_tests.cpp b/shared/test/unit_test/xe_hpg_core/os_agnostic_product_helper_xe_lpg_tests.cpp index 136608d167..035462204c 100644 --- a/shared/test/unit_test/xe_hpg_core/os_agnostic_product_helper_xe_lpg_tests.cpp +++ b/shared/test/unit_test/xe_hpg_core/os_agnostic_product_helper_xe_lpg_tests.cpp @@ -205,6 +205,14 @@ HWTEST2_F(XeLpgProductHelperTests, givenProductHelperWhenCheckBlitEnqueueAllowed EXPECT_FALSE(productHelper->blitEnqueueAllowed()); } +HWTEST2_F(XeLpgProductHelperTests, givenProductHelperWhenCheckDpasSupportedThenReturnTrue, IsXeLpg) { + EXPECT_TRUE(productHelper->isPlatformDpasSupported()); +} + +HWTEST2_F(XeLpgProductHelperTests, givenProductHelperWhenCheckDp4aSupportedThenReturnTrue, IsXeLpg) { + EXPECT_TRUE(productHelper->isPlatformDp4aSupported()); +} + HWTEST2_F(XeLpgProductHelperTests, givenProductHelperWhenGetCommandsStreamPropertiesSupportThenExpectCorrectValues, IsXeLpg) { EXPECT_FALSE(productHelper->getScmPropertyThreadArbitrationPolicySupport());