mirror of
https://github.com/intel/compute-runtime.git
synced 2026-01-06 19:32:25 +08:00
Add compilerHwInfoConfig
Signed-off-by: Kamil Kopryk <kamil.kopryk@intel.com> Related-To: NEO-6237
This commit is contained in:
committed by
Compute-Runtime-Automation
parent
0f7378f64e
commit
cfc673b77c
53
shared/source/helpers/compiler_hw_info_config.h
Normal file
53
shared/source/helpers/compiler_hw_info_config.h
Normal file
@@ -0,0 +1,53 @@
|
||||
/*
|
||||
* Copyright (C) 2021 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "shared/source/helpers/hw_info.h"
|
||||
|
||||
#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;
|
||||
};
|
||||
|
||||
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;
|
||||
|
||||
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
|
||||
Reference in New Issue
Block a user