cdl-saarland / rv

RV: A Unified Region Vectorizer for LLVM

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

How to get vector lane / number of lanes from within loop

mppf opened this issue · comments

Suppose I am using RV to expose a SIMT programming model.

How can I arrange for the generated code to get the current vector lane as well as the number of vector lanes used from within a vectorized loop?

Thanks.

There is currently no way to query this from the SIMT code itself. I will add two new intrinsics:

i32 rv_lane() that returns the vector lane id.
i32 rv_num_lanes() that returns the number of lanes.

Implemented by 92b679a

The intrinsics are called:

rv_lane_id()
rv_num_lanes()