Refactor logging of subgroup test start/pass messages (#1361)

Note that this also corrects the start messages logged for the
sub_group_ballot_bit_count/find_msb/find_lsb tests.

Signed-off-by: Stuart Brady <stuart.brady@arm.com>
This commit is contained in:
Stuart Brady
2021-12-14 17:52:44 +00:00
committed by GitHub
parent 73d71b6a76
commit 1161d788dd
8 changed files with 164 additions and 98 deletions

View File

@@ -1380,23 +1380,45 @@ template <typename Ty, typename Fns, size_t TSIZE = 0> struct test
const char *kname, const char *src,
WorkGroupParams test_params)
{
Fns::log_test(test_params, "");
test_status combined_error = TEST_SKIPPED_ITSELF;
for (auto &mask : test_params.all_work_item_masks)
{
test_params.work_items_mask = mask;
test_status error = run(device, context, queue, num_elements, kname,
src, test_params);
test_status error = do_run(device, context, queue, num_elements,
kname, src, test_params);
if (error == TEST_FAIL
|| (error == TEST_PASS && combined_error != TEST_FAIL))
combined_error = error;
}
if (combined_error == TEST_PASS)
{
Fns::log_test(test_params, " passed");
}
return combined_error;
};
static test_status run(cl_device_id device, cl_context context,
cl_command_queue queue, int num_elements,
const char *kname, const char *src,
WorkGroupParams test_params)
static int run(cl_device_id device, cl_context context,
cl_command_queue queue, int num_elements, const char *kname,
const char *src, WorkGroupParams test_params)
{
Fns::log_test(test_params, "");
int error = do_run(device, context, queue, num_elements, kname, src,
test_params);
if (error == TEST_PASS)
{
Fns::log_test(test_params, " passed");
}
return error;
};
static test_status do_run(cl_device_id device, cl_context context,
cl_command_queue queue, int num_elements,
const char *kname, const char *src,
WorkGroupParams test_params)
{
size_t tmp;
cl_int error;
@@ -1442,16 +1464,14 @@ template <typename Ty, typename Fns, size_t TSIZE = 0> struct test
log_info("Data type not supported : %s\n", TypeManager<Ty>::name());
return TEST_SKIPPED_ITSELF;
}
else
if (strstr(TypeManager<Ty>::name(), "double"))
{
if (strstr(TypeManager<Ty>::name(), "double"))
{
kernel_sstr << "#pragma OPENCL EXTENSION cl_khr_fp64: enable\n";
}
else if (strstr(TypeManager<Ty>::name(), "half"))
{
kernel_sstr << "#pragma OPENCL EXTENSION cl_khr_fp16: enable\n";
}
kernel_sstr << "#pragma OPENCL EXTENSION cl_khr_fp64: enable\n";
}
else if (strstr(TypeManager<Ty>::name(), "half"))
{
kernel_sstr << "#pragma OPENCL EXTENSION cl_khr_fp16: enable\n";
}
error = clGetDeviceInfo(device, CL_DEVICE_PLATFORM, sizeof(platform),