aboutsummaryrefslogtreecommitdiff
path: root/src/core/CL/kernels/CLGEMMMatrixMultiplyKernel.cpp
diff options
context:
space:
mode:
authorGian Marco Iodice <gianmarco.iodice@arm.com>2017-07-03 17:41:47 +0100
committerAnthony Barbier <anthony.barbier@arm.com>2018-09-17 14:15:39 +0100
commit8a383694445dfebb84732b19d5b3299961e8ffe3 (patch)
tree09f7521ec6112e7eab12ca2ea74cfbe59ea7d636 /src/core/CL/kernels/CLGEMMMatrixMultiplyKernel.cpp
parentbdb6b0bb156588dc39fd5084d4c91d05b5148610 (diff)
downloadComputeLibrary-8a383694445dfebb84732b19d5b3299961e8ffe3.tar.gz
COMPMID-434 - Port CLGEMM to support 16 bit fixed point
Change-Id: I30aef3c7ecd1ee740c2a7f2ce65a63c7dcd66e49 Reviewed-on: http://mpd-gerrit.cambridge.arm.com/79630 Reviewed-by: Anthony Barbier <anthony.barbier@arm.com> Tested-by: Kaizen <jeremy.johnson+kaizengerrit@arm.com>
Diffstat (limited to 'src/core/CL/kernels/CLGEMMMatrixMultiplyKernel.cpp')
-rw-r--r--src/core/CL/kernels/CLGEMMMatrixMultiplyKernel.cpp16
1 files changed, 13 insertions, 3 deletions
diff --git a/src/core/CL/kernels/CLGEMMMatrixMultiplyKernel.cpp b/src/core/CL/kernels/CLGEMMMatrixMultiplyKernel.cpp
index 7c5b3d7866..2d6b83a97d 100644
--- a/src/core/CL/kernels/CLGEMMMatrixMultiplyKernel.cpp
+++ b/src/core/CL/kernels/CLGEMMMatrixMultiplyKernel.cpp
@@ -50,7 +50,7 @@ CLGEMMMatrixMultiplyKernel::CLGEMMMatrixMultiplyKernel()
void CLGEMMMatrixMultiplyKernel::configure(const ICLTensor *input0, const ICLTensor *input1, ICLTensor *output, float alpha)
{
- ARM_COMPUTE_ERROR_ON_DATA_TYPE_CHANNEL_NOT_IN(input0, 1, DataType::QS8, DataType::F16, DataType::F32);
+ ARM_COMPUTE_ERROR_ON_DATA_TYPE_CHANNEL_NOT_IN(input0, 1, DataType::QS8, DataType::QS16, DataType::F16, DataType::F32);
ARM_COMPUTE_ERROR_ON_MISMATCHING_DATA_TYPES(input0, input1, output);
ARM_COMPUTE_ERROR_ON_MISMATCHING_FIXED_POINT(input0, input1, output);
@@ -74,8 +74,18 @@ void CLGEMMMatrixMultiplyKernel::configure(const ICLTensor *input0, const ICLTen
std::ostringstream mm_arguments;
mm_arguments << "-DWIDTH_MATRIX_B=" << input1->info()->dimension(0) << " ";
- mm_arguments << "-DALPHA=" << (input0->info()->data_type() == DataType::QS8 ? scvt_qs8_f32(alpha, input0->info()->fixed_point_position()) : alpha) << " ";
- mm_arguments << "-DFIXED_POINT_POSITION=" << input0->info()->fixed_point_position() << " ";
+ if(is_data_type_fixed_point(input0->info()->data_type()))
+ {
+ mm_arguments << "-DALPHA=" << (input0->info()->data_type() == DataType::QS8 ?
+ scvt_qs8_f32(alpha, input0->info()->fixed_point_position()) :
+ scvt_qs16_f32(alpha, input0->info()->fixed_point_position()))
+ << " ";
+ mm_arguments << "-DFIXED_POINT_POSITION=" << input0->info()->fixed_point_position() << " ";
+ }
+ else
+ {
+ mm_arguments << "-DALPHA=" << alpha << " ";
+ }
std::set<std::string> build_opts;
// Check if the output tensor is a vector. If so,the kernel runs the vector-matrix multiplication