diff options
Diffstat (limited to 'src/core')
-rw-r--r-- | src/core/CL/CLKernelLibrary.cpp | 2 | ||||
-rw-r--r-- | src/core/CL/cl_kernels/elementwise_operation.cl | 1 | ||||
-rw-r--r-- | src/core/CL/cl_kernels/elementwise_operation_quantized.cl | 3 | ||||
-rw-r--r-- | src/core/CL/kernels/CLElementwiseOperationKernel.cpp | 1 |
4 files changed, 6 insertions, 1 deletions
diff --git a/src/core/CL/CLKernelLibrary.cpp b/src/core/CL/CLKernelLibrary.cpp index 28152168bc..23eac1664a 100644 --- a/src/core/CL/CLKernelLibrary.cpp +++ b/src/core/CL/CLKernelLibrary.cpp @@ -253,12 +253,14 @@ const std::map<std::string, std::string> CLKernelLibrary::_kernel_program_map = { "elementwise_operation_DIV", "elementwise_operation.cl" }, { "elementwise_operation_SQUARED_DIFF", "elementwise_operation.cl" }, { "elementwise_operation_POWER", "elementwise_operation.cl" }, + { "elementwise_operation_PRELU", "elementwise_operation.cl" }, { "elementwise_operation_ADD_quantized", "elementwise_operation_quantized.cl" }, { "elementwise_operation_SUB_quantized", "elementwise_operation_quantized.cl" }, { "elementwise_operation_MAX_quantized", "elementwise_operation_quantized.cl" }, { "elementwise_operation_MIN_quantized", "elementwise_operation_quantized.cl" }, { "elementwise_operation_DIV_quantized", "elementwise_operation_quantized.cl" }, { "elementwise_operation_SQUARED_DIFF_quantized", "elementwise_operation_quantized.cl" }, + { "elementwise_operation_PRELU_quantized", "elementwise_operation_quantized.cl" }, { "elementwise_unary", "elementwise_unary.cl" }, { "erode", "erode.cl" }, { "fast_corners", "fast_corners.cl" }, diff --git a/src/core/CL/cl_kernels/elementwise_operation.cl b/src/core/CL/cl_kernels/elementwise_operation.cl index 0b660e4012..42d6d33e03 100644 --- a/src/core/CL/cl_kernels/elementwise_operation.cl +++ b/src/core/CL/cl_kernels/elementwise_operation.cl @@ -38,6 +38,7 @@ #define SQUARED_DIFF(x, y) (x - y) * (x - y) #define DIV(x, y) (x / y) #define POWER(x, y) pow(x, y) +#define PRELU(x, y) (select(y * x, x, x > (DATA_TYPE_OUT)0)) #define OP_FUN_NAME_STR(op) elementwise_operation_##op #define OP_FUN_NAME(op) OP_FUN_NAME_STR(op) diff --git a/src/core/CL/cl_kernels/elementwise_operation_quantized.cl b/src/core/CL/cl_kernels/elementwise_operation_quantized.cl index 1f0533be13..1b45da164f 100644 --- a/src/core/CL/cl_kernels/elementwise_operation_quantized.cl +++ b/src/core/CL/cl_kernels/elementwise_operation_quantized.cl @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018 ARM Limited. + * Copyright (c) 2018-2019 ARM Limited. * * SPDX-License-Identifier: MIT * @@ -28,6 +28,7 @@ #define MAX(x, y) max((x), (y)) #define MIN(x, y) min((x), (y)) #define SQUARED_DIFF(x, y) (x - y) * (x - y) +#define PRELU(x, y) (select(y * x, x, x > (DATA_TYPE_OUT)0)) #define DIV(x, y) (x / y) #define CONVERT_RTE(x, type) (convert_##type##_rte((x))) diff --git a/src/core/CL/kernels/CLElementwiseOperationKernel.cpp b/src/core/CL/kernels/CLElementwiseOperationKernel.cpp index ce0c51dac5..414b040f4c 100644 --- a/src/core/CL/kernels/CLElementwiseOperationKernel.cpp +++ b/src/core/CL/kernels/CLElementwiseOperationKernel.cpp @@ -43,6 +43,7 @@ std::map<ArithmeticOperation, std::string> supported_arithmetic_ops = { ArithmeticOperation::MIN, "MIN" }, { ArithmeticOperation::MAX, "MAX" }, { ArithmeticOperation::POWER, "POWER" }, + { ArithmeticOperation::PRELU, "PRELU" }, }; std::map<ArithmeticOperation, std::string> supported_sat_arithmetic_ops = |