/* Copyright 2008 BORDEAUX I UNIVERSITY & INRIA 
**
** This file is part of the PaStiX parallel sparse matrix package.
**
** This software is governed by the CeCILL-C license under French law
** and abiding by the rules of distribution of free software. You can
** use, modify and/or redistribute the software under the terms of the
** CeCILL-C license as circulated by CEA, CNRS and INRIA at the following
** URL: "http://www.cecill.info".
** 
** As a counterpart to the access to the source code and rights to copy,
** modify and redistribute granted by the license, users are provided
** only with a limited warranty and the software's author, the holder of
** the economic rights, and the successive licensors have only limited
** liability.
** 
** In this respect, the user's attention is drawn to the risks associated
** with loading, using, modifying and/or developing or reproducing the
** software by the user in light of its specific status of free software,
** that may mean that it is complicated to manipulate, and that also
** therefore means that it is reserved for developers and experienced
** professionals having in-depth computer knowledge. Users are therefore
** encouraged to load and test the software's suitability as regards
** their requirements in conditions enabling the security of their
** systems and/or data to be ensured and, more generally, to use and
** operate it in the same conditions as regards security.
** 
** The fact that you are presently reading this means that you have had
** knowledge of the CeCILL-C license and that you accept its terms.
*/
/**
 * @file starpu_register_data.h
 *
 * @author Xavier Lacoste
 * @precisions normal z -> s d c
 */

#include "common_pastix.h"
#include "starpu_defines.h"
#include "solver.h"

#define starpu_fanin_init_cpu_func PASTIX_PREFIX_F(starpu_fanin_init_cpu_func)
void starpu_fanin_init_cpu_func(void *descr[], void *cl_arg);

#define starpu_fanin_init_cuda_func PASTIX_PREFIX_F(starpu_fanin_init_cuda_func)
void starpu_fanin_init_cuda_func(void *descr[], void *cl_arg);

#define starpu_register_fanin PASTIX_PREFIX_F(starpu_register_fanin)
int
starpu_register_fanin(Sopalin_Data_t * sopalin_data,
                      SolverMatrix            * solvmtx,
                       starpu_data_handle_t  *** Lfanin_handle,
                       starpu_data_handle_t  *** Ufanin_handle);

#define starpu_register_halo PASTIX_PREFIX_F(starpu_register_halo)
int
starpu_register_halo(Sopalin_Data_t * sopalin_data,
                      SolverMatrix          * datacode,
                      starpu_data_handle_t ** Lhalo_handle,
                      starpu_data_handle_t ** Uhalo_handle);

#define starpu_register_cblk PASTIX_PREFIX_F(starpu_register_cblk)
int
starpu_register_cblk( Sopalin_Data_t * sopalin_data,
                      SolverMatrix          * datacode,
                       starpu_data_handle_t ** L_handle,
                       starpu_data_handle_t ** U_handle );

#define starpu_register_blocktab PASTIX_PREFIX_F(starpu_register_blocktab)
int
starpu_register_blocktab( Sopalin_Data_t        * sopalin_data,
                           starpu_data_handle_t ** blocktab_handles,
                           int                  ** blocktab);

#define starpu_register_work PASTIX_PREFIX_F(starpu_register_work)
int
starpu_register_work( Sopalin_Data_t * sopalin_data,
                      SolverMatrix * datacode,
                       starpu_data_handle_t * WORK_handle,
                       PASTIX_INT WORK_size );

#define starpu_zregister_data PASTIX_PREFIX_F(starpu_register_data)
#define starpu_register_data PASTIX_PREFIX_F(starpu_register_data)
int
starpu_register_data( Sopalin_Data_t         * sopalin_data,
                       starpu_data_handle_t  ** L_handle,
                       starpu_data_handle_t  ** U_handle,
                       starpu_data_handle_t  ** Lhalo_handle,
                       starpu_data_handle_t  ** Uhalo_handle,
                       starpu_data_handle_t *** Lfanin_handle,
                       starpu_data_handle_t *** Ufanin_handle,
                       starpu_data_handle_t  ** blocktab_handles,
                       int                   ** blocktab,
                       starpu_data_handle_t   * WORK_handle,
                       PASTIX_INT             WORK_size );

#define starpu_unregister_fanin PASTIX_PREFIX_F(starpu_unregister_fanin)
int
starpu_unregister_fanin(SolverMatrix            * solvmtx,
                         starpu_data_handle_t  *** Lfanin_handle,
                         starpu_data_handle_t  *** Ufanin_handle);

#define starpu_unregister_halo PASTIX_PREFIX_F(starpu_unregister_halo)
int
starpu_unregister_halo(SolverMatrix          * datacode,
                        starpu_data_handle_t ** Lhalo_handle,
                        starpu_data_handle_t ** Uhalo_handle);

#define starpu_unregister_cblk PASTIX_PREFIX_F(starpu_unregister_cblk)
int
starpu_unregister_cblk( SolverMatrix          * datacode,
                         starpu_data_handle_t ** L_handle,
                         starpu_data_handle_t ** U_handle );

#define starpu_unregister_blocktab PASTIX_PREFIX_F(starpu_unregister_blocktab)
int
starpu_unregister_blocktab( SolverMatrix          * datacode,
                             starpu_data_handle_t ** blocktab_handles,
                             int                  ** blocktab);

#define starpu_unregister_work PASTIX_PREFIX_F(starpu_unregister_work)
int
starpu_unregister_work( SolverMatrix * datacode,
                         starpu_data_handle_t * WORK_handle );

#define starpu_unregister_data PASTIX_PREFIX_F(starpu_unregister_data)
#define starpu_zunregister_data PASTIX_PREFIX_F(starpu_unregister_data)
int
starpu_unregister_data( Sopalin_Data_t         * sopalin_data,
                         starpu_data_handle_t  ** L_handle,
                         starpu_data_handle_t  ** U_handle,
                         starpu_data_handle_t  ** Lhalo_handle,
                         starpu_data_handle_t  ** Uhalo_handle,
                         starpu_data_handle_t *** Lfanin_handle,
                         starpu_data_handle_t *** Ufanin_handle,
                         starpu_data_handle_t  ** blocktab_handles,
                         int                   ** blocktab,
                         starpu_data_handle_t   * WORK_handle);
