File tree Expand file tree Collapse file tree 1 file changed +13
-5
lines changed
openmp/runtime/src/include Expand file tree Collapse file tree 1 file changed +13
-5
lines changed Original file line number Diff line number Diff line change 9
9
#ifndef __OMPX_H
10
10
#define __OMPX_H
11
11
12
- #ifdef __AMDGCN_WAVEFRONT_SIZE
13
- #define __WARP_SIZE __AMDGCN_WAVEFRONT_SIZE
14
- #else
15
- #define __WARP_SIZE 32
12
+ #if (defined(__NVPTX__) || defined(__AMDGPU__))
13
+ #include <gpuintrin.h>
14
+ #define __OMPX_TARGET_IS_GPU
16
15
#endif
17
16
18
17
typedef unsigned long uint64_t;
18
+ typedef unsigned int uint32_t;
19
+
20
+ static inline uint32_t __warpSize(void) {
21
+ #ifdef __OMPX_TARGET_IS_GPU
22
+ return __gpu_num_lanes();
23
+ #else
24
+ __builtin_trap();
25
+ #endif
26
+ }
19
27
20
28
#ifdef __cplusplus
21
29
extern "C" {
@@ -212,7 +220,7 @@ static inline uint64_t ballot_sync(uint64_t mask, int pred) {
212
220
///{
213
221
#define _TGT_KERNEL_LANGUAGE_SHFL_DOWN_SYNC(TYPE, TY) \
214
222
static inline TYPE shfl_down_sync(uint64_t mask, TYPE var, unsigned delta, \
215
- int width = __WARP_SIZE) { \
223
+ int width = __warpSize()) { \
216
224
return ompx_shfl_down_sync_##TY(mask, var, delta, width); \
217
225
}
218
226
You can’t perform that action at this time.
0 commit comments