From f8ec235d3c1555fbfaa7eea6bf5f3b588de1b03f Mon Sep 17 00:00:00 2001 From: Stuart Brady Date: Thu, 2 Dec 2021 15:27:30 +0000 Subject: [PATCH] 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 --- test_conformance/subgroups/test_subgroup_ballot.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/test_conformance/subgroups/test_subgroup_ballot.cpp b/test_conformance/subgroups/test_subgroup_ballot.cpp index f362a501..e742aa3b 100644 --- a/test_conformance/subgroups/test_subgroup_ballot.cpp +++ b/test_conformance/subgroups/test_subgroup_ballot.cpp @@ -437,9 +437,9 @@ template 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; }