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

Function doTest

test_conformance/printf/test_printf.cpp:689–928  ·  view source on GitHub ↗

----------------------------------------- doTest -----------------------------------------

Source from the content-addressed store, hash-verified

687// doTest
688//-----------------------------------------
689int doTest(cl_command_queue queue, cl_context context,
690 const unsigned int testId, cl_device_id device)
691{
692 int err = TEST_FAIL;
693
694 if ((allTestCase[testId]->_type == TYPE_HALF
695 || allTestCase[testId]->_type == TYPE_HALF_LIMITS)
696 && !is_extension_available(device, "cl_khr_fp16"))
697 {
698 log_info("Skipping half because cl_khr_fp16 extension is not "
699 "supported.\n");
700 return TEST_SKIPPED_ITSELF;
701 }
702
703 if ((allTestCase[testId]->_type == TYPE_LONG) && !isLongSupported(device))
704 {
705 log_info("Skipping long because long is not supported.\n");
706 return TEST_SKIPPED_ITSELF;
707 }
708
709 if ((allTestCase[testId]->_type == TYPE_DOUBLE
710 || allTestCase[testId]->_type == TYPE_DOUBLE_LIMITS)
711 && !is_extension_available(device, "cl_khr_fp64"))
712 {
713 log_info("Skipping double because cl_khr_fp64 extension is not "
714 "supported.\n");
715 return TEST_SKIPPED_ITSELF;
716 }
717
718 auto& genParams = allTestCase[testId]->_genParameters;
719
720 auto fail_count = s_test_fail;
721 auto pass_count = s_test_cnt;
722 auto skip_count = s_test_skip;
723
724 for (unsigned testNum = 0; testNum < genParams.size(); testNum++)
725 {
726 if (allTestCase[testId]->_type == TYPE_VECTOR)
727 {
728 auto is_vector_type_supported = [&](const char* type_name,
729 const char* ext_name) {
730 if ((strcmp(genParams[testNum].dataType, type_name) == 0)
731 && !is_extension_available(device, ext_name))
732 {
733 log_info("Skipping %s because %s extension "
734 "is not supported.\n",
735 type_name, ext_name);
736
737 s_test_skip++;
738 s_test_cnt++;
739 return false;
740 }
741 return true;
742 };
743
744 if (!is_vector_type_supported("half", "cl_khr_fp16")) continue;
745
746 if (!is_vector_type_supported("double", "cl_khr_fp64")) continue;

Callers 2

REGISTER_TESTFunction · 0.70
REGISTER_TEST_VERSIONFunction · 0.70

Calls 14

is_extension_availableFunction · 0.85
isLongSupportedFunction · 0.85
logTestTypeFunction · 0.85
makePrintfProgramFunction · 0.85
subtest_failFunction · 0.85
isKernelArgumentFunction · 0.85
isKernelPFormatFunction · 0.85
acquireOutputStreamFunction · 0.85
releaseOutputStreamFunction · 0.85
waitForEventFunction · 0.85
is64bAddressSpaceFunction · 0.85
getAnalysisBufferFunction · 0.85

Tested by

no test coverage detected