Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:54:46

0001 //----------------------------------*-C++-*----------------------------------//
0002 // Copyright 2022-2024 UT-Battelle, LLC, and other Celeritas developers.
0003 // See the top-level COPYRIGHT file for details.
0004 // SPDX-License-Identifier: (Apache-2.0 OR MIT)
0005 //---------------------------------------------------------------------------//
0006 //! \file corecel/data/detail/HyperslabIndexerImpl.hh
0007 //---------------------------------------------------------------------------//
0008 #pragma once
0009 
0010 namespace celeritas
0011 {
0012 namespace detail
0013 {
0014 // Utility function for calculating the size of hyperslab data
0015 template<celeritas::size_type N>
0016 inline CELER_FUNCTION celeritas::size_type
0017 hyperslab_size(celeritas::Array<celeritas::size_type, N> const& dims)
0018 {
0019     celeritas::size_type size = 1;
0020     for (auto const dim : dims)
0021     {
0022         size *= dim;
0023     }
0024     return size;
0025 }
0026 //---------------------------------------------------------------------------//
0027 }  // namespace detail
0028 }  // namespace celeritas