Mentions légales du service

Skip to content
Snippets Groups Projects
Commit 2c1e236a authored by Mathieu Faverge's avatar Mathieu Faverge
Browse files

Add cmake structure to integrate hmat support

parent b5829dfe
No related branches found
No related tags found
1 merge request!203Integrate H-Mat support via hmat-oss
......@@ -197,6 +197,9 @@ if (CHAMELEON_ENABLE_CUDA AND NOT CHAMELEON_USE_CUDA)
message("-- ${BoldGreen}CHAMELEON_USE_CUDA is set to OFF, turn it ON to use CUDA (unsupported by Quark)${ColourReset}")
endif()
# Enable Hmat-OSS kernels
option(CHAMELEON_USE_HMAT "Enable hmat-oss kernels" OFF)
option(CHAMELEON_RUNTIME_SYNC "Enable synchronous task submission when available to debug the code without parallelism" OFF)
if (CHAMELEON_RUNTIME_SYNC)
message("-- ${BoldGreen}CHAMELEON_RUNTIME_SYNC is set to ON, turn it OFF to avoid synchronisation in the tasks submission${ColourReset}")
......@@ -262,6 +265,27 @@ mark_as_advanced(CHAMELEON_COPY_DIAG)
################################
add_subdirectory(hqr)
###############################################################################
# Build dependency HMAT-OSS library #
#####################################
if ( CHAMELEON_USE_HMAT )
find_package(HMAT REQUIRED)
if(HMAT_FOUND)
# hmat-oss target is not correctly defined
add_library(HMAT::hmat-oss INTERFACE IMPORTED)
set_target_properties(HMAT::hmat-oss PROPERTIES
INTERFACE_INCLUDE_DIRECTORIES "${HMAT_INCLUDE_DIRS}"
INTERFACE_COMPILE_DEFINITIONS "${HMAT_DEFINITIONS}"
INTERFACE_LINK_DIRECTORIES "${HMAT_LIBRARY_DIRS}"
INTERFACE_LINK_LIBRARIES "hmat-oss"
)
message( STATUS "HMAT: Found" )
else()
message( ERROR "HMAT: Not found" )
endif()
endif()
###############################################################################
# Look for dependencies #
#########################
......
......@@ -82,6 +82,7 @@ set(dep_message "${dep_message}"
" Kernels specific\n"
" BLAS ................: ${BLAS_VENDOR_FOUND}\n"
" LAPACK...............: ${LAPACK_VENDOR_FOUND}\n"
" HMAT-OSS.............: ${CHAMELEON_USE_HMAT}\n"
"\n"
" Simulation mode .....: ${CHAMELEON_SIMULATION}\n"
"\n"
......
......@@ -52,6 +52,7 @@ subs = {
('ChamPattern', 'ChamRealFloat', 'ChamRealDouble', 'ChamRealFloat', r'\bChamRealDouble' ),
('int', 'float', 'double', 'complex32', 'complex64' ),
('Int', 'Float', 'Double', 'Complex32', 'Complex64' ),
('Int', 'HMAT_SIMPLE_PRECISION','HMAT_DOUBLE_PRECISION','HMAT_SIMPLE_COMPLEX', 'HMAT_DOUBLE_COMPLEX'),
# ----- Additional BLAS
('', 'sTile', 'dTile', 'cTile', 'zTile' ),
......@@ -102,5 +103,7 @@ subs = {
# ('', 'stesting', 'dtesting', 'ctesting', 'ztesting' ),
# ('', 'SAUXILIARY', 'DAUXILIARY', 'CAUXILIARY', 'ZAUXILIARY' ),
# ('', 'sbuild', 'dbuild', 'cbuild', 'zbuild' ),
# Hmat-OSS kernels
('hmat_p', 'hmat_s', 'hmat_d', 'hmat_c', 'hmat_z' ),
]
}
......@@ -105,6 +105,10 @@ set(ZSRC
core_zunmqr.c
core_ztile.c
)
if( CHAMELEON_USE_HMAT )
list( APPEND ZSRC
hmat_z.c )
endif()
precisions_rules_py(COREBLAS_SRCS_GENERATED "${ZSRC}"
PRECISIONS "${CHAMELEON_PRECISION}")
......@@ -133,6 +137,10 @@ target_include_directories(coreblas PUBLIC
$<INSTALL_INTERFACE:include>)
set_property(TARGET coreblas PROPERTY INSTALL_NAME_DIR "${CMAKE_INSTALL_PREFIX}/lib")
if( CHAMELEON_USE_HMAT )
target_link_libraries(coreblas PUBLIC HMAT::hmat-oss )
endif()
target_link_libraries(coreblas PRIVATE MORSE::LAPACKE)
target_link_libraries(coreblas PRIVATE MORSE::CBLAS)
target_link_libraries(coreblas PUBLIC MORSE::M)
......
......@@ -34,6 +34,11 @@ set(ZHDR
coreblas/coreblas_zc.h
coreblas/coreblas_ztile.h
)
if( CHAMELEON_USE_HMAT )
list( APPEND ZHDR
coreblas/hmat_z.h )
endif()
precisions_rules_py(
COREBLAS_HDRS_GENERATED "${ZHDR}"
TARGETDIR coreblas
......@@ -49,6 +54,10 @@ set(COREBLAS_HDRS
coreblas/lapacke_mangling.h
coreblas/random.h
)
if( CHAMELEON_USE_HMAT )
list( APPEND COREBLAS_HDRS
coreblas/hmat.h )
endif()
# Add generated headers
# ---------------------
......
......@@ -51,6 +51,9 @@
#cmakedefine CHAMELEON_USE_CUBLAS
#cmakedefine CHAMELEON_USE_CUBLAS_V2
/* Hmat-oss */
#cmakedefine CHAMELEON_USE_HMAT
/* Simulation */
#cmakedefine CHAMELEON_SIMULATION
#cmakedefine CHAMELEON_SIMULATION_EXTENDED
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment