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

Function findProperty

test_common/harness/propertyHelpers.cpp:25–49  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

23#include <vector>
24
25static bool findProperty(const std::vector<cl_properties>& props,
26 cl_properties prop, cl_properties& value)
27{
28 // This function assumes properties are valid:
29 assert(props.size() == 0 || props.back() == 0);
30 assert(props.size() == 0 || props.size() % 2 == 1);
31
32 for (cl_uint i = 0; i < props.size(); i = i + 2)
33 {
34 cl_properties check_prop = props[i];
35
36 if (check_prop == 0)
37 {
38 break;
39 }
40
41 if (check_prop == prop)
42 {
43 value = props[i + 1];
44 return true;
45 }
46 }
47
48 return false;
49}
50
51int compareProperties(const std::vector<cl_properties>& queried,
52 const std::vector<cl_properties>& check)

Callers 1

comparePropertiesFunction · 0.85

Calls 1

sizeMethod · 0.45

Tested by

no test coverage detected