diff options
author | Gian Marco Iodice <gianmarco.iodice@arm.com> | 2017-07-04 16:46:32 +0100 |
---|---|---|
committer | Anthony Barbier <anthony.barbier@arm.com> | 2018-09-17 14:15:39 +0100 |
commit | 2bbd96457e3740fd9df5556607514b5e80a25720 (patch) | |
tree | 679935dd849bdac044769dfff67516962493dd51 /src/core/NEON/kernels/NEGEMMMatrixAccumulateBiasesKernel.cpp | |
parent | 8a383694445dfebb84732b19d5b3299961e8ffe3 (diff) | |
download | ComputeLibrary-2bbd96457e3740fd9df5556607514b5e80a25720.tar.gz |
COMPMID-436, COMPMID-437 - Port NEConvolutionLayer & NEFullyConnectedLayer to support 16 bit fixed point
Change-Id: I69edf2dac242f941bac95c8479d921e7be6abca7
Reviewed-on: http://mpd-gerrit.cambridge.arm.com/79725
Tested-by: Kaizen <jeremy.johnson+kaizengerrit@arm.com>
Reviewed-by: Pablo Tello <pablo.tello@arm.com>
Diffstat (limited to 'src/core/NEON/kernels/NEGEMMMatrixAccumulateBiasesKernel.cpp')
-rw-r--r-- | src/core/NEON/kernels/NEGEMMMatrixAccumulateBiasesKernel.cpp | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/src/core/NEON/kernels/NEGEMMMatrixAccumulateBiasesKernel.cpp b/src/core/NEON/kernels/NEGEMMMatrixAccumulateBiasesKernel.cpp index 7a3bae50c0..826a386557 100644 --- a/src/core/NEON/kernels/NEGEMMMatrixAccumulateBiasesKernel.cpp +++ b/src/core/NEON/kernels/NEGEMMMatrixAccumulateBiasesKernel.cpp @@ -45,9 +45,9 @@ NEGEMMMatrixAccumulateBiasesKernel::NEGEMMMatrixAccumulateBiasesKernel() void NEGEMMMatrixAccumulateBiasesKernel::configure(ITensor *accum, const ITensor *biases) { - ARM_COMPUTE_ERROR_ON_DATA_TYPE_CHANNEL_NOT_IN(accum, 1, DataType::QS8, DataType::F32); - ARM_COMPUTE_ERROR_ON_DATA_TYPE_CHANNEL_NOT_IN(biases, 1, DataType::QS8, DataType::F32); + ARM_COMPUTE_ERROR_ON_DATA_TYPE_CHANNEL_NOT_IN(accum, 1, DataType::QS8, DataType::QS16, DataType::F32); ARM_COMPUTE_ERROR_ON_MISMATCHING_DATA_TYPES(biases, accum); + ARM_COMPUTE_ERROR_ON_MISMATCHING_FIXED_POINT_POSITION(biases, accum); ARM_COMPUTE_ERROR_ON(biases->info()->num_dimensions() != 1); _biases = biases; @@ -121,6 +121,21 @@ void NEGEMMMatrixAccumulateBiasesKernel::run(const Window &window) in0_out, in1); break; } + case DataType::QS16: + { + execute_window_loop(window, [&](const Coordinates & id) + { + qint16x8x2_t accum = vld2q_s16(reinterpret_cast<const qint16_t *>(in0_out.ptr())); + const qint16x8x2_t biases = vld2q_s16(reinterpret_cast<const qint16_t *>(in1.ptr())); + + accum.val[0] = vqaddq_qs16(accum.val[0], biases.val[0]); + accum.val[1] = vqaddq_qs16(accum.val[1], biases.val[1]); + + vst2q_s16(reinterpret_cast<qint16_t *>(in0_out.ptr()), accum); + }, + in0_out, in1); + break; + } default: ARM_COMPUTE_ERROR("Data type not supported"); break; |