alpaka
Abstraction Library for Parallel Kernel Acceleration
Loading...
Searching...
No Matches
SimdMask.hpp File Reference
#include "alpaka/Vec.hpp"
#include "alpaka/cast.hpp"
#include "alpaka/core/util.hpp"
#include "alpaka/mem/Alignment.hpp"
#include "alpaka/simd/concepts.hpp"
#include "alpaka/simd/internal/StdSimdMask.hpp"
#include "alpaka/simd/trait.hpp"
#include "alpaka/trait.hpp"
#include "simd/internal/EmuSimdMask.hpp"
#include "simd/internal/utility.hpp"
#include <array>
#include <bit>
#include <concepts>
#include <cstddef>
#include <cstdint>
#include <functional>
#include <iosfwd>
#include <ranges>
#include <sstream>
#include <string>
#include <type_traits>

Go to the source code of this file.

Classes

struct  alpaka::SimdMask< T_Type, T_width, T_Storage >
 Simd mask vector. More...
struct  alpaka::trait::GetDim< alpaka::SimdMask< T_Type, T_width, T_Storage > >
struct  alpaka::trait::GetValueType< alpaka::SimdMask< T_Type, T_width, T_Storage > >
struct  alpaka::trait::IsSimdMask< SimdMask< T_Type, T_width, T_Storage > >

Namespaces

namespace  alpaka
 main alpaka namespace.
namespace  alpaka::trait
namespace  std
 STL namespace.

Macros

#define ALPAKA_VECTOR_BINARY_OP(typenameOrConcept, op)
#define ALPAKA_VECTOR_ASSIGN_OP(op)
 assign operator
#define ALPAKA_NAMED_ARRAY_ACCESS(functionName, laneIdx)
 named lane access

Functions

template<std::size_t I, typename T_Type, uint32_t T_width, typename T_Storage>
constexpr auto & alpaka::get (SimdMask< T_Type, T_width, T_Storage > &v)
template<std::size_t I, typename T_Type, uint32_t T_width, typename T_Storage>
constexpr auto alpaka::get (SimdMask< T_Type, T_width, T_Storage > const &v)
template<typename T, typename... T_Args>
constexpr auto alpaka::makeSimdMask (T_Args... args)
 Creates a mask for the given type.
template<typename T_Type, uint32_t T_width, typename T_Storage, typename T_OtherStorage>
constexpr auto alpaka::operator!= (const SimdMask< T_Type, T_width, T_Storage > &lhs, const SimdMask< T_Type, T_width, T_OtherStorage > &rhs)
template<typename T_Type, concepts::LosslesslyConvertible< T_Type > T_ValueType, uint32_t T_width, typename T_Storage>
constexpr auto alpaka::operator!= (const SimdMask< T_Type, T_width, T_Storage > &lhs, T_ValueType rhs)
template<typename T_Type, concepts::LosslesslyConvertible< T_Type > T_ValueType, uint32_t T_width, typename T_Storage>
constexpr auto alpaka::operator!= (T_ValueType lhs, const SimdMask< T_Type, T_width, T_Storage > &rhs)
template<std::integral T_Type, uint32_t T_width, typename T_Storage, typename T_OtherStorage>
constexpr auto alpaka::operator& (const SimdMask< T_Type, T_width, T_Storage > &lhs, const SimdMask< T_Type, T_width, T_OtherStorage > &rhs)
template<std::integral T_Type, concepts::LosslesslyConvertible< T_Type > T_ValueType, uint32_t T_width, typename T_Storage>
constexpr auto alpaka::operator& (const SimdMask< T_Type, T_width, T_Storage > &lhs, T_ValueType rhs)
template<std::integral T_Type, concepts::LosslesslyConvertible< T_Type > T_ValueType, uint32_t T_width, typename T_Storage>
constexpr auto alpaka::operator& (T_ValueType lhs, const SimdMask< T_Type, T_width, T_Storage > &rhs)
template<typename T_Type, uint32_t T_width, typename T_Storage, typename T_OtherStorage>
constexpr auto alpaka::operator&& (const SimdMask< T_Type, T_width, T_Storage > &lhs, const SimdMask< T_Type, T_width, T_OtherStorage > &rhs)
template<typename T_Type, concepts::LosslesslyConvertible< T_Type > T_ValueType, uint32_t T_width, typename T_Storage>
constexpr auto alpaka::operator&& (const SimdMask< T_Type, T_width, T_Storage > &lhs, T_ValueType rhs)
template<typename T_Type, concepts::LosslesslyConvertible< T_Type > T_ValueType, uint32_t T_width, typename T_Storage>
constexpr auto alpaka::operator&& (T_ValueType lhs, const SimdMask< T_Type, T_width, T_Storage > &rhs)
template<typename Type, uint32_t T_width, typename T_Storage>
std::ostream & alpaka::operator<< (std::ostream &s, SimdMask< Type, T_width, T_Storage > const &vec)
template<typename T_Type, uint32_t T_width, typename T_Storage, typename T_OtherStorage>
constexpr auto alpaka::operator== (const SimdMask< T_Type, T_width, T_Storage > &lhs, const SimdMask< T_Type, T_width, T_OtherStorage > &rhs)
template<typename T_Type, concepts::LosslesslyConvertible< T_Type > T_ValueType, uint32_t T_width, typename T_Storage>
constexpr auto alpaka::operator== (const SimdMask< T_Type, T_width, T_Storage > &lhs, T_ValueType rhs)
template<typename T_Type, concepts::LosslesslyConvertible< T_Type > T_ValueType, uint32_t T_width, typename T_Storage>
constexpr auto alpaka::operator== (T_ValueType lhs, const SimdMask< T_Type, T_width, T_Storage > &rhs)
template<std::integral T_Type, uint32_t T_width, typename T_Storage, typename T_OtherStorage>
constexpr auto alpaka::operator^ (const SimdMask< T_Type, T_width, T_Storage > &lhs, const SimdMask< T_Type, T_width, T_OtherStorage > &rhs)
template<std::integral T_Type, concepts::LosslesslyConvertible< T_Type > T_ValueType, uint32_t T_width, typename T_Storage>
constexpr auto alpaka::operator^ (const SimdMask< T_Type, T_width, T_Storage > &lhs, T_ValueType rhs)
template<std::integral T_Type, concepts::LosslesslyConvertible< T_Type > T_ValueType, uint32_t T_width, typename T_Storage>
constexpr auto alpaka::operator^ (T_ValueType lhs, const SimdMask< T_Type, T_width, T_Storage > &rhs)
template<std::integral T_Type, uint32_t T_width, typename T_Storage, typename T_OtherStorage>
constexpr auto alpaka::operator| (const SimdMask< T_Type, T_width, T_Storage > &lhs, const SimdMask< T_Type, T_width, T_OtherStorage > &rhs)
template<std::integral T_Type, concepts::LosslesslyConvertible< T_Type > T_ValueType, uint32_t T_width, typename T_Storage>
constexpr auto alpaka::operator| (const SimdMask< T_Type, T_width, T_Storage > &lhs, T_ValueType rhs)
template<std::integral T_Type, concepts::LosslesslyConvertible< T_Type > T_ValueType, uint32_t T_width, typename T_Storage>
constexpr auto alpaka::operator| (T_ValueType lhs, const SimdMask< T_Type, T_width, T_Storage > &rhs)
template<typename T_Type, uint32_t T_width, typename T_Storage, typename T_OtherStorage>
constexpr auto alpaka::operator|| (const SimdMask< T_Type, T_width, T_Storage > &lhs, const SimdMask< T_Type, T_width, T_OtherStorage > &rhs)
template<typename T_Type, concepts::LosslesslyConvertible< T_Type > T_ValueType, uint32_t T_width, typename T_Storage>
constexpr auto alpaka::operator|| (const SimdMask< T_Type, T_width, T_Storage > &lhs, T_ValueType rhs)
template<typename T_Type, concepts::LosslesslyConvertible< T_Type > T_ValueType, uint32_t T_width, typename T_Storage>
constexpr auto alpaka::operator|| (T_ValueType lhs, const SimdMask< T_Type, T_width, T_Storage > &rhs)
template<typename T_1, typename... T_Args>
ALPAKA_FN_HOST_ACC alpaka::SimdMask (T_1, T_Args...) -> SimdMask< T_1, uint32_t(sizeof...(T_Args)+1u)>

Macro Definition Documentation

◆ ALPAKA_NAMED_ARRAY_ACCESS

#define ALPAKA_NAMED_ARRAY_ACCESS ( functionName,
laneIdx )
Value:
constexpr reference functionName() requires(T_width >= laneIdx + 1) \
{ \
return (*this)[laneIdx]; \
} \
constexpr type functionName() const requires(T_width >= laneIdx + 1) \
{ \
return (*this)[laneIdx]; \
}

named lane access

Attention
The mapping from names x,y,z,w to memory indices differ from the mapping of an alpaka vector Vec. The availability of the naming methods depends on the SIMD width.

You can have access to the same lane index via different nonspecific naming.

lane index : 0, 1, 2, 3, ..., 9, 10, ... , 15
hexadecimal : s0, s1, s2, s3, ..., s9, SA, ... , SF
coordinate : x, y, z, w
color channel: r, g, b, a

Definition at line 275 of file SimdMask.hpp.

◆ ALPAKA_VECTOR_ASSIGN_OP

#define ALPAKA_VECTOR_ASSIGN_OP ( op)
Value:
template<typename T_OtherStorage> \
constexpr SimdMask& operator op(SimdMask<T_Type, T_width, T_OtherStorage> const& rhs) \
{ \
this->asStorage() op rhs.asStorage(); \
return *this; \
} \
constexpr SimdMask& operator op(concepts::LosslesslyConvertible<T_Type> auto const value) \
{ \
this->asStorage() op static_cast<T_Type>(value); \
return *this; \
}

assign operator

Definition at line 227 of file SimdMask.hpp.

◆ ALPAKA_VECTOR_BINARY_OP

#define ALPAKA_VECTOR_BINARY_OP ( typenameOrConcept,
op )
Value:
template<typenameOrConcept T_Type, uint32_t T_width, typename T_Storage, typename T_OtherStorage> \
constexpr auto operator op( \
const SimdMask<T_Type, T_width, T_Storage>& lhs, \
const SimdMask<T_Type, T_width, T_OtherStorage>& rhs) \
{ \
using StoreageType = ALPAKA_TYPEOF(lhs.asStorage() op rhs.asStorage()); \
return SimdMask<T_Type, T_width, StoreageType>(lhs.asStorage() op rhs.asStorage()); \
} \
template< \
typenameOrConcept T_Type, \
concepts::LosslesslyConvertible<T_Type> T_ValueType, \
uint32_t T_width, \
typename T_Storage> \
constexpr auto operator op(const SimdMask<T_Type, T_width, T_Storage>& lhs, T_ValueType rhs) \
{ \
using StoreageType = ALPAKA_TYPEOF(lhs.asStorage() op static_cast<T_Type>(rhs)); \
return SimdMask<T_Type, T_width, StoreageType>(lhs.asStorage() op static_cast<T_Type>(rhs)); \
} \
template< \
typenameOrConcept T_Type, \
concepts::LosslesslyConvertible<T_Type> T_ValueType, \
uint32_t T_width, \
typename T_Storage> \
constexpr auto operator op(T_ValueType lhs, const SimdMask<T_Type, T_width, T_Storage>& rhs) \
{ \
using StoreageType = ALPAKA_TYPEOF(static_cast<T_Type>(lhs) op rhs.asStorage()); \
return SimdMask<T_Type, T_width, StoreageType>(static_cast<T_Type>(lhs) op rhs.asStorage()); \
}
#define ALPAKA_TYPEOF(...)
Get the type of instance.
Definition common.hpp:153

Definition at line 447 of file SimdMask.hpp.