mirror of
https://github.com/intel/compute-runtime.git
synced 2025-09-15 13:01:45 +08:00
Switch to c++17
Signed-off-by: Kamil Diedrich <kamil.diedrich@intel.com>
This commit is contained in:

committed by
Compute-Runtime-Automation

parent
19bea962d0
commit
79d4af28de
@ -178,8 +178,8 @@ if(NOT NEO_BINARY_DIR)
|
||||
set(NEO_BINARY_DIR ${CMAKE_BINARY_DIR})
|
||||
endif()
|
||||
|
||||
# we use c++14
|
||||
set(CMAKE_CXX_STANDARD 14)
|
||||
# we use c++17
|
||||
set(CMAKE_CXX_STANDARD 17)
|
||||
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
||||
|
||||
# we force using response files
|
||||
|
@ -52,7 +52,7 @@ void populateKernelInfoArgMetadata(KernelInfo &dstKernelInfoArg, const SPatchKer
|
||||
if (nullptr == argTypeDelim) {
|
||||
argTypeDelim = argTypeFull.data() + argTypeFull.size();
|
||||
}
|
||||
metadataExtended->type = std::string(argTypeFull.data(), argTypeDelim).c_str();
|
||||
metadataExtended->type = std::string(static_cast<const char *>(argTypeFull.data()), argTypeDelim).c_str();
|
||||
metadataExtended->typeQualifiers = parseLimitedString(inlineData.typeQualifiers.begin(), inlineData.typeQualifiers.size());
|
||||
|
||||
ArgTypeTraits metadata = {};
|
||||
|
@ -33,8 +33,8 @@ struct SkuInfoBaseReference {
|
||||
|
||||
refFtrTable.FtrTranslationTable = 1;
|
||||
refFtrTable.FtrUserModeTranslationTable = 1;
|
||||
refFtrTable.FtrLLCBypass = 1;
|
||||
refFtrTable.FtrWddm2Svm = 1;
|
||||
refFtrTable.FtrLLCBypass = 1;
|
||||
|
||||
refFtrTable.FtrE2ECompression = 1;
|
||||
refFtrTable.FtrLinearCCS = 1;
|
||||
|
@ -13,16 +13,72 @@
|
||||
|
||||
using namespace NEO;
|
||||
|
||||
inline bool operator==(const FeatureTable &lhs, const FeatureTable &rhs) {
|
||||
return lhs.ftrBcsInfo == rhs.ftrBcsInfo && lhs.packed[0] == rhs.packed[0] && lhs.packed[1] == rhs.packed[1];
|
||||
}
|
||||
|
||||
TEST(SkuInfoReceiverTest, givenAdapterInfoWhenReceivingThenUpdateFtrTable) {
|
||||
FeatureTable refFeatureTable = {};
|
||||
FeatureTable requestedFeatureTable = {};
|
||||
ADAPTER_INFO adapterInfo = {};
|
||||
memset(&adapterInfo.SkuTable, ~0, sizeof(adapterInfo.SkuTable));
|
||||
|
||||
SkuInfoReceiver::receiveFtrTableFromAdapterInfo(&requestedFeatureTable, &adapterInfo);
|
||||
|
||||
SkuInfoBaseReference::fillReferenceFtrToReceive(refFeatureTable);
|
||||
|
||||
EXPECT_TRUE(memcmp(&requestedFeatureTable, &refFeatureTable, sizeof(FeatureTable)) == 0);
|
||||
EXPECT_TRUE(refFeatureTable == requestedFeatureTable);
|
||||
|
||||
refFeatureTable.ftr3dMidBatchPreempt = false;
|
||||
requestedFeatureTable.ftr3dMidBatchPreempt = true;
|
||||
|
||||
EXPECT_FALSE(refFeatureTable == requestedFeatureTable);
|
||||
}
|
||||
|
||||
TEST(SkuInfoReceiverTest, givenFeatureTableWhenDifferentDataThenEqualityOperatorReturnsCorrectScore) {
|
||||
FeatureTable refFeatureTable = {};
|
||||
FeatureTable requestedFeatureTable = {};
|
||||
|
||||
refFeatureTable.ftrBcsInfo = 1;
|
||||
requestedFeatureTable.ftrBcsInfo = 0;
|
||||
|
||||
EXPECT_FALSE(refFeatureTable == requestedFeatureTable);
|
||||
|
||||
refFeatureTable.ftrBcsInfo = 0;
|
||||
requestedFeatureTable.ftrBcsInfo = 1;
|
||||
|
||||
EXPECT_FALSE(refFeatureTable == requestedFeatureTable);
|
||||
|
||||
refFeatureTable.ftrBcsInfo = 1;
|
||||
requestedFeatureTable.ftrBcsInfo = 1;
|
||||
refFeatureTable.packed[0] = 1u;
|
||||
requestedFeatureTable.packed[0] = 0;
|
||||
|
||||
EXPECT_FALSE(refFeatureTable == requestedFeatureTable);
|
||||
|
||||
refFeatureTable.packed[0] = 0;
|
||||
requestedFeatureTable.packed[0] = 1;
|
||||
|
||||
EXPECT_FALSE(refFeatureTable == requestedFeatureTable);
|
||||
|
||||
refFeatureTable.packed[0] = 0;
|
||||
requestedFeatureTable.packed[0] = 0;
|
||||
refFeatureTable.packed[1] = 0;
|
||||
requestedFeatureTable.packed[1] = 1;
|
||||
|
||||
EXPECT_FALSE(refFeatureTable == requestedFeatureTable);
|
||||
|
||||
refFeatureTable.packed[0] = 0;
|
||||
requestedFeatureTable.packed[0] = 0;
|
||||
refFeatureTable.packed[1] = 1;
|
||||
requestedFeatureTable.packed[1] = 0;
|
||||
|
||||
EXPECT_FALSE(refFeatureTable == requestedFeatureTable);
|
||||
|
||||
refFeatureTable.packed[1] = 1;
|
||||
requestedFeatureTable.packed[1] = 1;
|
||||
|
||||
EXPECT_TRUE(refFeatureTable == requestedFeatureTable);
|
||||
}
|
||||
|
||||
TEST(SkuInfoReceiverTest, givenAdapterInfoWhenReceivingThenUpdateWaTable) {
|
||||
|
@ -17,7 +17,9 @@ TEST(SkuInfoTransferTest, givenFeatureTableWhenFillingStructureForGmmThenCopyOnl
|
||||
_SKU_FEATURE_TABLE requestedFtrTable = {};
|
||||
_SKU_FEATURE_TABLE refFtrTable = {};
|
||||
FeatureTable featureTable;
|
||||
memset(reinterpret_cast<void *>(&featureTable), 1, sizeof(FeatureTable));
|
||||
|
||||
featureTable.packed[0] = 0xFFFFFFFFFFFFFFFF;
|
||||
featureTable.packed[1] = 0xFFFFFFFFFFFFFFFF;
|
||||
SkuInfoTransfer::transferFtrTableForGmm(&requestedFtrTable, &featureTable);
|
||||
|
||||
SkuInfoBaseReference::fillReferenceFtrForTransfer(refFtrTable);
|
||||
|
@ -310,7 +310,14 @@ inline const Node *getLastChild(const Node &parent, const NodesCache &allNodes)
|
||||
return &allNodes[childId];
|
||||
}
|
||||
|
||||
struct ConstSiblingsFwdIterator : std::iterator<std::forward_iterator_tag, Node> {
|
||||
struct ConstSiblingsFwdIterator {
|
||||
// iterator traits
|
||||
using difference_type = long;
|
||||
using value_type = long;
|
||||
using pointer = const long *;
|
||||
using reference = const long &;
|
||||
using iterator_category = std::forward_iterator_tag;
|
||||
|
||||
ConstSiblingsFwdIterator(NodeId currId, const NodesCache *allNodes)
|
||||
: allNodes(allNodes), currId(currId) {
|
||||
}
|
||||
|
@ -336,7 +336,7 @@ void populateArgMetadata(KernelDescriptor &dst, size_t argNum, const SPatchKerne
|
||||
if (nullptr == argTypeDelim) {
|
||||
argTypeDelim = argTypeFull.data() + argTypeFull.size();
|
||||
}
|
||||
metadataExtended->type = std::string(argTypeFull.data(), argTypeDelim).c_str();
|
||||
metadataExtended->type = std::string(static_cast<const char *>(argTypeFull.data()), argTypeDelim).c_str();
|
||||
metadataExtended->typeQualifiers = parseLimitedString(inlineData.typeQualifiers.begin(), inlineData.typeQualifiers.size());
|
||||
|
||||
ArgTypeTraits metadata = {};
|
||||
|
@ -11,6 +11,7 @@
|
||||
#include <bitset>
|
||||
|
||||
namespace NEO {
|
||||
|
||||
using BcsInfoMask = std::bitset<1>;
|
||||
|
||||
struct FeatureTable : FeatureTableBase {
|
||||
|
@ -7,92 +7,103 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <cstdint>
|
||||
|
||||
namespace NEO {
|
||||
struct FeatureTableBase {
|
||||
bool ftrDesktop = false;
|
||||
bool ftrChannelSwizzlingXOREnabled = false;
|
||||
public:
|
||||
FeatureTableBase() : packed{} {
|
||||
ftrRcsNode = 1;
|
||||
}
|
||||
union {
|
||||
struct {
|
||||
bool ftrDesktop : 1;
|
||||
bool ftrChannelSwizzlingXOREnabled : 1;
|
||||
|
||||
bool ftrGtBigDie = false;
|
||||
bool ftrGtMediumDie = false;
|
||||
bool ftrGtSmallDie = false;
|
||||
bool ftrGtBigDie : 1;
|
||||
bool ftrGtMediumDie : 1;
|
||||
bool ftrGtSmallDie : 1;
|
||||
|
||||
bool ftrGT1 = false;
|
||||
bool ftrGT1_5 = false;
|
||||
bool ftrGT2 = false;
|
||||
bool ftrGT2_5 = false;
|
||||
bool ftrGT3 = false;
|
||||
bool ftrGT4 = false;
|
||||
bool ftrGT1 : 1;
|
||||
bool ftrGT1_5 : 1;
|
||||
bool ftrGT2 : 1;
|
||||
bool ftrGT2_5 : 1;
|
||||
bool ftrGT3 : 1;
|
||||
bool ftrGT4 : 1;
|
||||
|
||||
bool ftrIVBM0M1Platform = false;
|
||||
bool ftrSGTPVSKUStrapPresent = false;
|
||||
bool ftrGTA = false;
|
||||
bool ftrGTC = false;
|
||||
bool ftrGTX = false;
|
||||
bool ftr5Slice = false;
|
||||
bool ftrIVBM0M1Platform : 1;
|
||||
bool ftrSGTPVSKUStrapPresent : 1;
|
||||
bool ftrGTA : 1;
|
||||
bool ftrGTC : 1;
|
||||
bool ftrGTX : 1;
|
||||
bool ftr5Slice : 1;
|
||||
|
||||
bool ftrGpGpuMidBatchPreempt = false;
|
||||
bool ftrGpGpuThreadGroupLevelPreempt = false;
|
||||
bool ftrGpGpuMidThreadLevelPreempt = false;
|
||||
bool ftrGpGpuMidBatchPreempt : 1;
|
||||
bool ftrGpGpuThreadGroupLevelPreempt : 1;
|
||||
bool ftrGpGpuMidThreadLevelPreempt : 1;
|
||||
|
||||
bool ftrIoMmuPageFaulting = false;
|
||||
bool ftrWddm2Svm = false;
|
||||
bool ftrPooledEuEnabled = false;
|
||||
bool ftrIoMmuPageFaulting : 1;
|
||||
bool ftrWddm2Svm : 1;
|
||||
bool ftrPooledEuEnabled : 1;
|
||||
|
||||
bool ftrResourceStreamer = false;
|
||||
bool ftrResourceStreamer : 1;
|
||||
|
||||
bool ftrPPGTT = false;
|
||||
bool ftrSVM = false;
|
||||
bool ftrEDram = false;
|
||||
bool ftrL3IACoherency = false;
|
||||
bool ftrIA32eGfxPTEs = false;
|
||||
bool ftrPPGTT : 1;
|
||||
bool ftrSVM : 1;
|
||||
bool ftrEDram : 1;
|
||||
bool ftrL3IACoherency : 1;
|
||||
bool ftrIA32eGfxPTEs : 1;
|
||||
|
||||
bool ftr3dMidBatchPreempt = false;
|
||||
bool ftr3dObjectLevelPreempt = false;
|
||||
bool ftrPerCtxtPreemptionGranularityControl = false;
|
||||
bool ftr3dMidBatchPreempt : 1;
|
||||
bool ftr3dObjectLevelPreempt : 1;
|
||||
bool ftrPerCtxtPreemptionGranularityControl : 1;
|
||||
|
||||
bool ftrTileY = false;
|
||||
bool ftrDisplayYTiling = false;
|
||||
bool ftrTranslationTable = false;
|
||||
bool ftrUserModeTranslationTable = false;
|
||||
bool ftrTileY : 1;
|
||||
bool ftrDisplayYTiling : 1;
|
||||
bool ftrTranslationTable : 1;
|
||||
bool ftrUserModeTranslationTable : 1;
|
||||
|
||||
bool ftrEnableGuC = false;
|
||||
bool ftrEnableGuC : 1;
|
||||
|
||||
bool ftrFbc = false;
|
||||
bool ftrFbc2AddressTranslation = false;
|
||||
bool ftrFbcBlitterTracking = false;
|
||||
bool ftrFbcCpuTracking = false;
|
||||
bool ftrFbc : 1;
|
||||
bool ftrFbc2AddressTranslation : 1;
|
||||
bool ftrFbcBlitterTracking : 1;
|
||||
bool ftrFbcCpuTracking : 1;
|
||||
|
||||
bool ftrVcs2 = false;
|
||||
bool ftrVEBOX = false;
|
||||
bool ftrSingleVeboxSlice = false;
|
||||
bool ftrULT = false;
|
||||
bool ftrLCIA = false;
|
||||
bool ftrGttCacheInvalidation = false;
|
||||
bool ftrTileMappedResource = false;
|
||||
bool ftrAstcHdr2D = false;
|
||||
bool ftrAstcLdr2D = false;
|
||||
bool ftrVcs2 : 1;
|
||||
bool ftrVEBOX : 1;
|
||||
bool ftrSingleVeboxSlice : 1;
|
||||
bool ftrULT : 1;
|
||||
bool ftrLCIA : 1;
|
||||
bool ftrGttCacheInvalidation : 1;
|
||||
bool ftrTileMappedResource : 1;
|
||||
bool ftrAstcHdr2D : 1;
|
||||
bool ftrAstcLdr2D : 1;
|
||||
|
||||
bool ftrStandardMipTailFormat = false;
|
||||
bool ftrFrameBufferLLC = false;
|
||||
bool ftrCrystalwell = false;
|
||||
bool ftrLLCBypass = false;
|
||||
bool ftrDisplayEngineS3d = false;
|
||||
bool ftrVERing = false;
|
||||
bool ftrWddm2GpuMmu = false;
|
||||
bool ftrWddm2_1_64kbPages = false;
|
||||
bool ftrWddmHwQueues = false;
|
||||
bool ftrMemTypeMocsDeferPAT = false;
|
||||
bool ftrStandardMipTailFormat : 1;
|
||||
bool ftrFrameBufferLLC : 1;
|
||||
bool ftrCrystalwell : 1;
|
||||
bool ftrLLCBypass : 1;
|
||||
bool ftrDisplayEngineS3d : 1;
|
||||
bool ftrVERing : 1;
|
||||
bool ftrWddm2GpuMmu : 1;
|
||||
bool ftrWddm2_1_64kbPages : 1;
|
||||
bool ftrWddmHwQueues : 1;
|
||||
bool ftrMemTypeMocsDeferPAT : 1;
|
||||
|
||||
bool ftrKmdDaf = false;
|
||||
bool ftrSimulationMode = false;
|
||||
bool ftrKmdDaf : 1;
|
||||
bool ftrSimulationMode : 1;
|
||||
|
||||
bool ftrE2ECompression = false;
|
||||
bool ftrLinearCCS = false;
|
||||
bool ftrCCSRing = false;
|
||||
bool ftrCCSNode = false;
|
||||
bool ftrRcsNode = true;
|
||||
bool ftrLocalMemory = false;
|
||||
bool ftrLocalMemoryAllows4KB = false;
|
||||
bool ftrE2ECompression : 1;
|
||||
bool ftrLinearCCS : 1;
|
||||
bool ftrCCSRing : 1;
|
||||
bool ftrCCSNode : 1;
|
||||
bool ftrRcsNode : 1;
|
||||
bool ftrLocalMemory : 1;
|
||||
bool ftrLocalMemoryAllows4KB : 1;
|
||||
};
|
||||
uint64_t packed[2];
|
||||
};
|
||||
};
|
||||
|
||||
struct WorkaroundTableBase {
|
||||
|
@ -25,7 +25,14 @@ TEST(YamlIsWhitespace, GivenCharThenReturnsTrueOnlyWhenCharIsWhitespace) {
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
struct IteratorAsValue : std::iterator<std::forward_iterator_tag, T> {
|
||||
struct IteratorAsValue {
|
||||
// iterator traits
|
||||
using difference_type = long;
|
||||
using value_type = long;
|
||||
using pointer = const long *;
|
||||
using reference = const long &;
|
||||
using iterator_category = std::forward_iterator_tag;
|
||||
|
||||
IteratorAsValue(const T &v) : value(v) {}
|
||||
T operator*() const { return value; }
|
||||
IteratorAsValue<T> &operator++() {
|
||||
|
Reference in New Issue
Block a user