diff --git a/hipamd/src/hip_context.cpp b/hipamd/src/hip_context.cpp index a056e58c98..f58768792f 100644 --- a/hipamd/src/hip_context.cpp +++ b/hipamd/src/hip_context.cpp @@ -28,7 +28,7 @@ namespace hip { std::once_flag g_ihipInitialized; -std::vector g_devices; +std::vector g_devices ROCCLR_INIT_PRIORITY(101); thread_local TlsAggregator tls; amd::Context* host_context = nullptr; diff --git a/hipamd/src/hip_graph_internal.cpp b/hipamd/src/hip_graph_internal.cpp index baa9fa1644..77ce47d490 100644 --- a/hipamd/src/hip_graph_internal.cpp +++ b/hipamd/src/hip_graph_internal.cpp @@ -51,8 +51,10 @@ const char* GetGraphNodeTypeString(uint32_t op) { } namespace hip { -std::unordered_map> GraphExecStatus_; -amd::Monitor GraphExecStatusLock_{"Guards graph execution state"}; +std::unordered_map> + GraphExecStatus_ ROCCLR_INIT_PRIORITY(101); +amd::Monitor GraphExecStatusLock_ ROCCLR_INIT_PRIORITY(101){ + "Guards graph execution state"}; int GraphNode::nextID = 0; int Graph::nextID = 0; diff --git a/rocclr/platform/command.cpp b/rocclr/platform/command.cpp index 2c98c4563d..b61159b99d 100644 --- a/rocclr/platform/command.cpp +++ b/rocclr/platform/command.cpp @@ -318,7 +318,7 @@ Command::Command(HostQueue& queue, cl_command_type type, const EventWaitList& ev } } -SysmemPool Command::command_pool_; +SysmemPool Command::command_pool_ ROCCLR_INIT_PRIORITY(101); // ================================================================================================ void Command::operator delete(void* ptr) { diff --git a/rocclr/platform/runtime.cpp b/rocclr/platform/runtime.cpp index 1b710ca207..945f54527a 100644 --- a/rocclr/platform/runtime.cpp +++ b/rocclr/platform/runtime.cpp @@ -109,7 +109,7 @@ amd::Monitor listenerLock("Hostcall listener lock"); std::vector RuntimeTearDown::external_; RuntimeTearDown::~RuntimeTearDown() { -#ifndef _WIN32 +#if !defined(_WIN32) && !defined(BUILD_STATIC_LIBS) // Only perform destruction if process matches the initialization, // to avoid a call with the child process after fork() if (amd::IS_HIP && amd::Os::getProcessId() == Runtime::pid()) {