From a9676118fd2a0e5bc916969af83ecee049bae76b Mon Sep 17 00:00:00 2001 From: Michalis Spyrou Date: Thu, 22 Feb 2018 18:07:43 +0000 Subject: 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 Tested-by: Jenkins --- arm_compute/core/CL/CLHelpers.h | 29 ++++++++++++++++++++++++++++- arm_compute/core/CL/CLTypes.h | 12 ++++++++++-- arm_compute/core/CL/ICLKernel.h | 2 +- 3 files changed, 39 insertions(+), 4 deletions(-) (limited to 'arm_compute/core') diff --git a/arm_compute/core/CL/CLHelpers.h b/arm_compute/core/CL/CLHelpers.h index 365ecb06c4..66423d648a 100644 --- a/arm_compute/core/CL/CLHelpers.h +++ b/arm_compute/core/CL/CLHelpers.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, 2017 ARM Limited. + * Copyright (c) 2016-2018 ARM Limited. * * SPDX-License-Identifier: MIT * @@ -103,6 +103,14 @@ std::unique_ptr create_kernel() return k; } +/** Helper function to get the GPU target from a device name + * + * @param[in] device_name A device name + * + * @return the GPU target + */ +GPUTarget get_target_from_name(const std::string &device_name); + /** Helper function to get the GPU target from CL device * * @param[in] device A CL device @@ -140,5 +148,24 @@ bool fp16_support(const cl::Device &device); * @return True if the extension is supported */ bool non_uniform_workgroup_support(const cl::Device &device); +/** Helper function to check whether a gpu target is equal to the provided targets + * + * @param[in] target_to_check gpu target to check + * @param[in] target First target to compare against + * @param[in] targets (Optional) Additional targets to compare with + * + * @return True if the target is equal with at least one of the targets. + */ +template +bool gpu_target_is_in(GPUTarget target_to_check, GPUTarget target, Args... targets) +{ + return (target_to_check == target) | gpu_target_is_in(target_to_check, targets...); +} + +/** Variant of gpu_target_is_in for comparing two targets */ +inline bool gpu_target_is_in(GPUTarget target_to_check, GPUTarget target) +{ + return target_to_check == target; +} } #endif /* __ARM_COMPUTE_CLHELPERS_H__ */ diff --git a/arm_compute/core/CL/CLTypes.h b/arm_compute/core/CL/CLTypes.h index 05f9e2e119..c207ec7611 100644 --- a/arm_compute/core/CL/CLTypes.h +++ b/arm_compute/core/CL/CLTypes.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017 ARM Limited. + * Copyright (c) 2017-2018 ARM Limited. * * SPDX-License-Identifier: MIT * @@ -34,13 +34,21 @@ static const std::string default_config_id = "no_config_id"; /** Available GPU Targets */ enum class GPUTarget { + UNKNOWN = 0x000, GPU_ARCH_MASK = 0xF00, MIDGARD = 0x100, BIFROST = 0x200, T600 = 0x110, T700 = 0x120, T800 = 0x130, - G70 = 0x210 + G71 = 0x210, + G72 = 0x220, + G51 = 0x230, + G51BIG = 0x231, + G51LIT = 0x232, + TNOX = 0x240, + TTRX = 0x250, + TBOX = 0x260 }; /* Available OpenCL Version */ diff --git a/arm_compute/core/CL/ICLKernel.h b/arm_compute/core/CL/ICLKernel.h index e660ae55a0..f331df2996 100644 --- a/arm_compute/core/CL/ICLKernel.h +++ b/arm_compute/core/CL/ICLKernel.h @@ -287,7 +287,7 @@ protected: * @param[in,out] queue OpenCL command queue. * @param[in] kernel Kernel to enqueue * @param[in] window Window the kernel has to process. - * @param[in] lws_hint Local workgroup size requested, by default (128,1). + * @param[in] lws_hint Local workgroup size requested. Default is based on the device target. * * @note If any dimension of the lws is greater than the global workgroup size then no lws will be passed. */ -- cgit v1.2.1