refactor: move methods from CompilerProductHelper to ReleaseHelper

Related-To: NEO-7786
Signed-off-by: Mateusz Jablonski <mateusz.jablonski@intel.com>
This commit is contained in:
Mateusz Jablonski
2023-08-01 15:03:43 +00:00
committed by Compute-Runtime-Automation
parent 12ab74fe96
commit 659f7b645f
48 changed files with 151 additions and 294 deletions

View File

@@ -46,9 +46,7 @@ set(NEO_CORE_HELPERS
${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_product_config_default.inl
${CMAKE_CURRENT_SOURCE_DIR}/compiler_product_helper_tgllp_and_later.inl

View File

@@ -38,8 +38,8 @@ class CompilerProductHelper {
virtual bool isForceEmuInt32DivRemSPRequired() const = 0;
virtual bool isStatelessToStatefulBufferOffsetSupported() const = 0;
virtual bool isMatrixMultiplyAccumulateSupported(const ReleaseHelper *releaseHelper) const = 0;
virtual bool isSplitMatrixMultiplyAccumulateSupported(const HardwareInfo &hwInfo) const = 0;
virtual bool isBFloat16ConversionSupported(const HardwareInfo &hwInfo) const = 0;
virtual bool isSplitMatrixMultiplyAccumulateSupported(const ReleaseHelper *releaseHelper) const = 0;
virtual bool isBFloat16ConversionSupported(const ReleaseHelper *releaseHelper) const = 0;
virtual bool isSubgroupLocalBlockIoSupported() const = 0;
virtual bool isDotAccumulateSupported() const = 0;
virtual bool isCreateBufferWithPropertiesSupported() const = 0;
@@ -76,8 +76,8 @@ class CompilerProductHelperHw : public CompilerProductHelper {
bool isForceEmuInt32DivRemSPRequired() const override;
bool isStatelessToStatefulBufferOffsetSupported() const override;
bool isMatrixMultiplyAccumulateSupported(const ReleaseHelper *releaseHelper) const override;
bool isSplitMatrixMultiplyAccumulateSupported(const HardwareInfo &hwInfo) const override;
bool isBFloat16ConversionSupported(const HardwareInfo &hwInfo) const override;
bool isSplitMatrixMultiplyAccumulateSupported(const ReleaseHelper *releaseHelper) const override;
bool isBFloat16ConversionSupported(const ReleaseHelper *releaseHelper) const override;
bool isSubgroupLocalBlockIoSupported() const override;
bool isDotAccumulateSupported() const override;
bool isCreateBufferWithPropertiesSupported() const override;

View File

@@ -156,7 +156,7 @@ std::string CompilerProductHelperHw<gfxProduct>::getDeviceExtensions(const Hardw
extensions += "cl_intel_media_block_io ";
}
if (isBFloat16ConversionSupported(hwInfo)) {
if (isBFloat16ConversionSupported(releaseHelper)) {
extensions += "cl_intel_bfloat16_conversions ";
}
@@ -176,7 +176,7 @@ std::string CompilerProductHelperHw<gfxProduct>::getDeviceExtensions(const Hardw
extensions += "cl_intel_subgroup_matrix_multiply_accumulate ";
}
if (isSplitMatrixMultiplyAccumulateSupported(hwInfo)) {
if (isSplitMatrixMultiplyAccumulateSupported(releaseHelper)) {
extensions += "cl_intel_subgroup_split_matrix_multiply_accumulate ";
}
@@ -206,4 +206,20 @@ bool CompilerProductHelperHw<gfxProduct>::isMatrixMultiplyAccumulateSupported(co
return false;
}
template <PRODUCT_FAMILY gfxProduct>
bool CompilerProductHelperHw<gfxProduct>::isSplitMatrixMultiplyAccumulateSupported(const ReleaseHelper *releaseHelper) const {
if (releaseHelper) {
return releaseHelper->isSplitMatrixMultiplyAccumulateSupported();
}
return false;
}
template <PRODUCT_FAMILY gfxProduct>
bool CompilerProductHelperHw<gfxProduct>::isBFloat16ConversionSupported(const ReleaseHelper *releaseHelper) const {
if (releaseHelper) {
return releaseHelper->isBFloat16ConversionSupported();
}
return false;
}
} // namespace NEO

View File

@@ -13,11 +13,6 @@ uint32_t CompilerProductHelperHw<gfxProduct>::getNumThreadsPerEu() const {
return 7u;
}
template <PRODUCT_FAMILY gfxProduct>
bool CompilerProductHelperHw<gfxProduct>::isBFloat16ConversionSupported(const HardwareInfo &hwInfo) const {
return false;
}
template <PRODUCT_FAMILY gfxProduct>
bool CompilerProductHelperHw<gfxProduct>::isDotAccumulateSupported() const {
return false;

View File

@@ -1,16 +0,0 @@
/*
* Copyright (C) 2023 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
*/
#include "shared/source/helpers/compiler_product_helper.h"
namespace NEO {
template <PRODUCT_FAMILY gfxProduct>
bool CompilerProductHelperHw<gfxProduct>::isSplitMatrixMultiplyAccumulateSupported(const HardwareInfo &hwInfo) const {
return false;
}
} // namespace NEO

View File

@@ -1,16 +0,0 @@
/*
* Copyright (C) 2023 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
*/
#include "shared/source/helpers/compiler_product_helper.h"
namespace NEO {
template <PRODUCT_FAMILY gfxProduct>
bool CompilerProductHelperHw<gfxProduct>::isSplitMatrixMultiplyAccumulateSupported(const HardwareInfo &hwInfo) const {
return true;
}
} // namespace NEO

View File

@@ -14,11 +14,6 @@ uint32_t CompilerProductHelperHw<gfxProduct>::getNumThreadsPerEu() const {
return 8u;
}
template <PRODUCT_FAMILY gfxProduct>
bool CompilerProductHelperHw<gfxProduct>::isBFloat16ConversionSupported(const HardwareInfo &hwInfo) const {
return true;
}
template <PRODUCT_FAMILY gfxProduct>
bool CompilerProductHelperHw<gfxProduct>::isDotAccumulateSupported() const {
return true;