aboutsummaryrefslogtreecommitdiff
path: root/src/core/CL/CLHelpers.cpp
diff options
context:
space:
mode:
authorMichalis Spyrou <michalis.spyrou@arm.com>2018-02-22 18:07:43 +0000
committerAnthony Barbier <anthony.barbier@arm.com>2018-11-02 16:48:35 +0000
commita9676118fd2a0e5bc916969af83ecee049bae76b (patch)
treef67ff64d962a2f802700f6b26a9ab160c04c721d /src/core/CL/CLHelpers.cpp
parent2bc74410251dcbaf17a7c5447317aa6d0171972a (diff)
downloadComputeLibrary-a9676118fd2a0e5bc916969af83ecee049bae76b.tar.gz
COMPMID-886 Don't use LWS hints by default for GPU post Mali-G72
Change-Id: I64cb2d7f9513d69aebd9307a803b1b2c9c0e04c3 Reviewed-on: https://eu-gerrit-1.euhpc.arm.com/121929 Reviewed-by: Anthony Barbier <anthony.barbier@arm.com> Tested-by: Jenkins <bsgcomp@arm.com>
Diffstat (limited to 'src/core/CL/CLHelpers.cpp')
-rw-r--r--src/core/CL/CLHelpers.cpp108
1 files changed, 80 insertions, 28 deletions
diff --git a/src/core/CL/CLHelpers.cpp b/src/core/CL/CLHelpers.cpp
index ef517aa589..eb1b06e7a8 100644
--- a/src/core/CL/CLHelpers.cpp
+++ b/src/core/CL/CLHelpers.cpp
@@ -35,9 +35,37 @@ namespace
{
arm_compute::GPUTarget get_bifrost_target(const std::string &version)
{
- if(version == "70")
+ if(version == "G71")
{
- return arm_compute::GPUTarget::G70;
+ return arm_compute::GPUTarget::G71;
+ }
+ else if(version == "G72")
+ {
+ return arm_compute::GPUTarget::G72;
+ }
+ else if(version == "G51")
+ {
+ return arm_compute::GPUTarget::G51;
+ }
+ else if(version == "G51BIG")
+ {
+ return arm_compute::GPUTarget::G51BIG;
+ }
+ else if(version == "G51LIT")
+ {
+ return arm_compute::GPUTarget::G51LIT;
+ }
+ else if(version == "TNOX")
+ {
+ return arm_compute::GPUTarget::TNOX;
+ }
+ else if(version == "TTRX")
+ {
+ return arm_compute::GPUTarget::TTRX;
+ }
+ else if(version == "TBOX")
+ {
+ return arm_compute::GPUTarget::TBOX;
}
else
{
@@ -47,16 +75,21 @@ arm_compute::GPUTarget get_bifrost_target(const std::string &version)
arm_compute::GPUTarget get_midgard_target(const std::string &version)
{
- switch(version[0])
- {
- case '6':
- return arm_compute::GPUTarget::T600;
- case '7':
- return arm_compute::GPUTarget::T700;
- case '8':
- return arm_compute::GPUTarget::T800;
- default:
- return arm_compute::GPUTarget::MIDGARD;
+ if(version == "T600")
+ {
+ return arm_compute::GPUTarget::T600;
+ }
+ else if(version == "T700")
+ {
+ return arm_compute::GPUTarget::T700;
+ }
+ else if(version == "T800")
+ {
+ return arm_compute::GPUTarget::T800;
+ }
+ else
+ {
+ return arm_compute::GPUTarget::MIDGARD;
}
}
@@ -159,39 +192,58 @@ const std::string &string_from_target(GPUTarget target)
{ GPUTarget::T600, "t600" },
{ GPUTarget::T700, "t700" },
{ GPUTarget::T800, "t800" },
- { GPUTarget::G70, "g70" }
+ { GPUTarget::G71, "g71" },
+ { GPUTarget::G72, "g72" },
+ { GPUTarget::G51, "g51" },
+ { GPUTarget::G51BIG, "g51big" },
+ { GPUTarget::G51LIT, "g51lit" },
+ { GPUTarget::TNOX, "tnox" },
+ { GPUTarget::TTRX, "ttrx" },
+ { GPUTarget::TBOX, "tbox" }
};
return gpu_target_map[target];
}
-GPUTarget get_target_from_device(cl::Device &device)
+GPUTarget get_target_from_name(const std::string &device_name)
{
- // Query device name size
- std::string device_name = device.getInfo<CL_DEVICE_NAME>();
- std::regex mali_regex(R"(Mali-([TG])(\d+))");
+ std::regex mali_regex(R"(Mali-(.*))");
std::smatch name_parts;
const bool found_mali = std::regex_search(device_name, name_parts, mali_regex);
if(!found_mali)
{
- ARM_COMPUTE_LOG_INFO_MSG_CORE("Can't find valid Mali GPU. Target is set to MIDGARD.");
- return GPUTarget::MIDGARD;
+ ARM_COMPUTE_LOG_INFO_MSG_CORE("Can't find valid Mali GPU. Target is set to UNKNOWN.");
+ return GPUTarget::UNKNOWN;
}
const char target = name_parts.str(1)[0];
- const std::string &version = name_parts.str(2);
+ const std::string &version = name_parts.str(1);
+
+ std::regex future_regex(R"(.*X)");
+ const bool is_future_bifrost = std::regex_search(version, future_regex);
- switch(target)
+ if(target == 'G' || is_future_bifrost)
{
- case 'T':
- return get_midgard_target(version);
- case 'G':
- return get_bifrost_target(version);
- default:
- ARM_COMPUTE_LOG_INFO_MSG_CORE("Mali GPU unknown. Target is set to the default one.");
- return GPUTarget::MIDGARD;
+ return get_bifrost_target(version);
+ }
+ else if(target == 'T')
+ {
+ return get_midgard_target(version);
}
+ else
+ {
+ ARM_COMPUTE_LOG_INFO_MSG_CORE("Mali GPU unknown. Target is set to the default one.");
+ return GPUTarget::UNKNOWN;
+ }
+}
+
+GPUTarget get_target_from_device(cl::Device &device)
+{
+ // Query device name size
+ std::string device_name = device.getInfo<CL_DEVICE_NAME>();
+
+ return get_target_from_name(device_name);
}
GPUTarget get_arch_from_target(GPUTarget target)