-
Notifications
You must be signed in to change notification settings - Fork 61
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
a7cfc03
commit 77f3c9a
Showing
11 changed files
with
195 additions
and
93 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
//================================================================================================== | ||
/* | ||
EVE - Expressive Vector Engine | ||
Copyright : EVE Project Contributors | ||
SPDX-License-Identifier: BSL-1.0 | ||
*/ | ||
//================================================================================================== | ||
#pragma once | ||
|
||
namespace eve | ||
{ | ||
namespace detail | ||
{ | ||
template<typename... Ts> | ||
consteval auto compute_max_lanes() | ||
{ | ||
std::ptrdiff_t cards[] = { cardinal_v<Ts>... }; | ||
|
||
auto max_card = cards[0]; | ||
for(auto c : cards) max_card = max_card < c ? c : max_card; | ||
|
||
return max_card; | ||
} | ||
} | ||
|
||
//================================================================================================ | ||
//! @addtogroup traits | ||
//! @{ | ||
//! @var max_lanes | ||
//! | ||
//! @tparam Ts Types to process | ||
//! | ||
//! @brief A meta function for getting a maximum lane count of given wide or scalar types. | ||
//! @} | ||
//================================================================================================ | ||
template <typename... Ts> | ||
inline constexpr auto max_lanes_v = detail::compute_max_lanes<Ts...>(); | ||
|
||
//================================================================================================ | ||
//! @addtogroup traits | ||
//! @{ | ||
//! @var max_lanes | ||
//! | ||
//! @tparam Ts Types to process | ||
//! | ||
//! @brief The cardinal type of the maximum lane count of given wide or scalar types. | ||
//! @} | ||
//================================================================================================ | ||
template <typename... Ts> | ||
using max_lanes_t = fixed<max_lanes_v<Ts...>>; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.