1
1
//===------- interface.h - NVPTX OpenMP interface definitions ---- CUDA -*-===//
2
2
//
3
- // The LLVM Compiler Infrastructure
4
- //
5
- // This file is dual licensed under the MIT and the University of Illinois Open
6
- // Source Licenses. See LICENSE.txt for details.
3
+ // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4
+ // See https://llvm.org/LICENSE.txt for license information.
5
+ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7
6
//
8
7
//===----------------------------------------------------------------------===//
9
8
//
10
9
// This file contains debug macros to be used in the application.
11
10
//
12
11
// This file contains all the definitions that are relevant to
13
12
// the interface. The first section contains the interface as
14
- // declared by OpenMP. A second section includes library private calls
15
- // (mostly debug, temporary?) The third section includes the compiler
13
+ // declared by OpenMP. The second section includes the compiler
16
14
// specific interfaces.
17
15
//
18
16
//===----------------------------------------------------------------------===//
@@ -201,6 +199,7 @@ typedef void (*kmp_CopyToScratchpadFctPtr)(void *reduceData, void *scratchpad,
201
199
typedef void (* kmp_LoadReduceFctPtr )(void * reduceData , void * scratchpad ,
202
200
int32_t index , int32_t width ,
203
201
int32_t reduce );
202
+ typedef void (* kmp_ListGlobalFctPtr )(void * buffer , int idx , void * reduce_data );
204
203
205
204
// task defs
206
205
typedef struct kmp_TaskDescr kmp_TaskDescr ;
@@ -211,51 +210,14 @@ typedef struct kmp_TaskDescr {
211
210
int32_t partId ; // unused
212
211
kmp_TaskFctPtr destructors ; // destructor of c++ first private
213
212
} kmp_TaskDescr ;
214
- // task dep defs
215
- #define KMP_TASKDEP_IN 0x1u
216
- #define KMP_TASKDEP_OUT 0x2u
217
- typedef struct kmp_TaskDep_Public {
218
- void * addr ;
219
- size_t len ;
220
- uint8_t flags ; // bit 0: in, bit 1: out
221
- } kmp_TaskDep_Public ;
222
-
223
- // flags that interpret the interface part of tasking flags
224
- #define KMP_TASK_IS_TIED 0x1
225
- #define KMP_TASK_FINAL 0x2
226
- #define KMP_TASK_MERGED_IF0 0x4 /* unused */
227
- #define KMP_TASK_DESTRUCTOR_THUNK 0x8
228
-
229
- // flags for task setup return
230
- #define KMP_CURRENT_TASK_NOT_SUSPENDED 0
231
- #define KMP_CURRENT_TASK_SUSPENDED 1
232
213
233
214
// sync defs
234
215
typedef int32_t kmp_CriticalName [8 ];
235
216
236
- ////////////////////////////////////////////////////////////////////////////////
237
- // flags for kstate (all bits initially off)
238
- ////////////////////////////////////////////////////////////////////////////////
239
-
240
- // first 2 bits used by kmp_Reduction (defined in kmp_reduction.cpp)
241
- #define KMP_REDUCTION_MASK 0x3
242
- #define KMP_SKIP_NEXT_CALL 0x4
243
- #define KMP_SKIP_NEXT_CANCEL_BARRIER 0x8
244
-
245
- ////////////////////////////////////////////////////////////////////////////////
246
- // data
247
- ////////////////////////////////////////////////////////////////////////////////
248
-
249
217
////////////////////////////////////////////////////////////////////////////////
250
218
// external interface
251
219
////////////////////////////////////////////////////////////////////////////////
252
220
253
- // query
254
- EXTERN int32_t __kmpc_global_num_threads (kmp_Ident * loc ); // missing
255
- EXTERN int32_t __kmpc_bound_thread_num (kmp_Ident * loc ); // missing
256
- EXTERN int32_t __kmpc_bound_num_threads (kmp_Ident * loc ); // missing
257
- EXTERN int32_t __kmpc_in_parallel (kmp_Ident * loc ); // missing
258
-
259
221
// parallel
260
222
EXTERN int32_t __kmpc_global_thread_num (kmp_Ident * loc );
261
223
EXTERN void __kmpc_push_num_threads (kmp_Ident * loc , int32_t global_tid ,
@@ -411,6 +373,12 @@ EXTERN int32_t __kmpc_nvptx_parallel_reduce_nowait_simple_generic(
411
373
EXTERN int32_t __kmpc_nvptx_simd_reduce_nowait (
412
374
int32_t global_tid , int32_t num_vars , size_t reduce_size , void * reduce_data ,
413
375
kmp_ShuffleReductFctPtr shflFct , kmp_InterWarpCopyFctPtr cpyFct );
376
+ EXTERN int32_t __kmpc_nvptx_teams_reduce_nowait_v2 (
377
+ kmp_Ident * loc , int32_t global_tid , void * global_buffer ,
378
+ int32_t num_of_records , void * reduce_data , kmp_ShuffleReductFctPtr shflFct ,
379
+ kmp_InterWarpCopyFctPtr cpyFct , kmp_ListGlobalFctPtr lgcpyFct ,
380
+ kmp_ListGlobalFctPtr lgredFct , kmp_ListGlobalFctPtr glcpyFct ,
381
+ kmp_ListGlobalFctPtr glredFct );
414
382
EXTERN int32_t __kmpc_nvptx_teams_reduce_nowait (
415
383
int32_t global_tid , int32_t num_vars , size_t reduce_size , void * reduce_data ,
416
384
kmp_ShuffleReductFctPtr shflFct , kmp_InterWarpCopyFctPtr cpyFct ,
0 commit comments