Apply constexpr on global constant varaibles

When HIP_ENABLE_DEFERRED_LOADING=0, many global variables will be
referenced but they are not initialized in that early time. The patch
will use constexpr to initialze global constant varables in compile
time.

Change-Id: I9d538b7abc6a0ce700ec3332b97fc144db5fc1ef
Este cometimento está contido em:
Tao Sang criou e Tao Sang cometeu 2020-07-22 22:14:13 -04:00
1 ascendente 2800fc2fa3
cometimento fdef6f722f
62 ficheiros modificados
+224 -227

Não existem ficheiros que correspondam à sua pesquisa

+11 -11
Ver ficheiro
@@ -164,17 +164,17 @@ typedef struct _HwDispatch {
uint padd41; // 0x00000021
} HwDispatch;
\n
static const uint WavefrontSize = 64;
static const uint MaxWaveSize = 0x400;
static const uint UsrRegOffset = 0x240;
static const uint Pm4Nop = 0xC0001002;
static const uint Pm4UserRegs = 0xC0007602;
static const uint Pm4CopyReg = 0xC0044000;
static const uint PrivateSegEna = 0x1;
static const uint DispatchEna = 0x2;
static const uint QueuePtrEna = 0x4;
static const uint KernelArgEna = 0x8;
static const uint FlatScratchEna = 0x20;
static constexpr uint WavefrontSize = 64;
static constexpr uint MaxWaveSize = 0x400;
static constexpr uint UsrRegOffset = 0x240;
static constexpr uint Pm4Nop = 0xC0001002;
static constexpr uint Pm4UserRegs = 0xC0007602;
static constexpr uint Pm4CopyReg = 0xC0044000;
static constexpr uint PrivateSegEna = 0x1;
static constexpr uint DispatchEna = 0x2;
static constexpr uint QueuePtrEna = 0x4;
static constexpr uint KernelArgEna = 0x8;
static constexpr uint FlatScratchEna = 0x20;
\n
uint GetCmdTemplateHeaderSize() { return sizeof(HwDispatchHeader); }
\n