2021-10-05 21:14:08 +08:00
|
|
|
/*
|
2022-03-04 17:42:37 +08:00
|
|
|
* Copyright (C) 2021-2022 Intel Corporation
|
2021-10-05 21:14:08 +08:00
|
|
|
*
|
|
|
|
* SPDX-License-Identifier: MIT
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include "shared/source/helpers/hw_info.h"
|
2022-06-14 07:13:43 +08:00
|
|
|
#include "shared/source/helpers/product_config_helper.h"
|
2021-10-05 21:14:08 +08:00
|
|
|
|
|
|
|
#include "igfxfmid.h"
|
|
|
|
|
|
|
|
namespace NEO {
|
|
|
|
|
|
|
|
class CompilerHwInfoConfig;
|
|
|
|
struct HardwareInfo;
|
|
|
|
extern CompilerHwInfoConfig *CompilerHwInfoConfigFactory[IGFX_MAX_PRODUCT];
|
|
|
|
|
|
|
|
class CompilerHwInfoConfig {
|
|
|
|
public:
|
|
|
|
static CompilerHwInfoConfig *get(PRODUCT_FAMILY product) {
|
|
|
|
return CompilerHwInfoConfigFactory[product];
|
|
|
|
}
|
|
|
|
|
|
|
|
virtual bool isMidThreadPreemptionSupported(const HardwareInfo &hwInfo) const = 0;
|
2021-10-26 23:25:20 +08:00
|
|
|
virtual bool isForceEmuInt32DivRemSPRequired() const = 0;
|
|
|
|
virtual bool isStatelessToStatefulBufferOffsetSupported() const = 0;
|
2021-12-29 06:17:46 +08:00
|
|
|
virtual bool isForceToStatelessRequired() const = 0;
|
2022-06-10 19:52:43 +08:00
|
|
|
virtual void adjustHwInfoForIgc(HardwareInfo &hwInfo) const = 0;
|
2022-06-14 07:13:43 +08:00
|
|
|
virtual void setProductConfigForHwInfo(HardwareInfo &hwInfo, AheadOfTimeConfig config) const = 0;
|
2022-08-27 13:18:51 +08:00
|
|
|
virtual const char *getCachingPolicyOptions() const = 0;
|
2021-10-05 21:14:08 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
template <PRODUCT_FAMILY gfxProduct>
|
|
|
|
class CompilerHwInfoConfigHw : public CompilerHwInfoConfig {
|
|
|
|
public:
|
|
|
|
static CompilerHwInfoConfig *get() {
|
|
|
|
static CompilerHwInfoConfigHw<gfxProduct> instance;
|
|
|
|
return &instance;
|
|
|
|
}
|
|
|
|
|
|
|
|
bool isMidThreadPreemptionSupported(const HardwareInfo &hwInfo) const override;
|
2021-10-26 23:25:20 +08:00
|
|
|
bool isForceEmuInt32DivRemSPRequired() const override;
|
|
|
|
bool isStatelessToStatefulBufferOffsetSupported() const override;
|
2021-12-29 06:17:46 +08:00
|
|
|
bool isForceToStatelessRequired() const override;
|
2022-06-10 19:52:43 +08:00
|
|
|
void adjustHwInfoForIgc(HardwareInfo &hwInfo) const override;
|
2022-06-14 07:13:43 +08:00
|
|
|
void setProductConfigForHwInfo(HardwareInfo &hwInfo, AheadOfTimeConfig config) const override;
|
2022-08-27 13:18:51 +08:00
|
|
|
const char *getCachingPolicyOptions() const override;
|
2021-10-05 21:14:08 +08:00
|
|
|
|
|
|
|
protected:
|
|
|
|
CompilerHwInfoConfigHw() = default;
|
|
|
|
};
|
|
|
|
|
|
|
|
template <PRODUCT_FAMILY gfxProduct>
|
|
|
|
struct EnableCompilerHwInfoConfig {
|
|
|
|
typedef typename HwMapper<gfxProduct>::GfxProduct GfxProduct;
|
|
|
|
|
|
|
|
EnableCompilerHwInfoConfig() {
|
|
|
|
CompilerHwInfoConfig *pCompilerHwInfoConfig = CompilerHwInfoConfigHw<gfxProduct>::get();
|
|
|
|
CompilerHwInfoConfigFactory[gfxProduct] = pCompilerHwInfoConfig;
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
} // namespace NEO
|