aboutsummaryrefslogtreecommitdiff
path: root/src/core/CL/kernels/CLBatchNormalizationLayerKernel.cpp
diff options
context:
space:
mode:
authorGeorgios Pinitas <georgios.pinitas@arm.com>2017-11-23 15:59:55 +0000
committerAnthony Barbier <anthony.barbier@arm.com>2018-11-02 16:41:58 +0000
commit236bfe7033a313ab98ff436d85f38a58b0738ed1 (patch)
treea07d0b122fa93fb26a24067de6341eaded1a52f7 /src/core/CL/kernels/CLBatchNormalizationLayerKernel.cpp
parent9c450cc0e0b2e7060fa0a74a5196906bc28d0625 (diff)
downloadComputeLibrary-236bfe7033a313ab98ff436d85f38a58b0738ed1.tar.gz
COMPIMID-553: MobileNet use case.
Change-Id: I1181abbd5785065f3d57e91844376a4b110938a9 Reviewed-on: https://eu-gerrit-1.euhpc.arm.com/110701 Tested-by: BSG Visual Compute Jenkins server to access repositories on http://mpd-gerrit.cambridge.arm.com <bsgcomp@arm.com> Reviewed-by: Anthony Barbier <anthony.barbier@arm.com>
Diffstat (limited to 'src/core/CL/kernels/CLBatchNormalizationLayerKernel.cpp')
-rw-r--r--src/core/CL/kernels/CLBatchNormalizationLayerKernel.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/core/CL/kernels/CLBatchNormalizationLayerKernel.cpp b/src/core/CL/kernels/CLBatchNormalizationLayerKernel.cpp
index 38e367dfb7..e8882b9daf 100644
--- a/src/core/CL/kernels/CLBatchNormalizationLayerKernel.cpp
+++ b/src/core/CL/kernels/CLBatchNormalizationLayerKernel.cpp
@@ -130,7 +130,8 @@ void CLBatchNormalizationLayerKernel::configure(ICLTensor *input, ICLTensor *out
_kernel = static_cast<cl::Kernel>(CLKernelLibrary::get().create_kernel("batchnormalization_layer", build_opts));
// Set kernel static arguments
- unsigned int idx = 2 * num_arguments_per_3D_tensor() + 4 * num_arguments_per_1D_tensor(); // Skip the input and output parameters
+ unsigned int include_output = (output != nullptr) ? 1 : 0;
+ unsigned int idx = (1 + include_output) * num_arguments_per_3D_tensor() + 4 * num_arguments_per_1D_tensor(); // Skip the input and output parameters
_kernel.setArg<cl_float>(idx++, _epsilon);
// Configure kernel window
@@ -160,7 +161,8 @@ void CLBatchNormalizationLayerKernel::run(const Window &window, cl::CommandQueue
Window vector_slice = window.first_slice_window_1D();
vector_slice.set(Window::DimX, Window::Dimension(0, 0, 0));
- unsigned int idx = 2 * num_arguments_per_3D_tensor();
+ unsigned int include_output = (_output != nullptr) ? 1 : 0;
+ unsigned int idx = (1 + include_output) * num_arguments_per_3D_tensor();
add_1D_tensor_argument(idx, _mean, vector_slice);
add_1D_tensor_argument(idx, _var, vector_slice);
add_1D_tensor_argument(idx, _beta, vector_slice);