refactor: move getters for device extension support to compiler product helper

isMatrixMultiplyAccumulateSupported
isBFloat16ConversionSupported

Signed-off-by: Mateusz Jablonski <mateusz.jablonski@intel.com>
This commit is contained in:
Mateusz Jablonski
2023-03-10 12:57:57 +00:00
committed by Compute-Runtime-Automation
parent 791a474a45
commit 89cd4bd4a5
22 changed files with 91 additions and 67 deletions

View File

@@ -9,6 +9,7 @@
#include "shared/source/device/device.h"
#include "shared/source/execution_environment/execution_environment.h"
#include "shared/source/execution_environment/root_device_environment.h"
#include "shared/source/helpers/compiler_product_helper.h"
#include "shared/source/helpers/gfx_core_helper.h"
#include "shared/source/helpers/hw_info.h"
#include "shared/source/helpers/string.h"
@@ -83,6 +84,7 @@ void ClDevice::setupFp64Flags() {
void ClDevice::initializeCaps() {
auto &hwInfo = getHardwareInfo();
auto &rootDeviceEnvironment = getRootDeviceEnvironment();
auto &compilerProductHelper = rootDeviceEnvironment.getHelper<CompilerProductHelper>();
auto &productHelper = rootDeviceEnvironment.getHelper<ProductHelper>();
auto &gfxCoreHelper = rootDeviceEnvironment.getHelper<GfxCoreHelper>();
auto &sharedDeviceInfo = getSharedDeviceInfo();
@@ -239,7 +241,7 @@ void ClDevice::initializeCaps() {
deviceExtensions += "cl_intel_media_block_io ";
}
if (productHelper.isBFloat16ConversionSupported(hwInfo)) {
if (compilerProductHelper.isBFloat16ConversionSupported(hwInfo)) {
deviceExtensions += "cl_intel_bfloat16_conversions ";
}

View File

@@ -6,7 +6,7 @@
*/
#include "shared/source/execution_environment/root_device_environment.h"
#include "shared/source/os_interface/product_helper.h"
#include "shared/source/helpers/compiler_product_helper.h"
#include "opencl/source/helpers/cl_gfx_core_helper.h"
@@ -26,8 +26,8 @@ cl_ulong ClGfxCoreHelperHw<GfxFamily>::getKernelPrivateMemSize(const KernelInfo
template <typename GfxFamily>
cl_device_feature_capabilities_intel ClGfxCoreHelperHw<GfxFamily>::getSupportedDeviceFeatureCapabilities(const RootDeviceEnvironment &rootDeviceEnvironment) const {
auto &hwInfo = *rootDeviceEnvironment.getHardwareInfo();
auto &productHelper = rootDeviceEnvironment.getHelper<ProductHelper>();
if (productHelper.isMatrixMultiplyAccumulateSupported(hwInfo)) {
auto &compilerProductHelper = rootDeviceEnvironment.getHelper<CompilerProductHelper>();
if (compilerProductHelper.isMatrixMultiplyAccumulateSupported(hwInfo)) {
return CL_DEVICE_FEATURE_FLAG_DPAS_INTEL | CL_DEVICE_FEATURE_FLAG_DP4A_INTEL;
}
return CL_DEVICE_FEATURE_FLAG_DP4A_INTEL;