alpaka
Abstraction Library for Parallel Kernel Acceleration
Loading...
Searching...
No Matches
Vec.hpp File Reference
#include "alpaka/cast.hpp"
#include "alpaka/core/common.hpp"
#include "alpaka/core/util.hpp"
#include "alpaka/trait.hpp"
#include "unused.hpp"
#include <array>
#include <concepts>
#include <cstdint>
#include <iosfwd>
#include <ranges>
#include <sstream>
#include <string>
#include <type_traits>

Go to the source code of this file.

Classes

struct  alpaka::ArrayStorage< T_Type, T_dim >
 Array storge for vector data. More...
struct  alpaka::detail::CVec< T, T_values >
struct  alpaka::detail::TemplateSignatureStorage< T >
struct  alpaka::detail::TemplateSignatureStorage< CVec< T_Type, T_values... > >
struct  alpaka::internal::PCast::Op< T_To, alpaka::Vec< T_Type, T_dim, T_Storage > >
struct  alpaka::trait::GetDim< alpaka::Vec< T_Type, T_dim, T_Storage > >
struct  alpaka::trait::GetValueType< Vec< T_Type, T_dim, T_Storage > >
struct  alpaka::trait::GetVec< alpaka::Vec< T_Type, T_dim, T_Storage > >
struct  alpaka::trait::GetVec< T >
struct  alpaka::trait::IsCVector< T >
struct  alpaka::trait::IsCVector< Vec< T_Type, T_dim, detail::CVec< T_Type, T_values... > > >
struct  alpaka::trait::IsVector< T >
struct  alpaka::trait::IsVector< Vec< T_Type, T_dim, T_Storage > >
struct  alpaka::Vec< T_Type, T_dim, T_Storage >
struct  alpaka::Vec< Type, 0 >
struct  std::tuple_element< I, alpaka::Vec< T_Type, T_dim, T_Storage > >
struct  std::tuple_size< alpaka::Vec< T_Type, T_dim, T_Storage > >

Namespaces

namespace  alpaka
 main alpaka namespace.
namespace  alpaka::concepts
namespace  alpaka::detail
namespace  alpaka::internal
 alpaka internal implementations.
namespace  alpaka::trait
namespace  std
 STL namespace.

Concepts

concept  alpaka::concepts::CVector
 Concept to check if a type is a CVector.
concept  alpaka::concepts::TypeOrVector
 Concept to check if a type is a vector or a specific other type.
concept  alpaka::concepts::Vector
 Concept to check if a type is a vector.
concept  alpaka::concepts::VectorOrConvertibleType
concept  alpaka::concepts::VectorOrScalar
 Concept to check if a type is a vector or scalar variable.

Macros

#define ALPAKA_NAMED_ARRAY_ACCESS(functionName, indexPos)
#define ALPAKA_VECTOR_ASSIGN_OP(op)
#define ALPAKA_VECTOR_BINARY_OP(typenameOrConcept, resultScalarType, op)

Typedefs

template<typename T>
using alpaka::trait::getVec_t = typename GetVec<T>::type

Functions

template<concepts::Vector T_Vector0, concepts::Vector T_Vector1>
ALPAKA_FN_HOST_ACC constexpr concepts::Vector auto alpaka::divCeil (T_Vector0 a, T_Vector1 b)
template<concepts::Vector T_Vector0, concepts::Vector T_Vector1>
ALPAKA_FN_HOST_ACC constexpr concepts::Vector auto alpaka::divExZero (T_Vector0 a, T_Vector1 b)
template<std::size_t I, typename T_Type, uint32_t T_dim, typename T_Storage>
constexpr decltype(auto) alpaka::get (Vec< T_Type, T_dim, T_Storage > &v)
template<std::size_t I, typename T_Type, uint32_t T_dim, typename T_Storage>
constexpr auto alpaka::get (Vec< T_Type, T_dim, T_Storage > const &v)
template<typename T>
consteval auto alpaka::getVec (T const &any)
template<typename Type, uint32_t T_dim, typename T_Storage>
std::ostream & alpaka::operator<< (std::ostream &s, Vec< Type, T_dim, T_Storage > const &vec)
template<typename T_1, typename... T_Args>
ALPAKA_FN_HOST_ACC alpaka::Vec (T_1, T_Args...) -> Vec< T_1, uint32_t(sizeof...(T_Args)+1u), ArrayStorage< T_1, uint32_t(sizeof...(T_Args)+1u)> >
template<std::integral T_Type, uint32_t T_dim, typename T_Storage, typename T_OtherStorage>
constexpr auto alpaka::operator% (const Vec< T_Type, T_dim, T_Storage > &lhs, const Vec< T_Type, T_dim, T_OtherStorage > &rhs)
 binary operators
template<std::integral T_Type, concepts::LosslesslyConvertible< T_Type > T_ValueType, uint32_t T_dim, typename T_Storage>
constexpr auto alpaka::operator% (const Vec< T_Type, T_dim, T_Storage > &lhs, T_ValueType rhs)
 binary operators
template<std::integral T_Type, concepts::LosslesslyConvertible< T_Type > T_ValueType, uint32_t T_dim, typename T_Storage>
constexpr auto alpaka::operator% (T_ValueType lhs, const Vec< T_Type, T_dim, T_Storage > &rhs)
 binary operators
template<std::integral T_Type, uint32_t T_dim, typename T_Storage, typename T_OtherStorage>
constexpr auto alpaka::operator& (const Vec< T_Type, T_dim, T_Storage > &lhs, const Vec< T_Type, T_dim, T_OtherStorage > &rhs)
 binary operators
template<std::integral T_Type, concepts::LosslesslyConvertible< T_Type > T_ValueType, uint32_t T_dim, typename T_Storage>
constexpr auto alpaka::operator& (const Vec< T_Type, T_dim, T_Storage > &lhs, T_ValueType rhs)
 binary operators
template<std::integral T_Type, concepts::LosslesslyConvertible< T_Type > T_ValueType, uint32_t T_dim, typename T_Storage>
constexpr auto alpaka::operator& (T_ValueType lhs, const Vec< T_Type, T_dim, T_Storage > &rhs)
 binary operators
template<typename T_Type, uint32_t T_dim, typename T_Storage, typename T_OtherStorage>
constexpr auto alpaka::operator&& (const Vec< T_Type, T_dim, T_Storage > &lhs, const Vec< T_Type, T_dim, T_OtherStorage > &rhs)
 binary operators
template<typename T_Type, concepts::LosslesslyConvertible< T_Type > T_ValueType, uint32_t T_dim, typename T_Storage>
constexpr auto alpaka::operator&& (const Vec< T_Type, T_dim, T_Storage > &lhs, T_ValueType rhs)
 binary operators
template<typename T_Type, concepts::LosslesslyConvertible< T_Type > T_ValueType, uint32_t T_dim, typename T_Storage>
constexpr auto alpaka::operator&& (T_ValueType lhs, const Vec< T_Type, T_dim, T_Storage > &rhs)
 binary operators
template<typename T_Type, uint32_t T_dim, typename T_Storage, typename T_OtherStorage>
constexpr auto alpaka::operator* (const Vec< T_Type, T_dim, T_Storage > &lhs, const Vec< T_Type, T_dim, T_OtherStorage > &rhs)
 binary operators
template<typename T_Type, concepts::LosslesslyConvertible< T_Type > T_ValueType, uint32_t T_dim, typename T_Storage>
constexpr auto alpaka::operator* (const Vec< T_Type, T_dim, T_Storage > &lhs, T_ValueType rhs)
 binary operators
template<typename T_Type, concepts::LosslesslyConvertible< T_Type > T_ValueType, uint32_t T_dim, typename T_Storage>
constexpr auto alpaka::operator* (T_ValueType lhs, const Vec< T_Type, T_dim, T_Storage > &rhs)
 binary operators
template<typename T_Type, uint32_t T_dim, typename T_Storage, typename T_OtherStorage>
constexpr auto alpaka::operator+ (const Vec< T_Type, T_dim, T_Storage > &lhs, const Vec< T_Type, T_dim, T_OtherStorage > &rhs)
 binary operators
template<typename T_Type, concepts::LosslesslyConvertible< T_Type > T_ValueType, uint32_t T_dim, typename T_Storage>
constexpr auto alpaka::operator+ (const Vec< T_Type, T_dim, T_Storage > &lhs, T_ValueType rhs)
 binary operators
template<typename T_Type, concepts::LosslesslyConvertible< T_Type > T_ValueType, uint32_t T_dim, typename T_Storage>
constexpr auto alpaka::operator+ (T_ValueType lhs, const Vec< T_Type, T_dim, T_Storage > &rhs)
 binary operators
template<typename T_Type, uint32_t T_dim, typename T_Storage, typename T_OtherStorage>
constexpr auto alpaka::operator- (const Vec< T_Type, T_dim, T_Storage > &lhs, const Vec< T_Type, T_dim, T_OtherStorage > &rhs)
 binary operators
template<typename T_Type, concepts::LosslesslyConvertible< T_Type > T_ValueType, uint32_t T_dim, typename T_Storage>
constexpr auto alpaka::operator- (const Vec< T_Type, T_dim, T_Storage > &lhs, T_ValueType rhs)
 binary operators
template<typename T_Type, concepts::LosslesslyConvertible< T_Type > T_ValueType, uint32_t T_dim, typename T_Storage>
constexpr auto alpaka::operator- (T_ValueType lhs, const Vec< T_Type, T_dim, T_Storage > &rhs)
 binary operators
template<typename T_Type, uint32_t T_dim, typename T_Storage, typename T_OtherStorage>
constexpr auto alpaka::operator/ (const Vec< T_Type, T_dim, T_Storage > &lhs, const Vec< T_Type, T_dim, T_OtherStorage > &rhs)
 binary operators
template<typename T_Type, concepts::LosslesslyConvertible< T_Type > T_ValueType, uint32_t T_dim, typename T_Storage>
constexpr auto alpaka::operator/ (const Vec< T_Type, T_dim, T_Storage > &lhs, T_ValueType rhs)
 binary operators
template<typename T_Type, concepts::LosslesslyConvertible< T_Type > T_ValueType, uint32_t T_dim, typename T_Storage>
constexpr auto alpaka::operator/ (T_ValueType lhs, const Vec< T_Type, T_dim, T_Storage > &rhs)
 binary operators
template<typename T_Type, uint32_t T_dim, typename T_Storage, typename T_OtherStorage>
constexpr auto alpaka::operator< (const Vec< T_Type, T_dim, T_Storage > &lhs, const Vec< T_Type, T_dim, T_OtherStorage > &rhs)
 binary operators
template<typename T_Type, concepts::LosslesslyConvertible< T_Type > T_ValueType, uint32_t T_dim, typename T_Storage>
constexpr auto alpaka::operator< (const Vec< T_Type, T_dim, T_Storage > &lhs, T_ValueType rhs)
 binary operators
template<typename T_Type, concepts::LosslesslyConvertible< T_Type > T_ValueType, uint32_t T_dim, typename T_Storage>
constexpr auto alpaka::operator< (T_ValueType lhs, const Vec< T_Type, T_dim, T_Storage > &rhs)
 binary operators
template<std::integral T_Type, uint32_t T_dim, typename T_Storage, typename T_OtherStorage>
constexpr auto alpaka::operator<< (const Vec< T_Type, T_dim, T_Storage > &lhs, const Vec< T_Type, T_dim, T_OtherStorage > &rhs)
 binary operators
template<std::integral T_Type, concepts::LosslesslyConvertible< T_Type > T_ValueType, uint32_t T_dim, typename T_Storage>
constexpr auto alpaka::operator<< (const Vec< T_Type, T_dim, T_Storage > &lhs, T_ValueType rhs)
 binary operators
template<std::integral T_Type, concepts::LosslesslyConvertible< T_Type > T_ValueType, uint32_t T_dim, typename T_Storage>
constexpr auto alpaka::operator<< (T_ValueType lhs, const Vec< T_Type, T_dim, T_Storage > &rhs)
 binary operators
template<typename T_Type, uint32_t T_dim, typename T_Storage, typename T_OtherStorage>
constexpr auto alpaka::operator<= (const Vec< T_Type, T_dim, T_Storage > &lhs, const Vec< T_Type, T_dim, T_OtherStorage > &rhs)
 binary operators
template<typename T_Type, concepts::LosslesslyConvertible< T_Type > T_ValueType, uint32_t T_dim, typename T_Storage>
constexpr auto alpaka::operator<= (const Vec< T_Type, T_dim, T_Storage > &lhs, T_ValueType rhs)
 binary operators
template<typename T_Type, concepts::LosslesslyConvertible< T_Type > T_ValueType, uint32_t T_dim, typename T_Storage>
constexpr auto alpaka::operator<= (T_ValueType lhs, const Vec< T_Type, T_dim, T_Storage > &rhs)
 binary operators
template<typename T_Type, uint32_t T_dim, typename T_Storage, typename T_OtherStorage>
constexpr auto alpaka::operator> (const Vec< T_Type, T_dim, T_Storage > &lhs, const Vec< T_Type, T_dim, T_OtherStorage > &rhs)
 binary operators
template<typename T_Type, concepts::LosslesslyConvertible< T_Type > T_ValueType, uint32_t T_dim, typename T_Storage>
constexpr auto alpaka::operator> (const Vec< T_Type, T_dim, T_Storage > &lhs, T_ValueType rhs)
 binary operators
template<typename T_Type, concepts::LosslesslyConvertible< T_Type > T_ValueType, uint32_t T_dim, typename T_Storage>
constexpr auto alpaka::operator> (T_ValueType lhs, const Vec< T_Type, T_dim, T_Storage > &rhs)
 binary operators
template<typename T_Type, uint32_t T_dim, typename T_Storage, typename T_OtherStorage>
constexpr auto alpaka::operator>= (const Vec< T_Type, T_dim, T_Storage > &lhs, const Vec< T_Type, T_dim, T_OtherStorage > &rhs)
 binary operators
template<typename T_Type, concepts::LosslesslyConvertible< T_Type > T_ValueType, uint32_t T_dim, typename T_Storage>
constexpr auto alpaka::operator>= (const Vec< T_Type, T_dim, T_Storage > &lhs, T_ValueType rhs)
 binary operators
template<typename T_Type, concepts::LosslesslyConvertible< T_Type > T_ValueType, uint32_t T_dim, typename T_Storage>
constexpr auto alpaka::operator>= (T_ValueType lhs, const Vec< T_Type, T_dim, T_Storage > &rhs)
 binary operators
template<std::integral T_Type, uint32_t T_dim, typename T_Storage, typename T_OtherStorage>
constexpr auto alpaka::operator>> (const Vec< T_Type, T_dim, T_Storage > &lhs, const Vec< T_Type, T_dim, T_OtherStorage > &rhs)
 binary operators
template<std::integral T_Type, concepts::LosslesslyConvertible< T_Type > T_ValueType, uint32_t T_dim, typename T_Storage>
constexpr auto alpaka::operator>> (const Vec< T_Type, T_dim, T_Storage > &lhs, T_ValueType rhs)
 binary operators
template<std::integral T_Type, concepts::LosslesslyConvertible< T_Type > T_ValueType, uint32_t T_dim, typename T_Storage>
constexpr auto alpaka::operator>> (T_ValueType lhs, const Vec< T_Type, T_dim, T_Storage > &rhs)
 binary operators
template<std::integral T_Type, uint32_t T_dim, typename T_Storage, typename T_OtherStorage>
constexpr auto alpaka::operator^ (const Vec< T_Type, T_dim, T_Storage > &lhs, const Vec< T_Type, T_dim, T_OtherStorage > &rhs)
 binary operators
template<std::integral T_Type, concepts::LosslesslyConvertible< T_Type > T_ValueType, uint32_t T_dim, typename T_Storage>
constexpr auto alpaka::operator^ (const Vec< T_Type, T_dim, T_Storage > &lhs, T_ValueType rhs)
 binary operators
template<std::integral T_Type, concepts::LosslesslyConvertible< T_Type > T_ValueType, uint32_t T_dim, typename T_Storage>
constexpr auto alpaka::operator^ (T_ValueType lhs, const Vec< T_Type, T_dim, T_Storage > &rhs)
 binary operators
template<std::integral T_Type, uint32_t T_dim, typename T_Storage, typename T_OtherStorage>
constexpr auto alpaka::operator| (const Vec< T_Type, T_dim, T_Storage > &lhs, const Vec< T_Type, T_dim, T_OtherStorage > &rhs)
 binary operators
template<std::integral T_Type, concepts::LosslesslyConvertible< T_Type > T_ValueType, uint32_t T_dim, typename T_Storage>
constexpr auto alpaka::operator| (const Vec< T_Type, T_dim, T_Storage > &lhs, T_ValueType rhs)
 binary operators
template<std::integral T_Type, concepts::LosslesslyConvertible< T_Type > T_ValueType, uint32_t T_dim, typename T_Storage>
constexpr auto alpaka::operator| (T_ValueType lhs, const Vec< T_Type, T_dim, T_Storage > &rhs)
 binary operators
template<typename T_Type, uint32_t T_dim, typename T_Storage, typename T_OtherStorage>
constexpr auto alpaka::operator|| (const Vec< T_Type, T_dim, T_Storage > &lhs, const Vec< T_Type, T_dim, T_OtherStorage > &rhs)
 binary operators
template<typename T_Type, concepts::LosslesslyConvertible< T_Type > T_ValueType, uint32_t T_dim, typename T_Storage>
constexpr auto alpaka::operator|| (const Vec< T_Type, T_dim, T_Storage > &lhs, T_ValueType rhs)
 binary operators
template<typename T_Type, concepts::LosslesslyConvertible< T_Type > T_ValueType, uint32_t T_dim, typename T_Storage>
constexpr auto alpaka::operator|| (T_ValueType lhs, const Vec< T_Type, T_dim, T_Storage > &rhs)
 binary operators
template<std::integral T_IntegralType, typename T_Storage, typename T_OtherStorage>
ALPAKA_FN_HOST_ACC T_IntegralType alpaka::linearize (Vec< T_IntegralType, 1u, T_Storage > const &, Vec< T_IntegralType, 1u, T_OtherStorage > const &idx)
 Give the linear index of an N-dimensional index within an N-dimensional index space.
template<std::integral T_IntegralType, typename T_Storage, typename T_OtherStorage, uint32_t T_dim>
requires (T_dim >= 2u)
constexpr T_IntegralType alpaka::linearize (Vec< T_IntegralType, T_dim - 1u, T_Storage > const &dim, Vec< T_IntegralType, T_dim, T_OtherStorage > const &idx)
 Give the linear index of an N-dimensional index within an N-dimensional index space.
template<std::integral T_IntegralType, typename T_Storage, typename T_OtherStorage, uint32_t T_dim>
constexpr T_IntegralType alpaka::linearize (Vec< T_IntegralType, T_dim, T_Storage > const &dim, Vec< T_IntegralType, T_dim, T_OtherStorage > const &idx)
 Give the linear index of an N-dimensional index within an N-dimensional index space.
template<std::integral T_IntegralType, typename T_Storage>
constexpr Vec< T_IntegralType, 1u > alpaka::mapToND (Vec< T_IntegralType, 1u, T_Storage > const &extents, T_IntegralType linearIdx)
 Maps a linear index to an N-dimensional index.
template<std::integral T_IntegralType, typename T_Storage, uint32_t T_dim>
requires (T_dim >= 2u)
constexpr Vec< T_IntegralType, T_dim > alpaka::mapToND (Vec< T_IntegralType, T_dim, T_Storage > const &extents, T_IntegralType linearIdx)
 Maps a linear index to an N-dimensional index.

Variables

template<typename T>
constexpr bool alpaka::isCVector_v = trait::IsCVector<T>::value
template<typename T>
constexpr bool alpaka::isVector_v = trait::IsVector<T>::value
template<typename T>
constexpr bool alpaka::detail::TemplateSignatureStorage_v = TemplateSignatureStorage<T>::value

Macro Definition Documentation

◆ ALPAKA_NAMED_ARRAY_ACCESS

#define ALPAKA_NAMED_ARRAY_ACCESS ( functionName,
indexPos )
Value:
/* An integer underflow may occur with `indexPos`, for example if `T_dim` is equal to 1 and `y()` should be \
declared as `(T_dim - 2u)`. Therefore the `requires` is fine, because everything which should be theoretical \
negative become much bigger. \
* than T_dim. */ \
constexpr decltype(auto) functionName() requires((indexPos) < T_dim) \
{ \
return (*this)[indexPos]; \
} \
constexpr decltype(auto) functionName() const requires((indexPos) < T_dim) \
{ \
return (*this)[indexPos]; \
}

Definition at line 367 of file Vec.hpp.

◆ ALPAKA_VECTOR_ASSIGN_OP

#define ALPAKA_VECTOR_ASSIGN_OP ( op)

Definition at line 312 of file Vec.hpp.

◆ ALPAKA_VECTOR_BINARY_OP

#define ALPAKA_VECTOR_BINARY_OP ( typenameOrConcept,
resultScalarType,
op )

Definition at line 756 of file Vec.hpp.