Argon 0.1.0
Loading...
Searching...
No Matches
argon::helpers Namespace Reference

Contains helper templates and concepts for type manipulation and compile-time utilities. More...

Classes

struct  ArgonFor
 Helper template to get the Argon type for a given vector type. More...
struct  NextLarger
 Helper template to determine the next larger type for a given type. More...
struct  NextSmaller
 Helper template to determine the next smaller type for a given type. More...

Concepts

concept  has_smaller
 Concept to check if a type has a smaller corresponding type.
concept  has_larger

Typedefs

template<typename T>
using NextLarger_t = NextLarger<T>::type
 Helper alias to get the next larger type for a given type.
template<typename T>
using NextSmaller_t = NextSmaller<T>::type
 Helper alias to get the next smaller type for a given type.
template<typename T>
using ArgonFor_t = typename ArgonFor<std::remove_cv_t<T>>::type
 Helper alias to get the Argon type for a given vector type.

Functions

template<typename T>
constexpr size_t vectorizeable_size (size_t size)
 Calculates the size of a vectorized range.
template<typename T>
constexpr size_t vectorized_size (size_t size)
 Calculates the number of vectorized elements in a range.

Variables

template<typename T>
constexpr bool has_smaller_v
 Helper template to determine if a type has a smaller corresponding type.
template<typename T>
constexpr bool has_larger_v
 Helper template to determine if a type has a larger corresponding type.

Detailed Description

Contains helper templates and concepts for type manipulation and compile-time utilities.

Typedef Documentation

◆ ArgonFor_t

template<typename T>
using argon::helpers::ArgonFor_t = typename ArgonFor<std::remove_cv_t<T>>::type

Helper alias to get the Argon type for a given vector type.

Template Parameters
TThe vector type to get the Argon type for.

◆ NextLarger_t

template<typename T>
using argon::helpers::NextLarger_t = NextLarger<T>::type

Helper alias to get the next larger type for a given type.

Template Parameters
TThe scalar type to determine the next larger type for.

◆ NextSmaller_t

template<typename T>
using argon::helpers::NextSmaller_t = NextSmaller<T>::type

Helper alias to get the next smaller type for a given type.

Template Parameters
TThe scalar type to determine the next smaller type for.

Function Documentation

◆ vectorizeable_size()

template<typename T>
size_t argon::helpers::vectorizeable_size ( size_t size)
constexpr

Calculates the size of a vectorized range.

Template Parameters
TThe type of the elements in the range.
Parameters
sizeThe size of the range.
Returns
The size of the vectorized range.

◆ vectorized_size()

template<typename T>
size_t argon::helpers::vectorized_size ( size_t size)
constexpr

Calculates the number of vectorized elements in a range.

Template Parameters
TThe type of the elements in the range.
Parameters
sizeThe size of the range.
Returns
The number of vectorized elements in the range.

Variable Documentation

◆ has_larger_v

template<typename T>
bool argon::helpers::has_larger_v
constexpr
Initial value:
=
std::is_same_v<T, uint8_t>
|| std::is_same_v<T, uint16_t>
|| std::is_same_v<T, uint32_t>
|| std::is_same_v<T, int8_t>
|| std::is_same_v<T, int16_t>
|| std::is_same_v<T, int32_t>
|| std::is_same_v<T, float>
|| std::is_same_v<T, float16_t>

Helper template to determine if a type has a larger corresponding type.

Template Parameters
TThe scalar type to check.

◆ has_smaller_v

template<typename T>
bool argon::helpers::has_smaller_v
constexpr
Initial value:
=
std::is_same_v<T, uint16_t>
|| std::is_same_v<T, uint32_t>
|| std::is_same_v<T, uint64_t>
|| std::is_same_v<T, int16_t>
|| std::is_same_v<T, int32_t>
|| std::is_same_v<T, int64_t>
|| std::is_same_v<T, double>
|| std::is_same_v<T, float>
|| std::is_same_v<T, float32_t>

Helper template to determine if a type has a smaller corresponding type.

Template Parameters
TThe scalar type to check.