forked from Samsung/ONE
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[ONE] Adapt Arm Compute Library v21.02. (Samsung#6241)
* ONE] Apply armcompute library v21.02. This commit enables armcompute library v21.02. ONE-DCO-1.0-Signed-off-by: Hyunjun Kim <[email protected]> * [ONE] Apply ARM Compute library v21.02 Some header files path had been changed in armcompute library v21.02. So, Applies new include path and changes for ARMComputeEx. 1. CLGEMMMatrixAccumulateBiasesKernel, NEGEMMMatrixAccumulateBiasesKernel and CLMemsetKernel removed. - Copied files(.h, .cpp, cl) into ARMComputeEx. 2. NEFlattenLayerKernel removed. - Changed to use NEFlattenLayer. 3. Remove {CL/NE}BinaryLogicalKernel. - Provide kernels in v20.11 4. Modify KernelGenerator to adapt. ONE-DCO-1.0-Signed-off-by: <Hyunjun Kim> <[email protected]> * [ONE] Adapt ARM COMPUTE lib v21.02. - Apply changes of v21.02. - Add some CL and Neon's Kernel which was deprecated from v21.02. - Fix Test case' failures. ONE-DCO-1.0-Signed-off-by: HyunJun <[email protected]>
- Loading branch information
Showing
126 changed files
with
13,812 additions
and
196 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
101 changes: 101 additions & 0 deletions
101
compute/ARMComputeEx/arm_compute/core/CL/kernels/CLGEMMMatrixAccumulateBiasesKernel.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,101 @@ | ||
/* | ||
* Copyright (c) 2021 Samsung Electronics Co., Ltd. All Rights Reserved | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
/* | ||
* Copyright (c) 2017-2020 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_CLGEMMMatrixAccumulateBiasesKernel_H | ||
#define ARM_COMPUTE_CLGEMMMatrixAccumulateBiasesKernel_H | ||
|
||
#include "src/core/CL/ICLKernel.h" | ||
|
||
namespace arm_compute | ||
{ | ||
/** Interface to add a bias to each row of the input tensor | ||
* | ||
*/ | ||
class CLGEMMMatrixAccumulateBiasesKernel : public ICLKernel | ||
{ | ||
public: | ||
/** Default constructor */ | ||
CLGEMMMatrixAccumulateBiasesKernel(); | ||
/** Prevent instances of this class from being copied (As this class contains pointers) */ | ||
CLGEMMMatrixAccumulateBiasesKernel(const CLGEMMMatrixAccumulateBiasesKernel &) = delete; | ||
/** Prevent instances of this class from being copied (As this class contains pointers) */ | ||
CLGEMMMatrixAccumulateBiasesKernel & | ||
operator=(const CLGEMMMatrixAccumulateBiasesKernel &) = delete; | ||
/** Allow instances of this class to be moved */ | ||
CLGEMMMatrixAccumulateBiasesKernel(CLGEMMMatrixAccumulateBiasesKernel &&) = default; | ||
/** Allow instances of this class to be moved */ | ||
CLGEMMMatrixAccumulateBiasesKernel &operator=(CLGEMMMatrixAccumulateBiasesKernel &&) = default; | ||
/** Set the accumulate buffer and the biases of the kernel. | ||
* | ||
* @param[in, out] accum The accumulate tensor to convert. Data types supported: F16/F32 | ||
* @param[in] biases The shared biases tensor to append. It must be 1D tensor. Data types | ||
* supported: Same as @p input | ||
*/ | ||
void configure(ICLTensor *accum, const ICLTensor *biases); | ||
/** Set the accumulate buffer and the biases of the kernel. | ||
* | ||
* @param[in] compile_context The compile context to be used. | ||
* @param[in, out] accum The accumulate tensor to convert. Data types supported: F16/F32 | ||
* @param[in] biases The shared biases tensor to append. It must be 1D tensor. Data | ||
* types supported: Same as @p input | ||
*/ | ||
void configure(const CLCompileContext &compile_context, ICLTensor *accum, | ||
const ICLTensor *biases); | ||
/** Static function to check if given info will lead to a valid configuration of @ref | ||
* CLGEMMMatrixAccumulateBiasesKernel | ||
* | ||
* @param[in] accum The accumulate tensor to convert. Data types supported: F16/F32 | ||
* @param[in] biases The shared biases tensor to append. It must be 1D tensor. Data types | ||
* supported: Same as @p input | ||
* @param[in] gpu_target GPU target | ||
* | ||
* @return a status | ||
*/ | ||
static Status validate(const ITensorInfo *accum, const ITensorInfo *biases, GPUTarget gpu_target); | ||
|
||
// Inherited methods overridden: | ||
void run(const Window &window, cl::CommandQueue &queue) override; | ||
|
||
private: | ||
ICLTensor *_accum; | ||
const ICLTensor *_biases; | ||
}; | ||
} // namespace arm_compute | ||
#endif /*ARM_COMPUTE_CLGEMMMatrixAccumulateBiasesKernel_H */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
107 changes: 107 additions & 0 deletions
107
compute/ARMComputeEx/arm_compute/core/CL/kernels/CLMemsetKernel.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,107 @@ | ||
/* | ||
* Copyright (c) 2018 Samsung Electronics Co., Ltd. All Rights Reserved | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
/* | ||
* Copyright (c) 2018-2020 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_CLMEMSETKERNEL_H | ||
#define ARM_COMPUTE_CLMEMSETKERNEL_H | ||
|
||
#include "arm_compute/core/PixelValue.h" | ||
#include "arm_compute/core/Types.h" | ||
#include "src/core/CL/ICLKernel.h" | ||
|
||
namespace arm_compute | ||
{ | ||
class ICLTensor; | ||
|
||
/** Interface for filling the planes of a tensor */ | ||
class CLMemsetKernel : public ICLKernel | ||
{ | ||
public: | ||
/** Default constructor */ | ||
CLMemsetKernel(); | ||
/** Prevent instances of this class from being copied (As this class contains pointers) */ | ||
CLMemsetKernel(const CLMemsetKernel &) = delete; | ||
/** Prevent instances of this class from being copied (As this class contains pointers) */ | ||
CLMemsetKernel &operator=(const CLMemsetKernel &) = delete; | ||
/** Allow instances of this class to be moved */ | ||
CLMemsetKernel(CLMemsetKernel &&) = default; | ||
/** Allow instances of this class to be moved */ | ||
CLMemsetKernel &operator=(CLMemsetKernel &&) = default; | ||
/** Default destructor */ | ||
~CLMemsetKernel() = default; | ||
|
||
/** Initialise the kernel's tensor and filling value | ||
* | ||
* @param[in,out] tensor Input tensor to fill. Supported data types: All. | ||
* @param[in] constant_value The value used to fill the planes of the tensor | ||
* @param[in] window Window to be used in case setting only part of a tensor. Default | ||
* is nullptr. | ||
*/ | ||
void configure(ICLTensor *tensor, const PixelValue &constant_value, Window *window = nullptr); | ||
/** Initialise the kernel's tensor and filling value | ||
* | ||
* @param[in] compile_context The compile context to be used. | ||
* @param[in,out] tensor Input tensor to fill. Supported data types: All. | ||
* @param[in] constant_value The value used to fill the planes of the tensor | ||
* @param[in] window Window to be used in case setting only part of a tensor. Default | ||
* is nullptr. | ||
*/ | ||
void configure(const CLCompileContext &compile_context, ICLTensor *tensor, | ||
const PixelValue &constant_value, Window *window = nullptr); | ||
/** Static function to check if given info will lead to a valid configuration of @ref | ||
* CLMemsetKernel | ||
* | ||
* @param[in] tensor Source tensor info. Data types supported: All. | ||
* @param[in] constant_value The value used to fill the planes of the tensor | ||
* @param[in] window Window to be used in case setting only part of a tensor. Default is | ||
* nullptr. | ||
* | ||
* @return a status | ||
*/ | ||
static Status validate(const ITensorInfo *tensor, const PixelValue &constant_value, | ||
Window *window = nullptr); | ||
|
||
// Inherited methods overridden: | ||
void run(const Window &window, cl::CommandQueue &queue) override; | ||
|
||
private: | ||
ICLTensor *_tensor; | ||
Window _full_window; | ||
}; | ||
} // namespace arm_compute | ||
#endif /*ARM_COMPUTE_CLMEMSETRKERNEL_H */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.