From ebc92e597553360fe6389be64de99370713bef10 Mon Sep 17 00:00:00 2001 From: Siu Chi Chan Date: Sun, 18 Feb 2018 14:19:21 -0500 Subject: [PATCH] make HIP to load the GPU objects and to setup the function symbol map on startup --- src/program_state.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/program_state.cpp b/src/program_state.cpp index 35785dcad5..aef92d463c 100644 --- a/src/program_state.cpp +++ b/src/program_state.cpp @@ -490,4 +490,16 @@ namespace hip_impl return executable; } + + // To force HIP to load the kernels and to setup the function + // symbol map on program startup + class startup_kernel_loader { + private: + startup_kernel_loader() { functions(); } + startup_kernel_loader(const startup_kernel_loader&) = delete; + startup_kernel_loader& operator= (const startup_kernel_loader&) = delete; + static startup_kernel_loader skl; + }; + startup_kernel_loader startup_kernel_loader::skl; + } // Namespace hip_impl.