1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
//! Functions that work over warps of threads.
//!
//! Warps in CUDA are groups of 32 threads that are dispatched together inside of
//! thread blocks and execute in SIMT fashion.
use crategpu_only;
/// Synchronizes all of the threads inside of this warp according to `mask`.
///
/// # Safety
///
/// The behavior of this function is undefined if:
/// - Any thread inside `mask` has exited.
/// - The executing thread is not inside of `mask`.
///
/// Moreover, on compute_62 and below, all of the threads inside `mask` must call
/// `sync` with the __exact same__ mask. Otherwise it is undefined behavior.
pub unsafe
/// Returns the thread's lane within its warp. This value ranges from `0` to `WARP_SIZE - 1` (`WARP_SIZE` is 32 on all
/// architectures currently).