[Openmp-commits] [openmp] r328228 - Fixed __kmpc_get_target_offload() to call library initialization.
Andrey Churbanov via Openmp-commits
openmp-commits at lists.llvm.org
Thu Mar 22 11:51:52 PDT 2018
Author: achurbanov
Date: Thu Mar 22 11:51:51 2018
New Revision: 328228
URL: http://llvm.org/viewvc/llvm-project?rev=328228&view=rev
Log:
Fixed __kmpc_get_target_offload() to call library initialization.
Differential Revision: https://reviews.llvm.org/D44793
Modified:
openmp/trunk/runtime/src/kmp_csupport.cpp
Modified: openmp/trunk/runtime/src/kmp_csupport.cpp
URL: http://llvm.org/viewvc/llvm-project/openmp/trunk/runtime/src/kmp_csupport.cpp?rev=328228&r1=328227&r2=328228&view=diff
==============================================================================
--- openmp/trunk/runtime/src/kmp_csupport.cpp (original)
+++ openmp/trunk/runtime/src/kmp_csupport.cpp Thu Mar 22 11:51:51 2018
@@ -4066,7 +4066,12 @@ void __kmpc_doacross_fini(ident_t *loc,
#endif
#if OMP_50_ENABLED
-int __kmpc_get_target_offload(void) { return __kmp_target_offload; }
+int __kmpc_get_target_offload(void) {
+ if (!__kmp_init_serial) {
+ __kmp_serial_initialize();
+ }
+ return __kmp_target_offload;
+}
#endif // OMP_50_ENABLED
// end of file //
More information about the Openmp-commits
mailing list