Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -52,3 +52,6 @@ local.properties

*.so

build*
scripts
logs
6 changes: 6 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
16 changes: 0 additions & 16 deletions inc/NE10_types.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,22 +39,6 @@
#include <assert.h>
#include <stdint.h>

/**
* @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
/////////////////////////////////////////////////////////
Expand Down
22 changes: 14 additions & 8 deletions modules/imgproc/test/test_suite_resize.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand All @@ -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));
Expand All @@ -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));
Expand All @@ -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;
Expand All @@ -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);
Expand All @@ -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);
}
);

Expand All @@ -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);

}
Expand Down
2 changes: 1 addition & 1 deletion test/include/seatest.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down