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
2020-07-14 20:10:24 -04:00
committed by Tao Sang
parent 2800fc2fa3
commit fdef6f722f
62 changed files with 224 additions and 227 deletions
+6 -6
View File
@@ -89,13 +89,13 @@ const pointer badPointer = (pointer)(intptr_t)_BAD_INTPTR;
const address badAddress = (address)(intptr_t)_BAD_INTPTR;
//! \endcond
const size_t Ki = 1024;
const size_t Mi = Ki * Ki;
const size_t Gi = Ki * Ki * Ki;
constexpr size_t Ki = 1024;
constexpr size_t Mi = Ki * Ki;
constexpr size_t Gi = Ki * Ki * Ki;
const size_t K = 1000;
const size_t M = K * K;
const size_t G = K * K * K;
constexpr size_t K = 1000;
constexpr size_t M = K * K;
constexpr size_t G = K * K * K;
#include "utils/debug.hpp"