Add support for cl_ext_float_atomics

Resolves: NEO-6596

Signed-off-by: Kacper Kasper <kacper.k.kasper@intel.com>
This commit is contained in:
Kacper Kasper
2023-02-17 19:00:29 +00:00
committed by Compute-Runtime-Automation
parent 6c2f5df6c3
commit da22e0aac9
25 changed files with 232 additions and 45 deletions

View File

@@ -1,5 +1,5 @@
/*
* Copyright (C) 2018-2022 Intel Corporation
* Copyright (C) 2018-2023 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
@@ -64,6 +64,7 @@ std::string getExtensionsList(const HardwareInfo &hwInfo) {
}
allExtensionsList += "cl_intel_spirv_subgroups ";
allExtensionsList += "cl_khr_spirv_no_integer_wrap_decoration ";
allExtensionsList += "cl_ext_float_atomics ";
}
if (hwInfo.capabilityTable.ftrSupportsFP64) {
@@ -128,6 +129,32 @@ void getOpenclCFeaturesList(const HardwareInfo &hwInfo, OpenClCFeaturesContainer
strcpy_s(openClCFeature.name, CL_NAME_VERSION_MAX_NAME_SIZE, "__opencl_c_subgroups");
openclCFeatures.push_back(openClCFeature);
if (hwInfo.capabilityTable.supportsFloatAtomics) {
strcpy_s(openClCFeature.name, CL_NAME_VERSION_MAX_NAME_SIZE, "__opencl_c_ext_fp32_global_atomic_add");
openclCFeatures.push_back(openClCFeature);
strcpy_s(openClCFeature.name, CL_NAME_VERSION_MAX_NAME_SIZE, "__opencl_c_ext_fp32_local_atomic_add");
openclCFeatures.push_back(openClCFeature);
strcpy_s(openClCFeature.name, CL_NAME_VERSION_MAX_NAME_SIZE, "__opencl_c_ext_fp32_global_atomic_min_max");
openclCFeatures.push_back(openClCFeature);
strcpy_s(openClCFeature.name, CL_NAME_VERSION_MAX_NAME_SIZE, "__opencl_c_ext_fp32_local_atomic_min_max");
openclCFeatures.push_back(openClCFeature);
strcpy_s(openClCFeature.name, CL_NAME_VERSION_MAX_NAME_SIZE, "__opencl_c_ext_fp16_global_atomic_load_store");
openclCFeatures.push_back(openClCFeature);
strcpy_s(openClCFeature.name, CL_NAME_VERSION_MAX_NAME_SIZE, "__opencl_c_ext_fp16_local_atomic_load_store");
openclCFeatures.push_back(openClCFeature);
strcpy_s(openClCFeature.name, CL_NAME_VERSION_MAX_NAME_SIZE, "__opencl_c_ext_fp16_global_atomic_min_max");
openclCFeatures.push_back(openClCFeature);
strcpy_s(openClCFeature.name, CL_NAME_VERSION_MAX_NAME_SIZE, "__opencl_c_ext_fp16_local_atomic_min_max");
openclCFeatures.push_back(openClCFeature);
}
}
auto forcePipeSupport = DebugManager.flags.ForcePipeSupport.get();
@@ -142,6 +169,20 @@ void getOpenclCFeaturesList(const HardwareInfo &hwInfo, OpenClCFeaturesContainer
(forceFp64Support == 1)) {
strcpy_s(openClCFeature.name, CL_NAME_VERSION_MAX_NAME_SIZE, "__opencl_c_fp64");
openclCFeatures.push_back(openClCFeature);
if (hwInfo.capabilityTable.supportsOcl21Features && hwInfo.capabilityTable.supportsFloatAtomics) {
strcpy_s(openClCFeature.name, CL_NAME_VERSION_MAX_NAME_SIZE, "__opencl_c_ext_fp64_global_atomic_add");
openclCFeatures.push_back(openClCFeature);
strcpy_s(openClCFeature.name, CL_NAME_VERSION_MAX_NAME_SIZE, "__opencl_c_ext_fp64_local_atomic_add");
openclCFeatures.push_back(openClCFeature);
strcpy_s(openClCFeature.name, CL_NAME_VERSION_MAX_NAME_SIZE, "__opencl_c_ext_fp64_global_atomic_min_max");
openclCFeatures.push_back(openClCFeature);
strcpy_s(openClCFeature.name, CL_NAME_VERSION_MAX_NAME_SIZE, "__opencl_c_ext_fp64_local_atomic_min_max");
openclCFeatures.push_back(openClCFeature);
}
}
}

View File

@@ -1,5 +1,5 @@
/*
* Copyright (C) 2018-2022 Intel Corporation
* Copyright (C) 2018-2023 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
@@ -13,7 +13,7 @@
#include <string>
using OpenClCFeaturesContainer = StackVec<cl_name_version, 15>;
using OpenClCFeaturesContainer = StackVec<cl_name_version, 27>;
namespace NEO {
struct HardwareInfo;

View File

@@ -75,7 +75,8 @@ const RuntimeCapabilityTable EHL::capabilityTable{
false, // p2pAccessSupported
false, // p2pAtomicAccessSupported
false, // fusedEuEnabled
false // l0DebuggerSupported;
false, // l0DebuggerSupported;
false // supportsFloatAtomics
};
WorkaroundTable EHL::workaroundTable = {};

View File

@@ -75,7 +75,8 @@ const RuntimeCapabilityTable ICLLP::capabilityTable{
false, // p2pAccessSupported
false, // p2pAtomicAccessSupported
false, // fusedEuEnabled
false // l0DebuggerSupported;
false, // l0DebuggerSupported;
false // supportsFloatAtomics
};
WorkaroundTable ICLLP::workaroundTable = {};

View File

@@ -75,7 +75,8 @@ const RuntimeCapabilityTable LKF::capabilityTable{
false, // p2pAccessSupported
false, // p2pAtomicAccessSupported
false, // fusedEuEnabled
false // l0DebuggerSupported;
false, // l0DebuggerSupported;
false // supportsFloatAtomics
};
WorkaroundTable LKF::workaroundTable = {};

View File

@@ -77,7 +77,9 @@ const RuntimeCapabilityTable ADLN::capabilityTable{
true, // supportsMediaBlock
false, // p2pAccessSupported
false, // p2pAtomicAccessSupported
true // fusedEuEnabled
true, // fusedEuEnabled
false, // l0DebuggerSupported;
true // supportsFloatAtomics
};
WorkaroundTable ADLN::workaroundTable = {};

View File

@@ -78,7 +78,8 @@ const RuntimeCapabilityTable ADLP::capabilityTable{
false, // p2pAccessSupported
false, // p2pAtomicAccessSupported
true, // fusedEuEnabled
false // l0DebuggerSupported;
false, // l0DebuggerSupported;
true // supportsFloatAtomics
};
WorkaroundTable ADLP::workaroundTable = {};

View File

@@ -78,7 +78,8 @@ const RuntimeCapabilityTable ADLS::capabilityTable{
false, // p2pAccessSupported
false, // p2pAtomicAccessSupported
true, // fusedEuEnabled
false // l0DebuggerSupported;
false, // l0DebuggerSupported;
true // supportsFloatAtomics
};
WorkaroundTable ADLS::workaroundTable = {};

View File

@@ -79,6 +79,7 @@ const RuntimeCapabilityTable DG1::capabilityTable{
false, // p2pAtomicAccessSupported
true, // fusedEuEnabled
true, // l0DebuggerSupported;
true // supportsFloatAtomics
};
WorkaroundTable DG1::workaroundTable = {};

View File

@@ -79,6 +79,7 @@ const RuntimeCapabilityTable RKL::capabilityTable{
false, // p2pAtomicAccessSupported
true, // fusedEuEnabled
false, // l0DebuggerSupported;
true // supportsFloatAtomics
};
WorkaroundTable RKL::workaroundTable = {};

View File

@@ -79,6 +79,7 @@ const RuntimeCapabilityTable TGLLP::capabilityTable{
false, // p2pAtomicAccessSupported
true, // fusedEuEnabled
false, // l0DebuggerSupported;
true // supportsFloatAtomics
};
WorkaroundTable TGLLP::workaroundTable = {};

View File

@@ -75,7 +75,8 @@ const RuntimeCapabilityTable BDW::capabilityTable{
false, // p2pAccessSupported
false, // p2pAtomicAccessSupported
false, // fusedEuEnabled
false // l0DebuggerSupported;
false, // l0DebuggerSupported;
false // supportsFloatAtomics
};
WorkaroundTable BDW::workaroundTable = {};

View File

@@ -75,7 +75,8 @@ const RuntimeCapabilityTable BXT::capabilityTable{
false, // p2pAccessSupported
false, // p2pAtomicAccessSupported
false, // fusedEuEnabled
false // l0DebuggerSupported;
false, // l0DebuggerSupported;
false // supportsFloatAtomics
};
WorkaroundTable BXT::workaroundTable = {};

View File

@@ -75,7 +75,8 @@ const RuntimeCapabilityTable CFL::capabilityTable{
false, // p2pAccessSupported
false, // p2pAtomicAccessSupported
false, // fusedEuEnabled
false // l0DebuggerSupported;
false, // l0DebuggerSupported;
false // supportsFloatAtomics
};
WorkaroundTable CFL::workaroundTable = {};

View File

@@ -75,7 +75,8 @@ const RuntimeCapabilityTable GLK::capabilityTable{
false, // p2pAccessSupported
false, // p2pAtomicAccessSupported
false, // fusedEuEnabled
false // l0DebuggerSupported;
false, // l0DebuggerSupported;
false // supportsFloatAtomics
};
WorkaroundTable GLK::workaroundTable = {};

View File

@@ -75,7 +75,8 @@ const RuntimeCapabilityTable KBL::capabilityTable{
false, // p2pAccessSupported
false, // p2pAtomicAccessSupported
false, // fusedEuEnabled
false // l0DebuggerSupported;
false, // l0DebuggerSupported;
false // supportsFloatAtomics
};
WorkaroundTable KBL::workaroundTable = {};

View File

@@ -75,7 +75,8 @@ const RuntimeCapabilityTable SKL::capabilityTable{
false, // p2pAccessSupported
false, // p2pAtomicAccessSupported
false, // fusedEuEnabled
false // l0DebuggerSupported;
false, // l0DebuggerSupported;
false // supportsFloatAtomics
};
WorkaroundTable SKL::workaroundTable = {};

View File

@@ -64,6 +64,7 @@ struct RuntimeCapabilityTable {
bool p2pAtomicAccessSupported;
bool fusedEuEnabled;
bool l0DebuggerSupported;
bool supportsFloatAtomics;
};
inline bool operator==(const RuntimeCapabilityTable &lhs, const RuntimeCapabilityTable &rhs) {
@@ -128,6 +129,7 @@ inline bool operator==(const RuntimeCapabilityTable &lhs, const RuntimeCapabilit
result &= (lhs.supportsMediaBlock == rhs.supportsMediaBlock);
result &= (lhs.fusedEuEnabled == rhs.fusedEuEnabled);
result &= (lhs.l0DebuggerSupported == rhs.l0DebuggerSupported);
result &= (lhs.supportsFloatAtomics == rhs.supportsFloatAtomics);
return result;
}