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

+1 -1
View File
@@ -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);