aboutsummaryrefslogtreecommitdiff
path: root/src/core/CL/kernels/CLGEMMMatrixAdditionKernel.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/CLGEMMMatrixAdditionKernel.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/CLGEMMMatrixAdditionKernel.cpp')
-rw-r--r--src/core/CL/kernels/CLGEMMMatrixAdditionKernel.cpp17
1 files changed, 14 insertions, 3 deletions
diff --git a/src/core/CL/kernels/CLGEMMMatrixAdditionKernel.cpp b/src/core/CL/kernels/CLGEMMMatrixAdditionKernel.cpp
index 5883dd698b..d1cdd7dc61 100644
--- a/src/core/CL/kernels/CLGEMMMatrixAdditionKernel.cpp
+++ b/src/core/CL/kernels/CLGEMMMatrixAdditionKernel.cpp
@@ -43,7 +43,7 @@ CLGEMMMatrixAdditionKernel::CLGEMMMatrixAdditionKernel()
void CLGEMMMatrixAdditionKernel::configure(const ICLTensor *input, ICLTensor *output, float beta)
{
- ARM_COMPUTE_ERROR_ON_DATA_TYPE_CHANNEL_NOT_IN(input, 1, DataType::QS8, DataType::F16, DataType::F32);
+ ARM_COMPUTE_ERROR_ON_DATA_TYPE_CHANNEL_NOT_IN(input, 1, DataType::QS8, DataType::QS16, DataType::F16, DataType::F32);
ARM_COMPUTE_ERROR_ON_MISMATCHING_DATA_TYPES(input, output);
ARM_COMPUTE_ERROR_ON(input->info()->dimension(0) != output->info()->dimension(0));
ARM_COMPUTE_ERROR_ON(input->info()->dimension(1) != output->info()->dimension(1));
@@ -53,8 +53,19 @@ void CLGEMMMatrixAdditionKernel::configure(const ICLTensor *input, ICLTensor *ou
const unsigned int num_elems_processed_per_iteration = max_cl_vector_width / data_size_from_type(input->info()->data_type());
std::ostringstream ma_arguments;
- ma_arguments << "-DBETA=" << (input->info()->data_type() == DataType::QS8 ? scvt_qs8_f32(beta, input->info()->fixed_point_position()) : beta) << " ";
- ma_arguments << "-DFIXED_POINT_POSITION=" << input->info()->fixed_point_position();
+ if(is_data_type_fixed_point(input->info()->data_type()))
+ {
+ ma_arguments << "-DBETA=" << (input->info()->data_type() == DataType::QS8 ?
+ scvt_qs8_f32(beta, input->info()->fixed_point_position()) :
+ scvt_qs16_f32(beta, input->info()->fixed_point_position()))
+ << " ";
+ ma_arguments << "-DFIXED_POINT_POSITION=" << input->info()->fixed_point_position();
+ }
+ else
+ {
+ ma_arguments << "-DBETA=" << beta;
+ }
+
std::set<std::string> build_opts;
build_opts.emplace(ma_arguments.str());