diff --git a/.gitignore b/.gitignore index 6e713a3e..e46e6739 100644 --- a/.gitignore +++ b/.gitignore @@ -52,3 +52,6 @@ local.properties *.so +build* +scripts +logs \ No newline at end of file diff --git a/CMakeLists.txt b/CMakeLists.txt index 40e1b723..aac44415 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -102,6 +102,12 @@ else(BUILD_DEBUG) message("-- Building type: RELEASE") endif(BUILD_DEBUG) +# Moved NE10_UNROLL_LEVEL in CMakeLists.txt +if("${NE10_TARGET_ARCH}" STREQUAL "aarch64") + add_definitions(-DNE10_UNROLL_LEVEL=1) +else() + add_definitions(-DNE10_UNROLL_LEVEL=0) +endif() # By default, we compile c intrinsic. set(NE10_ASM_OPTIMIZATION off) diff --git a/inc/NE10_types.h b/inc/NE10_types.h index d7d1e6ee..ad1ad1e3 100644 --- a/inc/NE10_types.h +++ b/inc/NE10_types.h @@ -39,22 +39,6 @@ #include #include -/** - * @TODO Move the definition of NE10_UNROLL_LEVEL to cmake configuration files. - * Macro NE10_UNROLL_LEVEL controls algorithm of FFT funtions. - * When NE10_UNROLL_LEVEL == 0, complex FFT performs radix-4 x2 per loop. - * When NE10_UNROLL_LEVEL == 1, complex FFT performs radix-4 x4 per loop. - */ -#if !defined(NE10_UNROLL_LEVEL) -#if defined(__arm__) -#define NE10_UNROLL_LEVEL 0 -#elif defined(__aarch64__) -#define NE10_UNROLL_LEVEL 1 -#else -#define NE10_UNROLL_LEVEL 0 -#endif -#endif - ///////////////////////////////////////////////////////// // constant values that are used across the library ///////////////////////////////////////////////////////// diff --git a/modules/imgproc/test/test_suite_resize.c b/modules/imgproc/test/test_suite_resize.c index eb8fd306..031d9f67 100644 --- a/modules/imgproc/test/test_suite_resize.c +++ b/modules/imgproc/test/test_suite_resize.c @@ -68,6 +68,7 @@ void test_resize_conformance_case() ne10_float32_t PSNR; ne10_int32_t i; ne10_int32_t channels = 4; + ne10_int32_t src_stride; ne10_int32_t pic_size = MEM_SIZE * MEM_SIZE * channels * sizeof (ne10_uint8_t); /* init input memory */ @@ -91,12 +92,13 @@ void test_resize_conformance_case() srch = h; dstw = w; dsth = w; + src_stride = srcw * channels; printf ("srcw X srch = %d X %d \n", srcw, srch); printf ("dstw X dsth = %d X %d \n", dstw, dsth); - ne10_img_resize_bilinear_rgba_c (out_c, dstw, dsth, in_c, srcw, srch, srcw); - ne10_img_resize_bilinear_rgba_neon (out_neon, dstw, dsth, in_neon, srcw, srch, srcw); + ne10_img_resize_bilinear_rgba_c (out_c, dstw, dsth, in_c, srcw, srch, src_stride); + ne10_img_resize_bilinear_rgba_neon (out_neon, dstw, dsth, in_neon, srcw, srch, src_stride); PSNR = CAL_PSNR_UINT8 (out_c, out_neon, dstw * dsth * channels); assert_false ( (PSNR < PSNR_THRESHOLD)); @@ -111,12 +113,13 @@ void test_resize_conformance_case() srch = h; dstw = w; dsth = w; + src_stride = srcw * channels; printf ("srcw X srch = %d X %d \n", srcw, srch); printf ("dstw X dsth = %d X %d \n", dstw, dsth); - ne10_img_resize_bilinear_rgba_c (out_c, dstw, dsth, in_c, srcw, srch, srcw); - ne10_img_resize_bilinear_rgba_neon (out_neon, dstw, dsth, in_neon, srcw, srch, srcw); + ne10_img_resize_bilinear_rgba_c (out_c, dstw, dsth, in_c, srcw, srch, src_stride); + ne10_img_resize_bilinear_rgba_neon (out_neon, dstw, dsth, in_neon, srcw, srch, src_stride); PSNR = CAL_PSNR_UINT8 (out_c, out_neon, dstw * dsth * channels); assert_false ( (PSNR < PSNR_THRESHOLD)); @@ -139,6 +142,7 @@ void test_resize_performance_case() ne10_int32_t i; ne10_int32_t w, h; ne10_int32_t channels = 4; + ne10_int32_t src_stride; ne10_int32_t pic_size = MEM_SIZE * MEM_SIZE * channels * sizeof (ne10_uint8_t); ne10_int64_t time_c = 0; ne10_int64_t time_neon = 0; @@ -164,6 +168,7 @@ void test_resize_performance_case() srch = h; dstw = w; dsth = w; + src_stride = srcw * channels; printf ("srcw X srch = %d X %d \n", srcw, srch); printf ("dstw X dsth = %d X %d \n", dstw, dsth); @@ -173,7 +178,7 @@ void test_resize_performance_case() time_c, { for (i = 0; i < TEST_COUNT; i++) - ne10_img_resize_bilinear_rgba_c (out_c, dstw, dsth, in_c, srcw, srch, srcw); + ne10_img_resize_bilinear_rgba_c (out_c, dstw, dsth, in_c, srcw, srch, src_stride); } ); @@ -182,11 +187,12 @@ void test_resize_performance_case() time_neon, { for (i = 0; i < TEST_COUNT; i++) - ne10_img_resize_bilinear_rgba_neon (out_neon, dstw, dsth, in_neon, srcw, srch, srcw); + ne10_img_resize_bilinear_rgba_neon (out_neon, dstw, dsth, in_neon, srcw, srch, src_stride); } ); - //printf ("time c %lld \n", time_c); - //printf ("time neon %lld \n", time_neon); + printf ("time c %lld ", (long long)time_c); + printf ("time neon %lld ", (long long)time_neon); + printf (" %f%% ", (time_c - time_neon) * 100.0 / time_c); ne10_log (__FUNCTION__, "IMAGERESIZE%20d%20lld%20lld%19.2f%%%18.2f:1\n", (h * MEM_SIZE + w), time_c, time_neon, 0, 0); } diff --git a/test/include/seatest.h b/test/include/seatest.h index 8290d758..5f2e7371 100644 --- a/test/include/seatest.h +++ b/test/include/seatest.h @@ -20,7 +20,7 @@ typedef void (*seatest_void_string)(char*); /* Declarationsresult_size */ -void (*seatest_simple_test_result)(int passed, char* reason, const char* function, unsigned int line); +extern void (*seatest_simple_test_result)(int passed, char* reason, const char* function, unsigned int line); void seatest_test_fixture_start(char* filepath); void seatest_test_fixture_end( void ); void seatest_simple_test_result_log(int passed, char* reason, const char* function, unsigned int line);