From: Daniel Arndt Date: Mon, 5 Dec 2022 00:15:09 +0000 (-0500) Subject: Add test X-Git-Tag: v9.5.0-rc1~697^2~28 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e0121e906e3e47c1292a7ea1b7a0d5bdf83c6041;p=dealii.git Add test --- 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