From d57891a80b2a45dfeb41826f2753c5e32b6887c4 Mon Sep 17 00:00:00 2001 From: Georgios Pinitas Date: Tue, 19 Feb 2019 18:10:03 +0000 Subject: COMPMID-2007: Compilation failures with ndk16b. Resolves double brace initialization issues. Change-Id: Ic9319d4abc1d6428cefabc18be1c176bea7607dc Signed-off-by: Georgios Pinitas Reviewed-on: https://review.mlplatform.org/729 Reviewed-by: Michele Di Giorgio Reviewed-by: Michalis Spyrou Tested-by: Arm Jenkins --- .../CPP/functions/CPPDetectionOutputLayer.cpp | 32 ++++++++++++++-------- 1 file changed, 20 insertions(+), 12 deletions(-) (limited to 'src/runtime/CPP/functions/CPPDetectionOutputLayer.cpp') diff --git a/src/runtime/CPP/functions/CPPDetectionOutputLayer.cpp b/src/runtime/CPP/functions/CPPDetectionOutputLayer.cpp index 34a7294513..79e619cfd6 100644 --- a/src/runtime/CPP/functions/CPPDetectionOutputLayer.cpp +++ b/src/runtime/CPP/functions/CPPDetectionOutputLayer.cpp @@ -173,14 +173,18 @@ void retrieve_all_priorbox(const ITensor *input_priorbox, { for(int i = 0; i < num_priors; ++i) { - all_prior_bboxes[i] = { *reinterpret_cast(input_priorbox->ptr_to_element(Coordinates(i * 4))), - *reinterpret_cast(input_priorbox->ptr_to_element(Coordinates(i * 4 + 1))), - *reinterpret_cast(input_priorbox->ptr_to_element(Coordinates(i * 4 + 2))), - *reinterpret_cast(input_priorbox->ptr_to_element(Coordinates(i * 4 + 3))) - }; + all_prior_bboxes[i] = + { + { + *reinterpret_cast(input_priorbox->ptr_to_element(Coordinates(i * 4))), + *reinterpret_cast(input_priorbox->ptr_to_element(Coordinates(i * 4 + 1))), + *reinterpret_cast(input_priorbox->ptr_to_element(Coordinates(i * 4 + 2))), + *reinterpret_cast(input_priorbox->ptr_to_element(Coordinates(i * 4 + 3))) + } + }; } - std::array var({ 0, 0, 0, 0 }); + std::array var({ { 0, 0, 0, 0 } }); for(int i = 0; i < num_priors; ++i) { for(int j = 0; j < 4; ++j) @@ -325,16 +329,20 @@ void ApplyNMSFast(const std::vector &bboxes, if(keep) { // Compute the jaccard (intersection over union IoU) overlap between two bboxes. - NormalizedBBox intersect_bbox = std::array({ 0, 0, 0, 0 }); + NormalizedBBox intersect_bbox = std::array({ { 0, 0, 0, 0 } }); if(bboxes[kept_idx][0] > bboxes[idx][2] || bboxes[kept_idx][2] < bboxes[idx][0] || bboxes[kept_idx][1] > bboxes[idx][3] || bboxes[kept_idx][3] < bboxes[idx][1]) { - intersect_bbox = std::array({ 0, 0, 0, 0 }); + intersect_bbox = std::array({ { 0, 0, 0, 0 } }); } else { - intersect_bbox = std::array({ std::max(bboxes[idx][0], bboxes[kept_idx][0]), std::max(bboxes[idx][1], bboxes[kept_idx][1]), std::min(bboxes[idx][2], bboxes[kept_idx][2]), std::min(bboxes[idx][3], - bboxes[kept_idx][3]) - }); + intersect_bbox = std::array({ { + std::max(bboxes[idx][0], bboxes[kept_idx][0]), + std::max(bboxes[idx][1], bboxes[kept_idx][1]), + std::min(bboxes[idx][2], bboxes[kept_idx][2]), + std::min(bboxes[idx][3], bboxes[kept_idx][3]) + } + }); } float intersect_width = intersect_bbox[2] - intersect_bbox[0]; @@ -434,7 +442,7 @@ void extract_bounding_boxes_from_tensor(const ITensor *bboxes, std::vector(input.ptr()); - bboxes_vector.push_back(NormalizedBBox({ *input_ptr, *(input_ptr + 1), *(2 + input_ptr), *(3 + input_ptr) })); + bboxes_vector.push_back(NormalizedBBox({ { *input_ptr, *(input_ptr + 1), *(2 + input_ptr), *(3 + input_ptr) } })); }; execute_window_loop(input_win, f, input); } -- cgit v1.2.1