]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Add test for CUDAWrappers::Vector::print
authorDaniel Arndt <daniel.arndt@iwr.uni-heidelberg.de>
Thu, 16 Aug 2018 21:04:34 +0000 (23:04 +0200)
committerDaniel Arndt <daniel.arndt@iwr.uni-heidelberg.de>
Thu, 16 Aug 2018 21:16:30 +0000 (23:16 +0200)
tests/cuda/cuda_vector_04.cu [new file with mode: 0644]
tests/cuda/cuda_vector_04.output [new file with mode: 0644]

diff --git a/tests/cuda/cuda_vector_04.cu b/tests/cuda/cuda_vector_04.cu
new file mode 100644 (file)
index 0000000..c97ee95
--- /dev/null
@@ -0,0 +1,57 @@
+// ---------------------------------------------------------------------
+//
+// Copyright (C) 2015 - 2016 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.
+//
+// ---------------------------------------------------------------------
+
+
+// Check LinearAlgebra::CUDAWrappers::Vector::print()
+
+#include <deal.II/base/utilities.h>
+
+#include <deal.II/lac/cuda_vector.h>
+#include <deal.II/lac/read_write_vector.h>
+
+#include <fstream>
+#include <iostream>
+
+#include "../tests.h"
+
+void
+test()
+{
+  const unsigned int                          size = 100;
+  LinearAlgebra::CUDAWrappers::Vector<double> cuda_vector(size);
+
+  LinearAlgebra::ReadWriteVector<double> read_write_1(size);
+  for (unsigned int i = 0; i < size; ++i)
+    {
+      read_write_1[i] = i;
+    }
+
+  cuda_vector.import(read_write_1, VectorOperation::insert);
+
+  cuda_vector.print(deallog.get_file_stream());
+}
+
+int
+main(int argc, char **argv)
+{
+  initlog();
+  deallog.depth_console(0);
+
+  test();
+
+  deallog << "OK" << std::endl;
+
+  return 0;
+}
diff --git a/tests/cuda/cuda_vector_04.output b/tests/cuda/cuda_vector_04.output
new file mode 100644 (file)
index 0000000..012f7ef
--- /dev/null
@@ -0,0 +1,104 @@
+
+IndexSet: {[0,99]}
+
+0.00e+00
+1.00e+00
+2.00e+00
+3.00e+00
+4.00e+00
+5.00e+00
+6.00e+00
+7.00e+00
+8.00e+00
+9.00e+00
+1.00e+01
+1.10e+01
+1.20e+01
+1.30e+01
+1.40e+01
+1.50e+01
+1.60e+01
+1.70e+01
+1.80e+01
+1.90e+01
+2.00e+01
+2.10e+01
+2.20e+01
+2.30e+01
+2.40e+01
+2.50e+01
+2.60e+01
+2.70e+01
+2.80e+01
+2.90e+01
+3.00e+01
+3.10e+01
+3.20e+01
+3.30e+01
+3.40e+01
+3.50e+01
+3.60e+01
+3.70e+01
+3.80e+01
+3.90e+01
+4.00e+01
+4.10e+01
+4.20e+01
+4.30e+01
+4.40e+01
+4.50e+01
+4.60e+01
+4.70e+01
+4.80e+01
+4.90e+01
+5.00e+01
+5.10e+01
+5.20e+01
+5.30e+01
+5.40e+01
+5.50e+01
+5.60e+01
+5.70e+01
+5.80e+01
+5.90e+01
+6.00e+01
+6.10e+01
+6.20e+01
+6.30e+01
+6.40e+01
+6.50e+01
+6.60e+01
+6.70e+01
+6.80e+01
+6.90e+01
+7.00e+01
+7.10e+01
+7.20e+01
+7.30e+01
+7.40e+01
+7.50e+01
+7.60e+01
+7.70e+01
+7.80e+01
+7.90e+01
+8.00e+01
+8.10e+01
+8.20e+01
+8.30e+01
+8.40e+01
+8.50e+01
+8.60e+01
+8.70e+01
+8.80e+01
+8.90e+01
+9.00e+01
+9.10e+01
+9.20e+01
+9.30e+01
+9.40e+01
+9.50e+01
+9.60e+01
+9.70e+01
+9.80e+01
+9.90e+01
+DEAL::OK

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.