Add hwInfo as argument to method getSupportedDeviceFeatureCapabilities

set proper value in method isMatrixMultiplyAccumulateSupported to be
consistent with support of extension *matrix_multiply_accumulate*

Signed-off-by: Katarzyna Cencelewska <katarzyna.cencelewska@intel.com>
This commit is contained in:
Katarzyna Cencelewska
2022-06-10 13:16:04 +00:00
committed by Compute-Runtime-Automation
parent 5510dc7daa
commit c59c4b2957
19 changed files with 51 additions and 35 deletions

View File

@ -281,8 +281,9 @@ cl_int ClDevice::getDeviceInfo(cl_device_info paramName,
break;
}
case CL_DEVICE_FEATURE_CAPABILITIES_INTEL: {
auto &clHwHelper = ClHwHelper::get(getHardwareInfo().platform.eRenderCoreFamily);
param.bitfield = clHwHelper.getSupportedDeviceFeatureCapabilities();
auto &hwInfo = getHardwareInfo();
auto &clHwHelper = ClHwHelper::get(hwInfo.platform.eRenderCoreFamily);
param.bitfield = clHwHelper.getSupportedDeviceFeatureCapabilities(hwInfo);
src = &param.bitfield;
retSize = srcSize = sizeof(cl_device_feature_capabilities_intel);
break;

View File

@ -1,5 +1,5 @@
/*
* Copyright (C) 2020-2021 Intel Corporation
* Copyright (C) 2020-2022 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
@ -24,7 +24,7 @@ void populateFactoryTable<ClHwHelperHw<Family>>() {
}
template <>
cl_device_feature_capabilities_intel ClHwHelperHw<Family>::getSupportedDeviceFeatureCapabilities() const {
cl_device_feature_capabilities_intel ClHwHelperHw<Family>::getSupportedDeviceFeatureCapabilities(const HardwareInfo &hwInfo) const {
return CL_DEVICE_FEATURE_FLAG_DP4A_INTEL;
}

View File

@ -1,5 +1,5 @@
/*
* Copyright (C) 2020-2021 Intel Corporation
* Copyright (C) 2020-2022 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
@ -9,5 +9,5 @@
namespace NEO {
void ClDeviceHelper::getExtraDeviceInfo(const ClDevice &clDevice, cl_device_info paramName, ClDeviceInfoParam &param, const void *&src, size_t &size, size_t &retSize) {}
cl_device_feature_capabilities_intel ClDeviceHelper::getExtraCapabilities() { return 0; }
cl_device_feature_capabilities_intel ClDeviceHelper::getExtraCapabilities(const HardwareInfo &hwInfo) { return 0; }
} // namespace NEO

View File

@ -1,5 +1,5 @@
/*
* Copyright (C) 2020-2021 Intel Corporation
* Copyright (C) 2020-2022 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
@ -14,9 +14,10 @@
namespace NEO {
class ClDevice;
struct ClDeviceInfoParam;
struct HardwareInfo;
namespace ClDeviceHelper {
void getExtraDeviceInfo(const ClDevice &clDevice, cl_device_info paramName, ClDeviceInfoParam &param, const void *&src, size_t &size, size_t &retSize);
cl_device_feature_capabilities_intel getExtraCapabilities();
cl_device_feature_capabilities_intel getExtraCapabilities(const HardwareInfo &hwInfo);
}; // namespace ClDeviceHelper
} // namespace NEO

View File

@ -1,5 +1,5 @@
/*
* Copyright (C) 2020-2021 Intel Corporation
* Copyright (C) 2020-2022 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
@ -39,7 +39,7 @@ class ClHwHelper {
virtual bool isSupportedKernelThreadArbitrationPolicy() const = 0;
virtual std::vector<uint32_t> getSupportedThreadArbitrationPolicies() const = 0;
virtual cl_version getDeviceIpVersion(const HardwareInfo &hwInfo) const = 0;
virtual cl_device_feature_capabilities_intel getSupportedDeviceFeatureCapabilities() const = 0;
virtual cl_device_feature_capabilities_intel getSupportedDeviceFeatureCapabilities(const HardwareInfo &hwInfo) const = 0;
virtual bool allowImageCompression(cl_image_format format) const = 0;
virtual bool isFormatRedescribable(cl_image_format format) const = 0;
@ -70,7 +70,7 @@ class ClHwHelperHw : public ClHwHelper {
bool isSupportedKernelThreadArbitrationPolicy() const override;
std::vector<uint32_t> getSupportedThreadArbitrationPolicies() const override;
cl_version getDeviceIpVersion(const HardwareInfo &hwInfo) const override;
cl_device_feature_capabilities_intel getSupportedDeviceFeatureCapabilities() const override;
cl_device_feature_capabilities_intel getSupportedDeviceFeatureCapabilities(const HardwareInfo &hwInfo) const override;
bool allowImageCompression(cl_image_format format) const override;
bool isFormatRedescribable(cl_image_format format) const override;

View File

@ -1,5 +1,5 @@
/*
* Copyright (C) 2021 Intel Corporation
* Copyright (C) 2021-2022 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
@ -24,7 +24,7 @@ cl_ulong ClHwHelperHw<GfxFamily>::getKernelPrivateMemSize(const KernelInfo &kern
}
template <typename GfxFamily>
cl_device_feature_capabilities_intel ClHwHelperHw<GfxFamily>::getSupportedDeviceFeatureCapabilities() const {
cl_device_feature_capabilities_intel ClHwHelperHw<GfxFamily>::getSupportedDeviceFeatureCapabilities(const HardwareInfo &hwInfo) const {
return 0;
}

View File

@ -1,5 +1,5 @@
/*
* Copyright (C) 2021 Intel Corporation
* Copyright (C) 2021-2022 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
@ -22,8 +22,8 @@ cl_ulong ClHwHelperHw<GfxFamily>::getKernelPrivateMemSize(const KernelInfo &kern
}
template <typename GfxFamily>
cl_device_feature_capabilities_intel ClHwHelperHw<GfxFamily>::getSupportedDeviceFeatureCapabilities() const {
return ClDeviceHelper::getExtraCapabilities();
cl_device_feature_capabilities_intel ClHwHelperHw<GfxFamily>::getSupportedDeviceFeatureCapabilities(const HardwareInfo &hwInfo) const {
return ClDeviceHelper::getExtraCapabilities(hwInfo);
}
template <typename GfxFamily>

View File

@ -1126,7 +1126,7 @@ struct DeviceAttributeQueryTest : public ::testing::TestWithParam<uint32_t /*cl_
auto pCapabilities = reinterpret_cast<cl_device_feature_capabilities_intel *>(object.get());
auto &hwInfo = device.getHardwareInfo();
auto &clHwHelper = ClHwHelper::get(hwInfo.platform.eRenderCoreFamily);
EXPECT_EQ(clHwHelper.getSupportedDeviceFeatureCapabilities(), *pCapabilities);
EXPECT_EQ(clHwHelper.getSupportedDeviceFeatureCapabilities(hwInfo), *pCapabilities);
EXPECT_EQ(sizeof(cl_device_feature_capabilities_intel), sizeReturned);
break;
}

View File

@ -1,5 +1,5 @@
/*
* Copyright (C) 2019-2021 Intel Corporation
* Copyright (C) 2019-2022 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
@ -41,7 +41,7 @@ GEN11TEST_F(HwHelperTestGen11, WhenGettingDeviceIpVersionThenMakeCorrectDeviceIp
}
GEN11TEST_F(HwHelperTestGen11, WhenGettingSupportedDeviceFeatureCapabilitiesThenReturnCorrectValue) {
EXPECT_EQ(0u, ClHwHelper::get(renderCoreFamily).getSupportedDeviceFeatureCapabilities());
EXPECT_EQ(0u, ClHwHelper::get(renderCoreFamily).getSupportedDeviceFeatureCapabilities(hardwareInfo));
}
using MemorySynchronizatiopCommandsTestsGen11 = ::testing::Test;

View File

@ -413,7 +413,7 @@ HWTEST2_F(HwHelperTestGen12Lp, WhenGettingDeviceIpVersionThenMakeCorrectDeviceIp
GEN12LPTEST_F(HwHelperTestGen12Lp, WhenGettingSupportedDeviceFeatureCapabilitiesThenReturnCorrectValue) {
cl_device_feature_capabilities_intel expectedCapabilities = CL_DEVICE_FEATURE_FLAG_DP4A_INTEL;
EXPECT_EQ(expectedCapabilities, ClHwHelper::get(renderCoreFamily).getSupportedDeviceFeatureCapabilities());
EXPECT_EQ(expectedCapabilities, ClHwHelper::get(renderCoreFamily).getSupportedDeviceFeatureCapabilities(hardwareInfo));
}
GEN12LPTEST_F(HwHelperTestGen12Lp, givenLocalMemoryFeatureDisabledWhenIsLocalMemoryEnabledIsCalledThenTrueIsReturned) {

View File

@ -1,5 +1,5 @@
/*
* Copyright (C) 2021 Intel Corporation
* Copyright (C) 2021-2022 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
@ -19,5 +19,5 @@ GEN8TEST_F(ClHwHelperTestGen8, WhenGettingDeviceIpVersionThenMakeCorrectDeviceIp
}
GEN8TEST_F(ClHwHelperTestGen8, WhenGettingSupportedDeviceFeatureCapabilitiesThenReturnCorrectValue) {
EXPECT_EQ(0u, ClHwHelper::get(renderCoreFamily).getSupportedDeviceFeatureCapabilities());
EXPECT_EQ(0u, ClHwHelper::get(renderCoreFamily).getSupportedDeviceFeatureCapabilities(*defaultHwInfo));
}

View File

@ -1,5 +1,5 @@
/*
* Copyright (C) 2018-2021 Intel Corporation
* Copyright (C) 2018-2022 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
@ -53,7 +53,7 @@ GEN9TEST_F(HwHelperTestGen9, WhenGettingDeviceIpVersionThenMakeCorrectDeviceIpVe
}
GEN9TEST_F(HwHelperTestGen9, WhenGettingSupportedDeviceFeatureCapabilitiesThenReturnCorrectValue) {
EXPECT_EQ(0u, ClHwHelper::get(renderCoreFamily).getSupportedDeviceFeatureCapabilities());
EXPECT_EQ(0u, ClHwHelper::get(renderCoreFamily).getSupportedDeviceFeatureCapabilities(*defaultHwInfo));
}
using MemorySynchronizatiopCommandsTestsGen9 = ::testing::Test;

View File

@ -494,3 +494,7 @@ HWCMDTEST_F(IGFX_XE_HP_CORE, HwInfoConfigTestXeHpAndLater, givenCLImageFormatsWh
EXPECT_EQ(false, clHwHelper.isFormatRedescribable(format));
}
}
HWCMDTEST_F(IGFX_XE_HP_CORE, HwHelperTestXeHPAndLater, givenHwInfosWhenIsMatrixMultiplyAccumulateSupportedThenReturnTrue) {
EXPECT_TRUE(HwInfoConfig::get(productFamily)->isMatrixMultiplyAccumulateSupported(*defaultHwInfo));
}

View File

@ -413,9 +413,4 @@ bool HwInfoConfigHw<gfxProduct>::isImplicitScalingSupported(const HardwareInfo &
return false;
}
template <PRODUCT_FAMILY gfxProduct>
bool HwInfoConfigHw<gfxProduct>::isMatrixMultiplyAccumulateSupported(const HardwareInfo &hwInfo) const {
return false;
}
} // namespace NEO

View File

@ -70,4 +70,8 @@ bool HwInfoConfigHw<gfxProduct>::useChannelRedForUnusedShaderChannels() const {
return true;
}
template <PRODUCT_FAMILY gfxProduct>
bool HwInfoConfigHw<gfxProduct>::isMatrixMultiplyAccumulateSupported(const HardwareInfo &hwInfo) const {
return false;
}
} // namespace NEO

View File

@ -67,4 +67,9 @@ bool HwInfoConfigHw<gfxProduct>::useChannelRedForUnusedShaderChannels() const {
return true;
}
template <PRODUCT_FAMILY gfxProduct>
bool HwInfoConfigHw<gfxProduct>::isMatrixMultiplyAccumulateSupported(const HardwareInfo &hwInfo) const {
return true;
}
} // namespace NEO

View File

@ -180,8 +180,3 @@ template <>
bool HwInfoConfigHw<gfxProduct>::isTimestampWaitSupportedForEvents() const {
return true;
}
template <>
bool HwInfoConfigHw<gfxProduct>::isMatrixMultiplyAccumulateSupported(const HardwareInfo &hwInfo) const {
return true;
}

View File

@ -342,6 +342,11 @@ bool HwInfoConfigHw<IGFX_UNKNOWN>::isBFloat16ConversionSupported(const HardwareI
return false;
}
template <>
bool HwInfoConfigHw<IGFX_UNKNOWN>::isMatrixMultiplyAccumulateSupported(const HardwareInfo &hwInfo) const {
return false;
}
template <>
bool HwInfoConfigHw<IGFX_UNKNOWN>::useChannelRedForUnusedShaderChannels() const {
return false;

View File

@ -1,11 +1,12 @@
/*
* Copyright (C) 2018-2021 Intel Corporation
* Copyright (C) 2018-2022 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
*/
#include "shared/source/helpers/constants.h"
#include "shared/source/os_interface/hw_info_config.h"
#include "shared/test/common/cmd_parse/gen_cmd_parse.h"
#include "shared/test/common/helpers/hw_helper_tests.h"
#include "shared/test/unit_test/helpers/get_gpgpu_engines_tests.inl"
@ -46,3 +47,8 @@ GEN8TEST_F(MemorySynchronizatiopCommandsTestsGen8, WhenProgrammingCacheFlushThen
ASSERT_NE(nullptr, pipeControl);
EXPECT_TRUE(pipeControl->getConstantCacheInvalidationEnable());
}
using HwInfoConfigTestGen8 = Test<DeviceFixture>;
GEN8TEST_F(HwInfoConfigTestGen8, givenHwInfosWhenIsMatrixMultiplyAccumulateSupportedThenReturnFalse) {
EXPECT_FALSE(HwInfoConfig::get(productFamily)->isMatrixMultiplyAccumulateSupported(*defaultHwInfo));
}