diff options
author | Michele Di Giorgio <michele.digiorgio@arm.com> | 2018-04-25 11:58:07 +0100 |
---|---|---|
committer | Anthony Barbier <anthony.barbier@arm.com> | 2018-11-02 16:51:50 +0000 |
commit | b8fc60fc9fe9ad6c48d9618fc65753fbe5813216 (patch) | |
tree | a9f271d73f573686ba29c724bb3a3cee4b6b203b /src/core/CL/CLHelpers.cpp | |
parent | 62385bce6baacfa194cff9e6be6d8eaa73bc3fab (diff) | |
download | ComputeLibrary-b8fc60fc9fe9ad6c48d9618fc65753fbe5813216.tar.gz |
COMPMID-1086: Optimizing GCGEMM - Add helpers to get target GPU information
This patch moves some of the helper functions in CLHelpers.[h,cpp] to
GPUTarget.[h,cpp] in order to make them avaialable to both CL and GLES backends.
Change-Id: Ib89b05a2084b73eb643b32fac13b8367cc80b6a5
Reviewed-on: https://eu-gerrit-1.euhpc.arm.com/128988
Tested-by: Jenkins <bsgcomp@arm.com>
Reviewed-by: Anthony Barbier <anthony.barbier@arm.com>
Diffstat (limited to 'src/core/CL/CLHelpers.cpp')
-rw-r--r-- | src/core/CL/CLHelpers.cpp | 126 |
1 files changed, 0 insertions, 126 deletions
diff --git a/src/core/CL/CLHelpers.cpp b/src/core/CL/CLHelpers.cpp index 9842d4d0ab..cda29d69d1 100644 --- a/src/core/CL/CLHelpers.cpp +++ b/src/core/CL/CLHelpers.cpp @@ -27,74 +27,8 @@ #include "arm_compute/core/Log.h" #include "arm_compute/core/Types.h" -#include <map> -#include <regex> #include <vector> -namespace -{ -arm_compute::GPUTarget get_bifrost_target(const std::string &version) -{ - if(version == "G71") - { - 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 - { - return arm_compute::GPUTarget::BIFROST; - } -} - -arm_compute::GPUTarget get_midgard_target(const std::string &version) -{ - 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; - } -} - -} // namespace - namespace arm_compute { std::string get_cl_type_from_data_type(const DataType &dt) @@ -177,61 +111,6 @@ std::string get_underlying_cl_type_from_data_type(const DataType &dt) } } -const std::string &string_from_target(GPUTarget target) -{ - static std::map<GPUTarget, const std::string> gpu_target_map = - { - { GPUTarget::MIDGARD, "midgard" }, - { GPUTarget::BIFROST, "bifrost" }, - { GPUTarget::T600, "t600" }, - { GPUTarget::T700, "t700" }, - { GPUTarget::T800, "t800" }, - { 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_name(const std::string &device_name) -{ - 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 UNKNOWN."); - return GPUTarget::UNKNOWN; - } - - const char target = name_parts.str(1)[0]; - 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); - - if(target == 'G' || is_future_bifrost) - { - 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. (BIFROST)"); - return GPUTarget::BIFROST; - } -} - GPUTarget get_target_from_device(cl::Device &device) { // Query device name size @@ -240,11 +119,6 @@ GPUTarget get_target_from_device(cl::Device &device) return get_target_from_name(device_name); } -GPUTarget get_arch_from_target(GPUTarget target) -{ - return (target & GPUTarget::GPU_ARCH_MASK); -} - bool arm_non_uniform_workgroup_supported(const cl::Device &device) { return device_supports_extension(device, "cl_arm_non_uniform_work_group_size"); |