MCPcopy Create free account
hub / github.com/KhronosGroup/OpenCL-CTS / test_enum_values

Function test_enum_values

test_conformance/spir/main.cpp:6310–6394  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

6308}
6309
6310static bool test_enum_values(cl_device_id device, cl_uint width,
6311 const char *folder)
6312{
6313 try_extract(folder);
6314 std::cout << "Running tests:" << std::endl;
6315 bool success = true;
6316 typedef bool (*EnumTest)(cl_context, cl_command_queue, cl_program,
6317 cl_device_id, CounterEventHandler & SuccE,
6318 std::list<std::string> & ErrList);
6319 EnumTest test_functions[] = { test_image_enumeration,
6320 test_image_enumeration_3d };
6321 const char *enum_tests[] = { HOSTVAL_IMAGE_DESC, HOSTVAL_IMAGE_DESC_3D };
6322 const size_t TEST_NUM = sizeof(enum_tests) / sizeof(char *);
6323
6324 unsigned int tests_passed = 0;
6325 CounterEventHandler SuccE(tests_passed, 0);
6326 std::list<std::string> ErrList;
6327
6328 // Composing the name of the CSV file.
6329 char *dir = get_exe_dir();
6330 std::string csvName(dir);
6331 csvName.append(dir_sep());
6332 csvName.append("khr.csv");
6333 free(dir);
6334
6335 // Figure out whether the test can run on the device. If not, we skip it.
6336 const KhrSupport &khrDb = *KhrSupport::get(csvName);
6337
6338 for (size_t i = 0; i < TEST_NUM; i++)
6339 {
6340 const char *cur_test = enum_tests[i];
6341 cl_bool images = khrDb.isImagesRequired(folder, cur_test);
6342 cl_bool images3D = khrDb.isImages3DRequired(folder, cur_test);
6343 if (images == CL_TRUE && checkForImageSupport(device) != 0)
6344 {
6345 std::cout << cur_test
6346 << " Skipped. (Cannot run on device due to Images is not "
6347 "supported)."
6348 << std::endl;
6349 continue;
6350 }
6351
6352 if (images3D == CL_TRUE && checkFor3DImageSupport(device) != 0)
6353 {
6354 std::cout << cur_test
6355 << " Skipped. (Cannot run on device as 3D images are not "
6356 "supported)."
6357 << std::endl;
6358 continue;
6359 }
6360
6361 std::string bc_file_path;
6362 get_bc_file_path(folder, cur_test, bc_file_path, width);
6363 clContextWrapper context;
6364 clCommandQueueWrapper queue;
6365 create_context_and_queue(device, &context, &queue);
6366 clProgramWrapper bcprog = create_program_from_bc(context, bc_file_path);
6367

Callers

nothing calls this directly

Calls 15

try_extractFunction · 0.85
get_exe_dirFunction · 0.85
dir_sepFunction · 0.85
checkForImageSupportFunction · 0.85
checkFor3DImageSupportFunction · 0.85
get_bc_file_pathFunction · 0.85
create_context_and_queueFunction · 0.85
create_program_from_bcFunction · 0.85
isImagesRequiredMethod · 0.80
isImages3DRequiredMethod · 0.80
executeMethod · 0.80
getErrorLogMethod · 0.80

Tested by

no test coverage detected