LCOV - code coverage report
Current view: top level - src/kokkos/kernels - KokkosKernel.K (source / functions) Hit Total Coverage
Test: idaholab/moose framework: #31730 (e8b711) with base e0c998 Lines: 30 30 100.0 %
Date: 2025-10-29 16:49:47 Functions: 4 4 100.0 %
Legend: Lines: hit not hit

          Line data    Source code
       1             : //* This file is part of the MOOSE framework
       2             : //* https://www.mooseframework.org
       3             : //*
       4             : //* All rights reserved, see COPYRIGHT for full restrictions
       5             : //* https://github.com/idaholab/moose/blob/master/COPYRIGHT
       6             : //*
       7             : //* Licensed under LGPL 2.1, please see LICENSE for details
       8             : //* https://www.gnu.org/licenses/lgpl-2.1.html
       9             : 
      10             : #include "KokkosKernel.h"
      11             : 
      12             : namespace Moose
      13             : {
      14             : namespace Kokkos
      15             : {
      16             : 
      17             : InputParameters
      18      122668 : Kernel::validParams()
      19             : {
      20      122668 :   InputParameters params = KernelBase::validParams();
      21      122668 :   return params;
      22             : }
      23             : 
      24        1335 : Kernel::Kernel(const InputParameters & parameters)
      25             :   : KernelBase(parameters, Moose::VarFieldType::VAR_FIELD_STANDARD),
      26             :     _test(),
      27             :     _grad_test(),
      28             :     _phi(),
      29             :     _grad_phi(),
      30        1021 :     _u(_var),
      31        1021 :     _grad_u(_var)
      32             : {
      33        1335 :   addMooseVariableDependency(&_var);
      34        1335 : }
      35             : 
      36             : void
      37       53547 : Kernel::computeResidual()
      38             : {
      39       53547 :   Policy policy(0, numKokkosBlockElements());
      40             : 
      41       53547 :   if (!_residual_dispatcher)
      42        1149 :     _residual_dispatcher = DispatcherRegistry::build<ResidualLoop>(this, type());
      43             : 
      44       53547 :   _residual_dispatcher->parallelFor(policy);
      45       53547 : }
      46             : 
      47             : void
      48        9992 : Kernel::computeJacobian()
      49             : {
      50        9992 :   if (DispatcherRegistry::hasUserMethod<JacobianLoop>(type()))
      51             :   {
      52        8261 :     Policy policy(0, numKokkosBlockElements());
      53             : 
      54        8261 :     if (!_jacobian_dispatcher)
      55         972 :       _jacobian_dispatcher = DispatcherRegistry::build<JacobianLoop>(this, type());
      56             : 
      57        8261 :     _jacobian_dispatcher->parallelFor(policy);
      58        8261 :   }
      59             : 
      60        9992 :   if (DispatcherRegistry::hasUserMethod<OffDiagJacobianLoop>(type()))
      61             :   {
      62          48 :     auto & sys = kokkosSystem(_kokkos_var.sys());
      63             : 
      64          96 :     _thread.resize({sys.getCoupling(_kokkos_var.var()).size(), numKokkosBlockElements()});
      65             : 
      66          48 :     Policy policy(0, _thread.size());
      67             : 
      68          48 :     if (!_offdiag_jacobian_dispatcher)
      69          27 :       _offdiag_jacobian_dispatcher = DispatcherRegistry::build<OffDiagJacobianLoop>(this, type());
      70             : 
      71          48 :     _offdiag_jacobian_dispatcher->parallelFor(policy);
      72          48 :   }
      73        9992 : }
      74             : 
      75             : } // namespace Kokkos
      76             : } // namespace Moose

Generated by: LCOV version 1.14