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

Function generate_argument

test_conformance/api/test_kernel_arg_info.cpp:133–162  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

131};
132
133static std::string generate_argument(const KernelArgInfo& kernel_arg)
134{
135 std::string ret;
136
137 const bool is_image = strstr(kernel_arg.arg_type, "image")
138 || strstr(kernel_arg.arg_type, "sampler");
139 std::string address_qualifier = "";
140 // Image Objects are always allocated from the global address space so the
141 // qualifier should not be specified
142 if (!is_image)
143 {
144 address_qualifier = get_address_qualifier(kernel_arg.address_qualifier);
145 }
146
147 std::string access_qualifier =
148 get_access_qualifier(kernel_arg.access_qualifier);
149 std::string type_qualifier_prefix =
150 get_type_qualifier_prefix(kernel_arg.type_qualifier);
151 std::string type_qualifier_postfix =
152 get_type_qualifier_postfix(kernel_arg.type_qualifier);
153
154 ret += address_qualifier + " ";
155 ret += access_qualifier + " ";
156 ret += type_qualifier_prefix + " ";
157 ret += kernel_arg.arg_type;
158 ret += " ";
159 ret += type_qualifier_postfix + " ";
160 ret += kernel_arg.arg_name;
161 return ret;
162}
163
164/* This function generates a kernel source and allows for multiple arguments to
165 * be passed in and subsequently queried. */

Callers 2

generate_kernelFunction · 0.85
create_expected_arg_infoFunction · 0.85

Calls 4

get_address_qualifierFunction · 0.85
get_access_qualifierFunction · 0.85

Tested by

no test coverage detected