diff --git a/CMakeLists.txt b/CMakeLists.txt index 4fdf9e3eba332522e1840be40c8cc04f9fed5247..10fd879878ab989c6fdc933d777107e9a370302f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -4,7 +4,7 @@ # 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. +# @copyright (c) 2012-2015 Bordeaux INP, CNRS (LaBRI UMR 5800), Inria, Univ. Bordeaux. All rights reserved. # ### # @@ -563,6 +563,15 @@ if (MORSE_DISTRIB_DIR OR EXISTS "${CMAKE_SOURCE_DIR}/cmake_modules/") list(APPEND CMAKE_REQUIRED_FLAGS "-L${libdir}") endforeach() string(REPLACE ";" " " CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS}") + set(CMAKE_REQUIRED_LIBRARIES "${STARPU_SHM_LIBRARIES}") + check_function_exists(starpu_data_idle_prefetch_on_node STARPU_IDLE_PREFETCH_FOUND) + if ( STARPU_IDLE_PREFETCH_FOUND ) + add_definitions(-DCHAMELEON_USE_STARPU_IDLE_PREFETCH) + endif() + check_function_exists(starpu_data_wont_use STARPU_DATA_WONT_USE_FOUND) + if ( STARPU_DATA_WONT_USE_FOUND ) + add_definitions(-DCHAMELEON_USE_STARPU_DATA_WONT_USE) + endif() if(CHAMELEON_USE_FXT) # check if fxt profiling is accessible in starpu and activate it in chameleon set(CMAKE_REQUIRED_LIBRARIES "${STARPU_SHM_LIBRARIES}") diff --git a/runtime/starpu/codelets/codelet_dataflush.c b/runtime/starpu/codelets/codelet_dataflush.c index eea2b90fb457e6e588879fb74fa78cac852e3d26..1debb4b6701d149c35d22874f457a4a863145f88 100644 --- a/runtime/starpu/codelets/codelet_dataflush.c +++ b/runtime/starpu/codelets/codelet_dataflush.c @@ -26,7 +26,8 @@ **/ #include "runtime/starpu/include/morse_starpu.h" -#ifdef CHAMELEON_USE_STARPU_IDLE_PREFETCH +#ifdef CHAMELEON_USE_STARPU_DATA_WONT_USE +#elif defined CHAMELEON_USE_STARPU_IDLE_PREFETCH static void data_flush(void *handle) { starpu_data_idle_prefetch_on_node(handle, STARPU_MAIN_RAM, 1); @@ -62,7 +63,9 @@ void MORSE_TASK_dataflush(MORSE_option_t *options, if ( A->myrank == A->get_rankof( A, Am, An ) ) { /* Push data to main memory when we have time to */ -#ifdef CHAMELEON_USE_STARPU_IDLE_PREFETCH +#ifdef CHAMELEON_USE_STARPU_DATA_WONT_USE + starpu_data_wont_use(*ptrtile); +#elif defined CHAMELEON_USE_STARPU_IDLE_PREFETCH starpu_data_acquire_on_node_cb(*ptrtile, -1, STARPU_R, data_flush, *ptrtile); #else starpu_data_acquire_cb(*ptrtile, STARPU_R, data_release, *ptrtile);