From e9cd9a446e1b36a02f6e8f959256d5f96eda21a4 Mon Sep 17 00:00:00 2001 From: Stuart Brady Date: Mon, 8 Nov 2021 11:00:50 +0000 Subject: [PATCH] Remove excessive logging in subgroup tests (#1343) This also adds some missing data type logging to the subgroup_functions_non_uniform_vote tests. Signed-off-by: Stuart Brady --- .../subgroups/subgroup_common_templates.h | 37 ------------ .../subgroups/test_subgroup_ballot.cpp | 14 ----- .../test_subgroup_non_uniform_vote.cpp | 58 +++++++------------ 3 files changed, 21 insertions(+), 88 deletions(-) diff --git a/test_conformance/subgroups/subgroup_common_templates.h b/test_conformance/subgroups/subgroup_common_templates.h index 5c5f9560..349f8100 100644 --- a/test_conformance/subgroups/subgroup_common_templates.h +++ b/test_conformance/subgroups/subgroup_common_templates.h @@ -80,7 +80,6 @@ template struct BC TypeManager::name()); if (non_uniform_size) { - log_info(" non uniform work group size mode ON\n"); ng++; } for (k = 0; k < ng; ++k) @@ -581,14 +580,6 @@ template struct SCEX_NU : func_name = "sub_group_scan_exclusive"; log_info(" %s_%s(%s)...\n", func_name.c_str(), operation_names(operation), TypeManager::name()); - log_info(" test params: global size = %d local size = %d subgroups " - "size = %d \n", - test_params.global_workgroup_size, nw, ns); - if (test_params.work_items_mask.any()) - { - log_info(" work items mask: %s\n", - test_params.work_items_mask.to_string().c_str()); - } genrand(x, t, m, ns, nw, ng); } @@ -637,16 +628,10 @@ template struct SCEX_NU } if (active_work_items.empty()) { - log_info(" No acitve workitems in workgroup id = %d " - "subgroup id = %d - no calculation\n", - k, j); continue; } else if (active_work_items.size() == 1) { - log_info(" One active workitem in workgroup id = %d " - "subgroup id = %d - no calculation\n", - k, j); continue; } else @@ -702,14 +687,6 @@ template struct SCIN_NU genrand(x, t, m, ns, nw, ng); log_info(" %s_%s(%s)...\n", func_name.c_str(), operation_names(operation), TypeManager::name()); - log_info(" test params: global size = %d local size = %d subgroups " - "size = %d \n", - test_params.global_workgroup_size, nw, ns); - if (test_params.work_items_mask.any()) - { - log_info(" work items mask: %s\n", - test_params.work_items_mask.to_string().c_str()); - } } static int chk(Ty *x, Ty *y, Ty *mx, Ty *my, cl_int *m, @@ -765,9 +742,6 @@ template struct SCIN_NU } if (active_work_items.empty()) { - log_info(" No acitve workitems in workgroup id = %d " - "subgroup id = %d - no calculation\n", - k, j); continue; } else @@ -828,14 +802,6 @@ template struct RED_NU : func_name = "sub_group_reduce"; log_info(" %s_%s(%s)...\n", func_name.c_str(), operation_names(operation), TypeManager::name()); - log_info(" test params: global size = %d local size = %d subgroups " - "size = %d \n", - test_params.global_workgroup_size, nw, ns); - if (test_params.work_items_mask.any()) - { - log_info(" work items mask: %s\n", - test_params.work_items_mask.to_string().c_str()); - } genrand(x, t, m, ns, nw, ng); } @@ -894,9 +860,6 @@ template struct RED_NU if (active_work_items.empty()) { - log_info(" No acitve workitems in workgroup id = %d " - "subgroup id = %d - no calculation\n", - k, j); continue; } diff --git a/test_conformance/subgroups/test_subgroup_ballot.cpp b/test_conformance/subgroups/test_subgroup_ballot.cpp index 2bd54e43..ac90bad7 100644 --- a/test_conformance/subgroups/test_subgroup_ballot.cpp +++ b/test_conformance/subgroups/test_subgroup_ballot.cpp @@ -31,10 +31,6 @@ template struct BALLOT int sbs = test_params.subgroup_size; int non_uniform_size = gws % lws; log_info(" sub_group_ballot...\n"); - if (non_uniform_size) - { - log_info(" non uniform work group size mode ON\n"); - } } static int chk(Ty *x, Ty *y, Ty *mx, Ty *my, cl_int *m, @@ -117,11 +113,6 @@ template struct BALLOT_BIT_EXTRACT log_info(" sub_group_%s(%s)...\n", operation_names(operation), TypeManager::name()); - if (non_uniform_size) - { - log_info(" non uniform work group size mode ON\n"); - } - for (wg_id = 0; wg_id < wg_number; ++wg_id) { // for each work_group for (sb_id = 0; sb_id < sb_number; ++sb_id) @@ -275,10 +266,6 @@ template struct BALLOT_INVERSE int sbs = test_params.subgroup_size; int non_uniform_size = gws % lws; log_info(" sub_group_inverse_ballot...\n"); - if (non_uniform_size) - { - log_info(" non uniform work group size mode ON\n"); - } // no work here } @@ -379,7 +366,6 @@ template struct BALLOT_COUNT_SCAN_FIND TypeManager::name()); if (non_uniform_size) { - log_info(" non uniform work group size mode ON\n"); wg_number++; } int e; diff --git a/test_conformance/subgroups/test_subgroup_non_uniform_vote.cpp b/test_conformance/subgroups/test_subgroup_non_uniform_vote.cpp index f956960b..835de25d 100644 --- a/test_conformance/subgroups/test_subgroup_non_uniform_vote.cpp +++ b/test_conformance/subgroups/test_subgroup_non_uniform_vote.cpp @@ -34,20 +34,10 @@ template struct VOTE int last_subgroup_size = 0; ii = 0; - log_info(" sub_group_%s%s... \n", + log_info(" sub_group_%s%s(%s)... \n", (operation == NonUniformVoteOp::elect) ? "" : "non_uniform_", - operation_names(operation)); + operation_names(operation), TypeManager::name()); - log_info(" test params: global size = %d local size = %d subgroups " - "size = %d data type (%s)\n", - test_params.global_workgroup_size, nw, ns, - TypeManager::name()); - log_info(" work items mask: %s\n", - test_params.work_items_mask.to_string().c_str()); - if (non_uniform_size) - { - log_info(" non uniform work group size mode ON\n"); - } if (operation == NonUniformVoteOp::elect) return; for (k = 0; k < ng; ++k) @@ -171,34 +161,28 @@ template struct VOTE } if (active_work_items.empty()) { - log_info(" no one workitem acitve... in workgroup id = %d " - "subgroup id = %d\n", - k, j); + continue; } - else + auto lowest_active = active_work_items.begin(); + for (const int &active_work_item : active_work_items) { - auto lowest_active = active_work_items.begin(); - for (const int &active_work_item : active_work_items) + i = active_work_item; + if (operation == NonUniformVoteOp::elect) { - i = active_work_item; - if (operation == NonUniformVoteOp::elect) - { - i == *lowest_active ? tr = 1 : tr = 0; - } + i == *lowest_active ? tr = 1 : tr = 0; + } - // normalize device values on host, non zero set 1. - rr = compare_ordered(my[ii + i], 0) ? 0 : 1; + // normalize device values on host, non zero set 1. + rr = compare_ordered(my[ii + i], 0) ? 0 : 1; - if (rr != tr) - { - log_error("ERROR: sub_group_%s() \n", - operation_names(operation)); - log_error( - "mismatch for work item %d sub group %d in " - "work group %d. Expected: %d Obtained: %d\n", - i, j, k, tr, rr); - return TEST_FAIL; - } + if (rr != tr) + { + log_error("ERROR: sub_group_%s() \n", + operation_names(operation)); + log_error("mismatch for work item %d sub group %d in " + "work group %d. Expected: %d Obtained: %d\n", + i, j, k, tr, rr); + return TEST_FAIL; } } } @@ -208,9 +192,9 @@ template struct VOTE m += 4 * nw; } - log_info(" sub_group_%s%s... passed\n", + log_info(" sub_group_%s%s(%s)... passed\n", (operation == NonUniformVoteOp::elect) ? "" : "non_uniform_", - operation_names(operation)); + operation_names(operation), TypeManager::name()); return TEST_PASS; } };