llvm-runtime-resources-darwin 22.1.8 → 23.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/include/__clang_cuda_complex_builtins.h +10 -3
- package/include/__clang_cuda_intrinsics.h +207 -226
- package/include/__clang_cuda_math_forward_declares.h +5 -0
- package/include/__clang_cuda_runtime_wrapper.h +9 -5
- package/include/__clang_gpu_builtin_vars.h +71 -0
- package/include/__clang_gpu_device_functions.h +411 -0
- package/include/__clang_gpu_intrinsics.h +242 -0
- package/include/__clang_hip_libdevice_declares.h +0 -102
- package/include/__clang_hip_math.h +3 -3
- package/include/__clang_hip_runtime_wrapper.h +6 -1
- package/include/__clang_spirv_libdevice_declares.h +170 -0
- package/include/__clang_spirv_math.h +719 -0
- package/include/altivec.h +79 -9
- package/include/amdgpuintrin.h +2 -29
- package/include/amdhsa_abi.h +83 -0
- package/include/amo.h +89 -0
- package/include/andes_vector.h +5 -0
- package/include/arm64_neon.h +21 -0
- package/include/arm64intr.h +10 -0
- package/include/arm_acle.h +1 -0
- package/include/arm_neon.h +3922 -3754
- package/include/arm_sme.h +12 -0
- package/include/arm_sve.h +420 -0
- package/include/avx2intrin.h +4 -5
- package/include/avx512bmmintrin.h +174 -0
- package/include/avx512bmmvlintrin.h +245 -0
- package/include/avx512bwintrin.h +19 -29
- package/include/avx512fintrin.h +62 -89
- package/include/avx512fp16intrin.h +12 -18
- package/include/avx512vbmi2intrin.h +12 -16
- package/include/avx512vlbwintrin.h +24 -36
- package/include/avx512vlintrin.h +80 -96
- package/include/avx512vlvbmi2intrin.h +24 -32
- package/include/avx512vlvnniintrin.h +29 -34
- package/include/avx512vnniintrin.h +32 -35
- package/include/avx512vp2intersectintrin.h +1 -1
- package/include/avxvnniintrin.h +23 -18
- package/include/crc32intrin.h +10 -8
- package/include/emmintrin.h +8 -8
- package/include/endian.h +91 -0
- package/include/fuzzer/FuzzedDataProvider.h +3 -3
- package/include/gpuintrin.h +123 -105
- package/include/hlsl_alias_intrinsics_gen.inc +3869 -0
- package/include/hlsl_inline_intrinsics_gen.inc +546 -0
- package/include/hvx_hexagon_protos.h +102 -80
- package/include/immintrin.h +4 -2
- package/include/intrin.h +20 -10
- package/include/larchintrin.h +2 -0
- package/include/llvm_libc_wrappers/ctype.h +3 -2
- package/include/llvm_libc_wrappers/string.h +3 -2
- package/include/module.modulemap +16 -1
- package/include/nvptxintrin.h +15 -26
- package/include/opencl-c-base.h +7 -0
- package/include/opencl-c.h +163 -102
- package/include/openmp_wrappers/__clang_openmp_device_functions.h +14 -0
- package/include/openmp_wrappers/complex +7 -1
- package/include/openmp_wrappers/complex.h +6 -0
- package/include/openmp_wrappers/math.h +10 -0
- package/include/profile/InstrProfData.inc +65 -3
- package/include/ptrauth.h +90 -12
- package/include/riscv_bitmanip.h +7 -0
- package/include/riscv_corev_alu.h +2 -0
- package/include/riscv_crypto.h +8 -0
- package/include/riscv_mips.h +2 -0
- package/include/riscv_nds.h +3 -0
- package/include/riscv_ntlh.h +2 -0
- package/include/riscv_packed_simd.h +644 -0
- package/include/riscv_vector.h +43 -0
- package/include/sanitizer/asan_interface.h +51 -1
- package/include/sanitizer/common_interface_defs.h +12 -49
- package/include/sanitizer/safestack_interface.h +50 -0
- package/include/sanitizer/tysan_interface.h +36 -0
- package/include/sanitizer/ubsan_interface.h +30 -0
- package/include/sifive_vector.h +18 -0
- package/include/spirvintrin.h +2 -29
- package/include/stdint.h +5 -14
- package/include/vecintrin.h +1 -1
- package/include/wasm_simd128.h +17 -0
- package/include/xmmintrin.h +8 -7
- package/include/zos_wrappers/grp.h +19 -0
- package/include/zos_wrappers/locale.h +19 -0
- package/include/zos_wrappers/math.h +31 -0
- package/include/zos_wrappers/poll.h +19 -0
- package/include/zos_wrappers/stdlib.h +20 -0
- package/include/zos_wrappers/string.h +19 -0
- package/include/zos_wrappers/time.h +19 -0
- package/include/zos_wrappers/variant.h +19 -0
- package/lib/darwin/libclang_rt.asan_abi_ios.a +0 -0
- package/lib/darwin/libclang_rt.asan_abi_iossim.a +0 -0
- package/lib/darwin/libclang_rt.asan_abi_osx.a +0 -0
- package/lib/darwin/libclang_rt.asan_ios_dynamic.dylib +0 -0
- package/lib/darwin/libclang_rt.asan_iossim_dynamic.dylib +0 -0
- package/lib/darwin/libclang_rt.asan_osx_dynamic.dylib +0 -0
- package/lib/darwin/libclang_rt.cc_kext.a +0 -0
- package/lib/darwin/libclang_rt.cc_kext_ios.a +0 -0
- package/lib/darwin/libclang_rt.fuzzer_ios.a +0 -0
- package/lib/darwin/libclang_rt.fuzzer_iossim.a +0 -0
- package/lib/darwin/libclang_rt.fuzzer_no_main_ios.a +0 -0
- package/lib/darwin/libclang_rt.fuzzer_no_main_iossim.a +0 -0
- package/lib/darwin/libclang_rt.fuzzer_no_main_osx.a +0 -0
- package/lib/darwin/libclang_rt.fuzzer_osx.a +0 -0
- package/lib/darwin/libclang_rt.ios.a +0 -0
- package/lib/darwin/libclang_rt.iossim.a +0 -0
- package/lib/darwin/libclang_rt.lsan_ios_dynamic.dylib +0 -0
- package/lib/darwin/libclang_rt.lsan_iossim_dynamic.dylib +0 -0
- package/lib/darwin/libclang_rt.lsan_osx_dynamic.dylib +0 -0
- package/lib/darwin/libclang_rt.osx.a +0 -0
- package/lib/darwin/libclang_rt.profile_ios.a +0 -0
- package/lib/darwin/libclang_rt.profile_iossim.a +0 -0
- package/lib/darwin/libclang_rt.profile_osx.a +0 -0
- package/lib/darwin/libclang_rt.rtsan_ios_dynamic.dylib +0 -0
- package/lib/darwin/libclang_rt.rtsan_iossim_dynamic.dylib +0 -0
- package/lib/darwin/libclang_rt.rtsan_osx_dynamic.dylib +0 -0
- package/lib/darwin/libclang_rt.stats_client_ios.a +0 -0
- package/lib/darwin/libclang_rt.stats_client_iossim.a +0 -0
- package/lib/darwin/libclang_rt.stats_client_osx.a +0 -0
- package/lib/darwin/libclang_rt.stats_ios_dynamic.dylib +0 -0
- package/lib/darwin/libclang_rt.stats_iossim_dynamic.dylib +0 -0
- package/lib/darwin/libclang_rt.stats_osx_dynamic.dylib +0 -0
- package/lib/darwin/libclang_rt.tsan_ios_dynamic.dylib +0 -0
- package/lib/darwin/libclang_rt.tsan_iossim_dynamic.dylib +0 -0
- package/lib/darwin/libclang_rt.tsan_osx_dynamic.dylib +0 -0
- package/lib/darwin/libclang_rt.tysan_ios_dynamic.dylib +0 -0
- package/lib/darwin/libclang_rt.tysan_iossim_dynamic.dylib +0 -0
- package/lib/darwin/libclang_rt.tysan_osx_dynamic.dylib +0 -0
- package/lib/darwin/libclang_rt.ubsan_ios_dynamic.dylib +0 -0
- package/lib/darwin/libclang_rt.ubsan_iossim_dynamic.dylib +0 -0
- package/lib/darwin/libclang_rt.ubsan_minimal_ios.a +0 -0
- package/lib/darwin/libclang_rt.ubsan_minimal_ios_dynamic.dylib +0 -0
- package/lib/darwin/libclang_rt.ubsan_minimal_iossim.a +0 -0
- package/lib/darwin/libclang_rt.ubsan_minimal_iossim_dynamic.dylib +0 -0
- package/lib/darwin/libclang_rt.ubsan_minimal_osx.a +0 -0
- package/lib/darwin/libclang_rt.ubsan_minimal_osx_dynamic.dylib +0 -0
- package/lib/darwin/libclang_rt.ubsan_osx_dynamic.dylib +0 -0
- package/package.json +1 -1
- package/include/amxtf32intrin.h +0 -108
package/include/gpuintrin.h
CHANGED
|
@@ -32,30 +32,6 @@ _Pragma("push_macro(\"bool\")");
|
|
|
32
32
|
#define bool _Bool
|
|
33
33
|
#endif
|
|
34
34
|
|
|
35
|
-
_Pragma("omp begin declare target device_type(nohost)");
|
|
36
|
-
_Pragma("omp begin declare variant match(device = {kind(gpu)})");
|
|
37
|
-
|
|
38
|
-
// Forward declare a few functions for the implementation header.
|
|
39
|
-
|
|
40
|
-
// Returns a bitmask marking all lanes that have the same value of __x.
|
|
41
|
-
_DEFAULT_FN_ATTRS static __inline__ uint64_t
|
|
42
|
-
__gpu_match_any_u32_impl(uint64_t __lane_mask, uint32_t __x);
|
|
43
|
-
|
|
44
|
-
// Returns a bitmask marking all lanes that have the same value of __x.
|
|
45
|
-
_DEFAULT_FN_ATTRS static __inline__ uint64_t
|
|
46
|
-
__gpu_match_any_u64_impl(uint64_t __lane_mask, uint64_t __x);
|
|
47
|
-
|
|
48
|
-
// Returns the current lane mask if every lane contains __x.
|
|
49
|
-
_DEFAULT_FN_ATTRS static __inline__ uint64_t
|
|
50
|
-
__gpu_match_all_u32_impl(uint64_t __lane_mask, uint32_t __x);
|
|
51
|
-
|
|
52
|
-
// Returns the current lane mask if every lane contains __x.
|
|
53
|
-
_DEFAULT_FN_ATTRS static __inline__ uint64_t
|
|
54
|
-
__gpu_match_all_u64_impl(uint64_t __lane_mask, uint64_t __x);
|
|
55
|
-
|
|
56
|
-
_Pragma("omp end declare variant");
|
|
57
|
-
_Pragma("omp end declare target");
|
|
58
|
-
|
|
59
35
|
#if defined(__NVPTX__)
|
|
60
36
|
#include <nvptxintrin.h>
|
|
61
37
|
#elif defined(__AMDGPU__)
|
|
@@ -69,6 +45,9 @@ _Pragma("omp end declare target");
|
|
|
69
45
|
_Pragma("omp begin declare target device_type(nohost)");
|
|
70
46
|
_Pragma("omp begin declare variant match(device = {kind(gpu)})");
|
|
71
47
|
|
|
48
|
+
// Attribute to declare a function as a kernel.
|
|
49
|
+
#define __gpu_kernel __attribute__((device_kernel, visibility("protected")))
|
|
50
|
+
|
|
72
51
|
#define __GPU_X_DIM 0
|
|
73
52
|
#define __GPU_Y_DIM 1
|
|
74
53
|
#define __GPU_Z_DIM 2
|
|
@@ -144,11 +123,10 @@ __gpu_is_first_in_lane(uint64_t __lane_mask) {
|
|
|
144
123
|
// Copies the value from the first active thread to the rest.
|
|
145
124
|
_DEFAULT_FN_ATTRS static __inline__ uint64_t
|
|
146
125
|
__gpu_read_first_lane_u64(uint64_t __lane_mask, uint64_t __x) {
|
|
147
|
-
uint32_t __hi = (uint32_t)(__x >>
|
|
148
|
-
uint32_t __lo = (uint32_t)(__x &
|
|
149
|
-
return ((uint64_t)__gpu_read_first_lane_u32(__lane_mask, __hi) <<
|
|
150
|
-
((uint64_t)__gpu_read_first_lane_u32(__lane_mask, __lo) &
|
|
151
|
-
0xFFFFFFFFull);
|
|
126
|
+
uint32_t __hi = (uint32_t)(__x >> 32);
|
|
127
|
+
uint32_t __lo = (uint32_t)(__x & 0xFFFFFFFF);
|
|
128
|
+
return ((uint64_t)__gpu_read_first_lane_u32(__lane_mask, __hi) << 32) |
|
|
129
|
+
((uint64_t)__gpu_read_first_lane_u32(__lane_mask, __lo) & 0xFFFFFFFF);
|
|
152
130
|
}
|
|
153
131
|
|
|
154
132
|
// Gets the first floating point value from the active lanes.
|
|
@@ -171,11 +149,10 @@ __gpu_read_first_lane_f64(uint64_t __lane_mask, double __x) {
|
|
|
171
149
|
_DEFAULT_FN_ATTRS static __inline__ uint64_t
|
|
172
150
|
__gpu_shuffle_idx_u64(uint64_t __lane_mask, uint32_t __idx, uint64_t __x,
|
|
173
151
|
uint32_t __width) {
|
|
174
|
-
uint32_t __hi = (uint32_t)(__x >>
|
|
152
|
+
uint32_t __hi = (uint32_t)(__x >> 32);
|
|
175
153
|
uint32_t __lo = (uint32_t)(__x & 0xFFFFFFFF);
|
|
176
154
|
uint32_t __mask = (uint32_t)__lane_mask;
|
|
177
|
-
return ((uint64_t)__gpu_shuffle_idx_u32(__mask, __idx, __hi, __width)
|
|
178
|
-
<< 32ull) |
|
|
155
|
+
return ((uint64_t)__gpu_shuffle_idx_u32(__mask, __idx, __hi, __width) << 32) |
|
|
179
156
|
((uint64_t)__gpu_shuffle_idx_u32(__mask, __idx, __lo, __width));
|
|
180
157
|
}
|
|
181
158
|
|
|
@@ -198,125 +175,166 @@ __gpu_shuffle_idx_f64(uint64_t __lane_mask, uint32_t __idx, double __x,
|
|
|
198
175
|
__builtin_bit_cast(uint64_t, __x), __width));
|
|
199
176
|
}
|
|
200
177
|
|
|
201
|
-
//
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
uint32_t __index = __gpu_lane_id() - __step; \
|
|
220
|
-
__bitmask_type bitmask = __gpu_lane_id() >= __step; \
|
|
221
|
-
__x += __builtin_bit_cast( \
|
|
222
|
-
__type, \
|
|
223
|
-
-bitmask & __builtin_bit_cast(__bitmask_type, \
|
|
224
|
-
__gpu_shuffle_idx_##__suffix( \
|
|
225
|
-
__lane_mask, __index, __x, \
|
|
226
|
-
__gpu_num_lanes()))); \
|
|
227
|
-
} \
|
|
178
|
+
// Implements scan and reduction operations across a GPU warp or wavefront.
|
|
179
|
+
//
|
|
180
|
+
// Both scans work by iterating log2(N) steps. The bitmask tracks the currently
|
|
181
|
+
// unprocessed lanes, above or below the current lane in the case of a suffix or
|
|
182
|
+
// prefix scan. Each iteration we shuffle in the unprocessed neighbors and then
|
|
183
|
+
// clear the bits that this operation handled.
|
|
184
|
+
#define __DO_LANE_OPS(__type, __op, __identity, __prefix, __suffix) \
|
|
185
|
+
_DEFAULT_FN_ATTRS static __inline__ __type \
|
|
186
|
+
__gpu_suffix_scan_##__prefix##_##__suffix(uint64_t __lane_mask, \
|
|
187
|
+
__type __x) { \
|
|
188
|
+
uint64_t __above = __lane_mask & -(UINT64_C(2) << __gpu_lane_id()); \
|
|
189
|
+
for (uint32_t __step = 1; __step < __gpu_num_lanes(); __step *= 2) { \
|
|
190
|
+
uint32_t __src = __builtin_ctzg(__above, (int)sizeof(__above) * 8); \
|
|
191
|
+
__type __result = __gpu_shuffle_idx_##__suffix(__lane_mask, __src, __x, \
|
|
192
|
+
__gpu_num_lanes()); \
|
|
193
|
+
__x = __op(__x, __above ? __result : (__type)__identity); \
|
|
194
|
+
for (uint32_t __i = 0; __i < __step; ++__i) \
|
|
195
|
+
__above &= __above - 1; \
|
|
228
196
|
} \
|
|
229
197
|
return __x; \
|
|
230
|
-
}
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
if (__divergent) { \
|
|
245
|
-
return __gpu_shuffle_idx_##__suffix( \
|
|
246
|
-
__lane_mask, 63 - __builtin_clzll(__lane_mask), \
|
|
247
|
-
__gpu_lane_scan_##__suffix(__lane_mask, __x), __gpu_num_lanes()); \
|
|
248
|
-
} else { \
|
|
249
|
-
for (uint32_t __step = 1; __step < __gpu_num_lanes(); __step *= 2) { \
|
|
250
|
-
uint32_t __index = __step + __gpu_lane_id(); \
|
|
251
|
-
__x += __gpu_shuffle_idx_##__suffix(__lane_mask, __index, __x, \
|
|
252
|
-
__gpu_num_lanes()); \
|
|
253
|
-
} \
|
|
254
|
-
return __gpu_read_first_lane_##__suffix(__lane_mask, __x); \
|
|
198
|
+
} \
|
|
199
|
+
\
|
|
200
|
+
_DEFAULT_FN_ATTRS static __inline__ __type \
|
|
201
|
+
__gpu_prefix_scan_##__prefix##_##__suffix(uint64_t __lane_mask, \
|
|
202
|
+
__type __x) { \
|
|
203
|
+
uint64_t __below = __lane_mask & ((UINT64_C(1) << __gpu_lane_id()) - 1); \
|
|
204
|
+
for (uint32_t __step = 1; __step < __gpu_num_lanes(); __step *= 2) { \
|
|
205
|
+
uint32_t __src = 63 - __builtin_clzg(__below, (int)sizeof(__below) * 8); \
|
|
206
|
+
__type __result = __gpu_shuffle_idx_##__suffix(__lane_mask, __src, __x, \
|
|
207
|
+
__gpu_num_lanes()); \
|
|
208
|
+
__x = __op(__x, __below ? __result : (__type)__identity); \
|
|
209
|
+
for (uint32_t __i = 0; __i < __step; ++__i) \
|
|
210
|
+
__below ^= \
|
|
211
|
+
(UINT64_C(1) << (63 - __builtin_clzg(__below, 0))) & __below; \
|
|
255
212
|
} \
|
|
213
|
+
return __x; \
|
|
214
|
+
} \
|
|
215
|
+
\
|
|
216
|
+
_DEFAULT_FN_ATTRS static __inline__ __type \
|
|
217
|
+
__gpu_lane_##__prefix##_##__suffix(uint64_t __lane_mask, __type __x) { \
|
|
218
|
+
return __gpu_read_first_lane_##__suffix( \
|
|
219
|
+
__lane_mask, \
|
|
220
|
+
__gpu_suffix_scan_##__prefix##_##__suffix(__lane_mask, __x)); \
|
|
256
221
|
}
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
222
|
+
|
|
223
|
+
#define __GPU_OP(__x, __y) ((__x) + (__y))
|
|
224
|
+
__DO_LANE_OPS(uint32_t, __GPU_OP, 0, add, u32);
|
|
225
|
+
__DO_LANE_OPS(uint64_t, __GPU_OP, 0, add, u64);
|
|
226
|
+
__DO_LANE_OPS(float, __GPU_OP, 0, add, f32);
|
|
227
|
+
__DO_LANE_OPS(double, __GPU_OP, 0, add, f64);
|
|
228
|
+
#undef __GPU_OP
|
|
229
|
+
|
|
230
|
+
#define __GPU_OP(__x, __y) ((__x) & (__y))
|
|
231
|
+
__DO_LANE_OPS(uint32_t, __GPU_OP, UINT32_MAX, and, u32);
|
|
232
|
+
__DO_LANE_OPS(uint64_t, __GPU_OP, UINT64_MAX, and, u64);
|
|
233
|
+
#undef __GPU_OP
|
|
234
|
+
|
|
235
|
+
#define __GPU_OP(__x, __y) ((__x) | (__y))
|
|
236
|
+
__DO_LANE_OPS(uint32_t, __GPU_OP, 0, or, u32);
|
|
237
|
+
__DO_LANE_OPS(uint64_t, __GPU_OP, 0, or, u64);
|
|
238
|
+
#undef __GPU_OP
|
|
239
|
+
|
|
240
|
+
#define __GPU_OP(__x, __y) ((__x) ^ (__y))
|
|
241
|
+
__DO_LANE_OPS(uint32_t, __GPU_OP, 0, xor, u32);
|
|
242
|
+
__DO_LANE_OPS(uint64_t, __GPU_OP, 0, xor, u64);
|
|
243
|
+
#undef __GPU_OP
|
|
244
|
+
|
|
245
|
+
#define __GPU_OP(__x, __y) ((__x) < (__y) ? (__x) : (__y))
|
|
246
|
+
__DO_LANE_OPS(uint32_t, __GPU_OP, UINT32_MAX, min, u32);
|
|
247
|
+
__DO_LANE_OPS(uint64_t, __GPU_OP, UINT64_MAX, min, u64);
|
|
248
|
+
#undef __GPU_OP
|
|
249
|
+
|
|
250
|
+
#define __GPU_OP(__x, __y) ((__x) > (__y) ? (__x) : (__y))
|
|
251
|
+
__DO_LANE_OPS(uint32_t, __GPU_OP, 0, max, u32);
|
|
252
|
+
__DO_LANE_OPS(uint64_t, __GPU_OP, 0, max, u64);
|
|
253
|
+
#undef __GPU_OP
|
|
254
|
+
|
|
255
|
+
#define __GPU_OP(__x, __y) __builtin_elementwise_minnum((__x), (__y))
|
|
256
|
+
__DO_LANE_OPS(float, __GPU_OP, __builtin_inff(), minnum, f32);
|
|
257
|
+
__DO_LANE_OPS(double, __GPU_OP, __builtin_inf(), minnum, f64);
|
|
258
|
+
#undef __GPU_OP
|
|
259
|
+
|
|
260
|
+
#define __GPU_OP(__x, __y) __builtin_elementwise_maxnum((__x), (__y))
|
|
261
|
+
__DO_LANE_OPS(float, __GPU_OP, -__builtin_inff(), maxnum, f32);
|
|
262
|
+
__DO_LANE_OPS(double, __GPU_OP, -__builtin_inf(), maxnum, f64);
|
|
263
|
+
#undef __GPU_OP
|
|
264
|
+
|
|
265
|
+
#undef __DO_LANE_OPS
|
|
262
266
|
|
|
263
267
|
// Returns a bitmask marking all lanes that have the same value of __x.
|
|
268
|
+
#ifndef __gpu_match_any_u32_impl
|
|
264
269
|
_DEFAULT_FN_ATTRS static __inline__ uint64_t
|
|
265
|
-
|
|
270
|
+
__gpu_match_any_u32(uint64_t __lane_mask, uint32_t __x) {
|
|
266
271
|
uint64_t __match_mask = 0;
|
|
267
272
|
|
|
268
273
|
bool __done = 0;
|
|
269
274
|
for (uint64_t __active_mask = __lane_mask; __active_mask;
|
|
270
275
|
__active_mask = __gpu_ballot(__lane_mask, !__done)) {
|
|
271
276
|
if (!__done) {
|
|
272
|
-
uint32_t __first =
|
|
277
|
+
uint32_t __first = __gpu_shuffle_idx_u32(
|
|
278
|
+
__active_mask, __builtin_ctzg(__active_mask), __x, __gpu_num_lanes());
|
|
279
|
+
uint64_t __ballot = __gpu_ballot(__active_mask, __first == __x);
|
|
273
280
|
if (__first == __x) {
|
|
274
|
-
__match_mask =
|
|
281
|
+
__match_mask = __ballot;
|
|
275
282
|
__done = 1;
|
|
276
283
|
}
|
|
277
284
|
}
|
|
278
285
|
}
|
|
279
|
-
__gpu_sync_lane(__lane_mask);
|
|
280
286
|
return __match_mask;
|
|
281
287
|
}
|
|
288
|
+
#endif
|
|
289
|
+
#undef __gpu_match_any_u32_impl
|
|
282
290
|
|
|
283
291
|
// Returns a bitmask marking all lanes that have the same value of __x.
|
|
292
|
+
#ifndef __gpu_match_any_u64_impl
|
|
284
293
|
_DEFAULT_FN_ATTRS static __inline__ uint64_t
|
|
285
|
-
|
|
294
|
+
__gpu_match_any_u64(uint64_t __lane_mask, uint64_t __x) {
|
|
286
295
|
uint64_t __match_mask = 0;
|
|
287
296
|
|
|
288
297
|
bool __done = 0;
|
|
289
298
|
for (uint64_t __active_mask = __lane_mask; __active_mask;
|
|
290
299
|
__active_mask = __gpu_ballot(__lane_mask, !__done)) {
|
|
291
300
|
if (!__done) {
|
|
292
|
-
uint64_t __first =
|
|
301
|
+
uint64_t __first = __gpu_shuffle_idx_u64(
|
|
302
|
+
__active_mask, __builtin_ctzg(__active_mask), __x, __gpu_num_lanes());
|
|
303
|
+
uint64_t __ballot = __gpu_ballot(__active_mask, __first == __x);
|
|
293
304
|
if (__first == __x) {
|
|
294
|
-
__match_mask =
|
|
305
|
+
__match_mask = __ballot;
|
|
295
306
|
__done = 1;
|
|
296
307
|
}
|
|
297
308
|
}
|
|
298
309
|
}
|
|
299
|
-
__gpu_sync_lane(__lane_mask);
|
|
300
310
|
return __match_mask;
|
|
301
311
|
}
|
|
312
|
+
#endif
|
|
313
|
+
#undef __gpu_match_any_u64_impl
|
|
302
314
|
|
|
303
315
|
// Returns the current lane mask if every lane contains __x.
|
|
316
|
+
#ifndef __gpu_match_all_u32_impl
|
|
304
317
|
_DEFAULT_FN_ATTRS static __inline__ uint64_t
|
|
305
|
-
|
|
306
|
-
uint32_t __first =
|
|
318
|
+
__gpu_match_all_u32(uint64_t __lane_mask, uint32_t __x) {
|
|
319
|
+
uint32_t __first = __gpu_shuffle_idx_u32(
|
|
320
|
+
__lane_mask, __builtin_ctzg(__lane_mask), __x, __gpu_num_lanes());
|
|
307
321
|
uint64_t __ballot = __gpu_ballot(__lane_mask, __x == __first);
|
|
308
|
-
|
|
309
|
-
return __ballot == __gpu_lane_mask() ? __gpu_lane_mask() : 0ull;
|
|
322
|
+
return __ballot == __lane_mask ? __lane_mask : UINT64_C(0);
|
|
310
323
|
}
|
|
324
|
+
#endif
|
|
325
|
+
#undef __gpu_match_all_u32_impl
|
|
311
326
|
|
|
312
327
|
// Returns the current lane mask if every lane contains __x.
|
|
328
|
+
#ifndef __gpu_match_all_u64_impl
|
|
313
329
|
_DEFAULT_FN_ATTRS static __inline__ uint64_t
|
|
314
|
-
|
|
315
|
-
uint64_t __first =
|
|
330
|
+
__gpu_match_all_u64(uint64_t __lane_mask, uint64_t __x) {
|
|
331
|
+
uint64_t __first = __gpu_shuffle_idx_u64(
|
|
332
|
+
__lane_mask, __builtin_ctzg(__lane_mask), __x, __gpu_num_lanes());
|
|
316
333
|
uint64_t __ballot = __gpu_ballot(__lane_mask, __x == __first);
|
|
317
|
-
|
|
318
|
-
return __ballot == __gpu_lane_mask() ? __gpu_lane_mask() : 0ull;
|
|
334
|
+
return __ballot == __lane_mask ? __lane_mask : UINT64_C(0);
|
|
319
335
|
}
|
|
336
|
+
#endif
|
|
337
|
+
#undef __gpu_match_all_u64_impl
|
|
320
338
|
|
|
321
339
|
_Pragma("omp end declare variant");
|
|
322
340
|
_Pragma("omp end declare target");
|