From 345ab188c66017bf80512024a42b8e85ee96c872 Mon Sep 17 00:00:00 2001 From: Alex Gilday Date: Tue, 9 Jan 2018 11:40:19 +0000 Subject: COMPMID-742: Add image input support for Harris Corners tests Change-Id: I4833eec0734776d8683fe867bb4f4d827f1a2fb7 Reviewed-on: https://eu-gerrit-1.euhpc.arm.com/115503 Tested-by: Jenkins Reviewed-by: Georgios Pinitas --- tests/benchmark/CL/HarrisCorners.cpp | 6 +++--- tests/benchmark/NEON/HarrisCorners.cpp | 10 +++++----- tests/benchmark/fixtures/HarrisCornersFixture.h | 12 +++++++----- 3 files changed, 15 insertions(+), 13 deletions(-) (limited to 'tests/benchmark') diff --git a/tests/benchmark/CL/HarrisCorners.cpp b/tests/benchmark/CL/HarrisCorners.cpp index 618968f8c1..990ac24894 100644 --- a/tests/benchmark/CL/HarrisCorners.cpp +++ b/tests/benchmark/CL/HarrisCorners.cpp @@ -28,7 +28,7 @@ #include "arm_compute/runtime/CL/functions/CLHarrisCorners.h" #include "tests/CL/CLAccessor.h" #include "tests/benchmark/fixtures/HarrisCornersFixture.h" -#include "tests/datasets/ShapeDatasets.h" +#include "tests/datasets/ImageFileDatasets.h" #include "tests/framework/Macros.h" #include "tests/framework/datasets/Datasets.h" #include "utils/TypePrinter.h" @@ -54,7 +54,7 @@ using CLHarrisCornersFixture = HarrisCornersFixture - void setup(const TensorShape &shape, Format format, float threshold, float min_dist, float sensitivity, + void setup(std::string image, Format format, float threshold, float min_dist, float sensitivity, int32_t gradient_size, int32_t block_size, BorderMode border_mode, bool use_fp16) { + // Load the image (cached by the library if loaded before) + const RawTensor &raw = library->get(image, format); + // Create tensor - src = create_tensor(shape, format); + src = create_tensor(raw.shape(), format); // Create and configure function harris_corners_func.configure(&src, threshold, min_dist, sensitivity, gradient_size, block_size, &out, border_mode, 0, use_fp16); @@ -54,9 +57,8 @@ public: // Allocate tensor src.allocator()->allocate(); - // Fill tensor - std::uniform_int_distribution distribution(100, 100); - library->fill(Accessor(src), distribution, 0); + // Copy image data to tensor + library->fill(Accessor(src), raw); } void run() -- cgit v1.2.1