From f7cc49c0b21af0c6bf1cfb21fd9322eaca196d79 Mon Sep 17 00:00:00 2001 From: Tao Sang Date: Tue, 14 Jul 2020 20:16:32 -0400 Subject: [PATCH] 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: I9837c42e6bab38a894ece4e0f34b64f81b38fef0 --- hipamd/lpl_ca/pstreams/pstream.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/hipamd/lpl_ca/pstreams/pstream.h b/hipamd/lpl_ca/pstreams/pstream.h index 363df0cf45..5b3afd7d35 100644 --- a/hipamd/lpl_ca/pstreams/pstream.h +++ b/hipamd/lpl_ca/pstreams/pstream.h @@ -70,12 +70,12 @@ struct pstreams { /// Type used for file descriptors. typedef int fd_type; - static const pmode pstdin = std::ios_base::out; ///< Write to stdin - static const pmode pstdout = std::ios_base::in; ///< Read from stdout - static const pmode pstderr = std::ios_base::app; ///< Read from stderr + static constexpr pmode pstdin = std::ios_base::out; ///< Write to stdin + static constexpr pmode pstdout = std::ios_base::in; ///< Read from stdout + static constexpr pmode pstderr = std::ios_base::app; ///< Read from stderr /// Create a new process group for the child process. - static const pmode newpg = std::ios_base::trunc; + static constexpr pmode newpg = std::ios_base::trunc; protected: enum { bufsz = 32 }; ///< Size of pstreambuf buffers.