From 75c85b4944b7d87c8277129645ba4083b6c32c7b Mon Sep 17 00:00:00 2001 From: Mathieu Faverge <mathieu.faverge@inria.fr> Date: Fri, 28 Jul 2017 16:52:08 +0200 Subject: [PATCH] Fix includes with the move to subdir chameleon, and fix some warnings --- control/async.c | 2 +- control/async.h | 4 +- control/auxiliary.h | 2 +- control/context.c | 2 +- control/context.h | 2 +- control/control.c | 2 +- control/descriptor.c | 2 +- control/descriptor.h | 4 +- coreblas/include/coreblas.h | 9 +-- example/basic_zposv/posv_users_functions.h | 1 + example/lapack_to_morse/step3.h | 2 + include/CMakeLists.txt | 9 +-- include/chameleon/chameleon_config.h.in | 16 +++++ include/chameleon/morse_kernels.h | 2 +- .../chameleon/{runtime.h => morse_runtime.h} | 38 ++--------- include/chameleon/morse_simulate.h | 2 +- include/chameleon/morse_struct.h | 7 +- include/chameleon/morse_tasks.h | 60 +++++++++++++++++ .../{runtime_z.h => morse_tasks_z.h} | 6 +- .../{runtime_zc.h => morse_tasks_zc.h} | 6 +- include/morse.h | 53 ++++++++------- runtime/starpu/control/runtime_async.c | 41 +++++++----- runtime/starpu/control/runtime_descriptor.c | 19 +++--- runtime/starpu/control/runtime_zlocality.c | 21 +++++- testing/testing_zauxiliary.c | 2 +- testing/testing_zauxiliary.h | 2 +- testing/testing_zpemv.c | 65 ++++++++++--------- 27 files changed, 230 insertions(+), 151 deletions(-) rename include/chameleon/{runtime.h => morse_runtime.h} (79%) create mode 100644 include/chameleon/morse_tasks.h rename include/chameleon/{runtime_z.h => morse_tasks_z.h} (99%) rename include/chameleon/{runtime_zc.h => morse_tasks_zc.h} (95%) diff --git a/control/async.c b/control/async.c index 82d998930..4e273b724 100644 --- a/control/async.c +++ b/control/async.c @@ -32,7 +32,7 @@ */ #include <stdlib.h> #include "control/common.h" -#include "runtime.h" +#include "chameleon/morse_runtime.h" /******************************************************************************* * Register an exception. diff --git a/control/async.h b/control/async.h index fda4143c1..8cfef81bf 100644 --- a/control/async.h +++ b/control/async.h @@ -9,7 +9,7 @@ **/ /*** - * + * * * @file async.h * @@ -26,7 +26,7 @@ #ifndef _MORSE_ASYNC_H_ #define _MORSE_ASYNC_H_ -#include "morse_struct.h" +#include "chameleon/morse_struct.h" #ifdef __cplusplus extern "C" { diff --git a/control/auxiliary.h b/control/auxiliary.h index 147fe1694..5cc85d6dc 100644 --- a/control/auxiliary.h +++ b/control/auxiliary.h @@ -27,7 +27,7 @@ #ifndef _MORSE_AUXILIARY_H_ #define _MORSE_AUXILIARY_H_ -#include "morse_struct.h" +#include "chameleon/morse_struct.h" #ifdef __cplusplus extern "C" { diff --git a/control/context.c b/control/context.c index 4d901902d..0204a1f48 100644 --- a/control/context.c +++ b/control/context.c @@ -41,7 +41,7 @@ #include "control/common.h" #include "control/auxiliary.h" #include "control/context.h" -#include "runtime.h" +#include "chameleon/morse_runtime.h" /******************************************************************************* * Global data diff --git a/control/context.h b/control/context.h index 948a2d6c5..0c9191c49 100644 --- a/control/context.h +++ b/control/context.h @@ -27,7 +27,7 @@ #ifndef _MORSE_CONTEXT_H_ #define _MORSE_CONTEXT_H_ -#include "morse_struct.h" +#include "chameleon/morse_struct.h" /******************************************************************************* * Routines to handle threads context diff --git a/control/control.c b/control/control.c index 7bb54781d..587a24ae1 100644 --- a/control/control.c +++ b/control/control.c @@ -35,7 +35,7 @@ #include <stdlib.h> #include "control/auxiliary.h" #include "control/common.h" -#include "runtime.h" +#include "chameleon/morse_runtime.h" /** *************************************************************************** * diff --git a/control/descriptor.c b/control/descriptor.c index 69d189a29..1a856099a 100644 --- a/control/descriptor.c +++ b/control/descriptor.c @@ -34,7 +34,7 @@ #include <assert.h> #include "control/common.h" #include "control/descriptor.h" -#include "runtime.h" +#include "chameleon/morse_runtime.h" static int nbdesc = 0; diff --git a/control/descriptor.h b/control/descriptor.h index 7972ea05c..2f6c6afe9 100644 --- a/control/descriptor.h +++ b/control/descriptor.h @@ -27,8 +27,8 @@ #define _MORSE_DESCRIPTOR_H_ #include <assert.h> -#include "include/chameleon_config.h" -#include "morse_struct.h" +#include "chameleon/chameleon_config.h" +#include "chameleon/morse_struct.h" #include "control/auxiliary.h" #ifdef __cplusplus diff --git a/coreblas/include/coreblas.h b/coreblas/include/coreblas.h index 590e48d62..d6269de79 100644 --- a/coreblas/include/coreblas.h +++ b/coreblas/include/coreblas.h @@ -42,12 +42,9 @@ /** **************************************************************************** * MORSE types and constants **/ -#include "morse_types.h" -#include "morse_struct.h" -#include "morse_constants.h" -//#include "control/auxiliary.h" -//#include "control/descriptor.h" -//#include "control/tile.h" +#include "chameleon/morse_types.h" +#include "chameleon/morse_struct.h" +#include "chameleon/morse_constants.h" /** **************************************************************************** * CORE BLAS headers diff --git a/example/basic_zposv/posv_users_functions.h b/example/basic_zposv/posv_users_functions.h index 2227941ad..af2469c30 100644 --- a/example/basic_zposv/posv_users_functions.h +++ b/example/basic_zposv/posv_users_functions.h @@ -53,6 +53,7 @@ inline static void* user_getaddr_arrayofpointers(const MORSE_desc_t *A, int m, i **/ inline static int user_getblkldd_arrayofpointers(const MORSE_desc_t *A, int m) { + (void)m; return A->mb; } diff --git a/example/lapack_to_morse/step3.h b/example/lapack_to_morse/step3.h index eedce3468..f27132fee 100644 --- a/example/lapack_to_morse/step3.h +++ b/example/lapack_to_morse/step3.h @@ -190,6 +190,7 @@ inline static void* user_getaddr_arrayofpointers(const MORSE_desc_t *A, int m, i */ inline static int user_getblkldd_arrayofpointers(const MORSE_desc_t *A, int m) { + (void)m; return A->mb; } @@ -198,6 +199,7 @@ inline static int user_getblkldd_arrayofpointers(const MORSE_desc_t *A, int m) */ inline static int user_getrankof_zero(const MORSE_desc_t *A, int m, int n) { + (void)A; (void)m; (void)n; return 0; } diff --git a/include/CMakeLists.txt b/include/CMakeLists.txt index 4308dc76d..21457aa53 100644 --- a/include/CMakeLists.txt +++ b/include/CMakeLists.txt @@ -34,8 +34,8 @@ set(CHAMELEON_HDRS_GENERATED "") set(ZHDR chameleon/morse_z.h chameleon/morse_zc.h - chameleon/runtime_z.h - chameleon/runtime_zc.h + chameleon/morse_tasks_z.h + chameleon/morse_tasks_zc.h ) precisions_rules_py(CHAMELEON_HDRS_GENERATED "${ZHDR}" @@ -52,11 +52,12 @@ set(CHAMELEON_HDRS chameleon/chameleon_config.h chameleon/morse_constants.h chameleon/morse_kernels.h + chameleon/morse_mangling.h + chameleon/morse_runtime.h chameleon/morse_simulate.h chameleon/morse_struct.h + chameleon/morse_tasks.h chameleon/morse_types.h - chameleon/morse_mangling.h - chameleon/runtime.h ${CHAMELEON_HDRS_GENERATED} ) diff --git a/include/chameleon/chameleon_config.h.in b/include/chameleon/chameleon_config.h.in index eceddc9e3..b1d6abb13 100644 --- a/include/chameleon/chameleon_config.h.in +++ b/include/chameleon/chameleon_config.h.in @@ -56,4 +56,20 @@ #cmakedefine CHAMELEON_HAVE_GETOPT_H #cmakedefine CHAMELEON_HAVE_GETOPT_LONG +#ifdef BEGIN_C_DECLS +#undef BEGIN_C_DECLS +#endif + +#ifdef END_C_DECLS +#undef END_C_DECLS +#endif + +#if defined(c_plusplus) || defined(__cplusplus) +# define BEGIN_C_DECLS extern "C" { +# define END_C_DECLS } +#else +# define BEGIN_C_DECLS /* empty */ +# define END_C_DECLS /* empty */ +#endif + #endif /* CHAMELEON_CONFIG_H_HAS_BEEN_INCLUDED */ diff --git a/include/chameleon/morse_kernels.h b/include/chameleon/morse_kernels.h index a979ab673..dd1ce89f0 100644 --- a/include/chameleon/morse_kernels.h +++ b/include/chameleon/morse_kernels.h @@ -85,4 +85,4 @@ typedef enum morse_kernel_e { MORSE_NBKERNELS } MORSE_kernel_t; -#endif /* _MORSE_KERNELS_H_ */ +#endif diff --git a/include/chameleon/runtime.h b/include/chameleon/morse_runtime.h similarity index 79% rename from include/chameleon/runtime.h rename to include/chameleon/morse_runtime.h index b4569f630..dc198373d 100644 --- a/include/chameleon/runtime.h +++ b/include/chameleon/morse_runtime.h @@ -24,10 +24,10 @@ * @date 2011-06-01 * **/ -#ifndef _RUNTIME_H_ -#define _RUNTIME_H_ +#ifndef _MORSE_RUNTIME_H_ +#define _MORSE_RUNTIME_H_ -#include "morse_struct.h" +#include "chameleon/morse_struct.h" /******************************************************************************* * RUNTIME Async @@ -133,34 +133,4 @@ void RUNTIME_ddisplay_oneprofile (MORSE_kernel_t); void RUNTIME_sdisplay_allprofile (); void RUNTIME_sdisplay_oneprofile (MORSE_kernel_t); -/******************************************************************************* - * RUNTIME Kernels - **/ -#include "runtime_z.h" -#include "runtime_d.h" -#include "runtime_c.h" -#include "runtime_s.h" -#include "runtime_zc.h" -#include "runtime_ds.h" - -void MORSE_TASK_ztile_zero(const MORSE_option_t *options, - int X1, int X2, int Y1, int Y2, - const MORSE_desc_t *A, int Am, int An, int lda); -void MORSE_TASK_dtile_zero(const MORSE_option_t *options, - int X1, int X2, int Y1, int Y2, - const MORSE_desc_t *A, int Am, int An, int lda); -void MORSE_TASK_ctile_zero(const MORSE_option_t *options, - int X1, int X2, int Y1, int Y2, - const MORSE_desc_t *A, int Am, int An, int lda); -void MORSE_TASK_stile_zero(const MORSE_option_t *options, - int X1, int X2, int Y1, int Y2, - const MORSE_desc_t *A, int Am, int An, int lda); - -/* - * Mark a data as unused after this call - */ -void MORSE_TASK_dataflush(const MORSE_option_t *options, - const MORSE_desc_t *A, int Am, int An); -void MORSE_TASK_dataflush_all(); - -#endif +#endif /* _MORSE_RUNTIME_H_ */ diff --git a/include/chameleon/morse_simulate.h b/include/chameleon/morse_simulate.h index 7ef57e729..51b8131c8 100644 --- a/include/chameleon/morse_simulate.h +++ b/include/chameleon/morse_simulate.h @@ -25,7 +25,7 @@ #ifndef _MORSE_SIMULATE_H_ #define _MORSE_SIMULATE_H_ -#include "chameleon_config.h" +#include "chameleon/chameleon_config.h" /* we need this when starpu is compiled with simgrid enabled */ #if defined(CHAMELEON_SCHED_STARPU) && defined(CHAMELEON_SIMULATION) diff --git a/include/chameleon/morse_struct.h b/include/chameleon/morse_struct.h index a87b8ca47..a2ecf1934 100644 --- a/include/chameleon/morse_struct.h +++ b/include/chameleon/morse_struct.h @@ -28,8 +28,8 @@ #ifndef _MORSE_STRUCT_H_ #define _MORSE_STRUCT_H_ -#include "chameleon_config.h" -#include "morse_types.h" +#include "chameleon/chameleon_config.h" +#include "chameleon/morse_types.h" /** **************************************************************************** * RUNTIME headers to include types of : @@ -188,7 +188,6 @@ typedef struct morse_option_s { /** **************************************************************************** * MORSE kernels **/ -#include "morse_kernels.h" - +#include "chameleon/morse_kernels.h" #endif /* __CHAMELEON_H__ */ diff --git a/include/chameleon/morse_tasks.h b/include/chameleon/morse_tasks.h new file mode 100644 index 000000000..6abc5dcc0 --- /dev/null +++ b/include/chameleon/morse_tasks.h @@ -0,0 +1,60 @@ +/** + * + * @copyright (c) 2009-2014 The University of Tennessee and The University + * of Tennessee Research Foundation. + * All rights reserved. + * @copyright (c) 2012-2014 Inria. All rights reserved. + * @copyright (c) 2012-2014 Bordeaux INP, CNRS (LaBRI UMR 5800), Inria, Univ. Bordeaux. All rights reserved. + * + **/ + +/** + * + * @file morse_tasks.h + * + * MORSE codelets kernel + * MORSE is a software package provided by Univ. of Tennessee, + * Univ. of California Berkeley and Univ. of Colorado Denver, + * and INRIA Bordeaux Sud-Ouest + * + * @version 2.3.1 + * @author Mathieu Faverge + * @author Cedric Augonnet + * @date 2011-06-01 + * + **/ +#ifndef _MORSE_TASKS_H_ +#define _MORSE_TASKS_H_ + +/******************************************************************************* + * MORSE Task submission routines + **/ +void MORSE_TASK_ztile_zero(const MORSE_option_t *options, + int X1, int X2, int Y1, int Y2, + const MORSE_desc_t *A, int Am, int An, int lda); +void MORSE_TASK_dtile_zero(const MORSE_option_t *options, + int X1, int X2, int Y1, int Y2, + const MORSE_desc_t *A, int Am, int An, int lda); +void MORSE_TASK_ctile_zero(const MORSE_option_t *options, + int X1, int X2, int Y1, int Y2, + const MORSE_desc_t *A, int Am, int An, int lda); +void MORSE_TASK_stile_zero(const MORSE_option_t *options, + int X1, int X2, int Y1, int Y2, + const MORSE_desc_t *A, int Am, int An, int lda); + +/* + * Mark a data as unused after this call + */ +void MORSE_TASK_dataflush(const MORSE_option_t *options, + const MORSE_desc_t *A, int Am, int An); +void MORSE_TASK_dataflush_all(); + +#include "chameleon/morse_tasks_z.h" +#include "chameleon/morse_tasks_d.h" +#include "chameleon/morse_tasks_c.h" +#include "chameleon/morse_tasks_s.h" +#include "chameleon/morse_tasks_zc.h" +#include "chameleon/morse_tasks_ds.h" + + +#endif /* _MORSE_TASKS_H_ */ diff --git a/include/chameleon/runtime_z.h b/include/chameleon/morse_tasks_z.h similarity index 99% rename from include/chameleon/runtime_z.h rename to include/chameleon/morse_tasks_z.h index d4e434a8c..1a74269cc 100644 --- a/include/chameleon/runtime_z.h +++ b/include/chameleon/morse_tasks_z.h @@ -10,7 +10,7 @@ /** * - * @file runtime_z.h + * @file morse_tasks_z.h * * MORSE auxiliary routines * MORSE is a software package provided by Univ. of Tennessee, @@ -29,8 +29,8 @@ * @precisions normal z -> c d s * **/ -#ifndef _RUNTIME_ZBLAS_H_ -#define _RUNTIME_ZBLAS_H_ +#ifndef _MORSE_TASKS_Z_H_ +#define _MORSE_TASKS_Z_H_ #define COMPLEX diff --git a/include/chameleon/runtime_zc.h b/include/chameleon/morse_tasks_zc.h similarity index 95% rename from include/chameleon/runtime_zc.h rename to include/chameleon/morse_tasks_zc.h index a17fd6fe0..7daedad43 100644 --- a/include/chameleon/runtime_zc.h +++ b/include/chameleon/morse_tasks_zc.h @@ -10,7 +10,7 @@ /** * - * @file runtime_zc.h + * @file morse_tasks_zc.h * * MORSE auxiliary routines * MORSE is a software package provided by Univ. of Tennessee, @@ -28,8 +28,8 @@ * @precisions mixed zc -> ds * **/ -#ifndef _RUNTIME_ZCBLAS_H_ -#define _RUNTIME_ZCBLAS_H_ +#ifndef _MORSE_TASKS_Z_H_ +#define _MORSE_TASKS_Z_H_ #ifdef __cplusplus extern "C" { diff --git a/include/morse.h b/include/morse.h index f87fdc098..dbce6b279 100644 --- a/include/morse.h +++ b/include/morse.h @@ -31,29 +31,48 @@ /* **************************************************************************** * MORSE types and constants */ -#include "chameleon_config.h" -#include "morse_types.h" -#include "morse_struct.h" -#include "morse_constants.h" +#include "chameleon/chameleon_config.h" +#include "chameleon/morse_types.h" +#include "chameleon/morse_struct.h" +#include "chameleon/morse_constants.h" +#include "chameleon/morse_kernels.h" /* **************************************************************************** - * RUNTIME Functions + * MORSE runtime common API */ -#include "runtime.h" +#include "chameleon/morse_runtime.h" /* **************************************************************************** - * For Simulation mode + * MORSE Simulation mode */ -#include "morse_simulate.h" +#include "chameleon/morse_simulate.h" + +/* **************************************************************************** + * Include LibHQR for hierarchical trees QR/LQ factorizations + */ +#include "libhqr.h" + +/* **************************************************************************** + * MORSE Tasks + */ +#include "chameleon/morse_tasks.h" + +/* **************************************************************************** + * MORSE functionnalities + */ +#include "chameleon/morse_z.h" +#include "chameleon/morse_c.h" +#include "chameleon/morse_d.h" +#include "chameleon/morse_s.h" +#include "chameleon/morse_zc.h" +#include "chameleon/morse_ds.h" /* **************************************************************************** * MORSE Functions */ -#ifdef __cplusplus -extern "C" { -#endif +BEGIN_C_DECLS /* Auxiliary */ int MORSE_Version (int *ver_major, int *ver_minor, int *ver_micro); @@ -113,16 +132,6 @@ int MORSE_Sequence_Create (MORSE_sequence_t **sequence); int MORSE_Sequence_Destroy (MORSE_sequence_t *sequence); int MORSE_Sequence_Wait (MORSE_sequence_t *sequence); -#ifdef __cplusplus -} -#endif - -#include "libhqr.h" -#include "morse_z.h" -#include "morse_c.h" -#include "morse_d.h" -#include "morse_s.h" -#include "morse_zc.h" -#include "morse_ds.h" +END_C_DECLS #endif diff --git a/runtime/starpu/control/runtime_async.c b/runtime/starpu/control/runtime_async.c index 03f5a6fa7..09a120e69 100644 --- a/runtime/starpu/control/runtime_async.c +++ b/runtime/starpu/control/runtime_async.c @@ -54,28 +54,33 @@ extern void (*update_progress_callback)(int, int) ; /******************************************************************************* * Display a progress information when executing the tasks **/ -int RUNTIME_progress( MORSE_context_t *morse) +int RUNTIME_progress( MORSE_context_t *morse ) { + int tasksLeft, current, timer = 0; + int max; + #if defined(CHAMELEON_USE_MPI) - if (morse->my_mpi_rank!=0) - return MORSE_SUCCESS; + if ( morse->my_mpi_rank != 0 ) + return MORSE_SUCCESS; #endif - int tasksLeft, current, timer=0; - int max = starpu_task_nsubmitted(); - if (max==0) - return MORSE_SUCCESS; - // update_progress_callback(0, max); - while ((tasksLeft = starpu_task_nsubmitted()) > 0) { - current = max - tasksLeft; + + max = starpu_task_nsubmitted(); + if ( max == 0 ) + return MORSE_SUCCESS; + + // update_progress_callback(0, max); + while ((tasksLeft = starpu_task_nsubmitted()) > 0) { + current = max - tasksLeft; + if (timer > PROGRESS_MINIMUM_DURATION) + update_progress_callback(current, max); + sleep(1); + timer++; + } if (timer > PROGRESS_MINIMUM_DURATION) - update_progress_callback(current, max); - sleep(1); - timer++; - } - if (timer > PROGRESS_MINIMUM_DURATION) - update_progress_callback(max, max); + update_progress_callback(max, max); - return MORSE_SUCCESS; + (void)morse; + return MORSE_SUCCESS; } /******************************************************************************* @@ -86,7 +91,7 @@ int RUNTIME_sequence_wait( MORSE_context_t *morse, MORSE_sequence_t *sequence ) (void)morse; (void)sequence; if (morse->progress_enabled) - RUNTIME_progress(morse); + RUNTIME_progress(morse); starpu_task_wait_for_all(); #if defined(CHAMELEON_USE_MPI) starpu_mpi_barrier(MPI_COMM_WORLD); diff --git a/runtime/starpu/control/runtime_descriptor.c b/runtime/starpu/control/runtime_descriptor.c index 6a05ce8ba..46383eae7 100644 --- a/runtime/starpu/control/runtime_descriptor.c +++ b/runtime/starpu/control/runtime_descriptor.c @@ -50,14 +50,17 @@ static int _tag_mpi_initialized_ = 0; #define FOLDED 0 #endif -void RUNTIME_user_tag_size(int user_tag_width, int user_tag_sep) { +void RUNTIME_user_tag_size( int user_tag_width, int user_tag_sep ) { #if defined(CHAMELEON_USE_MPI) if (_tag_mpi_initialized_ == 0) { - tag_width=user_tag_width; - tag_sep=user_tag_sep; - } else - morse_error("RUNTIME_user_tag_size", "must be called before creating any Morse descriptor with MORSE_Desc_create(). The tag sizes will not be modified."); + tag_width = user_tag_width; + tag_sep = user_tag_sep; + } else { + morse_error("RUNTIME_user_tag_size", + "must be called before creating any Morse descriptor with MORSE_Desc_create(). The tag sizes will not be modified."); + } #endif + (void)user_tag_width; (void)user_tag_sep; } @@ -126,9 +129,9 @@ void RUNTIME_desc_create( MORSE_desc_t *desc ) int pagesize = getpagesize(); if ((desc->mb * desc->nb * eltsze) % pagesize != 0 - || (lastmm * desc->nb * eltsze) % pagesize != 0 - || (desc->mb * lastnn * eltsze) % pagesize != 0 - || (lastmm * lastnn * eltsze) % pagesize != 0) + || (lastmm * desc->nb * eltsze) % pagesize != 0 + || (desc->mb * lastnn * eltsze) % pagesize != 0 + || (lastmm * lastnn * eltsze) % pagesize != 0) { morse_error("RUNTIME_desc_create", "Matrix and tile size not suitable for out-of-core: all tiles have to be multiples of 4096. Tip : choose 'n' and 'nb' as both multiples of 32."); return; diff --git a/runtime/starpu/control/runtime_zlocality.c b/runtime/starpu/control/runtime_zlocality.c index a83ddceb5..f7bdf1fff 100644 --- a/runtime/starpu/control/runtime_zlocality.c +++ b/runtime/starpu/control/runtime_zlocality.c @@ -250,8 +250,23 @@ void RUNTIME_zlocality_onerestore( MORSE_kernel_t kernel ) } } #else -void RUNTIME_zlocality_allrestrict( uint32_t where ) {} -void RUNTIME_zlocality_onerestrict( MORSE_kernel_t kernel, uint32_t where ) {} + +void RUNTIME_zlocality_allrestrict( uint32_t where ) +{ + (void)where; +} + +void RUNTIME_zlocality_onerestrict( MORSE_kernel_t kernel, uint32_t where ) +{ + (void)kernel; + (void)where; +} + void RUNTIME_zlocality_allrestore( ) {} -void RUNTIME_zlocality_onerestore( MORSE_kernel_t kernel ) {} + +void RUNTIME_zlocality_onerestore( MORSE_kernel_t kernel ) +{ + (void)kernel; +} + #endif diff --git a/testing/testing_zauxiliary.c b/testing/testing_zauxiliary.c index 748c56694..e1501a07d 100644 --- a/testing/testing_zauxiliary.c +++ b/testing/testing_zauxiliary.c @@ -157,7 +157,7 @@ int map_RRRB(int m, int n, int mb, int nb, int i, int j) { return ( m*n0 + (n-n0)*m0 + map_rm( m%mb, n%nb, i%mb, j%nb) ); } -void *formatmap[6] = { map_CM, map_RM, map_CCRB, map_CRRB, map_RCRB, map_RRRB }; +int (*formatmap[6])(int, int, int, int, int, int) = { map_CM, map_RM, map_CCRB, map_CRRB, map_RCRB, map_RRRB }; int main (int argc, char **argv) { diff --git a/testing/testing_zauxiliary.h b/testing/testing_zauxiliary.h index 2285df339..7c55d8057 100644 --- a/testing/testing_zauxiliary.h +++ b/testing/testing_zauxiliary.h @@ -68,7 +68,7 @@ extern char *itypestr[3]; extern char *storevstr[2]; extern char *normstr[4]; -extern void *formatmap[6]; +extern int (*formatmap[6])(int, int, int, int, int, int); int map_CM (int m, int n, int mb, int nb, int i, int j); int map_CCRB(int m, int n, int mb, int nb, int i, int j); diff --git a/testing/testing_zpemv.c b/testing/testing_zpemv.c index 7130fa5b9..4a3397263 100644 --- a/testing/testing_zpemv.c +++ b/testing/testing_zpemv.c @@ -42,12 +42,12 @@ /*-------------------------------------------------------------- * Check the pemv */ -static int check_solution(MORSE_enum trans, MORSE_enum storev, +static int check_solution(MORSE_enum trans, MORSE_enum storev, int M, int N, int L, MORSE_Complex64_t alpha, MORSE_Complex64_t *A, int LDA, - MORSE_Complex64_t *X, int INCX, + MORSE_Complex64_t *X, int INCX, MORSE_Complex64_t beta, MORSE_Complex64_t *Y0, int INCY0, - MORSE_Complex64_t *Y, int INCY, + MORSE_Complex64_t *Y, int INCY, MORSE_Complex64_t *W, double *Rnorm) { int k; @@ -61,28 +61,30 @@ static int check_solution(MORSE_enum trans, MORSE_enum storev, } else { k = M; } - + work = (double *)malloc(k * sizeof(double)); cblas_zcopy(k, Y0, INCY0, W, 1); - + /* w = a A x + b w */ - cblas_zgemv(CblasColMajor, (CBLAS_TRANSPOSE)trans, + cblas_zgemv(CblasColMajor, (CBLAS_TRANSPOSE)trans, M, N, - CBLAS_SADDR(alpha), A, LDA, - X, INCX, + CBLAS_SADDR(alpha), A, LDA, + X, INCX, CBLAS_SADDR(beta), W, 1); /* y - w */ cblas_zaxpy(k, CBLAS_SADDR(mzone), Y, INCY, W, 1); - + /* Max Norm */ *Rnorm = LAPACKE_zlange_work(LAPACK_COL_MAJOR, 'm', 1, k, W, 1, work); - + if ( (*Rnorm / (M*N)) > eps) { return 1; } else { return 0; } + + (void)L; (void)storev; } /*-------------------------------------------------------------- @@ -136,8 +138,8 @@ int testing_zpemv(int argc, char **argv) printf("Out of Memory \n "); exit(0); } - - /* Initialize Data */ + + /* Initialize Data */ MORSE_zplrnt(n, n, A, lda, 479 ); MORSE_zplrnt(n, n, X, lda, 320 ); MORSE_zplrnt(n, 1, Y0, n, 573 ); @@ -152,7 +154,7 @@ int testing_zpemv(int argc, char **argv) nfails = 0; for (i=0; i<6; i++) { - + /* m and n cannot be greater than lda (arg_n) */ switch (i) { case 0: l = 0; m = arg_n; n = m; break; @@ -165,17 +167,17 @@ int testing_zpemv(int argc, char **argv) /* Colwise ConjTrans & Rowwise NoTrans */ #ifdef COMPLEX - for (t=0; t<3; t++) { + for (t=0; t<3; t++) #else - for (t=0; t<2; t++) { + for (t=0; t<2; t++) #endif - + { /* Swap m and n for transpose cases */ if ( t == 1 ) { k = m; m = n; n = k; } - LAPACKE_zlacpy_work( LAPACK_COL_MAJOR, 'A', m, n, + LAPACKE_zlacpy_work( LAPACK_COL_MAJOR, 'A', m, n, A, lda, A0, lda); if ( trans[t] == MorseNoTrans ) { @@ -217,29 +219,29 @@ int testing_zpemv(int argc, char **argv) case 2: incx = lda; incy = 1; break; case 3: incx = lda; incy = lda; break; } - + /* initialize Y with incy */ cblas_zcopy(n, Y0, 1, Y, incy); - + /* ZPEMV */ - CORE_zpemv( trans[t], storev, m, n, l, - alpha, A, lda, - X, incx, - beta, Y, incy, + CORE_zpemv( trans[t], storev, m, n, l, + alpha, A, lda, + X, incx, + beta, Y, incy, work); - + /* Check the solution */ - info_solution = check_solution(trans[t], storev, - m, n, l, + info_solution = check_solution(trans[t], storev, + m, n, l, alpha, A0, lda, - X, incx, - beta, Y0, 1, - Y, incy, + X, incx, + beta, Y0, 1, + Y, incy, work, &rnorm); - + if ( info_solution != 0 ) { nfails++; - printf("Failed: t=%s, s=%s, M=%3d, N=%3d, L=%3d, alpha=%e, incx=%3d, beta=%e, incy=%3d, rnorm=%e\n", + printf("Failed: t=%s, s=%s, M=%3d, N=%3d, L=%3d, alpha=%e, incx=%3d, beta=%e, incy=%3d, rnorm=%e\n", transstr[t], cstorev, m, n, l, creal(alpha), incx, creal(beta), incy, rnorm ); } nbtests++; @@ -268,4 +270,3 @@ int testing_zpemv(int argc, char **argv) return hres; } - -- GitLab