]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Test matrix-free CUDA for float 9147/head
authorDaniel Arndt <arndtd@ornl.gov>
Thu, 5 Dec 2019 20:43:00 +0000 (20:43 +0000)
committerDaniel Arndt <arndtd@ornl.gov>
Fri, 6 Dec 2019 14:12:46 +0000 (09:12 -0500)
22 files changed:
include/deal.II/matrix_free/cuda_matrix_free.templates.h
tests/cuda/matrix_free_matrix_vector_01.cu
tests/cuda/matrix_free_matrix_vector_01.output
tests/cuda/matrix_free_matrix_vector_02.cu
tests/cuda/matrix_free_matrix_vector_02.output
tests/cuda/matrix_free_matrix_vector_03.cu
tests/cuda/matrix_free_matrix_vector_03.output
tests/cuda/matrix_free_matrix_vector_03b.cu
tests/cuda/matrix_free_matrix_vector_03b.output
tests/cuda/matrix_free_matrix_vector_04.cu
tests/cuda/matrix_free_matrix_vector_04.output
tests/cuda/matrix_free_matrix_vector_05.cu
tests/cuda/matrix_free_matrix_vector_05.output
tests/cuda/matrix_free_matrix_vector_06.cu
tests/cuda/matrix_free_matrix_vector_06.output
tests/cuda/matrix_free_matrix_vector_06a.cu
tests/cuda/matrix_free_matrix_vector_06a.output
tests/cuda/matrix_free_matrix_vector_06b.cu
tests/cuda/matrix_free_matrix_vector_06b.output
tests/cuda/matrix_free_matrix_vector_09.cu
tests/cuda/matrix_free_matrix_vector_09.output
tests/cuda/matrix_vector_common.h

index 9900fe10e2a648141f480e238789ba7b75a3b24c..a7ea5cd2b38793916aac2b571dbb3564190a4b33 100644 (file)
@@ -381,9 +381,9 @@ namespace CUDAWrappers
         {
           const std::vector<Point<dim>> &q_points =
             fe_values.get_quadrature_points();
-          memcpy(&q_points_host[cell_id * padding_length],
-                 q_points.data(),
-                 q_points_per_cell * sizeof(Point<dim>));
+          std::copy(q_points.begin(),
+                    q_points.end(),
+                    &q_points_host[cell_id * padding_length]);
         }
 
       if (update_flags & update_JxW_values)
@@ -398,9 +398,11 @@ namespace CUDAWrappers
         {
           const std::vector<DerivativeForm<1, dim, dim>> &inv_jacobians =
             fe_values.get_inverse_jacobians();
-          memcpy(&inv_jacobian_host[cell_id * padding_length * dim * dim],
-                 inv_jacobians.data(),
-                 q_points_per_cell * sizeof(DerivativeForm<1, dim, dim>));
+          std::copy(&inv_jacobians[0][0][0],
+                    &inv_jacobians[0][0][0] +
+                      q_points_per_cell * sizeof(DerivativeForm<1, dim, dim>) /
+                        sizeof(double),
+                    &inv_jacobian_host[cell_id * padding_length * dim * dim]);
         }
     }
 
index ce08bb12f1965ee53fb78b3951a7eca62bb88aa2..6a0f58dad58a33f9ef64178f8fbc50c20cf94154 100644 (file)
 // constraints
 
 #include "../tests.h"
-
-std::ofstream logfile("output");
-
 #include "matrix_vector_common.h"
 
-
-template <int dim, int fe_degree>
+template <int dim, int fe_degree, typename Number>
 void
 test()
 {
@@ -38,12 +34,12 @@ test()
   FE_Q<dim>       fe(fe_degree);
   DoFHandler<dim> dof(tria);
   dof.distribute_dofs(fe);
-  AffineConstraints<double> constraints;
+  AffineConstraints<Number> constraints;
   constraints.close();
 
   do_test<dim,
           fe_degree,
-          double,
-          LinearAlgebra::CUDAWrappers::Vector<double>,
+          Number,
+          LinearAlgebra::CUDAWrappers::Vector<Number>,
           fe_degree + 1>(dof, constraints, tria.n_active_cells());
 }
index 43ef13cd754847276775ad0edd4edc6128e9942f..6497d6d888ee3b7bcb855b18ba7af9a78e3593e0 100644 (file)
@@ -1,19 +1,37 @@
 
-DEAL:2d::Testing FE_Q<2>(1)
-DEAL:2d::Norm of difference: 0
-DEAL:2d::
-DEAL:2d::Testing FE_Q<2>(2)
-DEAL:2d::Norm of difference: 0
-DEAL:2d::
-DEAL:2d::Testing FE_Q<2>(3)
-DEAL:2d::Norm of difference: 0
-DEAL:2d::
-DEAL:3d::Testing FE_Q<3>(1)
-DEAL:3d::Norm of difference: 0
-DEAL:3d::
-DEAL:3d::Testing FE_Q<3>(2)
-DEAL:3d::Norm of difference: 0
-DEAL:3d::
-DEAL:3d::Testing FE_Q<3>(3)
-DEAL:3d::Norm of difference: 0
-DEAL:3d::
+DEAL:double:2d::Testing FE_Q<2>(1)
+DEAL:double:2d::Norm of difference: 1.54e-15
+DEAL:double:2d::
+DEAL:double:2d::Testing FE_Q<2>(2)
+DEAL:double:2d::Norm of difference: 2.38e-15
+DEAL:double:2d::
+DEAL:double:2d::Testing FE_Q<2>(3)
+DEAL:double:2d::Norm of difference: 9.36e-15
+DEAL:double:2d::
+DEAL:double:3d::Testing FE_Q<3>(1)
+DEAL:double:3d::Norm of difference: 1.78e-15
+DEAL:double:3d::
+DEAL:double:3d::Testing FE_Q<3>(2)
+DEAL:double:3d::Norm of difference: 4.05e-15
+DEAL:double:3d::
+DEAL:double:3d::Testing FE_Q<3>(3)
+DEAL:double:3d::Norm of difference: 2.13e-14
+DEAL:double:3d::
+DEAL:float:2d::Testing FE_Q<2>(1)
+DEAL:float:2d::Norm of difference: 1.42e-15
+DEAL:float:2d::
+DEAL:float:2d::Testing FE_Q<2>(2)
+DEAL:float:2d::Norm of difference: 2.49e-15
+DEAL:float:2d::
+DEAL:float:2d::Testing FE_Q<2>(3)
+DEAL:float:2d::Norm of difference: 9.43e-15
+DEAL:float:2d::
+DEAL:float:3d::Testing FE_Q<3>(1)
+DEAL:float:3d::Norm of difference: 1.25e-15
+DEAL:float:3d::
+DEAL:float:3d::Testing FE_Q<3>(2)
+DEAL:float:3d::Norm of difference: 4.01e-15
+DEAL:float:3d::
+DEAL:float:3d::Testing FE_Q<3>(3)
+DEAL:float:3d::Norm of difference: 2.37e-14
+DEAL:float:3d::
index 166b73cf87044a4f5e2bd48c97c08ccebdad51d9..2f20b805f4b15bc7668fc1b6c54dd8d6ad1483e9 100644 (file)
 #include <deal.II/base/function.h>
 
 #include "../tests.h"
-
-std::ofstream logfile("output");
-
 #include "matrix_vector_common.h"
 
-
-template <int dim, int fe_degree>
+template <int dim, int fe_degree, typename Number>
 void
 test()
 {
@@ -38,7 +34,7 @@ test()
   FE_Q<dim>       fe(fe_degree);
   DoFHandler<dim> dof(tria);
   dof.distribute_dofs(fe);
-  AffineConstraints<double> constraints;
+  AffineConstraints<Number> constraints;
   VectorTools::interpolate_boundary_values(dof,
                                            0,
                                            Functions::ZeroFunction<dim>(),
@@ -47,7 +43,7 @@ test()
 
   do_test<dim,
           fe_degree,
-          double,
-          LinearAlgebra::CUDAWrappers::Vector<double>,
+          Number,
+          LinearAlgebra::CUDAWrappers::Vector<Number>,
           fe_degree + 1>(dof, constraints, tria.n_active_cells());
 }
index 43ef13cd754847276775ad0edd4edc6128e9942f..bbd6a6cc7aa69d19920a9ff3a6b3259f821acf2f 100644 (file)
@@ -1,19 +1,37 @@
 
-DEAL:2d::Testing FE_Q<2>(1)
-DEAL:2d::Norm of difference: 0
-DEAL:2d::
-DEAL:2d::Testing FE_Q<2>(2)
-DEAL:2d::Norm of difference: 0
-DEAL:2d::
-DEAL:2d::Testing FE_Q<2>(3)
-DEAL:2d::Norm of difference: 0
-DEAL:2d::
-DEAL:3d::Testing FE_Q<3>(1)
-DEAL:3d::Norm of difference: 0
-DEAL:3d::
-DEAL:3d::Testing FE_Q<3>(2)
-DEAL:3d::Norm of difference: 0
-DEAL:3d::
-DEAL:3d::Testing FE_Q<3>(3)
-DEAL:3d::Norm of difference: 0
-DEAL:3d::
+DEAL:double:2d::Testing FE_Q<2>(1)
+DEAL:double:2d::Norm of difference: 1.16e-15
+DEAL:double:2d::
+DEAL:double:2d::Testing FE_Q<2>(2)
+DEAL:double:2d::Norm of difference: 2.12e-15
+DEAL:double:2d::
+DEAL:double:2d::Testing FE_Q<2>(3)
+DEAL:double:2d::Norm of difference: 1.01e-14
+DEAL:double:2d::
+DEAL:double:3d::Testing FE_Q<3>(1)
+DEAL:double:3d::Norm of difference: 1.01e-15
+DEAL:double:3d::
+DEAL:double:3d::Testing FE_Q<3>(2)
+DEAL:double:3d::Norm of difference: 2.26e-15
+DEAL:double:3d::
+DEAL:double:3d::Testing FE_Q<3>(3)
+DEAL:double:3d::Norm of difference: 1.76e-14
+DEAL:double:3d::
+DEAL:float:2d::Testing FE_Q<2>(1)
+DEAL:float:2d::Norm of difference: 1.02e-15
+DEAL:float:2d::
+DEAL:float:2d::Testing FE_Q<2>(2)
+DEAL:float:2d::Norm of difference: 1.64e-15
+DEAL:float:2d::
+DEAL:float:2d::Testing FE_Q<2>(3)
+DEAL:float:2d::Norm of difference: 8.83e-15
+DEAL:float:2d::
+DEAL:float:3d::Testing FE_Q<3>(1)
+DEAL:float:3d::Norm of difference: 4.55e-16
+DEAL:float:3d::
+DEAL:float:3d::Testing FE_Q<3>(2)
+DEAL:float:3d::Norm of difference: 2.65e-15
+DEAL:float:3d::
+DEAL:float:3d::Testing FE_Q<3>(3)
+DEAL:float:3d::Norm of difference: 1.54e-14
+DEAL:float:3d::
index c175a423ad0205d77eae28a8f9634457b366fe92..09a9cc7150443882d5c53f4f5e44ee6dc0495cb6 100644 (file)
 #include <deal.II/base/function.h>
 
 #include "../tests.h"
-
-std::ofstream logfile("output");
-
 #include "matrix_vector_common.h"
 
-template <int dim, int fe_degree>
+template <int dim, int fe_degree, typename Number>
 void
 test()
 {
@@ -57,7 +54,7 @@ test()
   FE_Q<dim>       fe(fe_degree);
   DoFHandler<dim> dof(tria);
   dof.distribute_dofs(fe);
-  AffineConstraints<double> constraints;
+  AffineConstraints<Number> constraints;
   DoFTools::make_hanging_node_constraints(dof, constraints);
 
   VectorTools::interpolate_boundary_values(dof,
@@ -68,7 +65,7 @@ test()
 
   do_test<dim,
           fe_degree,
-          double,
-          LinearAlgebra::CUDAWrappers::Vector<double>,
+          Number,
+          LinearAlgebra::CUDAWrappers::Vector<Number>,
           fe_degree + 1>(dof, constraints, tria.n_active_cells());
 }
index afa453aed9f2716a525cf677e2746011d845c12c..0e61608812399b8b7d1d8d2206caf03af53735b6 100644 (file)
@@ -1,19 +1,37 @@
 
-DEAL:2d::Testing FE_Q<2>(1)
-DEAL:2d::Norm of difference: 0.
-DEAL:2d::
-DEAL:2d::Testing FE_Q<2>(2)
-DEAL:2d::Norm of difference: 0.
-DEAL:2d::
-DEAL:2d::Testing FE_Q<2>(3)
-DEAL:2d::Norm of difference: 0.
-DEAL:2d::
-DEAL:3d::Testing FE_Q<3>(1)
-DEAL:3d::Norm of difference: 0.
-DEAL:3d::
-DEAL:3d::Testing FE_Q<3>(2)
-DEAL:3d::Norm of difference: 0.
-DEAL:3d::
-DEAL:3d::Testing FE_Q<3>(3)
-DEAL:3d::Norm of difference: 0.
-DEAL:3d::
+DEAL:double:2d::Testing FE_Q<2>(1)
+DEAL:double:2d::Norm of difference: 1.86e-15
+DEAL:double:2d::
+DEAL:double:2d::Testing FE_Q<2>(2)
+DEAL:double:2d::Norm of difference: 4.71e-15
+DEAL:double:2d::
+DEAL:double:2d::Testing FE_Q<2>(3)
+DEAL:double:2d::Norm of difference: 2.01e-14
+DEAL:double:2d::
+DEAL:double:3d::Testing FE_Q<3>(1)
+DEAL:double:3d::Norm of difference: 1.51e-15
+DEAL:double:3d::
+DEAL:double:3d::Testing FE_Q<3>(2)
+DEAL:double:3d::Norm of difference: 2.65e-15
+DEAL:double:3d::
+DEAL:double:3d::Testing FE_Q<3>(3)
+DEAL:double:3d::Norm of difference: 1.74e-14
+DEAL:double:3d::
+DEAL:float:2d::Testing FE_Q<2>(1)
+DEAL:float:2d::Norm of difference: 1.78e-15
+DEAL:float:2d::
+DEAL:float:2d::Testing FE_Q<2>(2)
+DEAL:float:2d::Norm of difference: 3.77e-15
+DEAL:float:2d::
+DEAL:float:2d::Testing FE_Q<2>(3)
+DEAL:float:2d::Norm of difference: 1.88e-14
+DEAL:float:2d::
+DEAL:float:3d::Testing FE_Q<3>(1)
+DEAL:float:3d::Norm of difference: 9.36e-16
+DEAL:float:3d::
+DEAL:float:3d::Testing FE_Q<3>(2)
+DEAL:float:3d::Norm of difference: 2.59e-15
+DEAL:float:3d::
+DEAL:float:3d::Testing FE_Q<3>(3)
+DEAL:float:3d::Norm of difference: 1.87e-14
+DEAL:float:3d::
index f386db0bb6842e4ef207d136e89b0bd9851ac483..ab8d0fd644ae6a247ebb07e6bc46aa8c474a3e23 100644 (file)
 #include <deal.II/base/function.h>
 
 #include "../tests.h"
-
-std::ofstream logfile("output");
-
 #include "matrix_vector_common.h"
 
-template <int dim, int fe_degree>
+template <int dim, int fe_degree, typename Number>
 void
 test()
 {
@@ -58,7 +55,7 @@ test()
   FE_Q<dim>       fe(fe_degree);
   DoFHandler<dim> dof(tria);
   dof.distribute_dofs(fe);
-  AffineConstraints<double> constraints;
+  AffineConstraints<Number> constraints;
   DoFTools::make_hanging_node_constraints(dof, constraints);
 
   VectorTools::interpolate_boundary_values(dof,
@@ -69,7 +66,7 @@ test()
 
   do_test<dim,
           fe_degree,
-          double,
-          LinearAlgebra::CUDAWrappers::Vector<double>,
+          Number,
+          LinearAlgebra::CUDAWrappers::Vector<Number>,
           fe_degree + 1>(dof, constraints, tria.n_active_cells(), true, true);
 }
index afa453aed9f2716a525cf677e2746011d845c12c..30022064b38b1d9a071aedd2151029a47b6a132d 100644 (file)
@@ -1,19 +1,37 @@
 
-DEAL:2d::Testing FE_Q<2>(1)
-DEAL:2d::Norm of difference: 0.
-DEAL:2d::
-DEAL:2d::Testing FE_Q<2>(2)
-DEAL:2d::Norm of difference: 0.
-DEAL:2d::
-DEAL:2d::Testing FE_Q<2>(3)
-DEAL:2d::Norm of difference: 0.
-DEAL:2d::
-DEAL:3d::Testing FE_Q<3>(1)
-DEAL:3d::Norm of difference: 0.
-DEAL:3d::
-DEAL:3d::Testing FE_Q<3>(2)
-DEAL:3d::Norm of difference: 0.
-DEAL:3d::
-DEAL:3d::Testing FE_Q<3>(3)
-DEAL:3d::Norm of difference: 0.
-DEAL:3d::
+DEAL:double:2d::Testing FE_Q<2>(1)
+DEAL:double:2d::Norm of difference: 6.11e-15
+DEAL:double:2d::
+DEAL:double:2d::Testing FE_Q<2>(2)
+DEAL:double:2d::Norm of difference: 4.71e-15
+DEAL:double:2d::
+DEAL:double:2d::Testing FE_Q<2>(3)
+DEAL:double:2d::Norm of difference: 2.02e-14
+DEAL:double:2d::
+DEAL:double:3d::Testing FE_Q<3>(1)
+DEAL:double:3d::Norm of difference: 1.54e-15
+DEAL:double:3d::
+DEAL:double:3d::Testing FE_Q<3>(2)
+DEAL:double:3d::Norm of difference: 2.64e-15
+DEAL:double:3d::
+DEAL:double:3d::Testing FE_Q<3>(3)
+DEAL:double:3d::Norm of difference: 1.74e-14
+DEAL:double:3d::
+DEAL:float:2d::Testing FE_Q<2>(1)
+DEAL:float:2d::Norm of difference: 5.83e-15
+DEAL:float:2d::
+DEAL:float:2d::Testing FE_Q<2>(2)
+DEAL:float:2d::Norm of difference: 3.76e-15
+DEAL:float:2d::
+DEAL:float:2d::Testing FE_Q<2>(3)
+DEAL:float:2d::Norm of difference: 1.88e-14
+DEAL:float:2d::
+DEAL:float:3d::Testing FE_Q<3>(1)
+DEAL:float:3d::Norm of difference: 1.10e-15
+DEAL:float:3d::
+DEAL:float:3d::Testing FE_Q<3>(2)
+DEAL:float:3d::Norm of difference: 2.61e-15
+DEAL:float:3d::
+DEAL:float:3d::Testing FE_Q<3>(3)
+DEAL:float:3d::Norm of difference: 1.87e-14
+DEAL:float:3d::
index c4c1085670d3b8270bbe880966b2a6358bec67f4..b56afcb73235579a6324fedef2824d6388ace672 100644 (file)
 // type: 2)
 
 #include "../tests.h"
-
-std::ofstream logfile("output");
-
 #include "matrix_vector_common.h"
 
 
-template <int dim, int fe_degree>
+template <int dim, int fe_degree, typename Number>
 void
 test()
 {
@@ -41,12 +38,12 @@ test()
   FE_Q<dim>       fe(fe_degree);
   DoFHandler<dim> dof(tria);
   dof.distribute_dofs(fe);
-  AffineConstraints<double> constraints;
+  AffineConstraints<Number> constraints;
   constraints.close();
 
   do_test<dim,
           fe_degree,
-          double,
-          LinearAlgebra::CUDAWrappers::Vector<double>,
+          Number,
+          LinearAlgebra::CUDAWrappers::Vector<Number>,
           fe_degree + 1>(dof, constraints, tria.n_active_cells());
 }
index 43ef13cd754847276775ad0edd4edc6128e9942f..5a75226da3de77617bb54a04511f68a8aedf5483 100644 (file)
@@ -1,19 +1,37 @@
 
-DEAL:2d::Testing FE_Q<2>(1)
-DEAL:2d::Norm of difference: 0
-DEAL:2d::
-DEAL:2d::Testing FE_Q<2>(2)
-DEAL:2d::Norm of difference: 0
-DEAL:2d::
-DEAL:2d::Testing FE_Q<2>(3)
-DEAL:2d::Norm of difference: 0
-DEAL:2d::
-DEAL:3d::Testing FE_Q<3>(1)
-DEAL:3d::Norm of difference: 0
-DEAL:3d::
-DEAL:3d::Testing FE_Q<3>(2)
-DEAL:3d::Norm of difference: 0
-DEAL:3d::
-DEAL:3d::Testing FE_Q<3>(3)
-DEAL:3d::Norm of difference: 0
-DEAL:3d::
+DEAL:double:2d::Testing FE_Q<2>(1)
+DEAL:double:2d::Norm of difference: 4.74e-15
+DEAL:double:2d::
+DEAL:double:2d::Testing FE_Q<2>(2)
+DEAL:double:2d::Norm of difference: 8.33e-15
+DEAL:double:2d::
+DEAL:double:2d::Testing FE_Q<2>(3)
+DEAL:double:2d::Norm of difference: 3.49e-14
+DEAL:double:2d::
+DEAL:double:3d::Testing FE_Q<3>(1)
+DEAL:double:3d::Norm of difference: 1.78e-15
+DEAL:double:3d::
+DEAL:double:3d::Testing FE_Q<3>(2)
+DEAL:double:3d::Norm of difference: 4.72e-15
+DEAL:double:3d::
+DEAL:double:3d::Testing FE_Q<3>(3)
+DEAL:double:3d::Norm of difference: 2.10e-14
+DEAL:double:3d::
+DEAL:float:2d::Testing FE_Q<2>(1)
+DEAL:float:2d::Norm of difference: 4.74e-15
+DEAL:float:2d::
+DEAL:float:2d::Testing FE_Q<2>(2)
+DEAL:float:2d::Norm of difference: 8.87e-15
+DEAL:float:2d::
+DEAL:float:2d::Testing FE_Q<2>(3)
+DEAL:float:2d::Norm of difference: 3.24e-14
+DEAL:float:2d::
+DEAL:float:3d::Testing FE_Q<3>(1)
+DEAL:float:3d::Norm of difference: 1.94e-15
+DEAL:float:3d::
+DEAL:float:3d::Testing FE_Q<3>(2)
+DEAL:float:3d::Norm of difference: 3.55e-15
+DEAL:float:3d::
+DEAL:float:3d::Testing FE_Q<3>(3)
+DEAL:float:3d::Norm of difference: 2.32e-14
+DEAL:float:3d::
index 4226aec558063be96ada3ad05aa9c605bb148f46..119ed67d7b9e0556f4da015bc5a47d28afedea34 100644 (file)
 // type: 1 = linear).
 
 #include "../tests.h"
-
-std::ofstream logfile("output");
-
 #include "matrix_vector_common.h"
 
 
-template <int dim, int fe_degree>
+template <int dim, int fe_degree, typename Number>
 void
 test()
 {
@@ -72,13 +69,13 @@ test()
   FE_Q<dim>       fe(fe_degree);
   DoFHandler<dim> dof(tria);
   dof.distribute_dofs(fe);
-  AffineConstraints<double> constraints;
+  AffineConstraints<Number> constraints;
   DoFTools::make_hanging_node_constraints(dof, constraints);
   constraints.close();
 
   do_test<dim,
           fe_degree,
-          double,
-          LinearAlgebra::CUDAWrappers::Vector<double>,
+          Number,
+          LinearAlgebra::CUDAWrappers::Vector<Number>,
           fe_degree + 1>(dof, constraints, tria.n_active_cells());
 }
index 43ef13cd754847276775ad0edd4edc6128e9942f..c3d51aad155a276585d5ef9655e0cdd74a63970c 100644 (file)
@@ -1,19 +1,37 @@
 
-DEAL:2d::Testing FE_Q<2>(1)
-DEAL:2d::Norm of difference: 0
-DEAL:2d::
-DEAL:2d::Testing FE_Q<2>(2)
-DEAL:2d::Norm of difference: 0
-DEAL:2d::
-DEAL:2d::Testing FE_Q<2>(3)
-DEAL:2d::Norm of difference: 0
-DEAL:2d::
-DEAL:3d::Testing FE_Q<3>(1)
-DEAL:3d::Norm of difference: 0
-DEAL:3d::
-DEAL:3d::Testing FE_Q<3>(2)
-DEAL:3d::Norm of difference: 0
-DEAL:3d::
-DEAL:3d::Testing FE_Q<3>(3)
-DEAL:3d::Norm of difference: 0
-DEAL:3d::
+DEAL:double:2d::Testing FE_Q<2>(1)
+DEAL:double:2d::Norm of difference: 4.24e-15
+DEAL:double:2d::
+DEAL:double:2d::Testing FE_Q<2>(2)
+DEAL:double:2d::Norm of difference: 2.98e-15
+DEAL:double:2d::
+DEAL:double:2d::Testing FE_Q<2>(3)
+DEAL:double:2d::Norm of difference: 8.07e-15
+DEAL:double:2d::
+DEAL:double:3d::Testing FE_Q<3>(1)
+DEAL:double:3d::Norm of difference: 6.42e-15
+DEAL:double:3d::
+DEAL:double:3d::Testing FE_Q<3>(2)
+DEAL:double:3d::Norm of difference: 4.84e-15
+DEAL:double:3d::
+DEAL:double:3d::Testing FE_Q<3>(3)
+DEAL:double:3d::Norm of difference: 1.04e-14
+DEAL:double:3d::
+DEAL:float:2d::Testing FE_Q<2>(1)
+DEAL:float:2d::Norm of difference: 3.53e-15
+DEAL:float:2d::
+DEAL:float:2d::Testing FE_Q<2>(2)
+DEAL:float:2d::Norm of difference: 3.08e-15
+DEAL:float:2d::
+DEAL:float:2d::Testing FE_Q<2>(3)
+DEAL:float:2d::Norm of difference: 7.39e-15
+DEAL:float:2d::
+DEAL:float:3d::Testing FE_Q<3>(1)
+DEAL:float:3d::Norm of difference: 8.25e-15
+DEAL:float:3d::
+DEAL:float:3d::Testing FE_Q<3>(2)
+DEAL:float:3d::Norm of difference: 5.28e-15
+DEAL:float:3d::
+DEAL:float:3d::Testing FE_Q<3>(3)
+DEAL:float:3d::Norm of difference: 9.10e-15
+DEAL:float:3d::
index 704255a86ead47b1fb5a9ebd16198fbc3d3fab1e..54f94cb4881b2831abf6a06619acb811f38ccfd6 100644 (file)
 
 #include "../tests.h"
 #include "create_mesh.h"
-
-std::ofstream logfile("output");
-
 #include "matrix_vector_common.h"
 
-template <int dim, int fe_degree>
+template <int dim, int fe_degree, typename Number>
 void
 test()
 {
@@ -66,7 +63,7 @@ test()
   FE_Q<dim>       fe(fe_degree);
   DoFHandler<dim> dof(tria);
   dof.distribute_dofs(fe);
-  AffineConstraints<double> constraints;
+  AffineConstraints<Number> constraints;
   DoFTools::make_hanging_node_constraints(dof, constraints);
   VectorTools::interpolate_boundary_values(dof,
                                            0,
@@ -76,7 +73,7 @@ test()
 
   do_test<dim,
           fe_degree,
-          double,
-          LinearAlgebra::CUDAWrappers::Vector<double>,
+          Number,
+          LinearAlgebra::CUDAWrappers::Vector<Number>,
           fe_degree + 1>(dof, constraints, tria.n_active_cells());
 }
index e9e176a4c1a834620441fbe7738f5b598c0455a6..2eb9b9d36878a333cc9677f7eee9a9daeddb86ae 100644 (file)
@@ -1,7 +1,13 @@
 
-DEAL:2d::Testing FE_Q<2>(1)
-DEAL:2d::Norm of difference: 0
-DEAL:2d::
-DEAL:3d::Testing FE_Q<3>(1)
-DEAL:3d::Norm of difference: 0
-DEAL:3d::
+DEAL:double:2d::Testing FE_Q<2>(1)
+DEAL:double:2d::Norm of difference: 3.00e-15
+DEAL:double:2d::
+DEAL:double:3d::Testing FE_Q<3>(1)
+DEAL:double:3d::Norm of difference: 6.24e-16
+DEAL:double:3d::
+DEAL:float:2d::Testing FE_Q<2>(1)
+DEAL:float:2d::Norm of difference: 3.17e-15
+DEAL:float:2d::
+DEAL:float:3d::Testing FE_Q<3>(1)
+DEAL:float:3d::Norm of difference: 6.94e-16
+DEAL:float:3d::
index 7aa0b084fda8972879db11ae9c946432f3536154..9f97896609815981d38de1950510209bf6adff16 100644 (file)
 
 #include "../tests.h"
 #include "create_mesh.h"
-
-std::ofstream logfile("output");
-
 #include "matrix_vector_common.h"
 
-template <int dim, int fe_degree>
+template <int dim, int fe_degree, typename Number>
 void
 test()
 {
@@ -62,7 +59,7 @@ test()
   FE_Q<dim>       fe(fe_degree);
   DoFHandler<dim> dof(tria);
   dof.distribute_dofs(fe);
-  AffineConstraints<double> constraints;
+  AffineConstraints<Number> constraints;
   DoFTools::make_hanging_node_constraints(dof, constraints);
   VectorTools::interpolate_boundary_values(dof,
                                            0,
@@ -72,7 +69,7 @@ test()
 
   do_test<dim,
           fe_degree,
-          double,
-          LinearAlgebra::distributed::Vector<double, MemorySpace::CUDA>,
+          Number,
+          LinearAlgebra::distributed::Vector<Number, MemorySpace::CUDA>,
           fe_degree + 1>(dof, constraints, tria.n_active_cells());
 }
index e9e176a4c1a834620441fbe7738f5b598c0455a6..e97ca667b1e281c6a7c5c834ba81a70d5f53149b 100644 (file)
@@ -1,7 +1,13 @@
 
-DEAL:2d::Testing FE_Q<2>(1)
-DEAL:2d::Norm of difference: 0
-DEAL:2d::
-DEAL:3d::Testing FE_Q<3>(1)
-DEAL:3d::Norm of difference: 0
-DEAL:3d::
+DEAL:double:2d::Testing FE_Q<2>(1)
+DEAL:double:2d::Norm of difference: 2.98e-15
+DEAL:double:2d::
+DEAL:double:3d::Testing FE_Q<3>(1)
+DEAL:double:3d::Norm of difference: 6.11e-16
+DEAL:double:3d::
+DEAL:float:2d::Testing FE_Q<2>(1)
+DEAL:float:2d::Norm of difference: 3.16e-15
+DEAL:float:2d::
+DEAL:float:3d::Testing FE_Q<3>(1)
+DEAL:float:3d::Norm of difference: 6.99e-16
+DEAL:float:3d::
index 30a8465be4aa5762de2de1bb68f0e24b3f73064b..1c5124a6b89cc9c1b8417beb0edcd42e03fa2be7 100644 (file)
 
 #include "../tests.h"
 #include "create_mesh.h"
-
-std::ofstream logfile("output");
-
 #include "matrix_vector_common.h"
 
-template <int dim, int fe_degree>
+template <int dim, int fe_degree, typename Number>
 void
 test()
 {
@@ -61,7 +58,7 @@ test()
   FE_Q<dim>       fe(fe_degree);
   DoFHandler<dim> dof(tria);
   dof.distribute_dofs(fe);
-  AffineConstraints<double> constraints;
+  AffineConstraints<Number> constraints;
   DoFTools::make_hanging_node_constraints(dof, constraints);
   VectorTools::interpolate_boundary_values(dof,
                                            0,
@@ -71,7 +68,7 @@ test()
 
   do_test<dim,
           fe_degree,
-          double,
-          LinearAlgebra::distributed::Vector<double, MemorySpace::CUDA>,
+          Number,
+          LinearAlgebra::distributed::Vector<Number, MemorySpace::CUDA>,
           fe_degree + 1>(dof, constraints, tria.n_active_cells(), false);
 }
index e9e176a4c1a834620441fbe7738f5b598c0455a6..c9943d26281d19be3c1bd8ff6dffa6e455398961 100644 (file)
@@ -1,7 +1,13 @@
 
-DEAL:2d::Testing FE_Q<2>(1)
-DEAL:2d::Norm of difference: 0
-DEAL:2d::
-DEAL:3d::Testing FE_Q<3>(1)
-DEAL:3d::Norm of difference: 0
-DEAL:3d::
+DEAL:double:2d::Testing FE_Q<2>(1)
+DEAL:double:2d::Norm of difference: 3.24e-15
+DEAL:double:2d::
+DEAL:double:3d::Testing FE_Q<3>(1)
+DEAL:double:3d::Norm of difference: 8.86e-16
+DEAL:double:3d::
+DEAL:float:2d::Testing FE_Q<2>(1)
+DEAL:float:2d::Norm of difference: 3.44e-15
+DEAL:float:2d::
+DEAL:float:3d::Testing FE_Q<3>(1)
+DEAL:float:3d::Norm of difference: 7.30e-16
+DEAL:float:3d::
index 24f36ed4f3ccb5057fd5faed89d4109dd3f9f5ed..10252fac16169ef418385da606ed5e4369f23fef 100644 (file)
 
 #include "../tests.h"
 #include "create_mesh.h"
-
-std::ofstream logfile("output");
-
 #include "matrix_vector_common.h"
 
-template <int dim, int fe_degree>
+template <int dim, int fe_degree, typename Number>
 void
 test()
 {
@@ -64,7 +61,7 @@ test()
   FE_Q<dim>       fe(fe_degree);
   DoFHandler<dim> dof(tria);
   dof.distribute_dofs(fe);
-  AffineConstraints<double> constraints;
+  AffineConstraints<Number> constraints;
   DoFTools::make_hanging_node_constraints(dof, constraints);
   VectorTools::interpolate_boundary_values(dof,
                                            0,
@@ -74,7 +71,7 @@ test()
 
   do_test<dim,
           fe_degree,
-          double,
-          LinearAlgebra::CUDAWrappers::Vector<double>,
+          Number,
+          LinearAlgebra::CUDAWrappers::Vector<Number>,
           fe_degree + 1>(dof, constraints, tria.n_active_cells());
 }
index e9e176a4c1a834620441fbe7738f5b598c0455a6..c202017a2f0434532f65bcc3a4047090d1064d13 100644 (file)
@@ -1,7 +1,13 @@
 
-DEAL:2d::Testing FE_Q<2>(1)
-DEAL:2d::Norm of difference: 0
-DEAL:2d::
-DEAL:3d::Testing FE_Q<3>(1)
-DEAL:3d::Norm of difference: 0
-DEAL:3d::
+DEAL:double:2d::Testing FE_Q<2>(1)
+DEAL:double:2d::Norm of difference: 2.03e-15
+DEAL:double:2d::
+DEAL:double:3d::Testing FE_Q<3>(1)
+DEAL:double:3d::Norm of difference: 4.13e-16
+DEAL:double:3d::
+DEAL:float:2d::Testing FE_Q<2>(1)
+DEAL:float:2d::Norm of difference: 1.64e-15
+DEAL:float:2d::
+DEAL:float:3d::Testing FE_Q<3>(1)
+DEAL:float:3d::Norm of difference: 3.36e-16
+DEAL:float:3d::
index 317aee39b7a6ea512c7d95543c90ddee24b720a1..25593516036547517748e8e0ae48ea050046b5b2 100644 (file)
@@ -49,7 +49,7 @@
 
 
 // forward declare this function. will be implemented in .cu files
-template <int dim, int fe_degree>
+template <int dim, int fe_degree, typename Number>
 void
 test();
 
@@ -76,7 +76,7 @@ template <int dim,
           int n_q_points_1d>
 void
 do_test(const DoFHandler<dim> &          dof,
-        const AffineConstraints<double> &constraints,
+        const AffineConstraints<Number> &constraints,
         const unsigned int               n_locally_owned_cells,
         const bool                       constant_coefficient = true,
         const bool                       coloring             = false)
@@ -188,7 +188,7 @@ do_test(const DoFHandler<dim> &          dof,
 int
 main()
 {
-  deallog.attach(logfile);
+  initlog();
   deallog.depth_console(0);
 
   deallog << std::setprecision(3);
@@ -196,15 +196,29 @@ main()
   init_cuda();
 
   {
+    deallog.push("double");
     deallog.push("2d");
-    test<2, 1>();
-    test<2, 2>();
-    test<2, 3>();
+    test<2, 1, double>();
+    test<2, 2, double>();
+    test<2, 3, double>();
     deallog.pop();
     deallog.push("3d");
-    test<3, 1>();
-    test<3, 2>();
-    test<3, 3>();
+    test<3, 1, double>();
+    test<3, 2, double>();
+    test<3, 3, double>();
+    deallog.pop();
+    deallog.pop();
+    deallog.push("float");
+    deallog.push("2d");
+    test<2, 1, double>();
+    test<2, 2, double>();
+    test<2, 3, double>();
+    deallog.pop();
+    deallog.push("3d");
+    test<3, 1, double>();
+    test<3, 2, double>();
+    test<3, 3, double>();
+    deallog.pop();
     deallog.pop();
   }
 

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.