mirror of
https://github.com/KhronosGroup/OpenCL-CTS.git
synced 2026-03-19 06:09:01 +00:00
Added missing tests for integer_dot_product_input_4x8bit and integer_dot_product_input_4x8bit_packed on feature_macro compiler test. (#1432)
* Added integer_dot_product_input_4x8bit and integer_dot_product_input_4x8bit_packed tests to feature_macro_test * clang formatting * Now the test checks whether the array of optional features returned by clGetDeviceInfo contains the standard optional features we are testing. * Update test_conformance/compiler/test_feature_macro.cpp Added printing the missing standard feature it it is not found inside the optional features array returned by clGetDeviceInfo. Co-authored-by: Ben Ashbaugh <ben.ashbaugh@intel.com> Co-authored-by: Ben Ashbaugh <ben.ashbaugh@intel.com>
This commit is contained in:
@@ -579,6 +579,78 @@ int test_feature_macro_fp64(cl_device_id deviceID, cl_context context,
|
||||
compiler_status, supported);
|
||||
}
|
||||
|
||||
int test_feature_macro_integer_dot_product_input_4x8bit_packed(
|
||||
cl_device_id deviceID, cl_context context, std::string test_macro_name,
|
||||
cl_bool& supported)
|
||||
{
|
||||
cl_int error = TEST_FAIL;
|
||||
cl_bool api_status;
|
||||
cl_bool compiler_status;
|
||||
log_info("\n%s ...\n", test_macro_name.c_str());
|
||||
|
||||
if (!is_extension_available(deviceID, "cl_khr_integer_dot_product"))
|
||||
{
|
||||
supported = false;
|
||||
return TEST_PASS;
|
||||
}
|
||||
|
||||
error = check_api_feature_info_capabilities<
|
||||
cl_device_integer_dot_product_capabilities_khr>(
|
||||
deviceID, context, api_status,
|
||||
CL_DEVICE_INTEGER_DOT_PRODUCT_CAPABILITIES_KHR,
|
||||
CL_DEVICE_INTEGER_DOT_PRODUCT_INPUT_4x8BIT_PACKED_KHR);
|
||||
if (error != CL_SUCCESS)
|
||||
{
|
||||
return error;
|
||||
}
|
||||
|
||||
error = check_compiler_feature_info(deviceID, context, test_macro_name,
|
||||
compiler_status);
|
||||
if (error != CL_SUCCESS)
|
||||
{
|
||||
return error;
|
||||
}
|
||||
|
||||
return feature_macro_verify_results(test_macro_name, api_status,
|
||||
compiler_status, supported);
|
||||
}
|
||||
|
||||
int test_feature_macro_integer_dot_product_input_4x8bit(
|
||||
cl_device_id deviceID, cl_context context, std::string test_macro_name,
|
||||
cl_bool& supported)
|
||||
{
|
||||
cl_int error = TEST_FAIL;
|
||||
cl_bool api_status;
|
||||
cl_bool compiler_status;
|
||||
log_info("\n%s ...\n", test_macro_name.c_str());
|
||||
|
||||
if (!is_extension_available(deviceID, "cl_khr_integer_dot_product"))
|
||||
{
|
||||
supported = false;
|
||||
return TEST_PASS;
|
||||
}
|
||||
|
||||
error = check_api_feature_info_capabilities<
|
||||
cl_device_integer_dot_product_capabilities_khr>(
|
||||
deviceID, context, api_status,
|
||||
CL_DEVICE_INTEGER_DOT_PRODUCT_CAPABILITIES_KHR,
|
||||
CL_DEVICE_INTEGER_DOT_PRODUCT_INPUT_4x8BIT_KHR);
|
||||
if (error != CL_SUCCESS)
|
||||
{
|
||||
return error;
|
||||
}
|
||||
|
||||
error = check_compiler_feature_info(deviceID, context, test_macro_name,
|
||||
compiler_status);
|
||||
if (error != CL_SUCCESS)
|
||||
{
|
||||
return error;
|
||||
}
|
||||
|
||||
return feature_macro_verify_results(test_macro_name, api_status,
|
||||
compiler_status, supported);
|
||||
}
|
||||
|
||||
int test_feature_macro_int64(cl_device_id deviceID, cl_context context,
|
||||
std::string test_macro_name, cl_bool& supported)
|
||||
{
|
||||
@@ -686,15 +758,6 @@ int test_consistency_c_features_list(cl_device_id deviceID,
|
||||
sort(vec_to_cmp.begin(), vec_to_cmp.end());
|
||||
sort(vec_device_feature_names.begin(), vec_device_feature_names.end());
|
||||
|
||||
if (vec_device_feature_names == vec_to_cmp)
|
||||
{
|
||||
log_info("Comparison list of features - passed\n");
|
||||
}
|
||||
else
|
||||
{
|
||||
log_info("Comparison list of features - failed\n");
|
||||
error = TEST_FAIL;
|
||||
}
|
||||
log_info(
|
||||
"Supported features based on CL_DEVICE_OPENCL_C_FEATURES API query:\n");
|
||||
for (auto each_f : vec_device_feature_names)
|
||||
@@ -703,11 +766,26 @@ int test_consistency_c_features_list(cl_device_id deviceID,
|
||||
}
|
||||
|
||||
log_info("\nSupported features based on queries to API/compiler :\n");
|
||||
|
||||
for (auto each_f : vec_to_cmp)
|
||||
{
|
||||
log_info("%s\n", each_f.c_str());
|
||||
}
|
||||
|
||||
for (auto each_f : vec_to_cmp)
|
||||
{
|
||||
if (find(vec_device_feature_names.begin(),
|
||||
vec_device_feature_names.end(), each_f)
|
||||
== vec_device_feature_names.end())
|
||||
{
|
||||
log_info("Comparison list of features - failed - missing %s\n",
|
||||
each_f.c_str());
|
||||
return TEST_FAIL;
|
||||
}
|
||||
}
|
||||
|
||||
log_info("Comparison list of features - passed\n");
|
||||
|
||||
return error;
|
||||
}
|
||||
|
||||
@@ -748,6 +826,8 @@ int test_features_macro(cl_device_id deviceID, cl_context context,
|
||||
NEW_FEATURE_MACRO_TEST(images);
|
||||
NEW_FEATURE_MACRO_TEST(fp64);
|
||||
NEW_FEATURE_MACRO_TEST(int64);
|
||||
NEW_FEATURE_MACRO_TEST(integer_dot_product_input_4x8bit);
|
||||
NEW_FEATURE_MACRO_TEST(integer_dot_product_input_4x8bit_packed);
|
||||
|
||||
error |= test_consistency_c_features_list(deviceID, supported_features_vec);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user