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.