[OpenMP][libomptarget] Add function for checking SPMD mode

Summary: Add function to the NVPTX libomptarget library that will return true if the current target region is being executed in SPMD mode.

Reviewers: ABataev, grokos, carlo.bertolli, caomhin

Reviewed By: grokos

Subscribers: guansong, openmp-commits

Differential Revision: https://reviews.llvm.org/D46840

llvm-svn: 332360
This commit is contained in:
Gheorghe-Teodor Bercea 2018-05-15 15:16:43 +00:00
parent d477bb9a50
commit 787a350021
2 changed files with 8 additions and 0 deletions

View File

@ -516,4 +516,7 @@ EXTERN void __kmpc_data_sharing_environment_end(
EXTERN void *
__kmpc_get_data_sharing_environment_frame(int32_t SourceThreadID,
int16_t IsOMPRuntimeInitialized);
// SPMD execution mode interrogation function.
EXTERN int8_t __kmpc_is_spmd_exec_mode();
#endif

View File

@ -187,3 +187,8 @@ EXTERN void __kmpc_spmd_kernel_deinit() {
omptarget_nvptx_threadPrivateContext);
}
}
// Return true if the current target region is executed in SPMD mode.
EXTERN int8_t __kmpc_is_spmd_exec_mode() {
return isSPMDMode();
}