diff options
author | Manuel Bottini <manuel.bottini@arm.com> | 2021-06-09 16:37:32 +0100 |
---|---|---|
committer | Manuel Bottini <manuel.bottini@arm.com> | 2021-06-15 16:31:27 +0000 |
commit | 94f799e8f6f605333d40472860fb472e8ba6d83d (patch) | |
tree | ce528244814463ed42dc86a84d54ea870c75d592 /src/runtime/gpu/cl/operators/ClSoftmax.h | |
parent | 36dff9f81e3a95aea19fcc7246a4896930a14bc6 (diff) | |
download | ComputeLibrary-94f799e8f6f605333d40472860fb472e8ba6d83d.tar.gz |
Fix incorrect memory handling in ported functions
Details of the functions:
- ClSoftmax
- CpuSoftmax
- CpuPool2d
Change-Id: Icd2c14d5df010c3b2301e2693ce6f414d7c61916
Resolves: COMPMID-4404
Signed-off-by: Manuel Bottini <manuel.bottini@arm.com>
Reviewed-on: https://review.mlplatform.org/c/ml/ComputeLibrary/+/5797
Reviewed-by: Georgios Pinitas <georgios.pinitas@arm.com>
Tested-by: Arm Jenkins <bsgcomp@arm.com>
Comments-Addressed: Arm Jenkins <bsgcomp@arm.com>
Diffstat (limited to 'src/runtime/gpu/cl/operators/ClSoftmax.h')
-rw-r--r-- | src/runtime/gpu/cl/operators/ClSoftmax.h | 36 |
1 files changed, 7 insertions, 29 deletions
diff --git a/src/runtime/gpu/cl/operators/ClSoftmax.h b/src/runtime/gpu/cl/operators/ClSoftmax.h index e38b7c595a..f19a51fc5e 100644 --- a/src/runtime/gpu/cl/operators/ClSoftmax.h +++ b/src/runtime/gpu/cl/operators/ClSoftmax.h @@ -67,7 +67,7 @@ public: experimental::MemoryRequirements workspace() const override; private: - enum class InternalTensorIdx + enum InternalTensorIdx { MAX = 0, SUM, @@ -77,41 +77,19 @@ private: COUNT }; - /** Create a single internal tensor - * - * @param[in] info The information used to create a tensor - * @param[in] idx The index within the internal array the created tensor will be held - */ - void create_internal_tensor(TensorInfo &info, InternalTensorIdx idx); - /** Create all required internal tensors */ - void create_internal_tensor(); - /** Function to convert from internal tensor index to @ref TensorType used externally */ - TensorType convert_internal_idx_to_tensor_type(InternalTensorIdx idx) const; - /** Function to import workspace memory allocated by the caller into internal tensor instances */ - void import_workspace_memory(ITensorPack &tensors); - /** Function to permute the given source tensor when permutation is required */ - void run_source_permute(const ITensor *src); - /** Function to permute the intemediate tensor to the final destination tensor when permutation is required */ - void run_destination_permute(ITensor *dst); - /** Function to run @ref arm_compute::opencl::kernels::ClLogits1DMaxShiftExpSumKernel */ - void run_max_sum(const ITensor *src); - /** Function to run @ref kernels::ClLogits1DNormKernel */ - void run_norm(ITensor *dst); - std::unique_ptr<ClPermute> _permute_input; std::unique_ptr<ClPermute> _permute_output; std::unique_ptr<kernels::ClLogits1DMaxShiftExpSumKernel> _max_shift_exp_sum_kernel; std::unique_ptr<kernels::ClLogits1DNormKernel> _norm_kernel; bool _needs_permute{ false }; - std::array<TensorInfo, static_cast<uint32_t>(InternalTensorIdx::COUNT)> _internal_info{}; - std::array<std::unique_ptr<CLTensor>, static_cast<uint32_t>(InternalTensorIdx::COUNT)> _internal_tensor{}; + TensorInfo _max_info; + TensorInfo _sum_info; + TensorInfo _tmp_info; + TensorInfo _permuted_src_info; + TensorInfo _permuted_dst_info; - TensorInfo &_max_info; - TensorInfo &_sum_info; - TensorInfo &_tmp_info; - TensorInfo &_permuted_src_info; - TensorInfo &_permuted_dst_info; + experimental::MemoryRequirements _aux_mem{}; }; } // opencl |