aboutsummaryrefslogtreecommitdiff
path: root/src/runtime/CL/functions/CLSoftmaxLayer.cpp
diff options
context:
space:
mode:
authorGeorgios Pinitas <georgios.pinitas@arm.com>2017-11-22 12:53:45 +0000
committerAnthony Barbier <anthony.barbier@arm.com>2018-11-02 16:35:24 +0000
commitee8be2d09573d4ec9960d8f2b947ef38716f0c62 (patch)
tree516110d2f92398705b4d79f8af12114e2bc088fd /src/runtime/CL/functions/CLSoftmaxLayer.cpp
parent4d55e0a3e848db25496b31529f4405bee7115cf8 (diff)
downloadComputeLibrary-ee8be2d09573d4ec9960d8f2b947ef38716f0c62.tar.gz
COMPMID-556: Set CLSoftmaxLayer temp buffers to resizable.
Auto-padding configuration lead the clone of input tensor info to be not resizable in computer_vision. Explicitly sets the tensor info clones to resizable. Change-Id: I8ec3d430127e6ed5cca7884c844654b6e71b7ee5 Reviewed-on: https://eu-gerrit-1.euhpc.arm.com/110194 Reviewed-by: Anthony Barbier <anthony.barbier@arm.com> Tested-by: BSG Visual Compute Jenkins server to access repositories on http://mpd-gerrit.cambridge.arm.com <bsgcomp@arm.com>
Diffstat (limited to 'src/runtime/CL/functions/CLSoftmaxLayer.cpp')
-rw-r--r--src/runtime/CL/functions/CLSoftmaxLayer.cpp15
1 files changed, 9 insertions, 6 deletions
diff --git a/src/runtime/CL/functions/CLSoftmaxLayer.cpp b/src/runtime/CL/functions/CLSoftmaxLayer.cpp
index d39335b6e5..f74b778e95 100644
--- a/src/runtime/CL/functions/CLSoftmaxLayer.cpp
+++ b/src/runtime/CL/functions/CLSoftmaxLayer.cpp
@@ -41,17 +41,20 @@ CLSoftmaxLayer::CLSoftmaxLayer(std::shared_ptr<IMemoryManager> memory_manager)
void CLSoftmaxLayer::configure(const ICLTensor *input, ICLTensor *output, float beta)
{
- ARM_COMPUTE_ERROR_ON_DATA_TYPE_CHANNEL_NOT_IN(input, 1, DataType::QS8, DataType::QASYMM8, DataType::QS16, DataType::F16, DataType::F32);
+ // Perform validation step
+ ARM_COMPUTE_ERROR_ON_NULLPTR(input, output);
+ ARM_COMPUTE_ERROR_THROW_ON(CLSoftmaxLayer::validate(input->info(), output->info()));
// Create intermediate tensors shapes
- DataType tmp_data_type = is_data_type_quantized_asymmetric(input->info()->data_type()) ? DataType::S32 : input->info()->data_type();
- TensorInfo tensor_info_tmp(input->info()->clone()->set_data_type(tmp_data_type).reset_padding());
+ const TensorInfo input_info = input->info()->clone()->reset_padding().set_is_resizable(true);
+ DataType tmp_data_type = is_data_type_quantized_asymmetric(input->info()->data_type()) ? DataType::S32 : input->info()->data_type();
+ TensorInfo tensor_info_tmp(input_info.clone()->set_data_type(tmp_data_type));
_tmp.allocator()->init(tensor_info_tmp);
TensorShape max_sum_shape = input->info()->tensor_shape();
max_sum_shape.set(0, 1);
- _max.allocator()->init(input->info()->clone()->set_tensor_shape(max_sum_shape).reset_padding());
- _sum.allocator()->init(input->info()->clone()->set_tensor_shape(max_sum_shape).set_data_type(tmp_data_type).reset_padding());
+ _max.allocator()->init(input_info.clone()->set_tensor_shape(max_sum_shape));
+ _sum.allocator()->init(input_info.clone()->set_tensor_shape(max_sum_shape).set_data_type(tmp_data_type));
// Set GPU target to kernels
_max_shift_exp_sum_kernel.set_target(CLScheduler::get().target());
@@ -83,7 +86,7 @@ void CLSoftmaxLayer::configure(const ICLTensor *input, ICLTensor *output, float
Error CLSoftmaxLayer::validate(const ITensorInfo *input, const ITensorInfo *output)
{
- ARM_COMPUTE_RETURN_ERROR_ON_NULLPTR(input);
+ ARM_COMPUTE_RETURN_ERROR_ON_NULLPTR(input, output);
// Create intermediate tensor info
DataType tmp_data_type = is_data_type_quantized_asymmetric(input->data_type()) ? DataType::S32 : input->data_type();