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
zatwierdzone przez Tao Sang
rodzic 2800fc2fa3
commit fdef6f722f
62 zmienionych plików z 224 dodań i 227 usunięć
+1 -1
Wyświetl plik
@@ -31,7 +31,7 @@ bool Comgr::is_ready_ = false;
bool Comgr::LoadLib() {
#if defined(COMGR_DYN_DLL)
ClPrint(amd::LOG_INFO, amd::LOG_CODE, "Loading COMGR library.");
static const char* ComgrLibName =
static constexpr const char* ComgrLibName =
LP64_SWITCH(WINDOWS_SWITCH("amd_comgr32.dll", "libamd_comgr32.so.1"),
WINDOWS_SWITCH("amd_comgr.dll", "libamd_comgr.so.1"));
cep_.handle = Os::loadLibrary(ComgrLibName);