diff --git a/examples/matrixtile.h b/examples/matrixtile.h index 8e519db86..203c58bf2 100644 --- a/examples/matrixtile.h +++ b/examples/matrixtile.h @@ -19,12 +19,14 @@ inline void allocator_init(int argc, char **argv) { // initialize MADNESS so that TA allocators can be created #if defined(TTG_PARSEC_IMPORTED) madness::ParsecRuntime::initialize_with_existing_context(ttg::default_execution_context().impl().context()); -#endif // TTG_PARSEC_IMPORTED madness::initialize(argc, argv, /* nthread = */ 1, /* quiet = */ true); +#endif // TTG_PARSEC_IMPORTED } inline void allocator_fini() { +#if defined(TTG_PARSEC_IMPORTED) madness::finalize(); +#endif // TTG_PARSEC_IMPORTED } #else // TILEDARRAY_HAS_DEVICE template diff --git a/examples/spmm/spmm.cc b/examples/spmm/spmm.cc index 8118d9e4c..d2b7021af 100644 --- a/examples/spmm/spmm.cc +++ b/examples/spmm/spmm.cc @@ -1887,7 +1887,7 @@ int main(int argc, char **argv) { } } -#ifdef BTAS_IS_USABLE +#if defined(BTAS_IS_USABLE) && defined(TTG_PARSEC_IMPORTED) madness::finalize(); #endif // BTAS_IS_USABLE