diff options
author | Viet-Hoa Do <viet-hoa.do@arm.com> | 2022-05-30 15:15:15 +0100 |
---|---|---|
committer | Viet-Hoa Do <viet-hoa.do@arm.com> | 2022-06-15 15:36:21 +0000 |
commit | f8bb0928ed5e2acce2f6e0c2fd8caf8884141c79 (patch) | |
tree | 61c3351ad0a0873220122987ceb99d6660964b54 /src/core/CL/CLCompileContext.cpp | |
parent | 0c687044c3f5d7f294858debfc7c4c070228a9b4 (diff) | |
download | ComputeLibrary-f8bb0928ed5e2acce2f6e0c2fd8caf8884141c79.tar.gz |
Add support OpenCL 3.0 non-uniform workgroup
* Add OpenCL version 3 detection.
* Use -cl-std=CL3.0 build option to support non-uniform workgroup
when OpenCL 3 is detected and the feature is supported.
Resolves: COMPMID-5208
Signed-off-by: Viet-Hoa Do <viet-hoa.do@arm.com>
Change-Id: Ifd8cbae6b34228c07e761bcb94ee8f35bdf1bace
Reviewed-on: https://review.mlplatform.org/c/ml/ComputeLibrary/+/7655
Tested-by: Arm Jenkins <bsgcomp@arm.com>
Comments-Addressed: Arm Jenkins <bsgcomp@arm.com>
Reviewed-by: Pablo Marquez Tello <pablo.tello@arm.com>
Benchmark: Arm Jenkins <bsgcomp@arm.com>
Diffstat (limited to 'src/core/CL/CLCompileContext.cpp')
-rw-r--r-- | src/core/CL/CLCompileContext.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/core/CL/CLCompileContext.cpp b/src/core/CL/CLCompileContext.cpp index 2fed76555b..81eb748ab8 100644 --- a/src/core/CL/CLCompileContext.cpp +++ b/src/core/CL/CLCompileContext.cpp @@ -232,6 +232,8 @@ void CLCompileContext::set_context(cl::Context context) std::string CLCompileContext::generate_build_options(const StringSet &build_options_set, const std::string &kernel_path) const { std::string concat_str; + bool ext_supported = false; + std::string ext_buildopts; #if defined(ARM_COMPUTE_DEBUG_ENABLED) // Enable debug properties in CL kernels @@ -257,13 +259,11 @@ std::string CLCompileContext::generate_build_options(const StringSet &build_opti concat_str += " -DARM_COMPUTE_OPENCL_DOT8_ACC_ENABLED=1 "; } - if(_device.version() == CLVersion::CL20) - { - concat_str += " -cl-std=CL2.0 "; - } - else if(_device.supported("cl_arm_non_uniform_work_group_size")) + std::tie(ext_supported, ext_buildopts) = _device.is_non_uniform_workgroup_supported(); + + if(ext_supported) { - concat_str += " -cl-arm-non-uniform-work-group-size "; + concat_str += ext_buildopts; } else { |