diff options
author | Giorgio Arena <giorgio.arena@arm.com> | 2021-05-20 11:36:56 +0100 |
---|---|---|
committer | Giorgio Arena <giorgio.arena@arm.com> | 2021-05-20 13:13:20 +0000 |
commit | ea8d266515812c4dec936b2153ffd5335873e583 (patch) | |
tree | bf02d78bf7a70b4535ad0628b8ec13e2d1c2004e /src/core/CL/CLCompileContext.cpp | |
parent | b7b6066b676aca315153806ef3cbcddb70b8c60a (diff) | |
download | ComputeLibrary-ea8d266515812c4dec936b2153ffd5335873e583.tar.gz |
Enable unroll through pragma based on DDK version
Change-Id: Id98a107d512369d3799961011a84e9cc4d99e775
Signed-off-by: Giorgio Arena <giorgio.arena@arm.com>
Reviewed-on: https://review.mlplatform.org/c/ml/ComputeLibrary/+/5679
Reviewed-by: Georgios Pinitas <georgios.pinitas@arm.com>
Comments-Addressed: Arm Jenkins <bsgcomp@arm.com>
Tested-by: Arm Jenkins <bsgcomp@arm.com>
Diffstat (limited to 'src/core/CL/CLCompileContext.cpp')
-rw-r--r-- | src/core/CL/CLCompileContext.cpp | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/core/CL/CLCompileContext.cpp b/src/core/CL/CLCompileContext.cpp index 3db0fe515a..bf3a866e4b 100644 --- a/src/core/CL/CLCompileContext.cpp +++ b/src/core/CL/CLCompileContext.cpp @@ -29,6 +29,8 @@ #include "arm_compute/core/Utils.h" #include "support/StringSupport.h" +#include <regex> + namespace arm_compute { CLBuildOptions::CLBuildOptions() @@ -263,6 +265,19 @@ std::string CLCompileContext::generate_build_options(const StringSet &build_opti ARM_COMPUTE_ERROR("Non uniform workgroup size is not supported!!"); } + const GPUTarget arch = get_arch_from_target(_device.target()); + if(arch != GPUTarget::UNKNOWN && arch != GPUTarget::MIDGARD) + { + const std::string device_vers = _device.device_version(); + const std::regex ddk_regex("r([0-9]*)p[0-9]"); + std::smatch ddk_match; + + if(std::regex_search(device_vers, ddk_match, ddk_regex) && std::stoi(ddk_match[1]) >= 9) + { + concat_str += " -DUNROLL_WITH_PRAGMA "; + } + } + std::string build_options = stringify_set(build_options_set, kernel_path) + concat_str; return build_options; |