diff options
author | Adnan AlSinan <adnan.alsinan@arm.com> | 2023-02-22 12:15:14 +0000 |
---|---|---|
committer | Adnan AlSinan <adnan.alsinan@arm.com> | 2023-03-01 11:48:22 +0000 |
commit | bbf2e7477be984702e1a51f2a23910ee8349b867 (patch) | |
tree | d5ce7a16e7f6e977bba2f88c8a913d071b4e04ed /arm_compute/core/Types.h | |
parent | 227db8db83cd85d8704a8edbd4e8c88af0dd1f84 (diff) | |
download | ComputeLibrary-bbf2e7477be984702e1a51f2a23910ee8349b867.tar.gz |
Add support for kernel indices in Maxpool
- Add a max pooling implementation that returns kernel indices.
- Add a parameter in pooling info object to pick kernel indices impl.
- Add validation tests.
Resolves: [ONCPUML-1187]
Signed-off-by: Adnan AlSinan <adnan.alsinan@arm.com>
Change-Id: I485ef1604f676ee14d5f7f62d33699e49c38e4d3
Reviewed-on: https://review.mlplatform.org/c/ml/ComputeLibrary/+/9192
Reviewed-by: Gunes Bayir <gunes.bayir@arm.com>
Tested-by: Arm Jenkins <bsgcomp@arm.com>
Comments-Addressed: Arm Jenkins <bsgcomp@arm.com>
Benchmark: Arm Jenkins <bsgcomp@arm.com>
Diffstat (limited to 'arm_compute/core/Types.h')
-rw-r--r-- | arm_compute/core/Types.h | 21 |
1 files changed, 15 insertions, 6 deletions
diff --git a/arm_compute/core/Types.h b/arm_compute/core/Types.h index e8eed67c58..946b8a6cb6 100644 --- a/arm_compute/core/Types.h +++ b/arm_compute/core/Types.h @@ -1210,7 +1210,8 @@ struct PoolingLayerInfo exclude_padding(false), is_global_pooling(false), fp_mixed_precision(false), - use_inf_as_limit(true) + use_inf_as_limit(true), + use_kernel_indices(false) { } /** Constructor @@ -1224,6 +1225,7 @@ struct PoolingLayerInfo * Defaults to false; * @param[in] fp_mixed_precision (Optional) Use wider accumulators (32 bit instead of 16 for FP16) to improve accuracy. * @param[in] use_inf_as_limit (Optional) Use inf to represent the limits of datatypes range, instead of using "lowest" property of the data type. + * @param[in] use_kernel_indices (Optional) Use kernel indices instead of using source indices while computing indices tensor. */ explicit PoolingLayerInfo(PoolingType pool_type, unsigned int pool_size, @@ -1231,7 +1233,8 @@ struct PoolingLayerInfo PadStrideInfo pad_stride_info = PadStrideInfo(), bool exclude_padding = false, bool fp_mixed_precision = false, - bool use_inf_as_limit = true) + bool use_inf_as_limit = true, + bool use_kernel_indices = false) : pool_type(pool_type), pool_size(Size2D(pool_size, pool_size)), data_layout(data_layout), @@ -1239,7 +1242,8 @@ struct PoolingLayerInfo exclude_padding(exclude_padding), is_global_pooling(false), fp_mixed_precision(fp_mixed_precision), - use_inf_as_limit(use_inf_as_limit) + use_inf_as_limit(use_inf_as_limit), + use_kernel_indices(use_kernel_indices) { } @@ -1254,6 +1258,7 @@ struct PoolingLayerInfo * Defaults to false; * @param[in] fp_mixed_precision (Optional) Use wider accumulators (32 bit instead of 16 for FP16) to improve accuracy. * @param[in] use_inf_as_limit (Optional) Use inf to represent the limits of datatypes range, instead of using "lowest" property of the data type. + * @param[in] use_kernel_indices (Optional) Use kernel indices instead of using source indices while computing indices tensor. */ explicit PoolingLayerInfo(PoolingType pool_type, Size2D pool_size, @@ -1261,7 +1266,8 @@ struct PoolingLayerInfo PadStrideInfo pad_stride_info = PadStrideInfo(), bool exclude_padding = false, bool fp_mixed_precision = false, - bool use_inf_as_limit = true) + bool use_inf_as_limit = true, + bool use_kernel_indices = false) : pool_type(pool_type), pool_size(pool_size), data_layout(data_layout), @@ -1269,7 +1275,8 @@ struct PoolingLayerInfo exclude_padding(exclude_padding), is_global_pooling(false), fp_mixed_precision(fp_mixed_precision), - use_inf_as_limit(use_inf_as_limit) + use_inf_as_limit(use_inf_as_limit), + use_kernel_indices(use_kernel_indices) { } @@ -1288,7 +1295,8 @@ struct PoolingLayerInfo exclude_padding(false), is_global_pooling(true), fp_mixed_precision(false), - use_inf_as_limit(true) + use_inf_as_limit(true), + use_kernel_indices(false) { } @@ -1300,6 +1308,7 @@ struct PoolingLayerInfo bool is_global_pooling; bool fp_mixed_precision; bool use_inf_as_limit; + bool use_kernel_indices; }; /** Pooling Layer Information struct*/ |