From 3eb0f50d85df0350af29f5f1dbbf5a3ddef906b3 Mon Sep 17 00:00:00 2001 From: Stuart Brady Date: Thu, 25 Nov 2021 13:36:20 +0000 Subject: [PATCH] Use maximum subgroup size in sub_group_ballot tests (#1344) sub_group_ballot_bit_count() and sub_group_ballot_find_msb() mask their input according to a subgroup size, which is assumed to be the maximum subgroup size, and not the actual subgroup size excluding non-existent work-items in the "remainder" subgroup. Fix this as per the the clarification made to the OpenCL C specification in revision 3.0.9 for issue KhronosGroup/OpenCL-Docs#626 by pull request KhronosGroup/OpenCL-Docs#689. 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 ee2c5e51..f362a501 100644 --- a/test_conformance/subgroups/test_subgroup_ballot.cpp +++ b/test_conformance/subgroups/test_subgroup_ballot.cpp @@ -496,7 +496,7 @@ template struct BALLOT_COUNT_SCAN_FIND | (bs128(mx[wg_offset + wi_id].s1) << 32) | (bs128(mx[wg_offset + wi_id].s2) << 64) | (bs128(mx[wg_offset + wi_id].s3) << 96); - bs &= getImportantBits(wi_id, current_sbs); + bs &= getImportantBits(wi_id, sbs); device_result = my[wg_offset + wi_id].s0; if (operation == BallotOp::ballot_inclusive_scan || operation == BallotOp::ballot_exclusive_scan @@ -516,7 +516,7 @@ template struct BALLOT_COUNT_SCAN_FIND } else if (operation == BallotOp::ballot_find_lsb) { - for (int id = 0; id < current_sbs; ++id) + for (int id = 0; id < sbs; ++id) { if (bs.test(id)) { @@ -537,7 +537,7 @@ template struct BALLOT_COUNT_SCAN_FIND } else if (operation == BallotOp::ballot_find_msb) { - for (int id = current_sbs - 1; id >= 0; --id) + for (int id = sbs - 1; id >= 0; --id) { if (bs.test(id)) {