diff --git a/cmake/modules/FindOrFetchBoost.cmake b/cmake/modules/FindOrFetchBoost.cmake index 1e133eee0..34550ecac 100644 --- a/cmake/modules/FindOrFetchBoost.cmake +++ b/cmake/modules/FindOrFetchBoost.cmake @@ -23,6 +23,7 @@ if (TTG_PARSEC_USE_BOOST_SERIALIZATION) list(APPEND optional_components serialization iostreams + graph ) endif() diff --git a/examples/CMakeLists.txt b/examples/CMakeLists.txt index 10b808540..efcd398f9 100644 --- a/examples/CMakeLists.txt +++ b/examples/CMakeLists.txt @@ -7,10 +7,12 @@ add_ttg_executable(t9-streaming t9/t9_streaming.cc) # sparse matmul need Eigen ... it's always provided by TA if (TARGET tiledarray) # MADworld used for MADNESS serialization - add_ttg_executable(spmm spmm/spmm.cc LINK_LIBRARIES TiledArray_Eigen) + add_ttg_executable(spmm spmm/spmm.cc LINK_LIBRARIES TiledArray_Eigen $ + COMPILE_DEFINITIONS $<$,HAVE_BOOST_GRAPH=1>) # block-sparse needs BTAS ... it's always provided by TA # since only need to use matrices, limit BTAS_TARGET_MAX_INDEX_RANK to 2 - add_ttg_executable(bspmm spmm/spmm.cc LINK_LIBRARIES tiledarray TiledArray_Eigen BTAS COMPILE_DEFINITIONS BLOCK_SPARSE_GEMM=1;BTAS_TARGET_MAX_INDEX_RANK=2) + add_ttg_executable(bspmm spmm/spmm.cc LINK_LIBRARIES tiledarray TiledArray_Eigen BTAS + COMPILE_DEFINITIONS BLOCK_SPARSE_GEMM=1;BTAS_TARGET_MAX_INDEX_RANK=2) add_ttg_executable(testing_dpotrf potrf/testing_dpotrf.cc LINK_LIBRARIES tiledarray lapackpp) add_ttg_executable(testing_dtrtri potrf/testing_dtrtri.cc LINK_LIBRARIES tiledarray lapackpp) @@ -37,12 +39,12 @@ if (TARGET tiledarray) if (TARGET roc::hipsolver) add_ttg_executable(testing_dpotrf_hip potrf/testing_dpotrf.cc LINK_LIBRARIES lapackpp tiledarray roc::hipblas roc::hipsolver - COMPILE_DEFINITIONS TTG_ENABLE_HIP=1;DEBUG_TILES_VALUES=1 + COMPILE_DEFINITIONS TTG_ENABLE_HIP=1 #;DEBUG_TILES_VALUES=1 RUNTIMES "parsec") endif(TARGET roc::hipsolver) elseif (TARGET MKL::MKL_DPCPP) add_ttg_executable(bspmm-lz spmm/spmm_cuda.cc - LINK_LIBRARIES tiledarray TiledArray_Eigen BTAS MKL::MKL_DPCPP level_zero::ze_loader m + LINK_LIBRARIES tiledarray TiledArray_Eigen BTAS MKL::MKL_DPCPP level_zero::ze_loader m Boost::graph COMPILE_DEFINITIONS BLOCK_SPARSE_GEMM=1;BTAS_TARGET_MAX_INDEX_RANK=2 RUNTIMES "parsec") endif() diff --git a/examples/spmm/spmm.cc b/examples/spmm/spmm.cc index 0c85eb3d4..e61bbffa3 100644 --- a/examples/spmm/spmm.cc +++ b/examples/spmm/spmm.cc @@ -21,8 +21,8 @@ #endif #include -#include #if !defined(BLOCK_SPARSE_GEMM) +#include #include #include #include @@ -1104,6 +1104,7 @@ static void initSpMatrixMarket(const std::function &)> &keymap, K = (int)A.cols(); } +#ifdef HAVE_BOOST_GRAPH static void initSpRmat(const std::function &)> &keymap, const char *opt, SpMatrix<> &A, SpMatrix<> &B, SpMatrix<> &C, int &M, int &N, int &K, unsigned long seed) { int E; @@ -1160,6 +1161,7 @@ static void initSpRmat(const std::function &)> &keymap, const c std::cout << "#R-MAT: " << E << " nonzero elements, density: " << (double)nnz / (double)N / (double)N << std::endl; } } +#endif // HAVE_BOOST_GRAPH static void initSpHardCoded(const std::function &)> &keymap, SpMatrix<> &A, SpMatrix<> &B, SpMatrix<> &C, int &m, int &n, int &k) { @@ -1802,10 +1804,12 @@ int main(int argc, char **argv) { char *filename = getCmdOption(argv, argv + argc, "-mm"); tiling_type = filename; initSpMatrixMarket(ij_keymap, filename, A, B, C, M, N, K); +#ifdef HAVE_BOOST_GRAPH } else if (cmdOptionExists(argv, argv + argc, "-rmat")) { char *opt = getCmdOption(argv, argv + argc, "-rmat"); tiling_type = "RandomSparseMatrix"; initSpRmat(ij_keymap, opt, A, B, C, M, N, K, seed); +#endif // HAVE_BOOST_GRAPH } else { tiling_type = "HardCodedSparseMatrix"; initSpHardCoded(ij_keymap, A, B, C, M, N, K);