aboutsummaryrefslogtreecommitdiff
path: root/docs/contributor_guide/adding_operator.dox
diff options
context:
space:
mode:
Diffstat (limited to 'docs/contributor_guide/adding_operator.dox')
-rw-r--r--docs/contributor_guide/adding_operator.dox18
1 files changed, 9 insertions, 9 deletions
diff --git a/docs/contributor_guide/adding_operator.dox b/docs/contributor_guide/adding_operator.dox
index 772d4362c8..559e8e2e76 100644
--- a/docs/contributor_guide/adding_operator.dox
+++ b/docs/contributor_guide/adding_operator.dox
@@ -1,5 +1,5 @@
///
-/// Copyright (c) 2018-2021 Arm Limited.
+/// Copyright (c) 2018-2022 Arm Limited.
///
/// SPDX-License-Identifier: MIT
///
@@ -55,13 +55,13 @@ Following are the steps involved in adding support for a new operator in Compute
@subsection S4_1_1_add_datatypes Adding new data types
Compute Library declares a few new datatypes related to its domain, kernels, and functions in the library process Tensors and Images (Computer Vision functions). Tensors are multi-dimensional arrays with a maximum of Coordinates::num_max_dimensions dimensions; depending on the number of dimensions tensors can be interpreted as various objects. A scalar can be represented as a zero-dimensional tensor and a vector of numbers can be represented as a one-dimensional tensor. Furthermore, an image is just a 2D tensor, a 3D tensor can be seen as an array of images and a 4D tensor as a 2D array of images, etc.
-All the datatype classes or structures are grouped in the core library folder arm_compute/core like the @ref ITensor, @ref ITensorInfo (all the information of a tensor), TensorShape and simpler types are in arm_compute/core/Types.h.
+All the datatype classes or structures are grouped in the core library folder arm_compute/core like the @ref ITensor, @ref ITensorInfo (all the information of a tensor), TensorShape and simpler types are in arm_compute/core/CoreTypes.h.
If an operator handles a new datatype, it must be added to the library. While adding a new data type to the library, it's necessary to implement the function to enable printing, the to_string() method and the output stream insertion (<<) operator. Every datatype implements these two functions in utils/TypePrinter.h
-A quick example, in <a href="https://github.com/ARM-software/ComputeLibrary/blob/master/arm_compute/core/Types.h">Types.h</a> we add:
+A quick example, in <a href="https://github.com/ARM-software/ComputeLibrary/blob/main/arm_compute/core/CoreTypes.h">CoreTypes.h</a> we add:
-@snippet arm_compute/core/Types.h DataLayout enum definition
+@snippet arm_compute/core/CoreTypes.h DataLayout enum definition
And for printing:
@@ -97,12 +97,12 @@ We must register the new layer in the respective libraries:
These files contain the list of all kernels available in the corresponding Compute Library's backend, for example CLKernels:
@code{.cpp}
-...
+...
#include "src/core/CL/kernels/CLMinMaxLayerKernel.h"
#include "src/core/CL/kernels/CLMinMaxLocationKernel.h"
-...
+...
#include "src/core/CL/kernels/CLReshapeLayerKernel.h"
-...
+...
@endcode
@@ -119,11 +119,11 @@ Each kernel will have to implement the method:
The structure of the kernel .cpp file should be similar to the next ones.
For OpenCL:
-@snippet src/core/gpu/cl/kernels/ClReshapeKernel.cpp ClReshapeKernel Kernel
+@snippet src/gpu/cl/kernels/ClReshapeKernel.cpp ClReshapeKernel Kernel
The run will call the function defined in the .cl file.
For the Arm® Neon™ backend case:
-@snippet src/core/cpu/kernels/CpuReshapeKernel.cpp NEReshapeLayerKernel Kernel
+@snippet src/cpu/kernels/CpuReshapeKernel.cpp NEReshapeLayerKernel Kernel
In the Arm® Neon™ case, there is no need to add an extra file and we implement the kernel in the same NEReshapeLayerKernel.cpp file.
If the tests are already in place, the new kernel can be tested using the existing tests by adding the configure and run of the kernel to the compute_target() in the fixture.