From 799d1e570b03849ba04610cc5cf81e6be3c1ae15 Mon Sep 17 00:00:00 2001 From: Daniel Arndt Date: Wed, 10 Jul 2019 12:00:16 -0400 Subject: [PATCH] Address comments --- tests/cuda/matrix_free_no_index_initialize.cu | 40 +++++++++---------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/tests/cuda/matrix_free_no_index_initialize.cu b/tests/cuda/matrix_free_no_index_initialize.cu index f8987d83be..85b2a780ac 100644 --- a/tests/cuda/matrix_free_no_index_initialize.cu +++ b/tests/cuda/matrix_free_no_index_initialize.cu @@ -24,11 +24,6 @@ #include "../tests.h" -// forward declare this function -template -void -test(); - template 1 ? threadIdx.y : 0) * n_q_points_1d + (dim > 2 ? threadIdx.z : 0) * n_q_points_1d * n_q_points_1d; - bool const evaluate_values = true; - bool const evaluate_gradients = true; - // set to unit vector fe_eval.submit_dof_value(1., tid); __syncthreads(); - fe_eval.evaluate(evaluate_values, evaluate_gradients); + fe_eval.evaluate(/*evaluate_values =*/true, /*evaluate_gradients=*/true); +#ifndef __APPLE__ // values should evaluate to one, derivatives to zero - assert(fe_eval.get_dof_value(tid) == 1.); assert(fe_eval.get_value(tid) == 1.); for (unsigned int e = 0; e < dim; ++e) assert(fe_eval.get_gradient(tid)[e] == 0.); + + fe_eval.integrate(/*integrate_values = */ true, + /*integrate_gradients=*/true); + assert(fe_eval.get_dof_value(tid) == 1.); +#endif } @@ -88,6 +85,7 @@ public: AssertCuda(cudaGetLastError()); // Check that there was no problem during the execution of the kernel AssertCuda(cudaDeviceSynchronize()); + deallog << "OK" << std::endl; }; @@ -117,16 +115,6 @@ do_test(const DoFHandler & dof, } -int -main() -{ - initlog(); - deal_II_exceptions::disable_abort_on_exception(); - - test<2, 1>(); -} - - template void test() @@ -156,3 +144,15 @@ test() do_test(dof, constraints); } + + + +int +main() +{ + initlog(); + + init_cuda(); + + test<2, 1>(); +} -- 2.39.5