From e9146ed3b4ad8501cb17dfe5953ef0259f106c2e Mon Sep 17 00:00:00 2001 From: Georgios Pinitas Date: Wed, 7 Feb 2018 16:05:47 +0000 Subject: COMPMID-879: Investigate CL mismatches in Convolution S16 Changes and simplifies the validation to divide the scale in integer format instead of double. Change-Id: Ib9156e9515e4e542391eeda11548f3d15613a0af Reviewed-on: https://eu-gerrit-1.euhpc.arm.com/119256 Tested-by: Jenkins Reviewed-by: Gian Marco Iodice --- src/core/CL/kernels/CLConvolutionKernel.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'src/core/CL') diff --git a/src/core/CL/kernels/CLConvolutionKernel.cpp b/src/core/CL/kernels/CLConvolutionKernel.cpp index fd64dc4fe0..2b08c8dfba 100644 --- a/src/core/CL/kernels/CLConvolutionKernel.cpp +++ b/src/core/CL/kernels/CLConvolutionKernel.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, 2017 ARM Limited. + * Copyright (c) 2016-2018 ARM Limited. * * SPDX-License-Identifier: MIT * @@ -63,8 +63,8 @@ void CLConvolutionKernel::configure(const ICLTensor *input, ICLTens _input = input; _output = output; - std::stringstream kernel_name; - std::set options; + std::stringstream kernel_name; + CLBuildOptions build_opts; kernel_name << "convolution" << matrix_size << "x" << matrix_size << "_static"; if(scale == 0) @@ -76,19 +76,19 @@ void CLConvolutionKernel::configure(const ICLTensor *input, ICLTens { std::stringstream mat_str; mat_str << "-DMAT" << i << "=" << conv[i]; - options.insert(mat_str.str()); + build_opts.add_option(mat_str.str()); } - options.insert("-DSCALE=" + support::cpp11::to_string(scale)); + build_opts.add_option("-DSCALE=" + support::cpp11::to_string(scale)); DataType data_type = data_type_for_convolution_matrix(conv, matrix_size * matrix_size); - options.insert("-DDATA_TYPE=" + get_cl_type_from_data_type(data_type)); + build_opts.add_option("-DDATA_TYPE=" + get_cl_type_from_data_type(data_type)); std::stringstream out_type; out_type << "-DDATA_TYPE_OUT=" << get_cl_type_from_data_type(output->info()->data_type()); - options.insert(out_type.str()); + build_opts.add_option(out_type.str()); - _kernel = static_cast(CLKernelLibrary::get().create_kernel(kernel_name.str(), options)); + _kernel = static_cast(CLKernelLibrary::get().create_kernel(kernel_name.str(), build_opts.options())); // Configure kernel window constexpr unsigned int num_elems_processed_per_iteration = 8; -- cgit v1.2.1