2021-10-05 13:14:08 +00:00
|
|
|
/*
|
2023-01-17 11:19:19 +00:00
|
|
|
* Copyright (C) 2021-2023 Intel Corporation
|
2021-10-05 13:14:08 +00:00
|
|
|
*
|
|
|
|
|
* SPDX-License-Identifier: MIT
|
|
|
|
|
*
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
|
|
#include "shared/source/helpers/hw_info.h"
|
2022-06-13 23:13:43 +00:00
|
|
|
#include "shared/source/helpers/product_config_helper.h"
|
2021-10-05 13:14:08 +00:00
|
|
|
|
|
|
|
|
#include "igfxfmid.h"
|
|
|
|
|
|
|
|
|
|
namespace NEO {
|
|
|
|
|
|
2022-11-30 14:28:39 +00:00
|
|
|
class CompilerProductHelper;
|
2021-10-05 13:14:08 +00:00
|
|
|
struct HardwareInfo;
|
2022-11-30 14:28:39 +00:00
|
|
|
extern CompilerProductHelper *CompilerProductHelperFactory[IGFX_MAX_PRODUCT];
|
2021-10-05 13:14:08 +00:00
|
|
|
|
2022-11-30 14:28:39 +00:00
|
|
|
class CompilerProductHelper {
|
2021-10-05 13:14:08 +00:00
|
|
|
public:
|
2022-11-30 14:28:39 +00:00
|
|
|
static CompilerProductHelper *get(PRODUCT_FAMILY product) {
|
|
|
|
|
return CompilerProductHelperFactory[product];
|
2021-10-05 13:14:08 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
virtual bool isMidThreadPreemptionSupported(const HardwareInfo &hwInfo) const = 0;
|
2021-10-26 15:25:20 +00:00
|
|
|
virtual bool isForceEmuInt32DivRemSPRequired() const = 0;
|
|
|
|
|
virtual bool isStatelessToStatefulBufferOffsetSupported() const = 0;
|
2021-12-28 22:17:46 +00:00
|
|
|
virtual bool isForceToStatelessRequired() const = 0;
|
2022-12-06 15:59:36 +00:00
|
|
|
virtual void setProductConfigForHwInfo(HardwareInfo &hwInfo, HardwareIpVersion config) const = 0;
|
2022-08-23 11:48:18 +00:00
|
|
|
virtual const char *getCachingPolicyOptions(bool isDebuggerActive) const = 0;
|
2021-10-05 13:14:08 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
template <PRODUCT_FAMILY gfxProduct>
|
2022-11-30 14:28:39 +00:00
|
|
|
class CompilerProductHelperHw : public CompilerProductHelper {
|
2021-10-05 13:14:08 +00:00
|
|
|
public:
|
2022-11-30 14:28:39 +00:00
|
|
|
static CompilerProductHelper *get() {
|
|
|
|
|
static CompilerProductHelperHw<gfxProduct> instance;
|
2021-10-05 13:14:08 +00:00
|
|
|
return &instance;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
bool isMidThreadPreemptionSupported(const HardwareInfo &hwInfo) const override;
|
2021-10-26 15:25:20 +00:00
|
|
|
bool isForceEmuInt32DivRemSPRequired() const override;
|
|
|
|
|
bool isStatelessToStatefulBufferOffsetSupported() const override;
|
2021-12-28 22:17:46 +00:00
|
|
|
bool isForceToStatelessRequired() const override;
|
2022-12-06 15:59:36 +00:00
|
|
|
void setProductConfigForHwInfo(HardwareInfo &hwInfo, HardwareIpVersion config) const override;
|
2022-08-23 11:48:18 +00:00
|
|
|
const char *getCachingPolicyOptions(bool isDebuggerActive) const override;
|
2021-10-05 13:14:08 +00:00
|
|
|
|
|
|
|
|
protected:
|
2022-11-30 14:28:39 +00:00
|
|
|
CompilerProductHelperHw() = default;
|
2021-10-05 13:14:08 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
template <PRODUCT_FAMILY gfxProduct>
|
2022-11-30 14:28:39 +00:00
|
|
|
struct EnableCompilerProductHelper {
|
2021-10-05 13:14:08 +00:00
|
|
|
typedef typename HwMapper<gfxProduct>::GfxProduct GfxProduct;
|
|
|
|
|
|
2022-11-30 14:28:39 +00:00
|
|
|
EnableCompilerProductHelper() {
|
|
|
|
|
CompilerProductHelper *pCompilerProductHelper = CompilerProductHelperHw<gfxProduct>::get();
|
|
|
|
|
CompilerProductHelperFactory[gfxProduct] = pCompilerProductHelper;
|
2021-10-05 13:14:08 +00:00
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
} // namespace NEO
|