summaryrefslogtreecommitdiffstats
path: root/openmp/runtime/src
diff options
context:
space:
mode:
authorAndrey Churbanov <Andrey.Churbanov@intel.com>2018-03-22 18:51:51 +0000
committerAndrey Churbanov <Andrey.Churbanov@intel.com>2018-03-22 18:51:51 +0000
commit2d91a8a3baddfcd817b07cc06be63cdbaf49a676 (patch)
treef4c8b81012f10101e0f7f5690a64ad6ea5832516 /openmp/runtime/src
parent710d7b9945fc8732cc2564483789284ddb9bab5f (diff)
downloadbcm5719-llvm-2d91a8a3baddfcd817b07cc06be63cdbaf49a676.tar.gz
bcm5719-llvm-2d91a8a3baddfcd817b07cc06be63cdbaf49a676.zip
Fixed __kmpc_get_target_offload() to call library initialization.
Differential Revision: https://reviews.llvm.org/D44793 llvm-svn: 328228
Diffstat (limited to 'openmp/runtime/src')
-rw-r--r--openmp/runtime/src/kmp_csupport.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/openmp/runtime/src/kmp_csupport.cpp b/openmp/runtime/src/kmp_csupport.cpp
index dbf2f995a78..61a8c89fdf1 100644
--- a/openmp/runtime/src/kmp_csupport.cpp
+++ b/openmp/runtime/src/kmp_csupport.cpp
@@ -4066,7 +4066,12 @@ void __kmpc_doacross_fini(ident_t *loc, int gtid) {
#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 //
OpenPOWER on IntegriCloud