Back to home page

EIC code displayed by LXR

 
 

    


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

0001 //----------------------------------*-C++-*----------------------------------//
0002 // Copyright 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/sys/detail/KernelTraitsImpl.hh
0007 //---------------------------------------------------------------------------//
0008 #pragma once
0009 
0010 #include <type_traits>
0011 
0012 namespace celeritas
0013 {
0014 namespace detail
0015 {
0016 //---------------------------------------------------------------------------//
0017 //! Checks if type T has a `max_block_size` static member data
0018 template<typename T, typename = void>
0019 struct HasMaxBlockSize : std::false_type
0020 {
0021 };
0022 
0023 template<typename T>
0024 struct HasMaxBlockSize<T, std::void_t<decltype(T::max_block_size)>>
0025     : std::true_type
0026 {
0027 };
0028 
0029 template<typename T>
0030 inline constexpr bool has_max_block_size_v = HasMaxBlockSize<T>::value;
0031 
0032 //---------------------------------------------------------------------------//
0033 //! Checks if type T has a `min_warps_per_eu` static member data
0034 template<typename T, typename = void>
0035 struct HasMinWarpsPerEU : std::false_type
0036 {
0037 };
0038 
0039 template<typename T>
0040 struct HasMinWarpsPerEU<T, std::void_t<decltype(T::min_warps_per_eu)>>
0041     : std::true_type
0042 {
0043 };
0044 
0045 template<typename T>
0046 inline constexpr bool has_min_warps_per_eu_v = HasMinWarpsPerEU<T>::value;
0047 
0048 //---------------------------------------------------------------------------//
0049 //! Checks if type T declared an `Applier` member type
0050 template<typename T, typename = void>
0051 struct HasApplier : std::false_type
0052 {
0053 };
0054 
0055 template<typename T>
0056 struct HasApplier<T, std::void_t<typename T::Applier>> : std::true_type
0057 {
0058 };
0059 
0060 template<typename T>
0061 inline constexpr bool has_applier_v = HasApplier<T>::value;
0062 
0063 //---------------------------------------------------------------------------//
0064 }  // namespace detail
0065 }  // namespace celeritas