Compute Library
 23.11
CLTypes.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2017-2022 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 ARM_COMPUTE_CL_TYPES_H
25 #define ARM_COMPUTE_CL_TYPES_H
26 
29 
30 #include <set>
31 #include <string>
32 
33 namespace arm_compute
34 {
35 /** Default string for the CLKernel configuration id */
36 static const std::string default_config_id = "no_config_id";
37 
38 /** Available OpenCL Version */
39 enum class CLVersion
40 {
41  CL10, /* the OpenCL 1.0 */
42  CL11, /* the OpenCL 1.1 */
43  CL12, /* the OpenCL 1.2 */
44  CL20, /* the OpenCL 2.x */
45  CL30, /* the OpenCL 3.x */
46  UNKNOWN /* unkown version */
47 };
48 
49 /** OpenCL device options */
51 {
52  std::string name{}; /**< Device name */
53  std::string device_version{}; /**< Device version string */
54  std::set<std::string> extensions{}; /**< List of supported extensions */
55  std::string ddk_version{}; /**< DDK version */
56  GPUTarget gpu_target{}; /**< GPU target architecture/instance */
57  CLVersion version{}; /**< Device OpenCL version */
58  size_t compute_units{}; /**< Number of compute units */
59  size_t cache_size{}; /**< Cache size */
60 };
61 
62 /** OpenCL quantization data */
64 {
65  /** Default Constructor */
66  CLQuantization() : scale(nullptr), offset(nullptr){};
67  /** Constructor
68  *
69  * @param[in] scale OpenCL scale array
70  * @param[in] offset OpenCL offset array
71  */
73 
74  const ICLFloatArray *scale; /**< Quantization scale array */
75  const ICLInt32Array *offset; /**< Quantization offset array */
76 };
77 
79 {
80  UNKNOWN, /**< Unknown CL kernel type */
81  DEPTHWISE, /**< Depthwise CL kernel type */
82  DIRECT, /**< Direct Convolution CL kernel type */
83  ELEMENTWISE, /**< Elementwise CL kernel type */
84  GEMM, /**< GEMM CL kernel type */
85  POOL, /**< Pool CL kernel type */
86  WINOGRAD /**< Winograd CL kernel type */
87 };
88 } // namespace arm_compute
89 #endif /* ARM_COMPUTE_CL_TYPES_H */
arm_compute::CLDeviceOptions::gpu_target
GPUTarget gpu_target
GPU target architecture/instance.
Definition: CLTypes.h:56
arm_compute::CLVersion::CL10
@ CL10
arm_compute::CLQuantization::CLQuantization
CLQuantization()
Default Constructor.
Definition: CLTypes.h:66
arm_compute::POOL
@ POOL
Pool CL kernel type.
Definition: CLTypes.h:85
arm_compute::CLVersion::CL30
@ CL30
arm_compute::CLVersion::CL11
@ CL11
arm_compute::DEPTHWISE
@ DEPTHWISE
Depthwise CL kernel type.
Definition: CLTypes.h:81
arm_compute::CLDeviceOptions
OpenCL device options.
Definition: CLTypes.h:50
arm_compute::CLDeviceOptions::ddk_version
std::string ddk_version
DDK version.
Definition: CLTypes.h:55
arm_compute::CLVersion
CLVersion
Available OpenCL Version.
Definition: CLTypes.h:39
arm_compute::WINOGRAD
@ WINOGRAD
Winograd CL kernel type.
Definition: CLTypes.h:86
arm_compute::CLDeviceOptions::extensions
std::set< std::string > extensions
List of supported extensions.
Definition: CLTypes.h:54
arm_compute::ICLArray< cl_float >
arm_compute::DIRECT
@ DIRECT
Direct Convolution CL kernel type.
Definition: CLTypes.h:82
arm_compute::CLQuantization
OpenCL quantization data.
Definition: CLTypes.h:63
GPUTarget.h
arm_compute::CLDeviceOptions::version
CLVersion version
Device OpenCL version.
Definition: CLTypes.h:57
arm_compute::GPUTarget
GPUTarget
Available GPU Targets.
Definition: GPUTarget.h:34
arm_compute::CLKernelType
CLKernelType
Definition: CLTypes.h:78
arm_compute::CLDeviceOptions::compute_units
size_t compute_units
Number of compute units.
Definition: CLTypes.h:58
arm_compute::CLVersion::CL20
@ CL20
arm_compute::CLQuantization::scale
const ICLFloatArray * scale
Quantization scale array.
Definition: CLTypes.h:72
arm_compute::ELEMENTWISE
@ ELEMENTWISE
Elementwise CL kernel type.
Definition: CLTypes.h:83
arm_compute
Copyright (c) 2017-2023 Arm Limited.
Definition: introduction.dox:24
arm_compute::UNKNOWN
@ UNKNOWN
Unknown CL kernel type.
Definition: CLTypes.h:80
arm_compute::CLDeviceOptions::device_version
std::string device_version
Device version string.
Definition: CLTypes.h:53
arm_compute::CLVersion::CL12
@ CL12
arm_compute::CLQuantization::offset
const ICLInt32Array * offset
Quantization offset array.
Definition: CLTypes.h:75
arm_compute::GEMM
@ GEMM
GEMM CL kernel type.
Definition: CLTypes.h:84
arm_compute::CLDeviceOptions::cache_size
size_t cache_size
Cache size.
Definition: CLTypes.h:59
arm_compute::CLDeviceOptions::name
std::string name
Device name.
Definition: CLTypes.h:52
ICLArray.h