diff options
Diffstat (limited to 'compute/ARMComputeEx/src/core/CL/kernels/CLPReLUKernel.cpp')
-rw-r--r-- | compute/ARMComputeEx/src/core/CL/kernels/CLPReLUKernel.cpp | 50 |
1 files changed, 37 insertions, 13 deletions
diff --git a/compute/ARMComputeEx/src/core/CL/kernels/CLPReLUKernel.cpp b/compute/ARMComputeEx/src/core/CL/kernels/CLPReLUKernel.cpp index e7d587029..8910a7b80 100644 --- a/compute/ARMComputeEx/src/core/CL/kernels/CLPReLUKernel.cpp +++ b/compute/ARMComputeEx/src/core/CL/kernels/CLPReLUKernel.cpp @@ -1,6 +1,5 @@ /* * Copyright (c) 2018 Samsung Electronics Co., Ltd. All Rights Reserved - * Copyright (c) 2016-2018 ARM Limited. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,6 +13,31 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + +/* + * Copyright (c) 2016-2018 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. + */ + #include "arm_compute/core/CL/kernels/CLPReLUKernel.h" #include "arm_compute/core/CL/CLHelpers.h" @@ -72,18 +96,18 @@ void CLPReLUKernel::configure(const ICLTensor *input, const ICLTensor *alpha, IC if (is_data_type_quantized_asymmetric(input->info()->data_type())) { - build_opts.emplace("-DOFF_IN=" + - support::cpp11::to_string(input->info()->quantization_info().offset)); - build_opts.emplace("-DOFF_ALPHA=" + - support::cpp11::to_string(alpha->info()->quantization_info().offset)); - build_opts.emplace("-DOFF_OUT=" + - support::cpp11::to_string(output->info()->quantization_info().offset)); - build_opts.emplace("-DSCALE_IN=" + - support::cpp11::to_string(input->info()->quantization_info().scale)); - build_opts.emplace("-DSCALE_ALPHA=" + - support::cpp11::to_string(alpha->info()->quantization_info().scale)); - build_opts.emplace("-DSCALE_OUT=" + - support::cpp11::to_string(output->info()->quantization_info().scale)); + build_opts.emplace("-DOFF_IN=" + support::cpp11::to_string( + input->info()->quantization_info().uniform().offset)); + build_opts.emplace("-DOFF_ALPHA=" + support::cpp11::to_string( + alpha->info()->quantization_info().uniform().offset)); + build_opts.emplace("-DOFF_OUT=" + support::cpp11::to_string( + output->info()->quantization_info().uniform().offset)); + build_opts.emplace("-DSCALE_IN=" + support::cpp11::to_string( + input->info()->quantization_info().uniform().scale)); + build_opts.emplace("-DSCALE_ALPHA=" + support::cpp11::to_string( + alpha->info()->quantization_info().uniform().scale)); + build_opts.emplace("-DSCALE_OUT=" + support::cpp11::to_string( + output->info()->quantization_info().uniform().scale)); kernel_name += "_qasymm8"; } _kernel = |