mirror of
https://github.com/intel/compute-runtime.git
synced 2026-01-03 06:49:52 +08:00
refactor: move GfxCoreHelper::getExtensions to CompilerProductHelper
Related-To: NEO-7800 Signed-off-by: Mateusz Jablonski <mateusz.jablonski@intel.com>
This commit is contained in:
committed by
Compute-Runtime-Automation
parent
86c91847cc
commit
340f932ca2
@@ -49,6 +49,7 @@ class CompilerProductHelper {
|
||||
virtual const char *getCachingPolicyOptions(bool isDebuggerActive) const = 0;
|
||||
virtual uint64_t getHwInfoConfig(const HardwareInfo &hwInfo) const = 0;
|
||||
virtual uint32_t getNumThreadsPerEu() const = 0;
|
||||
virtual std::string getExtensions(const HardwareInfo &hwInfo) const = 0;
|
||||
|
||||
virtual ~CompilerProductHelper() = default;
|
||||
|
||||
@@ -80,6 +81,7 @@ class CompilerProductHelperHw : public CompilerProductHelper {
|
||||
const char *getCachingPolicyOptions(bool isDebuggerActive) const override;
|
||||
uint64_t getHwInfoConfig(const HardwareInfo &hwInfo) const override;
|
||||
uint32_t getNumThreadsPerEu() const override;
|
||||
std::string getExtensions(const HardwareInfo &hwInfo) const override;
|
||||
|
||||
~CompilerProductHelperHw() override = default;
|
||||
|
||||
|
||||
@@ -32,4 +32,35 @@ bool CompilerProductHelperHw<gfxProduct>::failBuildProgramWithStatefulAccessPref
|
||||
return false;
|
||||
}
|
||||
|
||||
template <PRODUCT_FAMILY gfxProduct>
|
||||
std::string CompilerProductHelperHw<gfxProduct>::getExtensions(const HardwareInfo &hwInfo) const {
|
||||
std::string extensions = "";
|
||||
|
||||
if (isCreateBufferWithPropertiesSupported()) {
|
||||
extensions += "cl_intel_create_buffer_with_properties ";
|
||||
}
|
||||
|
||||
if (isDotAccumulateSupported()) {
|
||||
extensions += "cl_intel_dot_accumulate ";
|
||||
}
|
||||
|
||||
if (isSubgroupLocalBlockIoSupported()) {
|
||||
extensions += "cl_intel_subgroup_local_block_io ";
|
||||
}
|
||||
|
||||
if (isMatrixMultiplyAccumulateSupported(hwInfo)) {
|
||||
extensions += "cl_intel_subgroup_matrix_multiply_accumulate ";
|
||||
extensions += "cl_intel_subgroup_split_matrix_multiply_accumulate ";
|
||||
}
|
||||
|
||||
if (isSubgroupNamedBarrierSupported()) {
|
||||
extensions += "cl_khr_subgroup_named_barrier ";
|
||||
}
|
||||
|
||||
if (isSubgroupExtendedBlockReadSupported()) {
|
||||
extensions += "cl_intel_subgroup_extended_block_read ";
|
||||
}
|
||||
return extensions;
|
||||
}
|
||||
|
||||
} // namespace NEO
|
||||
|
||||
@@ -91,7 +91,6 @@ class GfxCoreHelper {
|
||||
virtual const StackVec<size_t, 3> getDeviceSubGroupSizes() const = 0;
|
||||
virtual const StackVec<uint32_t, 6> getThreadsPerEUConfigs() const = 0;
|
||||
virtual bool getEnableLocalMemory(const HardwareInfo &hwInfo) const = 0;
|
||||
virtual std::string getExtensions(const RootDeviceEnvironment &rootDeviceEnvironment) const = 0;
|
||||
static uint32_t getMaxThreadsForVfe(const HardwareInfo &hwInfo);
|
||||
virtual uint32_t getMetricsLibraryGenId() const = 0;
|
||||
virtual uint32_t getMocsIndex(const GmmHelper &gmmHelper, bool l3enabled, bool l1enabled) const = 0;
|
||||
@@ -267,8 +266,6 @@ class GfxCoreHelperHw : public GfxCoreHelper {
|
||||
|
||||
bool getEnableLocalMemory(const HardwareInfo &hwInfo) const override;
|
||||
|
||||
std::string getExtensions(const RootDeviceEnvironment &rootDeviceEnvironment) const override;
|
||||
|
||||
uint32_t getMetricsLibraryGenId() const override;
|
||||
|
||||
uint32_t getMocsIndex(const GmmHelper &gmmHelper, bool l3enabled, bool l1enabled) const override;
|
||||
|
||||
@@ -684,37 +684,4 @@ template <typename gfxProduct>
|
||||
bool GfxCoreHelperHw<gfxProduct>::isRelaxedOrderingSupported() const {
|
||||
return false;
|
||||
}
|
||||
|
||||
template <typename GfxFamily>
|
||||
std::string GfxCoreHelperHw<GfxFamily>::getExtensions(const RootDeviceEnvironment &rootDeviceEnvironment) const {
|
||||
std::string extensions = "";
|
||||
auto &hwInfo = *rootDeviceEnvironment.getHardwareInfo();
|
||||
auto &compilerProductHelper = rootDeviceEnvironment.template getHelper<CompilerProductHelper>();
|
||||
|
||||
if (compilerProductHelper.isCreateBufferWithPropertiesSupported()) {
|
||||
extensions += "cl_intel_create_buffer_with_properties ";
|
||||
}
|
||||
|
||||
if (compilerProductHelper.isDotAccumulateSupported()) {
|
||||
extensions += "cl_intel_dot_accumulate ";
|
||||
}
|
||||
|
||||
if (compilerProductHelper.isSubgroupLocalBlockIoSupported()) {
|
||||
extensions += "cl_intel_subgroup_local_block_io ";
|
||||
}
|
||||
|
||||
if (compilerProductHelper.isMatrixMultiplyAccumulateSupported(hwInfo)) {
|
||||
extensions += "cl_intel_subgroup_matrix_multiply_accumulate ";
|
||||
extensions += "cl_intel_subgroup_split_matrix_multiply_accumulate ";
|
||||
}
|
||||
|
||||
if (compilerProductHelper.isSubgroupNamedBarrierSupported()) {
|
||||
extensions += "cl_khr_subgroup_named_barrier ";
|
||||
}
|
||||
|
||||
if (compilerProductHelper.isSubgroupExtendedBlockReadSupported()) {
|
||||
extensions += "cl_intel_subgroup_extended_block_read ";
|
||||
}
|
||||
return extensions;
|
||||
}
|
||||
} // namespace NEO
|
||||
|
||||
Reference in New Issue
Block a user