Module amdgpu
amdgpu intrinsics
The reference is the LLVM amdgpu guide and the LLVM implementation. The order of intrinsics here follows the order in the LLVM implementation.
Functions
-
ballot
Returns a bitfield (
u32oru64) containing the result of its i1 argument in all active lanes, and zero in all inactive lanes. - dispatch_id Returns the id of the dispatch that is currently executed.
- ds_bpermute Gather data across all lanes in a wavefront.
- ds_permute Scatter data across all lanes in a wavefront.
- endpgm Stop execution of the wavefront.
- groupstaticsize Returns the size of statically allocated shared memory for this program in bytes.
-
inverse_ballot
Indexes into the
valuewith the current lane id and returns for each lane if the corresponding bit is set. - llvm_ballot
- llvm_dispatch_id
- llvm_ds_bpermute
- llvm_ds_permute
- llvm_endpgm
- llvm_groupstaticsize
- llvm_inverse_ballot
- llvm_mbcnt_hi
- llvm_mbcnt_lo
- llvm_perm
- llvm_permlane16_swap
- llvm_permlane16_u32
- llvm_permlane16_var
- llvm_permlane32_swap
- llvm_permlane64_u32
- llvm_permlanex16_u32
- llvm_permlanex16_var
- llvm_readfirstlane_u32
- llvm_readfirstlane_u64
- llvm_readlane_u32
- llvm_readlane_u64
- llvm_s_barrier
- llvm_s_barrier_signal
- llvm_s_barrier_signal_isfirst
- llvm_s_barrier_wait
- llvm_s_get_barrier_state
- llvm_s_get_waveid_in_workgroup
- llvm_s_getpc
- llvm_s_memrealtime
- llvm_s_sethalt
- llvm_s_sleep
- llvm_sched_barrier
- llvm_sched_group_barrier
- llvm_update_dpp
- llvm_wave_barrier
- llvm_wave_id
- llvm_wave_reduce_add
- llvm_wave_reduce_and
- llvm_wave_reduce_max
- llvm_wave_reduce_min
- llvm_wave_reduce_or
- llvm_wave_reduce_umax
- llvm_wave_reduce_umin
- llvm_wave_reduce_xor
- llvm_wavefrontsize
- llvm_workgroup_id_x
- llvm_workgroup_id_y
- llvm_workgroup_id_z
- llvm_workitem_id_x
- llvm_workitem_id_y
- llvm_workitem_id_z
- llvm_writelane_u32
- llvm_writelane_u64
- mbcnt_hi Masked bit count, high 32 lanes.
- mbcnt_lo Masked bit count, low 32 lanes.
- perm Permute a 64-bit value.
-
permlane16_swap
Provide direct access to
v_permlane16_swap_b32instruction on supported targets. - permlane16_u32 Performs arbitrary gather-style operation within a row (16 contiguous lanes) of the second input operand.
- permlane16_var Performs arbitrary gather-style operation within a row (16 contiguous lanes) of the second input operand.
-
permlane32_swap
Provide direct access to
v_permlane32_swap_b32instruction on supported targets. -
permlane64_u32
Swap
valuebetween upper and lower 32 lanes in a wavefront. - permlanex16_u32 Performs arbitrary gather-style operation across two rows (16 contiguous lanes) of the second input operand.
- permlanex16_var Performs arbitrary gather-style operation across two rows (16 contiguous lanes) of the second input operand.
-
readfirstlane_u32
Get
valuefrom the first active lane in the wavefront. -
readfirstlane_u64
Get
valuefrom the first active lane in the wavefront. -
readlane_u32
Get
valuefrom the lane at indexlanein the wavefront. -
readlane_u64
Get
valuefrom the lane at indexlanein the wavefront. - s_barrier Synchronize all wavefronts in a workgroup.
- s_barrier_signal Signal a specific barrier type.
- s_barrier_signal_isfirst Signal a specific barrier type.
- s_barrier_wait Wait for a specific barrier type.
- s_get_barrier_state Get the state of a specific barrier type.
- s_get_waveid_in_workgroup Get the index of the current wavefront in the workgroup.
- s_getpc Returns the current process counter.
- s_memrealtime Measures time based on a fixed frequency.
- s_sethalt Stop execution of the kernel.
-
s_sleep
Sleeps for approximately
COUNT * 64cycles. - sched_barrier Prevent movement of some instruction types.
- sched_group_barrier Creates schedule groups with specific properties to create custom scheduling pipelines.
-
update_dpp
The
update_dppintrinsic represents theupdate.dppoperation in AMDGPU. It takes an old value, a source operand, a DPP control operand, a row mask, a bank mask, and a bound control. This operation is equivalent to a sequence ofv_mov_b32operations. - wave_barrier A barrier for only the threads within the current wavefront.
- wave_id Get the index of the current wavefront in the workgroup.
- wave_reduce_add Performs an arithmetic add reduction on the values provided by each lane in the wavefront.
- wave_reduce_and Performs a logical and reduction on the unsigned values provided by each lane in the wavefront.
- wave_reduce_max Performs an arithmetic max reduction on the signed values provided by each lane in the wavefront.
- wave_reduce_min Performs an arithmetic min reduction on the signed values provided by each lane in the wavefront.
- wave_reduce_or Performs a logical or reduction on the unsigned values provided by each lane in the wavefront.
- wave_reduce_umax Performs an arithmetic max reduction on the unsigned values provided by each lane in the wavefront.
- wave_reduce_umin Performs an arithmetic min reduction on the unsigned values provided by each lane in the wavefront.
- wave_reduce_xor Performs a logical xor reduction on the unsigned values provided by each lane in the wavefront.
- wavefrontsize Returns the number of threads in a wavefront.
- workgroup_id_x Returns the x coordinate of the workgroup index within the dispatch.
- workgroup_id_y Returns the y coordinate of the workgroup index within the dispatch.
- workgroup_id_z Returns the z coordinate of the workgroup index within the dispatch.
- workitem_id_x Returns the x coordinate of the workitem index within the workgroup.
- workitem_id_y Returns the y coordinate of the workitem index within the workgroup.
- workitem_id_z Returns the z coordinate of the workitem index within the workgroup.
-
writelane_u32
Return
valuefor the lane at indexlanein the wavefront. Returndefaultfor all other lanes. -
writelane_u64
Return
valuefor the lane at indexlanein the wavefront. Returndefaultfor all other lanes.