summaryrefslogtreecommitdiffstats
path: root/clang/lib
diff options
context:
space:
mode:
authorGheorghe-Teodor Bercea <gheorghe-teod.bercea@ibm.com>2018-03-22 17:33:27 +0000
committerGheorghe-Teodor Bercea <gheorghe-teod.bercea@ibm.com>2018-03-22 17:33:27 +0000
commit36cdfad06236e1f3f348ab68b7ba8083337c81b3 (patch)
treeca4d947a09e8030e12e6bdb564f2de1e1f0acb2c /clang/lib
parentb3297ef05179e1fee616b97b1c65b58e4c7fef17 (diff)
downloadbcm5719-llvm-36cdfad06236e1f3f348ab68b7ba8083337c81b3.tar.gz
bcm5719-llvm-36cdfad06236e1f3f348ab68b7ba8083337c81b3.zip
[OpenMP][Clang] Add call to global data sharing stack initialization on the workers side
Summary: The workers also need to initialize the global stack. The call to the initialization function needs to happen after the kernel_init() function is called by the master. This ensures that the per-team data structures of the runtime have been initialized. Reviewers: ABataev, grokos, carlo.bertolli, caomhin Reviewed By: ABataev Subscribers: jholewinski, guansong, cfe-commits Differential Revision: https://reviews.llvm.org/D44749 llvm-svn: 328219
Diffstat (limited to 'clang/lib')
-rw-r--r--clang/lib/CodeGen/CGOpenMPRuntimeNVPTX.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/clang/lib/CodeGen/CGOpenMPRuntimeNVPTX.cpp b/clang/lib/CodeGen/CGOpenMPRuntimeNVPTX.cpp
index 8ab890cb4c3..62131cd0243 100644
--- a/clang/lib/CodeGen/CGOpenMPRuntimeNVPTX.cpp
+++ b/clang/lib/CodeGen/CGOpenMPRuntimeNVPTX.cpp
@@ -801,6 +801,11 @@ void CGOpenMPRuntimeNVPTX::emitWorkerLoop(CodeGenFunction &CGF,
// Wait for parallel work
syncCTAThreads(CGF);
+ // For data sharing, we need to initialize the stack for workers.
+ CGF.EmitRuntimeCall(
+ createNVPTXRuntimeFunction(
+ OMPRTL_NVPTX__kmpc_data_sharing_init_stack));
+
Address WorkFn =
CGF.CreateDefaultAlignTempAlloca(CGF.Int8PtrTy, /*Name=*/"work_fn");
Address ExecStatus =
OpenPOWER on IntegriCloud