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

Function l_compare

test_conformance/basic/test_progvar.cpp:830–851  ·  view source on GitHub ↗

Return num_value values of the given type. Returns CL_SUCCESS if they compared as equal.

Source from the content-addressed store, hash-verified

828// Return num_value values of the given type.
829// Returns CL_SUCCESS if they compared as equal.
830static int l_compare(const char* test_name, const cl_uchar* expected,
831 const cl_uchar* received, size_t num_values,
832 const TypeInfo& ti)
833{
834 // Compare only the valid returned bytes.
835 for (unsigned value_idx = 0; value_idx < num_values; value_idx++)
836 {
837 const cl_uchar* expv = expected + value_idx * ti.get_size();
838 const cl_uchar* gotv = received + value_idx * ti.get_size();
839 if (memcmp(expv, gotv, ti.get_value_size()))
840 {
841 std::string exp_str = ti.as_string(expv);
842 std::string got_str = ti.as_string(gotv);
843 log_error(
844 "Error: %s test for type %s, at index %d: Expected %s got %s\n",
845 test_name, ti.get_name_c_str(), value_idx, exp_str.c_str(),
846 got_str.c_str());
847 return 1;
848 }
849 }
850 return CL_SUCCESS;
851}
852
853// Copy a target value from src[idx] to dest[idx]
854static int l_copy(cl_uchar* dest, unsigned dest_idx, const cl_uchar* src,

Callers 3

l_write_read_for_typeFunction · 0.85
l_capacityFunction · 0.85

Calls 4

get_sizeMethod · 0.80
get_value_sizeMethod · 0.80
as_stringMethod · 0.80
get_name_c_strMethod · 0.80

Tested by

no test coverage detected