NVlabs / NVBit

200 stars 18 forks source link

Implementing a tool for branch divergence #25

Open trinayan opened 3 years ago

trinayan commented 3 years ago

Hi,

I was working on implementing a tool for branch divergence. I am wondering if there is any functional equivalence of the GetDirection function which was present in SASSI (https://github.com/NVlabs/SASSI/blob/master/instlibs/src/branch.cu#L214). Since it is important to know the threads that took a branch vs threads that did not for calculating branch divergence, I am wondering how I can achieve this functionality using the NVBit APIs. Thanks again.

WilliamWangPeng commented 2 years ago

@x-y-z hi dear author, I'm also working on this and I have searched all of the APIs in NVBit, and I did not find one?

do you have any advice?

thank you
best regards
William

x-y-z commented 2 years ago

By checking active_mask (all working threads) and predicate_mask (all working threads executing the instruction), you should be able to get branch divergence information at any instruction.

WilliamWangPeng commented 2 years ago

By checking active_mask (all working threads) and predicate_mask (all working threads executing the instruction), you should be able to get branch divergence information at any instruction.

thank you dear @x-y-z 👍

image

I have put the active_mask and predicate_mask in the count_instrs function, And next step, how can I get branch divergence information at any instruction

thank you
Best Regards
William