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
This commit is contained in:
Tao Sang authored and Tao Sang committed 2020-07-22 22:14:13 -04:00
1 parent 2800fc2fa3
commit fdef6f722f
62 files changed
+224 -227

No files matched your search

+11 -11
View File
@@ -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