blob: d9366069f2e1b443aa6b00d7a7d468bf65cab261 [file] [log] [blame]
Michalis Spyroua9676112018-02-22 18:07:43 +00001/*
Georgios Pinitasd5462ff2019-07-03 19:33:57 +01002 * Copyright (c) 2018-2019 ARM Limited.
Michalis Spyroua9676112018-02-22 18:07:43 +00003 *
4 * SPDX-License-Identifier: MIT
5 *
6 * Permission is hereby granted, free of charge, to any person obtaining a copy
7 * of this software and associated documentation files (the "Software"), to
8 * deal in the Software without restriction, including without limitation the
9 * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
10 * sell copies of the Software, and to permit persons to whom the Software is
11 * furnished to do so, subject to the following conditions:
12 *
13 * The above copyright notice and this permission notice shall be included in all
14 * copies or substantial portions of the Software.
15 *
16 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22 * SOFTWARE.
23 */
Michele Di Giorgiob8fc60f2018-04-25 11:58:07 +010024#include "arm_compute/core/GPUTarget.h"
Michalis Spyroua9676112018-02-22 18:07:43 +000025#include "support/ToolchainSupport.h"
26#include "tests/AssetsLibrary.h"
27#include "tests/Globals.h"
28#include "tests/Utils.h"
29#include "tests/framework/Asserts.h"
30#include "tests/framework/Macros.h"
31namespace arm_compute
32{
33namespace test
34{
35namespace validation
36{
37TEST_SUITE(UNIT)
Michele Di Giorgiob8fc60f2018-04-25 11:58:07 +010038TEST_SUITE(GPUTarget)
Michalis Spyroua9676112018-02-22 18:07:43 +000039
40TEST_CASE(GetGPUTargetFromName, framework::DatasetMode::ALL)
41{
42 ARM_COMPUTE_EXPECT(get_target_from_name("Mali-T600") == GPUTarget::T600, framework::LogLevel::ERRORS);
43 ARM_COMPUTE_EXPECT(get_target_from_name("Mali-T700") == GPUTarget::T700, framework::LogLevel::ERRORS);
44 ARM_COMPUTE_EXPECT(get_target_from_name("Mali-T800") == GPUTarget::T800, framework::LogLevel::ERRORS);
45 ARM_COMPUTE_EXPECT(get_target_from_name("Mali-G71") == GPUTarget::G71, framework::LogLevel::ERRORS);
46 ARM_COMPUTE_EXPECT(get_target_from_name("Mali-G72") == GPUTarget::G72, framework::LogLevel::ERRORS);
47 ARM_COMPUTE_EXPECT(get_target_from_name("Mali-G51") == GPUTarget::G51, framework::LogLevel::ERRORS);
48 ARM_COMPUTE_EXPECT(get_target_from_name("Mali-G51BIG") == GPUTarget::G51BIG, framework::LogLevel::ERRORS);
49 ARM_COMPUTE_EXPECT(get_target_from_name("Mali-G51LIT") == GPUTarget::G51LIT, framework::LogLevel::ERRORS);
Georgios Pinitasa34286e2018-09-04 12:18:50 +010050 ARM_COMPUTE_EXPECT(get_target_from_name("Mali-G52") == GPUTarget::G52, framework::LogLevel::ERRORS);
51 ARM_COMPUTE_EXPECT(get_target_from_name("Mali-G52LIT") == GPUTarget::G52LIT, framework::LogLevel::ERRORS);
Georgios Pinitasb03f7c52018-07-12 10:49:53 +010052 ARM_COMPUTE_EXPECT(get_target_from_name("Mali-G76") == GPUTarget::G76, framework::LogLevel::ERRORS);
Michalis Spyrouc95988a2019-07-17 13:24:52 +010053 ARM_COMPUTE_EXPECT(get_target_from_name("Mali-G76 r0p0") == GPUTarget::G76, framework::LogLevel::ERRORS);
Georgios Pinitasd5462ff2019-07-03 19:33:57 +010054 ARM_COMPUTE_EXPECT(get_target_from_name("Mali-G77") == GPUTarget::G77, framework::LogLevel::ERRORS);
Michalis Spyroua9676112018-02-22 18:07:43 +000055 ARM_COMPUTE_EXPECT(get_target_from_name("Mali-TBOX") == GPUTarget::TBOX, framework::LogLevel::ERRORS);
Georgios Pinitasd5462ff2019-07-03 19:33:57 +010056 ARM_COMPUTE_EXPECT(get_target_from_name("Mali-TODX") == GPUTarget::TODX, framework::LogLevel::ERRORS);
Michalis Spyroua9676112018-02-22 18:07:43 +000057 ARM_COMPUTE_EXPECT(get_target_from_name("Mali-T000") == GPUTarget::MIDGARD, framework::LogLevel::ERRORS);
58}
59
60TEST_CASE(GPUTargetIsIn, framework::DatasetMode::ALL)
61{
62 ARM_COMPUTE_EXPECT(!gpu_target_is_in(GPUTarget::G71, GPUTarget::T600, GPUTarget::T800, GPUTarget::G72), framework::LogLevel::ERRORS);
63 ARM_COMPUTE_EXPECT(gpu_target_is_in(GPUTarget::G71, GPUTarget::T600, GPUTarget::T800, GPUTarget::G71), framework::LogLevel::ERRORS);
64}
65TEST_SUITE_END() // CLHelpers
66TEST_SUITE_END() // UNIT
67} // namespace validation
68} // namespace test
69} // namespace arm_compute