LCOV - code coverage report
Current view: top level - src/kokkos/materials - KokkosMaterialData.K (source / functions) Hit Total Coverage
Test: idaholab/moose framework: #32971 (54bef8) with base c6cf66 Lines: 18 18 100.0 %
Date: 2026-05-29 20:35:17 Functions: 5 5 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 "KokkosMaterialPropertyStorage.h"
      11             : 
      12             : #include "MaterialData.h"
      13             : 
      14             : Moose::Kokkos::MaterialPropertyBase &
      15        3206 : MaterialData::addKokkosPropertyHelper(const std::string & prop_name,
      16             :                                       const std::type_info & type,
      17             :                                       const unsigned int state,
      18             :                                       std::shared_ptr<Moose::Kokkos::MaterialPropertyBase> shell)
      19             : {
      20        3206 :   auto & storage = Moose::Kokkos::MaterialPropertyStorage::cast(_storage);
      21             : 
      22        3206 :   return storage.addKokkosProperty(prop_name, type, state, nullptr, shell);
      23             : }
      24             : 
      25             : Moose::Kokkos::MaterialPropertyBase &
      26        2996 : MaterialData::declareKokkosPropertyHelper(
      27             :     const std::string & prop_name,
      28             :     const std::type_info & type,
      29             :     const MaterialBase * declarer,
      30             :     const std::vector<unsigned int> & dims,
      31             :     const bool bnd,
      32             :     const bool on_demand,
      33             :     const Moose::Kokkos::PropertyConstantOption constant_option,
      34             :     std::shared_ptr<Moose::Kokkos::MaterialPropertyBase> shell)
      35             : {
      36        2996 :   auto & storage = Moose::Kokkos::MaterialPropertyStorage::cast(_storage);
      37             : 
      38        4688 :   return storage.declareKokkosProperty(
      39        3384 :       prop_name, type, declarer, dims, bnd, on_demand, constant_option, shell);
      40             : }
      41             : 
      42             : Moose::Kokkos::MaterialPropertyBase &
      43        1958 : MaterialData::getKokkosPropertyHelper(
      44             :     const std::string & prop_name,
      45             :     const unsigned int state,
      46             :     std::shared_ptr<Moose::Kokkos::MaterialPropertyBase> shell) const
      47             : {
      48        1958 :   auto & storage = Moose::Kokkos::MaterialPropertyStorage::cast(_storage);
      49             : 
      50        1958 :   if (state)
      51         987 :     return storage.addKokkosPropertyState(prop_name, state, shell);
      52             :   else
      53         971 :     return storage.getKokkosProperty(prop_name);
      54             : }
      55             : 
      56             : bool
      57          17 : MaterialData::haveKokkosPropertyHelper(const std::string & prop_name) const
      58             : {
      59          17 :   auto & storage = Moose::Kokkos::MaterialPropertyStorage::cast(_storage);
      60             : 
      61          17 :   return storage.haveKokkosProperty(prop_name);
      62             : }
      63             : 
      64             : void
      65        2252 : MaterialData::kokkosRegisterLoadStoreHelper(std::type_index type,
      66             :                                             Moose::Kokkos::PropertyStore store,
      67             :                                             Moose::Kokkos::PropertyLoad load)
      68             : {
      69        2252 :   auto & storage = Moose::Kokkos::MaterialPropertyStorage::cast(_storage);
      70             : 
      71        2252 :   return storage.registerLoadStore(type, store, load);
      72             : }

Generated by: LCOV version 1.14