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 2117 : 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 2117 : auto & storage = Moose::Kokkos::MaterialPropertyStorage::cast(_storage); 21 : 22 2117 : return storage.addKokkosProperty(prop_name, type, state, nullptr, shell); 23 : } 24 : 25 : Moose::Kokkos::MaterialPropertyBase & 26 1027 : 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 : std::shared_ptr<Moose::Kokkos::MaterialPropertyBase> shell) 33 : { 34 1027 : auto & storage = Moose::Kokkos::MaterialPropertyStorage::cast(_storage); 35 : 36 1027 : return storage.declareKokkosProperty(prop_name, type, declarer, dims, bnd, shell); 37 : } 38 : 39 : Moose::Kokkos::MaterialPropertyBase & 40 1129 : MaterialData::getKokkosPropertyHelper( 41 : const std::string & prop_name, 42 : const unsigned int state, 43 : std::shared_ptr<Moose::Kokkos::MaterialPropertyBase> shell) const 44 : { 45 1129 : auto & storage = Moose::Kokkos::MaterialPropertyStorage::cast(_storage); 46 : 47 1129 : if (state) 48 772 : return storage.addKokkosPropertyState(prop_name, state, shell); 49 : else 50 357 : return storage.getKokkosProperty(prop_name); 51 : } 52 : 53 : bool 54 0 : MaterialData::haveKokkosPropertyHelper(const std::string & prop_name) const 55 : { 56 0 : auto & storage = Moose::Kokkos::MaterialPropertyStorage::cast(_storage); 57 : 58 0 : return storage.haveKokkosProperty(prop_name); 59 : } 60 : 61 : void 62 1760 : MaterialData::kokkosRegisterLoadStoreHelper(std::type_index type, 63 : Moose::Kokkos::PropertyStore store, 64 : Moose::Kokkos::PropertyLoad load) 65 : { 66 1760 : auto & storage = Moose::Kokkos::MaterialPropertyStorage::cast(_storage); 67 : 68 1760 : return storage.registerLoadStore(type, store, load); 69 : }