diff options
author | Georgios Pinitas <georgios.pinitas@arm.com> | 2018-07-11 18:16:20 +0100 |
---|---|---|
committer | Anthony Barbier <anthony.barbier@arm.com> | 2018-11-02 16:54:54 +0000 |
commit | 7777b1aa865d3c17dcef31573d44fae421176109 (patch) | |
tree | 7c50dd7262abebc9390e01f1ebccb5d487eb410f /arm_compute/runtime/CL/tuners/Tuners.h | |
parent | e88b9bb3e2c97bc2c3f5024f17fa6c5080ee522c (diff) | |
download | ComputeLibrary-7777b1aa865d3c17dcef31573d44fae421176109.tar.gz |
COMPMID-1388: Change default CLTuner to the one for the detected GPU
Sets a default tuner for the detected target if no tuner is specified in
default_init()
Change-Id: I27f1b9bbc0df91c1940315c6cc9042720cd1d3fe
Reviewed-on: https://eu-gerrit-1.euhpc.arm.com/139630
Reviewed-by: Anthony Barbier <anthony.barbier@arm.com>
Tested-by: Jenkins <bsgcomp@arm.com>
Diffstat (limited to 'arm_compute/runtime/CL/tuners/Tuners.h')
-rw-r--r-- | arm_compute/runtime/CL/tuners/Tuners.h | 56 |
1 files changed, 56 insertions, 0 deletions
diff --git a/arm_compute/runtime/CL/tuners/Tuners.h b/arm_compute/runtime/CL/tuners/Tuners.h new file mode 100644 index 0000000000..a9eaa074aa --- /dev/null +++ b/arm_compute/runtime/CL/tuners/Tuners.h @@ -0,0 +1,56 @@ +/* + * Copyright (c) 2018 ARM Limited. + * + * SPDX-License-Identifier: MIT + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to + * deal in the Software without restriction, including without limitation the + * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or + * sell copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ +#ifndef __ARM_COMPUTE_TUNERS_H__ +#define __ARM_COMPUTE_TUNERS_H__ + +#include "arm_compute/runtime/CL/tuners/BifrostTuner.h" +#include "arm_compute/runtime/CL/tuners/MidgardTuner.h" + +#include <memory> + +namespace arm_compute +{ +namespace tuners +{ +/** Tuner factory class */ +class TunerFactory final +{ +public: + static std::unique_ptr<ICLTuner> create_tuner(GPUTarget target) + { + GPUTarget arch = get_arch_from_target(target); + switch(arch) + { + case GPUTarget::BIFROST: + return support::cpp14::make_unique<BifrostTuner>(); + case GPUTarget::MIDGARD: + return support::cpp14::make_unique<MidgardTuner>(); + default: + return nullptr; + } + } +}; +} // namespace tuners +} // namespace arm_compute +#endif /*__ARM_COMPUTE_TUNERS_H__ */ |