mirror of
https://github.com/KhronosGroup/OpenCL-CTS.git
synced 2026-03-19 06:09:01 +00:00
Tidy up code to determine bit mask for ballot scans (#1363)
It seems more intuitive to set only the bits that are required, rather than to set one more bit than is required, only to clear it again. Signed-off-by: Stuart Brady <stuart.brady@arm.com>
This commit is contained in:
@@ -437,9 +437,9 @@ template <typename Ty, BallotOp operation> struct BALLOT_COUNT_SCAN_FIND
|
||||
else if (operation == BallotOp::ballot_inclusive_scan
|
||||
|| operation == BallotOp::ballot_exclusive_scan)
|
||||
{
|
||||
for (cl_uint i = 0; i <= sub_group_local_id; ++i) mask.set(i);
|
||||
if (operation == BallotOp::ballot_exclusive_scan)
|
||||
mask.reset(sub_group_local_id);
|
||||
for (cl_uint i = 0; i < sub_group_local_id; ++i) mask.set(i);
|
||||
if (operation == BallotOp::ballot_inclusive_scan)
|
||||
mask.set(sub_group_local_id);
|
||||
}
|
||||
return mask;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user