aboutsummaryrefslogtreecommitdiff
path: root/src/core/CL/kernels/CLInstanceNormalizationLayerKernel.cpp
diff options
context:
space:
mode:
authorPablo Tello <pablo.tello@arm.com>2021-04-26 15:39:05 +0100
committerPablo Marquez Tello <pablo.tello@arm.com>2021-04-27 11:29:07 +0000
commit5c3eeec645883dc8f57a1e10995b4e8298343ecb (patch)
tree8c936233e98c2d0032b60cdd1c399bf4643527df /src/core/CL/kernels/CLInstanceNormalizationLayerKernel.cpp
parent0ff73c70003bad895e1d0bd5c53aa117eb798900 (diff)
downloadComputeLibrary-5c3eeec645883dc8f57a1e10995b4e8298343ecb.tar.gz
Fixed CTS failures CLInstanceNorm
* Resolves COMPMID-4400 Change-Id: I54c33a017c735194fbf4437d1c7df465208bc0ca Signed-off-by: Pablo Tello <pablo.tello@arm.com> Reviewed-on: https://review.mlplatform.org/c/ml/ComputeLibrary/+/5505 Comments-Addressed: Arm Jenkins <bsgcomp@arm.com> Tested-by: Arm Jenkins <bsgcomp@arm.com> Reviewed-by: Sheri Zhang <sheri.zhang@arm.com>
Diffstat (limited to 'src/core/CL/kernels/CLInstanceNormalizationLayerKernel.cpp')
-rw-r--r--src/core/CL/kernels/CLInstanceNormalizationLayerKernel.cpp13
1 files changed, 10 insertions, 3 deletions
diff --git a/src/core/CL/kernels/CLInstanceNormalizationLayerKernel.cpp b/src/core/CL/kernels/CLInstanceNormalizationLayerKernel.cpp
index 80a42cc3f5..dcde0850a7 100644
--- a/src/core/CL/kernels/CLInstanceNormalizationLayerKernel.cpp
+++ b/src/core/CL/kernels/CLInstanceNormalizationLayerKernel.cpp
@@ -74,7 +74,7 @@ CLComputeMeanVariance::CLComputeMeanVariance()
{
}
-void CLComputeMeanVariance::configure(const CLCompileContext &compile_context, ICLTensor *input, ICLTensor *output)
+void CLComputeMeanVariance::configure(const CLCompileContext &compile_context, ICLTensor *input, ICLTensor *output, bool use_mixed_precision)
{
ARM_COMPUTE_ERROR_ON_NULLPTR(input);
auto padding_info = get_padding_info({ input, output });
@@ -86,6 +86,7 @@ void CLComputeMeanVariance::configure(const CLCompileContext &compile_context, I
const unsigned int num_elems_processed_per_iteration = 16 / input->info()->element_size();
CLBuildOptions build_opts;
+ build_opts.add_option("-DINTERNAL_DATA_TYPE=" + (use_mixed_precision ? "float" : get_cl_type_from_data_type(input->info()->data_type())));
build_opts.add_option("-DDATA_TYPE=" + get_cl_type_from_data_type(input->info()->data_type()));
build_opts.add_option("-DVEC_SIZE=" + support::cpp11::to_string(num_elems_processed_per_iteration));
build_opts.add_option("-DDIM_X=" + support::cpp11::to_string(input->info()->dimension(0)));
@@ -105,8 +106,14 @@ void CLComputeMeanVariance::configure(const CLCompileContext &compile_context, I
const TensorShape out_shape(input_channel, 2u, input_batches);
// Output auto initialization if not yet initialized
- auto_init_if_empty(*output->info(), out_shape, 1, input->info()->data_type());
-
+ if(use_mixed_precision)
+ {
+ auto_init_if_empty(*output->info(), out_shape, 1, DataType::F32);
+ }
+ else
+ {
+ auto_init_if_empty(*output->info(), out_shape, 1, input->info()->data_type());
+ }
ICLKernel::configure_internal(win);
ARM_COMPUTE_ERROR_ON(has_padding_changed(padding_info));
}