MCPcopy Create free account
hub / github.com/ARM-software/ComputeLibrary / generate_build_options

Method generate_build_options

src/core/CL/CLCompileContext.cpp:245–295  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

243}
244
245std::string CLCompileContext::generate_build_options(const StringSet &build_options_set,
246 const std::string &kernel_path) const
247{
248 std::string concat_str;
249 bool ext_supported = false;
250 std::string ext_buildopts;
251
252#if defined(ARM_COMPUTE_DEBUG_ENABLED)
253 // Enable debug properties in CL kernels
254 concat_str += " -DARM_COMPUTE_DEBUG_ENABLED";
255#endif // defined(ARM_COMPUTE_DEBUG_ENABLED)
256
257 GPUTarget gpu_arch = get_arch_from_target(_device.target());
258 concat_str +=
259 " -DGPU_ARCH=" + support::cpp11::to_string(static_cast<std::underlying_type<GPUTarget>::type>(gpu_arch));
260
261 if (_device.supported("cl_khr_fp16"))
262 {
263 concat_str += " -DARM_COMPUTE_OPENCL_FP16_ENABLED=1 ";
264 }
265
266 if (_device.supported("cl_arm_integer_dot_product_int8") || _device.supported("cl_khr_integer_dot_product"))
267 {
268 concat_str += " -DARM_COMPUTE_OPENCL_DOT8_ENABLED=1 ";
269 }
270
271 if (_device.supported("cl_arm_integer_dot_product_accumulate_int8"))
272 {
273 concat_str += " -DARM_COMPUTE_OPENCL_DOT8_ACC_ENABLED=1 ";
274 }
275
276 std::tie(ext_supported, ext_buildopts) = _device.is_non_uniform_workgroup_supported();
277
278 if (ext_supported)
279 {
280 concat_str += ext_buildopts;
281 }
282 else
283 {
284 ARM_COMPUTE_ERROR("Non uniform workgroup size is not supported!!");
285 }
286
287 if (gpu_arch != GPUTarget::UNKNOWN && gpu_arch != GPUTarget::MIDGARD && get_ddk_version() >= 11)
288 {
289 concat_str += " -DUNROLL_WITH_PRAGMA ";
290 }
291
292 std::string build_options = stringify_set(build_options_set, kernel_path) + concat_str;
293
294 return build_options;
295}
296
297bool CLCompileContext::fp16_supported() const
298{

Callers

nothing calls this directly

Calls 5

get_arch_from_targetFunction · 0.85
supportedMethod · 0.80
to_stringFunction · 0.50
targetMethod · 0.45

Tested by

no test coverage detected