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

Function run_pipe_tests

test_conformance/api/test_kernel_arg_info.cpp:714–778  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

712}
713
714static int run_pipe_tests(cl_context context, cl_device_id device)
715{
716 int failed_tests = 0;
717
718 cl_kernel_arg_address_qualifier address_qualifier =
719 CL_KERNEL_ARG_ADDRESS_PRIVATE;
720 std::vector<std::string> type_arguments =
721 generate_all_type_arguments(device);
722 const std::vector<cl_kernel_arg_access_qualifier> access_qualifiers = {
723 CL_KERNEL_ARG_ACCESS_READ_ONLY, CL_KERNEL_ARG_ACCESS_WRITE_ONLY
724 };
725 std::vector<KernelArgInfo> all_args, expected_args;
726 size_t max_param_size = get_max_param_size(device);
727 size_t total_param_size(0);
728 cl_int err = CL_SUCCESS;
729 cl_uint max_number_of_pipes = get_max_number_of_pipes(device, err);
730 test_error_ret(err, "get_max_number_of_pipes", TEST_FAIL);
731 cl_uint number_of_pipes(0);
732
733 const bool is_pointer = false;
734 const bool is_pipe = true;
735
736 for (auto type_qualifier : pipe_qualifiers)
737 {
738 for (auto access_qualifier : access_qualifiers)
739 {
740 for (auto arg_type : type_arguments)
741 {
742 /* We cannot have void pipes */
743 if (arg_type == "void")
744 {
745 continue;
746 }
747
748 size_t param_size = get_param_size(arg_type, device, is_pipe);
749 if (param_size + total_param_size >= max_param_size
750 || number_of_pipes == max_number_of_pipes)
751 {
752 const std::string kernel_src = generate_kernel(all_args);
753 failed_tests += compare_kernel_with_expected(
754 context, device, kernel_src.c_str(), expected_args);
755 all_args.clear();
756 expected_args.clear();
757 total_param_size = 0;
758 number_of_pipes = 0;
759 }
760 total_param_size += param_size;
761 number_of_pipes++;
762
763 KernelArgInfo kernel_argument(address_qualifier,
764 access_qualifier, type_qualifier,
765 arg_type, all_args.size());
766
767 expected_args.push_back(
768 create_expected_arg_info(kernel_argument, is_pointer));
769
770 all_args.push_back(kernel_argument);
771 }

Callers 1

run_all_testsFunction · 0.85

Calls 8

get_max_param_sizeFunction · 0.85
get_max_number_of_pipesFunction · 0.85
get_param_sizeFunction · 0.85
generate_kernelFunction · 0.85
create_expected_arg_infoFunction · 0.85
sizeMethod · 0.45

Tested by

no test coverage detected