Commit 4ab7cc5c authored by PRUVOST Florent's avatar PRUVOST Florent

remove add_definitions from CMakeLists.txt to store definitions in morse_config.h file

parent 832bb76c
......@@ -414,7 +414,7 @@ if(NOT CHAMELEON_SIMULATION)
message("-- ${Blue}Add definition CHAMELEON_USE_CUDA"
" - Activate CUDA in Chameleon${ColourReset}")
set(EXTRA_LIBRARIES_CUDA)
add_definitions(-DCHAMELEON_USE_CUDA)
set (CHAMELEON_USE_CUDA 1)
if(CUDA_VERSION VERSION_LESS "3.0")
set(CUDA_HOST_COMPILATION_CPP OFF)
endif(CUDA_VERSION VERSION_LESS "3.0")
......@@ -443,7 +443,7 @@ if(NOT CHAMELEON_SIMULATION)
if (CUDA_CUBLAS_LIBRARIES)
message("-- ${Blue}Add definition CHAMELEON_USE_CUBLAS"
" - Use GPU kernels from cuBLAS${ColourReset}")
add_definitions(-DCHAMELEON_USE_CUBLAS)
set( CHAMELEON_USE_CUBLAS 1)
list(APPEND EXTRA_LIBRARIES_CUDA ${CUDA_CUBLAS_LIBRARIES})
list(APPEND EXTRA_LIBRARIES_CUDA ${CUDA_LIBRARIES}) # need CUDA libs to link.
else()
......@@ -458,7 +458,7 @@ if(NOT CHAMELEON_SIMULATION)
endif()
#FindHeader(CUDA cublas_v2.h)
#if(CUDA_cublas_v2.h_DIRS)
#add_definitions(-DCHAMELEON_USE_CUBLAS_V2)
#set (CHAMELEON_USE_CUBLAS_V2 1)
#endif()
endif (CUDA_FOUND)
......@@ -472,7 +472,7 @@ if(NOT CHAMELEON_SIMULATION)
if ( MAGMA_FOUND )
message("-- ${Blue}Add definition CHAMELEON_USE_MAGMA"
" - Use GPU kernels from MAGMA${ColourReset}")
add_definitions(-DCHAMELEON_USE_MAGMA)
set (CHAMELEON_USE_MAGMA 1)
if(MAGMA_INCLUDE_DIRS)
include_directories(${MAGMA_INCLUDE_DIRS})
endif()
......@@ -518,7 +518,7 @@ if(NOT CHAMELEON_SIMULATION)
if (MPI_C_FOUND)
message("-- ${Blue}Add definition CHAMELEON_USE_MPI"
" - Activate MPI in Chameleon${ColourReset}")
add_definitions(-DCHAMELEON_USE_MPI)
set (CHAMELEON_USE_MPI 1)
list(APPEND EXTRA_LIBRARIES ${MPI_C_LIBRARIES} )
include_directories( ${MPI_C_INCLUDE_PATH} )
# tests for intel mpi
......@@ -545,7 +545,7 @@ else (NOT CHAMELEON_SIMULATION)
message("-- ${Blue}Add definition CHAMELEON_SIMULATION"
" - Activate simulation mode in Chameleon (to use with StarPU+SimGrid)${ColourReset}")
add_definitions(-DCHAMELEON_SIMULATION)
set (CHAMELEON_SIMULATION 1)
add_subdirectory(simucore)
......@@ -570,10 +570,10 @@ else (NOT CHAMELEON_SIMULATION)
# Add CUDA definition if required
if (CHAMELEON_USE_CUDA)
add_definitions(-DCHAMELEON_USE_CUDA)
set (CHAMELEON_USE_CUDA 1)
# Add MAGMA definition if required
if (CHAMELEON_USE_MAGMA)
add_definitions(-DCHAMELEON_USE_MAGMA)
set (CHAMELEON_USE_MAGMA 1)
endif()
endif()
......@@ -639,7 +639,7 @@ else (NOT CHAMELEON_SIMULATION)
if (MPI_C_FOUND)
message("-- ${Blue}Add definition CHAMELEON_USE_MPI"
" - Activate MPI in Chameleon${ColourReset}")
add_definitions(-DCHAMELEON_USE_MPI)
set (CHAMELEON_USE_MPI 1)
list(APPEND EXTRA_LIBRARIES ${MPI_C_LIBRARIES} )
include_directories( ${MPI_C_INCLUDE_PATH} )
if(MPI_C_LINK_FLAGS)
......@@ -682,7 +682,7 @@ if( CHAMELEON_SCHED_STARPU )
if ( STARPU_FOUND )
message("-- ${Blue}Add definition CHAMELEON_SCHED_STARPU"
" - Activate StarPU in Chameleon${ColourReset}")
add_definitions(-DCHAMELEON_SCHED_STARPU) # TODO: remove that
set (CHAMELEON_SCHED_STARPU 1)
include_directories(${STARPU_INCLUDE_DIRS_DEP})
if(STARPU_LINKER_FLAGS)
list(APPEND CMAKE_EXE_LINKER_FLAGS "${STARPU_LINKER_FLAGS}")
......@@ -703,17 +703,17 @@ if( CHAMELEON_SCHED_STARPU )
string(REPLACE ";" " " CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS}")
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)
set (CHAMELEON_USE_STARPU_IDLE_PREFETCH 1)
message("-- ${Blue}Add definition CHAMELEON_USE_STARPU_IDLE_PREFETCH${ColourReset}")
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)
set (CHAMELEON_USE_STARPU_DATA_WONT_USE 1)
message("-- ${Blue}Add definition CHAMELEON_USE_STARPU_DATA_WONT_USE${ColourReset}")
endif()
check_function_exists(starpu_malloc_on_node_set_default_flags STARPU_MALLOC_ON_NODE_SET_DEFAULT_FLAGS)
if ( STARPU_MALLOC_ON_NODE_SET_DEFAULT_FLAGS )
add_definitions(-DCHAMELEON_USE_STARPU_MALLOC_ON_NODE_SET_DEFAULT_FLAGS)
set (CHAMELEON_USE_STARPU_MALLOC_ON_NODE_SET_DEFAULT_FLAGS 1)
message("-- ${Blue}Add definition CHAMELEON_USE_STARPU_MALLOC_ON_NODE_SET_DEFAULT_FLAGS${ColourReset}")
endif()
if(CHAMELEON_ENABLE_TRACING)
......@@ -723,7 +723,7 @@ if( CHAMELEON_SCHED_STARPU )
if ( STARPU_FXT_START_PROFILING_FOUND )
message("-- ${Blue}Add definition HAVE_STARPU_FXT_PROFILING"
" - Activate FxT profiling through StarPU${ColourReset}")
add_definitions(-DHAVE_STARPU_FXT_PROFILING)
set (HAVE_STARPU_FXT_PROFILING 1)
else()
message("-- ${Red}Looking for starpu with fxt"
" - starpu_fxt_start_profiling() test fails in StarPU${ColourReset}")
......@@ -737,7 +737,7 @@ if( CHAMELEON_SCHED_STARPU )
if ( STARPU_MPI_DATA_REGISTER_FOUND )
message("-- ${Blue}Add definition HAVE_STARPU_MPI_DATA_REGISTER - Activate"
" use of starpu_mpi_data_register() in Chameleon with StarPU${ColourReset}")
add_definitions(-DHAVE_STARPU_MPI_DATA_REGISTER)
set (HAVE_STARPU_MPI_DATA_REGISTER 1)
else()
message("-- ${Red}Looking for starpu with starpu_mpi_data_register"
" - starpu_mpi_data_register() test fails in StarPU${ColourReset}")
......@@ -748,7 +748,7 @@ if( CHAMELEON_SCHED_STARPU )
if ( STARPU_MPI_COMM_RANK_FOUND )
message("-- ${Blue}Add definition HAVE_STARPU_MPI_COMM_RANK - Activate"
" use of starpu_mpi_comm_rank() in Chameleon with StarPU${ColourReset}")
add_definitions(-DHAVE_STARPU_MPI_COMM_RANK)
set (HAVE_STARPU_MPI_COMM_RANK 1)
else()
message("-- ${Red}Looking for starpu with starpu_mpi_comm_rank"
" - starpu_mpi_comm_rank() test fails in StarPU${ColourReset}")
......@@ -864,7 +864,7 @@ if( CHAMELEON_SCHED_PARSEC )
message("-- ${Blue}Add definition CHAMELEON_SCHED_PARSEC"
" - Activate PaRSEC in Chameleon${ColourReset}")
add_definitions(-DCHAMELEON_SCHED_PARSEC) # TODO: remove that
set (CHAMELEON_SCHED_PARSEC 1)
include_directories(${PARSEC_INCLUDE_DIRS_DEP})
include_directories(${PARSEC_INCLUDE_DIRS}/daguepp)
set(CMAKE_REQUIRED_INCLUDES "${PARSEC_INCLUDE_DIRS_DEP}")
......@@ -940,7 +940,7 @@ if( CHAMELEON_SCHED_QUARK )
if(QUARK_FOUND)
message("-- ${Blue}Add definition CHAMELEON_SCHED_QUARK"
" - Activate QUARK in Chameleon${ColourReset}")
add_definitions(-DCHAMELEON_SCHED_QUARK) # TODO: remove that
set (CHAMELEON_SCHED_QUARK 1)
include_directories(${QUARK_INCLUDE_DIRS})
if(QUARK_LIBRARY_DIRS)
# the RPATH to be used when installing
......@@ -992,24 +992,25 @@ endif()
# ------------------------------------------------------------------
message("-- ${Blue}Add definition ADD_"
" - For Fortran mangling${ColourReset}")
add_definitions(-DADD_)
set (ADD_ 1)
#------------------------------------------------------------------------------
if(CHAMELEON_SCHED_STARPU)
link_directories(${STARPU_LIBRARY_DIRS_DEP})
elseif(CHAMELEON_SCHED_PARSEC)
link_directories(${PARSEC_LIBRARY_DIRS_DEP})
elseif(CHAMELEON_SCHED_QUARK)
link_directories(${QUARK_LIBRARY_DIRS})
if(CHAMELEON_SCHED_STARPU)
link_directories(${STARPU_LIBRARY_DIRS_DEP})
elseif(CHAMELEON_SCHED_PARSEC)
link_directories(${PARSEC_LIBRARY_DIRS_DEP})
elseif(CHAMELEON_SCHED_QUARK)
link_directories(${QUARK_LIBRARY_DIRS})
endif()
if(NOT CHAMELEON_SIMULATION)
if(CHAMELEON_USE_CUDA)
link_directories(${CUDA_LIBRARY_DIRS})
endif()
if(NOT CHAMELEON_SIMULATION)
if(CHAMELEON_USE_CUDA)
link_directories(${CUDA_LIBRARY_DIRS})
endif()
if(CHAMELEON_USE_MAGMA)
link_directories(${MAGMA_LIBRARY_DIRS})
endif()
if(CHAMELEON_USE_MAGMA)
link_directories(${MAGMA_LIBRARY_DIRS})
endif()
endif()
# Save extra dependencies (all required links)
list(APPEND CHAMELEON_DEP ${EXTRA_LIBRARIES})
list(REMOVE_DUPLICATES CHAMELEON_DEP) # WARNING: is it safe, respect order?
......
......@@ -40,6 +40,9 @@ set(ZHDR
precisions_rules_py(CHAMELEON_HDRS_GENERATED "${ZHDR}"
PRECISIONS "z;c;d;s;zc;ds")
configure_file("morse_config.h.in"
"morse_config.h"
@ONLY)
configure_file("morse.h.in"
"morse.h"
@ONLY)
......@@ -52,6 +55,7 @@ set(CHAMELEON_HDRS
morse_simulate.h
morse_struct.h
morse_types.h
morse_config.h
morse.h
runtime.h
${CHAMELEON_HDRS_GENERATED}
......@@ -79,7 +83,7 @@ set(HDR_INSTALL
foreach( hdr_file ${CHAMELEON_HDRS_GENERATED} )
list(APPEND HDR_INSTALL ${CMAKE_CURRENT_BINARY_DIR}/${hdr_file})
endforeach()
list(APPEND HDR_INSTALL ${CMAKE_CURRENT_BINARY_DIR}/morse.h)
list(APPEND HDR_INSTALL ${CMAKE_CURRENT_BINARY_DIR}/morse.h ${CMAKE_CURRENT_BINARY_DIR}/morse_config.h)
# installation
# ------------
......
......@@ -32,14 +32,11 @@
#define MORSE_VERSION_MINOR @MORSE_VERSION_MINOR@
#define MORSE_VERSION_MICRO @MORSE_VERSION_MICRO@
#define CHAMELEON_VERSION_MAJOR @CHAMELEON_VERSION_MAJOR@
#define CHAMELEON_VERSION_MINOR @CHAMELEON_VERSION_MINOR@
#define CHAMELEON_VERSION_MICRO @CHAMELEON_VERSION_MICRO@
/* ****************************************************************************
* MORSE types and constants
*/
#include "morse_config.h"
#include "morse_types.h"
#include "morse_struct.h"
#include "morse_constants.h"
......
/**
*
* @copyright (c) 2009-2014 The University of Tennessee and The University
* of Tennessee Research Foundation.
* All rights reserved.
* @copyright (c) 2012-2017 Inria. All rights reserved.
* @copyright (c) 2012-2015 Bordeaux INP, CNRS (LaBRI UMR 5800), Inria, Univ. Bordeaux. All rights reserved.
*
**/
/**
*
* @file chameleon.h
*
* MORSE main header
* 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 0.9.1
* @author Florent Pruvost
* @date 2017-01-06
*
**/
#ifndef MORSE_CONFIG_H_HAS_BEEN_INCLUDED
#define MORSE_CONFIG_H_HAS_BEEN_INCLUDED
#define CHAMELEON_VERSION_MAJOR @CHAMELEON_VERSION_MAJOR@
#define CHAMELEON_VERSION_MINOR @CHAMELEON_VERSION_MINOR@
#define CHAMELEON_VERSION_MICRO @CHAMELEON_VERSION_MICRO@
/* Scheduling engine */
#cmakedefine CHAMELEON_SCHED_QUARK
#cmakedefine CHAMELEON_SCHED_PARSEC
#cmakedefine CHAMELEON_SCHED_STARPU
/* Communication engine */
#cmakedefine CHAMELEON_USE_MPI
/* GPU Support */
#cmakedefine CHAMELEON_USE_CUDA
#cmakedefine CHAMELEON_USE_CUBLAS
#cmakedefine CHAMELEON_USE_CUBLAS_V2
#cmakedefine CHAMELEON_USE_MAGMA
/* For BLAS Fortran mangling */
#cmakedefine ADD_
/* Profiling */
#cmakedefine HAVE_STARPU_FXT_PROFILING
/* Simulating */
#cmakedefine CHAMELEON_SIMULATION
/* Optional functions */
#cmakedefine CBLAS_HAS_ZGEMM3M
#cmakedefine CBLAS_HAS_CGEMM3M
#cmakedefine HAVE_MAGMA_GETRF_INCPIV_GPU
#cmakedefine CHAMELEON_USE_STARPU_IDLE_PREFETCH
#cmakedefine CHAMELEON_USE_STARPU_DATA_WONT_USE
#cmakedefine CHAMELEON_USE_STARPU_MALLOC_ON_NODE_SET_DEFAULT_FLAGS
#cmakedefine HAVE_STARPU_MPI_DATA_REGISTER
#cmakedefine HAVE_STARPU_MPI_COMM_RANK
#endif /*MORSE_CONFIG_H_HAS_BEEN_INCLUDED */
......@@ -33,11 +33,12 @@
/** ****************************************************************************
* RUNTIME headers to include types of :
* - QUARK
* - PaRSEC
* - StarPU
**/
typedef enum morse_sched_e {
RUNTIME_SCHED_PARSEC,
RUNTIME_SCHED_QUARK,
RUNTIME_SCHED_PARSEC,
RUNTIME_SCHED_STARPU,
} MORSE_sched_t;
......
......@@ -36,7 +36,7 @@ if ( CBLAS_FOUND AND LAPACKE_FOUND AND LAPACK_FOUND AND CUDA_FOUND AND CUDA_CUBL
check_function_exists(magma_dgetrf_incpiv_gpu MAGMA_DGETRF_INCPIV_GPU_FOUND)
if ( MAGMA_DGETRF_INCPIV_GPU_FOUND )
message(STATUS "Set HAVE_MAGMA_GETRF_INCPIV_GPU")
add_definitions(-DHAVE_MAGMA_GETRF_INCPIV_GPU)
set (HAVE_MAGMA_GETRF_INCPIV_GPU 1)
endif()
endif()
......
......@@ -16,7 +16,7 @@
void RUNTIME_context_create(MORSE_context_t *morse)
{
/* In case of PaRSEC, this is done in init */
morse->scheduler = CHAMELEON_SCHED_PARSEC;
morse->scheduler = RUNTIME_SCHED_PARSEC;
return;
}
......
......@@ -36,7 +36,7 @@ if ( CBLAS_FOUND AND LAPACKE_FOUND AND LAPACK_FOUND AND CUDA_FOUND AND CUDA_CUBL
check_function_exists(magma_dgetrf_incpiv_gpu MAGMA_DGETRF_INCPIV_GPU_FOUND)
if ( MAGMA_DGETRF_INCPIV_GPU_FOUND )
message(STATUS "Set HAVE_MAGMA_GETRF_INCPIV_GPU")
add_definitions(-DHAVE_MAGMA_GETRF_INCPIV_GPU)
set (HAVE_MAGMA_GETRF_INCPIV_GPU 1)
endif()
endif()
......
......@@ -36,7 +36,7 @@ void RUNTIME_context_create( MORSE_context_t *morse )
{
starpu_conf_t *conf;
morse->scheduler = CHAMELEON_SCHED_STARPU;
morse->scheduler = RUNTIME_SCHED_STARPU;
if (! _starpu_is_initialized() ) {
morse->schedopt = (void*) malloc (sizeof(struct starpu_conf));
......
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