forked from kokkos/kokkos-kernels
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Initial support for SuperLU TPL: Issue kokkos#545
- Loading branch information
jjwilke
committed
Dec 18, 2019
1 parent
93a6787
commit 95ceb0a
Showing
6 changed files
with
77 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
TRIBITS_PACKAGE_DEFINE_DEPENDENCIES( | ||
LIB_REQUIRED_PACKAGES KokkosCore KokkosContainers KokkosAlgorithms | ||
LIB_OPTIONAL_TPLS quadmath MKL BLAS LAPACK CUSPARSE MAGMA | ||
LIB_OPTIONAL_TPLS quadmath MKL BLAS LAPACK CUSPARSE MAGMA SuperLU | ||
TEST_OPTIONAL_TPLS yaml-cpp | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
#This assume SuperLU >= 5.0. We don't worry about older versions. | ||
KOKKOSKERNELS_FIND_IMPORTED(SUPERLU LIBRARY superlu HEADER supermatrix.h) | ||
SET(SUPERLU_LIBS KokkosKernels::SUPERLU) | ||
IF (TARGET KokkosKernels::BLAS) #This is an interface library | ||
#I don't like doing this since it breaks the abstraction of | ||
#a target is just a thing we link to. CMake doesn't allow | ||
#us to pass in interface targets to try_compile | ||
GET_TARGET_PROPERTY(SUPERLU_BLAS_LIBS KokkosKernels::BLAS INTERFACE_LINK_LIBRARIES) | ||
LIST(APPEND SUPERLU_LIBS ${SUPERLU_BLAS_LIBS}) | ||
ENDIF() | ||
IF (TARGET KokkosKernels::LAPACK) | ||
#I don't like doing this since it breaks the abstraction of | ||
#a target is just a thing we link to try_compile | ||
GET_TARGET_PROPERTY(SUPERLU_LAPACK_LIBS KokkosKernels::LAPACK INTERFACE_LINK_LIBRARIES) | ||
LIST(APPEND SUPERLU_LIBS ${SUPERLU_LAPACK_LIBS}) | ||
ENDIF() | ||
|
||
TRY_COMPILE(SUPERLU_COMPILE_SUCCEEDS) | ||
${KOKKOSKERNELS_TOP_BUILD_DIR}/tpl_tests | ||
${KOKKOSKERNELS_TOP_SOURCE_DIR}/cmake/compile_tests/superlu_test.cpp | ||
LINK_LIBRARIES ${SUPERLU_LIBS} | ||
) | ||
|
||
IF (NOT SUPERLU_COMPILE_SUCCEEDS) | ||
MESSAGE(WARNING "SuperLU failed to correctly compile test." | ||
" The most likely failure is missing or incorrect BLAS libraries" | ||
" Please ensure that KokkosKernels is built with same BLAS as SuperLU") | ||
IF (TARGET KokkosKernels::BLAS) | ||
MESSAGE(WARNING "KokkosKernels is using BLAS: ${SUPERLU_BLAS_LIBS}") | ||
ENDIF() | ||
IF (TARGET KokkosKernels::LAPACK) | ||
MESSAGE(WARNING "KokkosKernels is using LAPACK: ${SUPERLU_LAPACK_LIBS}") | ||
ENDIF() | ||
INCLUDE(FindPackageHandleStandardArgs) | ||
FIND_PACKAGE_HANDLE_STANDARD_ARGS(TPLSUPERLU DEFAULT_MSG SUPERLU_CORRECT) | ||
ENDIF() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
#include <slu_ddefs.h> | ||
|
||
int main() | ||
{ | ||
GlobalLU_t lu; | ||
superlu_options_t opt; | ||
SuperMatrix M; | ||
int *i; | ||
double *d; | ||
void *v; | ||
char *c; | ||
SuperLUStat_t stat; | ||
mem_usage_t mem; | ||
|
||
dgsisx(&opt,&M,i,i,i,c,d,d,&M,&M,v,*i,&M,&M,d,d,&lu,&mem,&stat,i); | ||
return 0; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
#include <slu_ddefs.h> | ||
|
||
int main() | ||
{ | ||
GlobalLU_t lu; | ||
superlu_options_t opt; | ||
SuperMatrix M; | ||
int *i; | ||
double *d; | ||
void *v; | ||
char *c; | ||
SuperLUStat_t stat; | ||
mem_usage_t mem; | ||
|
||
dgsisx(&opt,&M,i,i,i,c,d,d,&M,&M,v,*i,&M,&M,d,d,&lu,&mem,&stat,i); | ||
return 0; | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters