Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-09-16 08:52:43

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