diff options
author | Georgios Pinitas <georgios.pinitas@arm.com> | 2020-09-04 20:20:56 +0100 |
---|---|---|
committer | Georgios Pinitas <georgios.pinitas@arm.com> | 2020-09-07 12:37:27 +0000 |
commit | 8a14b2ca62c43a2691066ce374949c2501ae8315 (patch) | |
tree | dc262d9b720ca1caadcc39ee065e66502889e354 /arm_compute | |
parent | 903f8cca78502a9e3835e6ec42caa1f816274600 (diff) | |
download | ComputeLibrary-8a14b2ca62c43a2691066ce374949c2501ae8315.tar.gz |
COMPMID-3748: Compiler issue with Bfloat16 on gcc8
Treat bf16 memory on memset as raw memory by casting to void*. This
hides the class-memaccess warning and is safe for the current class
layout of arm_compute::bfloat16
Signed-off-by: Georgios Pinitas <georgios.pinitas@arm.com>
Change-Id: I5e242827d3737b4491d29abe7570eefee5b6edc1
Reviewed-on: https://review.mlplatform.org/c/ml/ComputeLibrary/+/3928
Reviewed-by: Michele Di Giorgio <michele.digiorgio@arm.com>
Comments-Addressed: Arm Jenkins <bsgcomp@arm.com>
Tested-by: Arm Jenkins <bsgcomp@arm.com>
Diffstat (limited to 'arm_compute')
-rw-r--r-- | arm_compute/core/utils/misc/ShapeCalculator.h | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/arm_compute/core/utils/misc/ShapeCalculator.h b/arm_compute/core/utils/misc/ShapeCalculator.h index f2f5a30b6a..72b7675749 100644 --- a/arm_compute/core/utils/misc/ShapeCalculator.h +++ b/arm_compute/core/utils/misc/ShapeCalculator.h @@ -1083,24 +1083,24 @@ inline TensorShape compute_batch_to_space_shape(const ITensorInfo *input, const /** Calculate the depth to space output shape of a tensor * - * @param[in] input Input tensor info - * @param[in] block Block shape value + * @param[in] input_shape Input tensor shape + * @param[in] data_layout Operation data layout + * @param[in] block Block shape value * * @return the calculated shape */ -inline TensorShape compute_depth_to_space_shape(const ITensorInfo *input, int block) +inline TensorShape compute_depth_to_space_shape(const TensorShape &input_shape, DataLayout data_layout, int block) { ARM_COMPUTE_ERROR_ON(block < 2); - const DataLayout data_layout = input->data_layout(); - const int idx_width = get_data_layout_dimension_index(data_layout, DataLayoutDimension::WIDTH); - const int idx_height = get_data_layout_dimension_index(data_layout, DataLayoutDimension::HEIGHT); - const int idx_channel = get_data_layout_dimension_index(data_layout, DataLayoutDimension::CHANNEL); + const int idx_width = get_data_layout_dimension_index(data_layout, DataLayoutDimension::WIDTH); + const int idx_height = get_data_layout_dimension_index(data_layout, DataLayoutDimension::HEIGHT); + const int idx_channel = get_data_layout_dimension_index(data_layout, DataLayoutDimension::CHANNEL); - TensorShape output_shape{ input->tensor_shape() }; - output_shape.set(idx_width, input->dimension(idx_width) * block); - output_shape.set(idx_height, input->dimension(idx_height) * block); - output_shape.set(idx_channel, input->dimension(idx_channel) / (block * block)); + TensorShape output_shape{ input_shape }; + output_shape.set(idx_width, input_shape[idx_width] * block); + output_shape.set(idx_height, input_shape[idx_height] * block); + output_shape.set(idx_channel, input_shape[idx_channel] / (block * block)); return output_shape; } |