Skip to content

Commit 4887752

Browse files
committed
[OpenMP] Remove obsolete external interface for device RT
We do not generate _serialized_parallel calls in device mode, no need for an external API. Reviewed By: JonChesterfield Differential Revision: https://reviews.llvm.org/D112145
1 parent 5102c3c commit 4887752

File tree

4 files changed

+9
-25
lines changed

4 files changed

+9
-25
lines changed

openmp/libomptarget/DeviceRTL/include/Interface.h

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -280,12 +280,6 @@ bool __kmpc_kernel_parallel(ParallelRegionFnTy *WorkFn);
280280
/// TODO
281281
void __kmpc_kernel_end_parallel();
282282

283-
/// TODO
284-
void __kmpc_serialized_parallel(IdentTy *Loc, uint32_t);
285-
286-
/// TODO
287-
void __kmpc_end_serialized_parallel(IdentTy *Loc, uint32_t);
288-
289283
/// TODO
290284
void __kmpc_push_proc_bind(IdentTy *Loc, uint32_t TId, int ProcBind);
291285

openmp/libomptarget/DeviceRTL/src/Parallelism.cpp

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -85,9 +85,10 @@ void __kmpc_parallel_51(IdentTy *ident, int32_t, int32_t if_expr,
8585
uint32_t TId = mapping::getThreadIdInBlock();
8686
// Handle the serialized case first, same for SPMD/non-SPMD.
8787
if (OMP_UNLIKELY(!if_expr || icv::Level)) {
88-
__kmpc_serialized_parallel(ident, TId);
88+
state::enterDataEnvironment();
89+
++icv::Level;
8990
invokeMicrotask(TId, 0, fn, args, nargs);
90-
__kmpc_end_serialized_parallel(ident, TId);
91+
state::exitDataEnvironment();
9192
return;
9293
}
9394

@@ -192,15 +193,6 @@ __attribute__((noinline)) void __kmpc_kernel_end_parallel() {
192193
ASSERT(!mapping::isSPMDMode());
193194
}
194195

195-
void __kmpc_serialized_parallel(IdentTy *, uint32_t TId) {
196-
state::enterDataEnvironment();
197-
++icv::Level;
198-
}
199-
200-
void __kmpc_end_serialized_parallel(IdentTy *, uint32_t TId) {
201-
state::exitDataEnvironment();
202-
}
203-
204196
uint16_t __kmpc_parallel_level(IdentTy *, uint32_t) { return omp_get_level(); }
205197

206198
int32_t __kmpc_global_thread_num(IdentTy *) { return omp_get_thread_num(); }

openmp/libomptarget/deviceRTLs/common/src/parallel.cu

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -177,8 +177,8 @@ EXTERN void __kmpc_kernel_end_parallel() {
177177
// support for parallel that goes sequential
178178
////////////////////////////////////////////////////////////////////////////////
179179

180-
EXTERN void __kmpc_serialized_parallel(kmp_Ident *loc, uint32_t global_tid) {
181-
PRINT0(LD_IO, "call to __kmpc_serialized_parallel\n");
180+
static void serializedParallel(kmp_Ident *loc, uint32_t global_tid) {
181+
PRINT0(LD_IO, "call to serializedParallel\n");
182182

183183
IncParallelLevel(/*ActiveParallel=*/false, __kmpc_impl_activemask());
184184

@@ -215,9 +215,9 @@ EXTERN void __kmpc_serialized_parallel(kmp_Ident *loc, uint32_t global_tid) {
215215
newTaskDescr);
216216
}
217217

218-
EXTERN void __kmpc_end_serialized_parallel(kmp_Ident *loc,
218+
static void endSerializedParallel(kmp_Ident *loc,
219219
uint32_t global_tid) {
220-
PRINT0(LD_IO, "call to __kmpc_end_serialized_parallel\n");
220+
PRINT0(LD_IO, "call to endSerializedParallel\n");
221221

222222
DecParallelLevel(/*ActiveParallel=*/false, __kmpc_impl_activemask());
223223

@@ -293,9 +293,9 @@ NOINLINE EXTERN void __kmpc_parallel_51(kmp_Ident *ident, kmp_int32 global_tid,
293293
bool InParallelRegion =
294294
(__kmpc_parallel_level() > __kmpc_is_spmd_exec_mode());
295295
if (!if_expr || InParallelRegion) {
296-
__kmpc_serialized_parallel(ident, global_tid);
296+
serializedParallel(ident, global_tid);
297297
__kmp_invoke_microtask(global_tid, 0, fn, args, nargs);
298-
__kmpc_end_serialized_parallel(ident, global_tid);
298+
endSerializedParallel(ident, global_tid);
299299
return;
300300
}
301301

openmp/libomptarget/deviceRTLs/interface.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -222,8 +222,6 @@ typedef int32_t kmp_CriticalName[8];
222222
EXTERN int32_t __kmpc_global_thread_num(kmp_Ident *loc);
223223
EXTERN void __kmpc_push_num_threads(kmp_Ident *loc, int32_t global_tid,
224224
int32_t num_threads);
225-
EXTERN void __kmpc_serialized_parallel(kmp_Ident *loc, uint32_t global_tid);
226-
EXTERN void __kmpc_end_serialized_parallel(kmp_Ident *loc, uint32_t global_tid);
227225
NOINLINE EXTERN uint8_t __kmpc_parallel_level();
228226

229227
// proc bind

0 commit comments

Comments
 (0)