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 "KokkosMemoryPool.h" 11 : 12 : namespace Moose 13 : { 14 : namespace Kokkos 15 : { 16 : 17 0 : MemoryPool::MemoryPool(dof_id_type size, unsigned int ways) 18 : { 19 0 : MemSpace::memory_space space; 20 : 21 0 : _pools.create(ways); 22 : 23 : // clang-format off 24 : 25 0 : for (auto & pool : _pools) 26 0 : new (&pool) ::Kokkos::MemoryPool<MemSpace>(space, size / ways); 27 : 28 : // clang-format on 29 : 30 0 : _pools.copyToDevice(); 31 0 : } 32 : 33 : } // namespace Kokkos 34 : } // namespace Moose