From e2b14255577374edd7f8974958266594c7114d29 Mon Sep 17 00:00:00 2001 From: Peter Munch Date: Fri, 16 Aug 2024 19:52:47 +0200 Subject: [PATCH] Make small modifications to protoptypes/kokkos_poisson --- prototypes/kokkos_poisson/kokkos_poisson.cc | 47 ++++++++++----------- 1 file changed, 22 insertions(+), 25 deletions(-) diff --git a/prototypes/kokkos_poisson/kokkos_poisson.cc b/prototypes/kokkos_poisson/kokkos_poisson.cc index e68240255d..e78bf2b4bb 100644 --- a/prototypes/kokkos_poisson/kokkos_poisson.cc +++ b/prototypes/kokkos_poisson/kokkos_poisson.cc @@ -32,10 +32,10 @@ #include #include -#include -#include #include #include +#include +#include #include #include @@ -116,12 +116,12 @@ class LaplaceOperatorQuad { public: DEAL_II_HOST_DEVICE void - operator()(CUDAWrappers:: - FEEvaluation - *fe_eval, - const int q_point) const + operator()( + Portable::FEEvaluation + *phi, + const int q_point) const { - fe_eval->submit_gradient(fe_eval->get_gradient(q_point), q_point); + phi->submit_gradient(phi->get_gradient(q_point), q_point); } }; @@ -130,25 +130,23 @@ class LaplaceOperatorLocal { public: DEAL_II_HOST_DEVICE void - operator()( - const unsigned int cell, - const typename CUDAWrappers::MatrixFree::Data *gpu_data, - CUDAWrappers::SharedData *shared_data, - const Number *src, - Number *dst) const + operator()(const unsigned int cell, + const typename Portable::MatrixFree::Data *gpu_data, + Portable::SharedData *shared_data, + const Number *src, + Number *dst) const { (void)cell; // TODO? - CUDAWrappers:: - FEEvaluation - fe_eval( - /*cell,*/ gpu_data, shared_data); - fe_eval.read_dof_values(src); - fe_eval.evaluate(false, true); - fe_eval.apply_for_each_quad_point( + Portable::FEEvaluation + phi( + /*cell,*/ gpu_data, shared_data); + phi.read_dof_values(src); + phi.evaluate(false, true); + phi.apply_for_each_quad_point( LaplaceOperatorQuad()); - fe_eval.integrate(false, true); - fe_eval.distribute_local_to_global(dst); + phi.integrate(false, true); + phi.distribute_local_to_global(dst); } static const unsigned int n_dofs_1d = fe_degree + 1; static const unsigned int n_local_dofs = Utilities::pow(fe_degree + 1, dim); @@ -174,8 +172,7 @@ class LaplaceOperator &constraints, const Quadrature<1> &quadrature) { - typename CUDAWrappers::MatrixFree::AdditionalData - additional_data; + typename Portable::MatrixFree::AdditionalData additional_data; additional_data.mapping_update_flags = update_JxW_values | update_gradients; matrix_free.reinit( @@ -198,7 +195,7 @@ class LaplaceOperator matrix_free; + Portable::MatrixFree matrix_free; };