mirror of
https://github.com/KhronosGroup/OpenCL-CTS.git
synced 2026-03-19 06:09:01 +00:00
Migrate compiler suite to the new test registration framework (#2319)
Contributes to #2181. Signed-off-by: Ahmed Hesham <ahmed.hesham@arm.com>
This commit is contained in:
@@ -205,10 +205,10 @@ int feature_macro_verify_results(std::string test_macro_name,
|
||||
return error;
|
||||
}
|
||||
|
||||
int test_feature_macro_atomic_order_acq_rel(cl_device_id deviceID,
|
||||
cl_context context,
|
||||
std::string test_macro_name,
|
||||
cl_bool& supported)
|
||||
static int test_feature_macro_atomic_order_acq_rel(cl_device_id deviceID,
|
||||
cl_context context,
|
||||
std::string test_macro_name,
|
||||
cl_bool& supported)
|
||||
{
|
||||
cl_int error = TEST_FAIL;
|
||||
cl_bool api_status;
|
||||
@@ -233,10 +233,10 @@ int test_feature_macro_atomic_order_acq_rel(cl_device_id deviceID,
|
||||
compiler_status, supported);
|
||||
}
|
||||
|
||||
int test_feature_macro_atomic_order_seq_cst(cl_device_id deviceID,
|
||||
cl_context context,
|
||||
std::string test_macro_name,
|
||||
cl_bool& supported)
|
||||
static int test_feature_macro_atomic_order_seq_cst(cl_device_id deviceID,
|
||||
cl_context context,
|
||||
std::string test_macro_name,
|
||||
cl_bool& supported)
|
||||
{
|
||||
cl_int error = TEST_FAIL;
|
||||
cl_bool api_status;
|
||||
@@ -262,10 +262,10 @@ int test_feature_macro_atomic_order_seq_cst(cl_device_id deviceID,
|
||||
compiler_status, supported);
|
||||
}
|
||||
|
||||
int test_feature_macro_atomic_scope_device(cl_device_id deviceID,
|
||||
cl_context context,
|
||||
std::string test_macro_name,
|
||||
cl_bool& supported)
|
||||
static int test_feature_macro_atomic_scope_device(cl_device_id deviceID,
|
||||
cl_context context,
|
||||
std::string test_macro_name,
|
||||
cl_bool& supported)
|
||||
{
|
||||
cl_int error = TEST_FAIL;
|
||||
cl_bool api_status;
|
||||
@@ -289,10 +289,9 @@ int test_feature_macro_atomic_scope_device(cl_device_id deviceID,
|
||||
compiler_status, supported);
|
||||
}
|
||||
|
||||
int test_feature_macro_atomic_scope_all_devices(cl_device_id deviceID,
|
||||
cl_context context,
|
||||
std::string test_macro_name,
|
||||
cl_bool& supported)
|
||||
static int test_feature_macro_atomic_scope_all_devices(
|
||||
cl_device_id deviceID, cl_context context, std::string test_macro_name,
|
||||
cl_bool& supported)
|
||||
{
|
||||
cl_int error = TEST_FAIL;
|
||||
cl_bool api_status;
|
||||
@@ -316,10 +315,10 @@ int test_feature_macro_atomic_scope_all_devices(cl_device_id deviceID,
|
||||
compiler_status, supported);
|
||||
}
|
||||
|
||||
int test_feature_macro_3d_image_writes(cl_device_id deviceID,
|
||||
cl_context context,
|
||||
std::string test_macro_name,
|
||||
cl_bool& supported)
|
||||
static int test_feature_macro_3d_image_writes(cl_device_id deviceID,
|
||||
cl_context context,
|
||||
std::string test_macro_name,
|
||||
cl_bool& supported)
|
||||
{
|
||||
cl_int error = TEST_FAIL;
|
||||
cl_bool api_status;
|
||||
@@ -343,9 +342,10 @@ int test_feature_macro_3d_image_writes(cl_device_id deviceID,
|
||||
compiler_status, supported);
|
||||
}
|
||||
|
||||
int test_feature_macro_device_enqueue(cl_device_id deviceID, cl_context context,
|
||||
std::string test_macro_name,
|
||||
cl_bool& supported)
|
||||
static int test_feature_macro_device_enqueue(cl_device_id deviceID,
|
||||
cl_context context,
|
||||
std::string test_macro_name,
|
||||
cl_bool& supported)
|
||||
{
|
||||
cl_int error = TEST_FAIL;
|
||||
cl_bool api_status;
|
||||
@@ -371,10 +371,10 @@ int test_feature_macro_device_enqueue(cl_device_id deviceID, cl_context context,
|
||||
compiler_status, supported);
|
||||
}
|
||||
|
||||
int test_feature_macro_generic_address_space(cl_device_id deviceID,
|
||||
cl_context context,
|
||||
std::string test_macro_name,
|
||||
cl_bool& supported)
|
||||
static int test_feature_macro_generic_address_space(cl_device_id deviceID,
|
||||
cl_context context,
|
||||
std::string test_macro_name,
|
||||
cl_bool& supported)
|
||||
{
|
||||
cl_int error = TEST_FAIL;
|
||||
cl_bool api_status;
|
||||
@@ -398,8 +398,9 @@ int test_feature_macro_generic_address_space(cl_device_id deviceID,
|
||||
compiler_status, supported);
|
||||
}
|
||||
|
||||
int test_feature_macro_pipes(cl_device_id deviceID, cl_context context,
|
||||
std::string test_macro_name, cl_bool& supported)
|
||||
static int test_feature_macro_pipes(cl_device_id deviceID, cl_context context,
|
||||
std::string test_macro_name,
|
||||
cl_bool& supported)
|
||||
{
|
||||
cl_int error = TEST_FAIL;
|
||||
cl_bool api_status;
|
||||
@@ -423,7 +424,7 @@ int test_feature_macro_pipes(cl_device_id deviceID, cl_context context,
|
||||
compiler_status, supported);
|
||||
}
|
||||
|
||||
int test_feature_macro_program_scope_global_variables(
|
||||
static int test_feature_macro_program_scope_global_variables(
|
||||
cl_device_id deviceID, cl_context context, std::string test_macro_name,
|
||||
cl_bool& supported)
|
||||
{
|
||||
@@ -449,10 +450,10 @@ int test_feature_macro_program_scope_global_variables(
|
||||
compiler_status, supported);
|
||||
}
|
||||
|
||||
int test_feature_macro_read_write_images(cl_device_id deviceID,
|
||||
cl_context context,
|
||||
std::string test_macro_name,
|
||||
cl_bool& supported)
|
||||
static int test_feature_macro_read_write_images(cl_device_id deviceID,
|
||||
cl_context context,
|
||||
std::string test_macro_name,
|
||||
cl_bool& supported)
|
||||
{
|
||||
cl_int error = TEST_FAIL;
|
||||
cl_bool api_status;
|
||||
@@ -476,9 +477,10 @@ int test_feature_macro_read_write_images(cl_device_id deviceID,
|
||||
compiler_status, supported);
|
||||
}
|
||||
|
||||
int test_feature_macro_subgroups(cl_device_id deviceID, cl_context context,
|
||||
std::string test_macro_name,
|
||||
cl_bool& supported)
|
||||
static int test_feature_macro_subgroups(cl_device_id deviceID,
|
||||
cl_context context,
|
||||
std::string test_macro_name,
|
||||
cl_bool& supported)
|
||||
{
|
||||
cl_int error = TEST_FAIL;
|
||||
cl_bool api_status;
|
||||
@@ -502,7 +504,7 @@ int test_feature_macro_subgroups(cl_device_id deviceID, cl_context context,
|
||||
compiler_status, supported);
|
||||
}
|
||||
|
||||
int test_feature_macro_work_group_collective_functions(
|
||||
static int test_feature_macro_work_group_collective_functions(
|
||||
cl_device_id deviceID, cl_context context, std::string test_macro_name,
|
||||
cl_bool& supported)
|
||||
{
|
||||
@@ -529,8 +531,9 @@ int test_feature_macro_work_group_collective_functions(
|
||||
compiler_status, supported);
|
||||
}
|
||||
|
||||
int test_feature_macro_images(cl_device_id deviceID, cl_context context,
|
||||
std::string test_macro_name, cl_bool& supported)
|
||||
static int test_feature_macro_images(cl_device_id deviceID, cl_context context,
|
||||
std::string test_macro_name,
|
||||
cl_bool& supported)
|
||||
{
|
||||
cl_int error = TEST_FAIL;
|
||||
cl_bool api_status;
|
||||
@@ -554,8 +557,9 @@ int test_feature_macro_images(cl_device_id deviceID, cl_context context,
|
||||
compiler_status, supported);
|
||||
}
|
||||
|
||||
int test_feature_macro_fp64(cl_device_id deviceID, cl_context context,
|
||||
std::string test_macro_name, cl_bool& supported)
|
||||
static int test_feature_macro_fp64(cl_device_id deviceID, cl_context context,
|
||||
std::string test_macro_name,
|
||||
cl_bool& supported)
|
||||
{
|
||||
cl_int error = TEST_FAIL;
|
||||
cl_bool api_status;
|
||||
@@ -580,7 +584,7 @@ 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(
|
||||
static 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)
|
||||
{
|
||||
@@ -616,7 +620,7 @@ int test_feature_macro_integer_dot_product_input_4x8bit_packed(
|
||||
compiler_status, supported);
|
||||
}
|
||||
|
||||
int test_feature_macro_integer_dot_product_input_4x8bit(
|
||||
static int test_feature_macro_integer_dot_product_input_4x8bit(
|
||||
cl_device_id deviceID, cl_context context, std::string test_macro_name,
|
||||
cl_bool& supported)
|
||||
{
|
||||
@@ -652,8 +656,9 @@ int test_feature_macro_integer_dot_product_input_4x8bit(
|
||||
compiler_status, supported);
|
||||
}
|
||||
|
||||
int test_feature_macro_int64(cl_device_id deviceID, cl_context context,
|
||||
std::string test_macro_name, cl_bool& supported)
|
||||
static int test_feature_macro_int64(cl_device_id deviceID, cl_context context,
|
||||
std::string test_macro_name,
|
||||
cl_bool& supported)
|
||||
{
|
||||
cl_int error = TEST_FAIL;
|
||||
cl_bool api_status;
|
||||
@@ -722,8 +727,8 @@ int test_feature_macro_int64(cl_device_id deviceID, cl_context context,
|
||||
compiler_status, supported);
|
||||
}
|
||||
|
||||
int test_consistency_c_features_list(cl_device_id deviceID,
|
||||
std::vector<std::string> vec_to_cmp)
|
||||
static int test_consistency_c_features_list(cl_device_id deviceID,
|
||||
std::vector<std::string> vec_to_cmp)
|
||||
{
|
||||
log_info("\nComparison list of features: CL_DEVICE_OPENCL_C_FEATURES vs "
|
||||
"API/compiler queries.\n");
|
||||
@@ -792,13 +797,12 @@ int test_consistency_c_features_list(cl_device_id deviceID,
|
||||
|
||||
#define NEW_FEATURE_MACRO_TEST(feat) \
|
||||
test_macro_name = "__opencl_c_" #feat; \
|
||||
error |= test_feature_macro_##feat(deviceID, context, test_macro_name, \
|
||||
error |= test_feature_macro_##feat(device, context, test_macro_name, \
|
||||
supported); \
|
||||
if (supported) supported_features_vec.push_back(test_macro_name);
|
||||
|
||||
|
||||
int test_features_macro(cl_device_id deviceID, cl_context context,
|
||||
cl_command_queue queue, int num_elements)
|
||||
REGISTER_TEST_VERSION(features_macro, Version(3, 0))
|
||||
{
|
||||
|
||||
// Note: Not checking that the feature array is empty for the compiler not
|
||||
@@ -806,7 +810,7 @@ int test_features_macro(cl_device_id deviceID, cl_context context,
|
||||
// support compilation from OpenCL C source, this query may return an empty
|
||||
// array." It "may" return an empty array implies that an implementation
|
||||
// also "may not".
|
||||
check_compiler_available(deviceID);
|
||||
check_compiler_available(device);
|
||||
|
||||
int error = TEST_PASS;
|
||||
cl_bool supported = CL_FALSE;
|
||||
@@ -830,17 +834,16 @@ int test_features_macro(cl_device_id deviceID, cl_context context,
|
||||
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);
|
||||
error |= test_consistency_c_features_list(device, supported_features_vec);
|
||||
|
||||
return error;
|
||||
}
|
||||
|
||||
// This test checks that a supported feature comes with other required features
|
||||
int test_features_macro_coupling(cl_device_id deviceID, cl_context context,
|
||||
cl_command_queue queue, int num_elements)
|
||||
REGISTER_TEST(features_macro_coupling)
|
||||
{
|
||||
OpenCLCFeatures features;
|
||||
int error = get_device_cl_c_features(deviceID, features);
|
||||
int error = get_device_cl_c_features(device, features);
|
||||
if (error)
|
||||
{
|
||||
log_error("Couldn't query OpenCL C features for the device!\n");
|
||||
|
||||
Reference in New Issue
Block a user