Commit 522ed2ef authored by Mathieu Faverge's avatar Mathieu Faverge

Move starpu specific function to detect cached data to an inline function in header file

parent 0a0b856d
......@@ -41,21 +41,6 @@ static void data_release(void *handle)
}
#endif
#ifdef CHAMELEON_USE_MPI
#ifdef HAVE_STARPU_MPI_CACHED_RECEIVE
int RUNTIME_desc_iscached(const MORSE_desc_t *A, int Am, int An)
{
starpu_data_handle_t *ptrtile = (starpu_data_handle_t*)(A->schedopt);
ptrtile += ((int64_t)(A->lmt) * (int64_t)An + (int64_t)Am);
if (!(*ptrtile))
return 0;
return starpu_mpi_cached_receive(*ptrtile);
}
#endif
#endif
void MORSE_TASK_flush_data( const MORSE_option_t *options,
const MORSE_desc_t *A, int Am, int An )
{
......@@ -87,7 +72,7 @@ void MORSE_TASK_flush_data( const MORSE_option_t *options,
}
void MORSE_TASK_flush_desc( const MORSE_option_t *options,
MORSE_enum uplo, const MORSE_desc_t *A )
MORSE_enum uplo, const MORSE_desc_t *A )
{
int m, n;
......
......@@ -120,21 +120,28 @@ typedef struct starpu_conf starpu_conf_t;
#define RTBLKADDR( desc, type, m, n ) ( (starpu_data_handle_t)RUNTIME_desc_getaddr( desc, m, n ) )
void RUNTIME_set_reduction_methods(starpu_data_handle_t handle, MORSE_enum dtyp);
#ifdef CHAMELEON_USE_MPI
#ifdef HAVE_STARPU_MPI_CACHED_RECEIVE
int RUNTIME_desc_iscached(const MORSE_desc_t *A, int Am, int An);
#endif
#endif
#if defined(CHAMELEON_USE_MPI)
# if defined(HAVE_STARPU_MPI_CACHED_RECEIVE)
# define RUNTIME_ACCESS_WRITE_CACHED(A, Am, An) do { if (RUNTIME_desc_iscached(A, Am, An)) __morse_need_submit = 1; } while(0)
# else
# warning "WAR dependencies need starpu_mpi_cached_receive support from StarPU 1.2.1 or greater"
# define RUNTIME_ACCESS_WRITE_CACHED(A, Am, An)
# endif
#if defined(CHAMELEON_USE_MPI) && defined(HAVE_STARPU_MPI_CACHED_RECEIVE)
static inline int
chameleon_starpu_data_iscached(const MORSE_desc_t *A, int Am, int An)
{
starpu_data_handle_t *ptrtile = (starpu_data_handle_t*)(A->schedopt);
ptrtile += ((int64_t)(A->lmt) * (int64_t)An + (int64_t)Am);
if (!(*ptrtile))
return 0;
return starpu_mpi_cached_receive(*ptrtile);
}
#define RUNTIME_ACCESS_WRITE_CACHED(A, Am, An) do { \
if (chameleon_starpu_data_iscached(A, Am, An)) __morse_need_submit = 1; } while(0)
#else
#define RUNTIME_ACCESS_WRITE_CACHED(A, Am, An)
#warning "WAR dependencies need starpu_mpi_cached_receive support from StarPU 1.2.1 or greater"
#define RUNTIME_ACCESS_WRITE_CACHED(A, Am, An) do {} while (0)
#endif
#ifdef CHAMELEON_ENABLE_PRUNING_STATS
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment