PTX ISA v9.4

9.7.15.12. Parallel Synchronization and Communication Instructions: activemask

activemask

Queries the active threads within a warp.

Syntax

ptx
activemask.b32 d;

Description

activemask queries predicated-on active threads from the executing warp and sets the destination d with 32-bit integer mask where bit position in the mask corresponds to the thread's laneid.

Destination d is a 32-bit destination register.

An active thread will contribute 1 for its entry in the result and exited or inactive or predicated-off thread will contribute 0 for its entry in the result.

PTX ISA Notes

Introduced in PTX ISA version 6.2.

Target ISA Notes

Requires sm_30 or higher.

Examples

ptx
activemask.b32  %r1;
esc
Type to search across all documentation