24.02.1
GPUTarget.h
Go to the documentation of this file.
1
/*
2
* Copyright (c) 2018-2023 Arm Limited.
3
*
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
*/
24
#ifndef ACL_ARM_COMPUTE_CORE_GPUTARGET_H
25
#define ACL_ARM_COMPUTE_CORE_GPUTARGET_H
26
27
#include "
support/Traits.h
"
28
29
#include <string>
30
31
namespace
arm_compute
32
{
33
/** Available GPU Targets */
34
enum class
GPUTarget
35
{
36
UNKNOWN
= 0x101,
37
GPU_ARCH_MASK
= 0xF00,
38
GPU_GENERATION_MASK
= 0x0F0,
39
MIDGARD
= 0x100,
40
BIFROST
= 0x200,
41
VALHALL
= 0x300,
42
FIFTHGEN
= 0X400,
43
T600
= 0x110,
44
T700
= 0x120,
45
T800
= 0x130,
46
G71
= 0x210,
47
G72
= 0x220,
48
G51
= 0x221,
49
G51BIG
= 0x222,
50
G51LIT
= 0x223,
51
G31
= 0x224,
52
G76
= 0x230,
53
G52
= 0x231,
54
G52LIT
= 0x232,
55
G77
= 0x310,
56
G57
= 0x311,
57
G78
= 0x320,
58
G68
= 0x321,
59
G78AE
= 0x330,
60
G710
= 0x340,
61
G610
= 0x341,
62
G510
= 0x342,
63
G310
= 0x343,
64
G715
= 0x350,
65
G615
= 0x351,
66
G720
= 0x410,
67
G620
= 0X411
68
};
69
70
/** Enable bitwise operations on GPUTarget enumerations */
71
template
<>
72
struct
enable_bitwise_ops
<
arm_compute
::
GPUTarget
>
73
{
74
static
constexpr
bool
value
=
true
;
/**< Enabled. */
75
};
76
77
/** Translates a given gpu device target to string.
78
*
79
* @param[in] target Given gpu target.
80
*
81
* @return The string describing the target.
82
*/
83
const
std::string &
string_from_target
(
GPUTarget
target);
84
85
/** Helper function to get the GPU target from a device name
86
*
87
* @param[in] device_name A device name
88
*
89
* @return the GPU target
90
*/
91
GPUTarget
get_target_from_name
(
const
std::string &device_name);
92
93
/** Helper function to get the GPU arch
94
*
95
* @param[in] target GPU target
96
*
97
* @return the GPU target which shows the arch
98
*/
99
GPUTarget
get_arch_from_target
(
GPUTarget
target);
100
/** Helper function to check whether a gpu target is equal to the provided targets
101
*
102
* @param[in] target_to_check gpu target to check
103
* @param[in] target First target to compare against
104
* @param[in] targets (Optional) Additional targets to compare with
105
*
106
* @return True if the target is equal with at least one of the targets.
107
*/
108
template
<
typename
... Args>
109
bool
gpu_target_is_in
(
GPUTarget
target_to_check,
GPUTarget
target, Args... targets)
110
{
111
return
(target_to_check == target) |
gpu_target_is_in
(target_to_check, targets...);
112
}
113
114
/** Variant of gpu_target_is_in for comparing two targets */
115
inline
bool
gpu_target_is_in
(
GPUTarget
target_to_check,
GPUTarget
target)
116
{
117
return
target_to_check == target;
118
}
119
}
// namespace arm_compute
120
#endif // ACL_ARM_COMPUTE_CORE_GPUTARGET_H
arm_compute::GPUTarget::T700
@ T700
arm_compute::GPUTarget::G31
@ G31
arm_compute::GPUTarget::G610
@ G610
arm_compute::GPUTarget::VALHALL
@ VALHALL
arm_compute::GPUTarget::T800
@ T800
arm_compute::GPUTarget::FIFTHGEN
@ FIFTHGEN
Traits.h
arm_compute::GPUTarget::G620
@ G620
arm_compute::GPUTarget::G720
@ G720
arm_compute::GPUTarget::G51BIG
@ G51BIG
arm_compute::GPUTarget::G715
@ G715
arm_compute::get_target_from_name
GPUTarget get_target_from_name(const std::string &device_name)
Helper function to get the GPU target from a device name.
Definition:
GPUTarget.cpp:188
arm_compute::GPUTarget::G615
@ G615
arm_compute::GPUTarget::GPU_GENERATION_MASK
@ GPU_GENERATION_MASK
arm_compute::GPUTarget::G310
@ G310
arm_compute::GPUTarget::BIFROST
@ BIFROST
arm_compute::string_from_target
const std::string & string_from_target(GPUTarget target)
Translates a given gpu device target to string.
Definition:
GPUTarget.cpp:169
arm_compute::GPUTarget::G78AE
@ G78AE
arm_compute::GPUTarget::G51
@ G51
arm_compute::GPUTarget::G52
@ G52
arm_compute::get_arch_from_target
GPUTarget get_arch_from_target(GPUTarget target)
Helper function to get the GPU arch.
Definition:
GPUTarget.cpp:247
arm_compute::GPUTarget::G77
@ G77
arm_compute::GPUTarget::G510
@ G510
arm_compute::GPUTarget::MIDGARD
@ MIDGARD
arm_compute::GPUTarget::G68
@ G68
arm_compute::GPUTarget::G710
@ G710
arm_compute::GPUTarget
GPUTarget
Available GPU Targets.
Definition:
GPUTarget.h:34
arm_compute::GPUTarget::G52LIT
@ G52LIT
arm_compute::GPUTarget::G76
@ G76
arm_compute::enable_bitwise_ops::value
static constexpr bool value
Disabled.
Definition:
Traits.h:35
arm_compute
Copyright (c) 2017-2024 Arm Limited.
Definition:
introduction.dox:24
arm_compute::GPUTarget::GPU_ARCH_MASK
@ GPU_ARCH_MASK
arm_compute::gpu_target_is_in
bool gpu_target_is_in(GPUTarget target_to_check, GPUTarget target, Args... targets)
Helper function to check whether a gpu target is equal to the provided targets.
Definition:
GPUTarget.h:109
arm_compute::GPUTarget::G57
@ G57
arm_compute::GPUTarget::G71
@ G71
arm_compute::GPUTarget::G51LIT
@ G51LIT
arm_compute::GPUTarget::T600
@ T600
arm_compute::enable_bitwise_ops
Disable bitwise operations by default.
Definition:
Traits.h:33
arm_compute::GPUTarget::UNKNOWN
@ UNKNOWN
arm_compute::GPUTarget::G78
@ G78
arm_compute::GPUTarget::G72
@ G72
arm_compute
core
GPUTarget.h
Generated on Mon Mar 18 2024 11:31:54 for Compute Library by
1.8.17