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

Function generate_kernel

test_conformance/api/test_kernel_arg_info.cpp:166–195  ·  view source on GitHub ↗

This function generates a kernel source and allows for multiple arguments to * be passed in and subsequently queried. */

Source from the content-addressed store, hash-verified

164/* This function generates a kernel source and allows for multiple arguments to
165 * be passed in and subsequently queried. */
166static std::string generate_kernel(const std::vector<KernelArgInfo>& all_args,
167 const bool supports_3d_image_writes = false,
168 const bool kernel_uses_half_type = false)
169{
170
171 std::string ret;
172 if (supports_3d_image_writes)
173 {
174 ret += "#pragma OPENCL EXTENSION cl_khr_3d_image_writes: enable\n";
175 }
176 if (kernel_uses_half_type)
177 {
178 ret += "#pragma OPENCL EXTENSION cl_khr_fp16 : enable\n";
179 }
180 ret += "kernel void get_kernel_arg_info(\n";
181 for (size_t i = 0; i < all_args.size(); ++i)
182 {
183 ret += generate_argument(all_args[i]);
184 if (i == all_args.size() - 1)
185 {
186 ret += "\n";
187 }
188 else
189 {
190 ret += ",\n";
191 }
192 }
193 ret += "){}";
194 return ret;
195}
196
197static const char* get_kernel_arg_address_qualifier(
198 cl_kernel_arg_address_qualifier address_qualifier)

Callers 5

run_scalar_vector_testsFunction · 0.85
run_pipe_testsFunction · 0.85
run_sampler_testFunction · 0.85
run_image_testsFunction · 0.85
run_boundary_testsFunction · 0.85

Calls 2

generate_argumentFunction · 0.85
sizeMethod · 0.45

Tested by

no test coverage detected