mirror of
https://github.com/KhronosGroup/OpenCL-CTS.git
synced 2026-03-20 06:29:02 +00:00
Fix test_subgroups - test as core feature. (#682)
* Fix test_subgroups - test as core feature. * Fix kernels pragma in case of OpenCL 2.1 core subgroups * Change global variable names to gVariable convention * Allow subgroups tests execute 2 paths - as core feature - as extension feature * Fix code formatting. * Set correct OpenCL version * Fix code format * test_subgroups review fixes: * do not use global variables * make IFP as separate tests * use stringstream data type * use special class to load function pointer for specific API * Remove not not used variable * Test subgroups - use common enums * Test subgroups - set TEST_SKIPPED_ITSELF
This commit is contained in:
committed by
GitHub
parent
944b0a8178
commit
58cf793fdb
@@ -23,49 +23,22 @@
|
||||
MTdata gMTdata;
|
||||
|
||||
test_definition test_list[] = {
|
||||
ADD_TEST(sub_group_info),
|
||||
ADD_TEST(work_item_functions),
|
||||
ADD_TEST(work_group_functions),
|
||||
ADD_TEST(barrier_functions),
|
||||
ADD_TEST_VERSION(sub_group_info_ext, Version(2, 0)),
|
||||
ADD_TEST_VERSION(sub_group_info_core, Version(2, 1)),
|
||||
ADD_TEST_VERSION(work_item_functions_ext, Version(2, 0)),
|
||||
ADD_TEST_VERSION(work_item_functions_core, Version(2, 1)),
|
||||
ADD_TEST_VERSION(work_group_functions_ext, Version(2, 0)),
|
||||
ADD_TEST_VERSION(work_group_functions_core, Version(2, 1)),
|
||||
ADD_TEST_VERSION(barrier_functions_ext, Version(2, 0)),
|
||||
ADD_TEST_VERSION(barrier_functions_core, Version(2, 1)),
|
||||
ADD_TEST_VERSION(ifp_ext, Version(2, 0)),
|
||||
ADD_TEST_VERSION(ifp_core, Version(2, 1))
|
||||
};
|
||||
|
||||
const int test_num = ARRAY_SIZE(test_list);
|
||||
|
||||
static test_status checkSubGroupsExtension(cl_device_id device)
|
||||
{
|
||||
// The extension is optional in OpenCL 2.0 (minimum required version) and
|
||||
// required in later versions.
|
||||
auto version = get_device_cl_version(device);
|
||||
auto expected_min_version = Version(2, 0);
|
||||
|
||||
if (version < expected_min_version)
|
||||
{
|
||||
version_expected_info("Test", expected_min_version.to_string().c_str(),
|
||||
version.to_string().c_str());
|
||||
return TEST_SKIP;
|
||||
}
|
||||
|
||||
bool hasExtension = is_extension_available(device, "cl_khr_subgroups");
|
||||
|
||||
if ((version == expected_min_version) && !hasExtension)
|
||||
{
|
||||
log_info(
|
||||
"Device does not support 'cl_khr_subgroups'. Skipping the test.\n");
|
||||
return TEST_SKIP;
|
||||
}
|
||||
|
||||
if ((version > expected_min_version) && !hasExtension)
|
||||
{
|
||||
log_error("'cl_khr_subgroups' is a required extension, failing.\n");
|
||||
return TEST_FAIL;
|
||||
}
|
||||
|
||||
return TEST_PASS;
|
||||
}
|
||||
|
||||
static test_status InitCL(cl_device_id device)
|
||||
{
|
||||
|
||||
auto version = get_device_cl_version(device);
|
||||
test_status ret = TEST_PASS;
|
||||
if (version >= Version(3, 0))
|
||||
@@ -86,10 +59,6 @@ static test_status InitCL(cl_device_id device)
|
||||
ret = TEST_SKIP;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
ret = checkSubGroupsExtension(device);
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user