From e0121e906e3e47c1292a7ea1b7a0d5bdf83c6041 Mon Sep 17 00:00:00 2001 From: Daniel Arndt Date: Sun, 4 Dec 2022 19:15:09 -0500 Subject: [PATCH] Add test --- tests/base/kokkos_01.cc | 42 +++++++++++++++++++++++++++++++++++++ tests/base/kokkos_01.output | 2 ++ 2 files changed, 44 insertions(+) create mode 100644 tests/base/kokkos_01.cc create mode 100644 tests/base/kokkos_01.output diff --git a/tests/base/kokkos_01.cc b/tests/base/kokkos_01.cc new file mode 100644 index 0000000000..5abc787e5a --- /dev/null +++ b/tests/base/kokkos_01.cc @@ -0,0 +1,42 @@ +// --------------------------------------------------------------------- +// +// Copyright (C) 2022 by the deal.II authors +// +// This file is part of the deal.II library. +// +// The deal.II library is free software; you can use it, redistribute +// it, and/or modify it under the terms of the GNU Lesser General +// Public License as published by the Free Software Foundation; either +// version 2.1 of the License, or (at your option) any later version. +// The full text of the license can be found in the file LICENSE.md at +// the top level directory of deal.II. +// +// --------------------------------------------------------------------- + +// test that we can initialize and finalize Kokkos in user code. + +#include + +#include +#include + +#include "../tests.h" + +int +main() +{ + Kokkos::initialize(); + + initlog(); + + GrowingVectorMemory< + LinearAlgebra::distributed::Vector>{}; + GrowingVectorMemory< + LinearAlgebra::distributed::Vector>{}; + + Impl::ensure_kokkos_initialized(); + deallog << "Kokkos initialized by Kokkos: " << Impl::dealii_initialized_kokkos + << std::endl; + + Kokkos::finalize(); +} diff --git a/tests/base/kokkos_01.output b/tests/base/kokkos_01.output new file mode 100644 index 0000000000..147e64f753 --- /dev/null +++ b/tests/base/kokkos_01.output @@ -0,0 +1,2 @@ + +DEAL::Kokkos initialized by Kokkos: 0 -- 2.39.5