1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80
|
/*========================== begin_copyright_notice ============================
Copyright (C) 2021-2022 Intel Corporation
SPDX-License-Identifier: MIT
============================= end_copyright_notice ===========================*/
// VC platform selection process need to be used in two places:
// * igcdeps library to determine platform for SPIRV compilation
// * fcl library to determine platform for sources compilation
// this is header-only because we do not want link dependencies
// from library with only two functions
#ifndef VC_PLATFORM_SELECTOR_H
#define VC_PLATFORM_SELECTOR_H
#include "llvm/Support/ErrorHandling.h"
#include "Probe/Assertion.h"
#include "StringMacros.hpp"
#include "igfxfmid.h"
namespace cmc {
constexpr int ComputeTileMaskPVC = 0x7;
inline const char *getPlatformStr(PLATFORM Platform, unsigned &RevId) {
// after some consultations with Wndows KMD folks,
// only render core shall be used in all cases
auto Core = Platform.eRenderCoreFamily;
auto Product = Platform.eProductFamily;
IGC_ASSERT(RevId == Platform.usRevId);
switch (Core) {
case IGFX_GEN9_CORE:
return "SKL";
case IGFX_GEN11_CORE:
return "ICLLP";
case IGFX_GEN12_CORE:
case IGFX_GEN12LP_CORE:
case IGFX_XE_HP_CORE:
case IGFX_XE_HPG_CORE:
case IGFX_XE_HPC_CORE:
if (Product == IGFX_TIGERLAKE_LP)
return "TGLLP";
if (Product == IGFX_DG1)
return "DG1";
if (Product == IGFX_ROCKETLAKE)
return "RKL";
if (Product == IGFX_ALDERLAKE_S)
return "ADLS";
if (Product == IGFX_ALDERLAKE_P)
return "ADLP";
if (Product == IGFX_ALDERLAKE_N)
return "ADLN";
else if (Product == IGFX_XE_HP_SDV)
return "XEHP";
else if (Product == IGFX_DG2)
return "DG2";
else if (Product == IGFX_METEORLAKE)
return "MTL";
else if (Product == IGFX_PVC) {
// fixing revision id for PVC to compute tile
RevId &= cmc::ComputeTileMaskPVC;
if (RevId < REVISION_B)
return "PVC";
else if (RevId < REVISION_D)
return "PVCXT_A0"; // PVC XT A0 RevID==0x3==REVISION_B
else
return "PVCXT";
}
default:
break;
}
return nullptr;
}
} // namespace cmc
#endif
|