From 6fc5ea44528678d2d8d915d6750c615c2b0c5930 Mon Sep 17 00:00:00 2001 From: yang Date: Thu, 30 Aug 2012 17:50:08 +0800 Subject: [PATCH] fix issues about Android.mk --- android/Android.mk | 4 +++- inc/NE10_math.h | 6 +++--- modules/NE10_init.c | 9 ++++++++- modules/math/NE10_init_math.c | 7 ++++--- samples/NE10_test.c | 7 ++++++- 5 files changed, 24 insertions(+), 9 deletions(-) diff --git a/android/Android.mk b/android/Android.mk index a118c67..f68b1dc 100644 --- a/android/Android.mk +++ b/android/Android.mk @@ -18,7 +18,7 @@ ne10_neon_source := \ modules/math/NE10_mulcmatvec.neon.s \ modules/math/NE10_mulc.neon.c \ modules/math/NE10_mulmat.neon.s \ - modules/math/NE10_mul.neon.c \ + modules/math/NE10_mul.neon.s \ modules/math/NE10_normalize.neon.s \ modules/math/NE10_rsbc.neon.c \ modules/math/NE10_setc.neon.c \ @@ -78,6 +78,8 @@ ne10_source_files := \ modules/math/NE10_submat.c \ modules/math/NE10_sub.c \ modules/math/NE10_transmat.c \ + modules/math/NE10_init_math.c \ + modules/NE10_init.c \ include $(CLEAR_VARS) diff --git a/inc/NE10_math.h b/inc/NE10_math.h index 9172013..cb38997 100644 --- a/inc/NE10_math.h +++ b/inc/NE10_math.h @@ -479,7 +479,7 @@ extern ne10_result_t (*vdiv_vec4f)(ne10_vec4f_t * dst, ne10_vec4f_t * src1, ne10 @param[in] src2 Pointer to the second source array @param[in] count The number of items in the input arrays */ -extern ne10_result_t (*vmla_vec2f)(ne10_vec2f_t * acc, ne10_vec2f_t * src1, ne10_vec2f_t * src2, ne10_uint32_t count); +extern ne10_result_t (*vmla_vec2f)(ne10_vec2f_t * dst, ne10_vec2f_t * acc, ne10_vec2f_t * src1, ne10_vec2f_t * src2, ne10_uint32_t count); /*! Performs a multiply and accumulate operation on the components of a 3D vector with the corresponding components of another @param[out] dst Pointer to the destination array @@ -487,7 +487,7 @@ extern ne10_result_t (*vmla_vec2f)(ne10_vec2f_t * acc, ne10_vec2f_t * src1, ne10 @param[in] src2 Pointer to the second source array @param[in] count The number of items in the input arrays */ -extern ne10_result_t (*vmla_vec3f)(ne10_vec3f_t * acc, ne10_vec3f_t * src1, ne10_vec3f_t * src2, ne10_uint32_t count); +extern ne10_result_t (*vmla_vec3f)(ne10_vec3f_t * dst, ne10_vec3f_t * acc, ne10_vec3f_t * src1, ne10_vec3f_t * src2, ne10_uint32_t count); /*! Performs a multiply and accumulate operation on the components of a 4D vector with the corresponding components of another @param[out] dst Pointer to the destination array @@ -495,7 +495,7 @@ extern ne10_result_t (*vmla_vec3f)(ne10_vec3f_t * acc, ne10_vec3f_t * src1, ne10 @param[in] src2 Pointer to the second source array @param[in] count The number of items in the input arrays */ -extern ne10_result_t (*vmla_vec4f)(ne10_vec4f_t * acc, ne10_vec4f_t * src1, ne10_vec4f_t * src2, ne10_uint32_t count); +extern ne10_result_t (*vmla_vec4f)(ne10_vec4f_t * dst, ne10_vec4f_t * acc, ne10_vec4f_t * src1, ne10_vec4f_t * src2, ne10_uint32_t count); diff --git a/modules/NE10_init.c b/modules/NE10_init.c index 5a7fb57..b81c2de 100644 --- a/modules/NE10_init.c +++ b/modules/NE10_init.c @@ -34,6 +34,7 @@ ne10_result_t NE10_init() ne10_int8_t cpuinfo[CPUINFO_BUFFER_SIZE]; // The buffer to read in the string ne10_uint32_t bytes = 0; // Numbers of bytes read from the file ne10_int32_t i = 0; // Temporary loop counter + ne10_result_t status = NE10_ERR; memset (cpuinfo, 0, CPUINFO_BUFFER_SIZE); infofile = fopen ("/proc/cpuinfo", "r"); @@ -54,6 +55,12 @@ ne10_result_t NE10_init() } #if defined (NE10_ENABLE_MATH) - NE10_init_math (is_NEON_available); + status = NE10_init_math (is_NEON_available); + if (status != NE10_OK) + { + fprintf(stderr, "ERROR: init math failed\n"); + return NE10_ERR; + } #endif + return NE10_OK; } diff --git a/modules/math/NE10_init_math.c b/modules/math/NE10_init_math.c index 6b4633a..e292403 100644 --- a/modules/math/NE10_init_math.c +++ b/modules/math/NE10_init_math.c @@ -202,6 +202,7 @@ ne10_result_t NE10_init_math (int is_NEON_available) transmat_2x2f = transmat_2x2f_c; identitymat_2x2f = identitymat_2x2f_c; } + return NE10_OK; } // These are actual definitions of our function pointers that are declared in inc/NE10_types.h @@ -255,9 +256,9 @@ ne10_result_t (*vmul_vec4f) (ne10_vec4f_t * dst, ne10_vec4f_t * src1, ne10_vec4f ne10_result_t (*vdiv_vec2f) (ne10_vec2f_t * dst, ne10_vec2f_t * src1, ne10_vec2f_t * src2, ne10_uint32_t count); ne10_result_t (*vdiv_vec3f) (ne10_vec3f_t * dst, ne10_vec3f_t * src1, ne10_vec3f_t * src2, ne10_uint32_t count); ne10_result_t (*vdiv_vec4f) (ne10_vec4f_t * dst, ne10_vec4f_t * src1, ne10_vec4f_t * src2, ne10_uint32_t count); -ne10_result_t (*vmla_vec2f) (ne10_vec2f_t * acc, ne10_vec2f_t * src1, ne10_vec2f_t * src2, ne10_uint32_t count); -ne10_result_t (*vmla_vec3f) (ne10_vec3f_t * acc, ne10_vec3f_t * src1, ne10_vec3f_t * src2, ne10_uint32_t count); -ne10_result_t (*vmla_vec4f) (ne10_vec4f_t * acc, ne10_vec4f_t * src1, ne10_vec4f_t * src2, ne10_uint32_t count); +ne10_result_t (*vmla_vec2f) (ne10_vec2f_t * dst, ne10_vec2f_t * acc, ne10_vec2f_t * src1, ne10_vec2f_t * src2, ne10_uint32_t count); +ne10_result_t (*vmla_vec3f) (ne10_vec3f_t * dst, ne10_vec3f_t * acc, ne10_vec3f_t * src1, ne10_vec3f_t * src2, ne10_uint32_t count); +ne10_result_t (*vmla_vec4f) (ne10_vec4f_t * dst, ne10_vec4f_t * acc, ne10_vec4f_t * src1, ne10_vec4f_t * src2, ne10_uint32_t count); ne10_result_t (*add_vec2f) (ne10_vec2f_t * dst, ne10_vec2f_t * src1, ne10_vec2f_t * src2, ne10_uint32_t count); ne10_result_t (*add_vec3f) (ne10_vec3f_t * dst, ne10_vec3f_t * src1, ne10_vec3f_t * src2, ne10_uint32_t count); ne10_result_t (*add_vec4f) (ne10_vec4f_t * dst, ne10_vec4f_t * src1, ne10_vec4f_t * src2, ne10_uint32_t count); diff --git a/samples/NE10_test.c b/samples/NE10_test.c index 8005131..718bc43 100644 --- a/samples/NE10_test.c +++ b/samples/NE10_test.c @@ -21,8 +21,13 @@ void main() { + ne10_result_t status; printf ("Going to initialze NE10...\n"); - NE10_init(); + + status = NE10_init(); + if (status != NE10_OK) + printf ("NE10 init failed.\n"); + printf ("NE10 has been initialized.\n"); } -- 2.7.4