![]() |
Vc
1.1.0
SIMD Vector Classes for C++
|
|
Data-parallel type with (somewhat) arbitrary number of components.
Definition at line 475 of file simdarray.h.
#include <simdarray.h>
Public Member Functions | |||||||
SimdArray | operator+ () const | ||||||
Returns a copy of itself. | |||||||
MaskType | isNegative () const | ||||||
SimdArray | exponent () const | ||||||
Returns the exponents of the floating-point values in the vector. More... | |||||||
Gather constructors and member functions | |||||||
Constructs or loads a vector from the objects at All gather functions optionally take a mask as last argument. In that case only the entries that are selected in the mask are accessed in memory and copied to the vector. This enables invalid indexes in the Gathers from structured data (AoS: arrays of struct) are possible via a special subscript operator of the container (array). You can use Vc::array and Vc::vector as drop-in replacements for Vc::vector<float> data(100);
std::iota(data.begin(), data.end(), 0.f); // fill with values 0, 1, 2, ...
auto indexes = float_v::IndexType::IndexesFromZero();
float_v gathered = data[indexes]; // gathered == [0, 1, 2, ...]
Alternatively, you can use Vc::Common::AdaptSubscriptOperator to extend a given container class with the necessary subscript operator. Example: template <typename T, typename Allocator = std::allocator<T>>
using my_vector = Vc::Common::AdaptSubscriptOperator<std::vector<T, Allocator>>;
| |||||||
template<typename MT , typename IT , typename = enable_if<Traits::has_subscript_operator<IT>::value>> | |||||||
SimdArray (const MT *mem, IT &&indexes) | |||||||
Gather constructor. | |||||||
template<typename MT , typename IT , typename = enable_if<Vc::Traits::has_subscript_operator<IT>::value>> | |||||||
SimdArray (const MT *mem, IT &&indexes, MaskArgument mask) | |||||||
Masked gather constructor. | |||||||
template<typename MT , typename IT , typename = enable_if<Vc::Traits::has_subscript_operator<IT>::value>> | |||||||
void | gather (const MT *mem, IT &&indexes) | ||||||
Gather function. | |||||||
template<typename MT , typename IT , typename = enable_if<Vc::Traits::has_subscript_operator<IT>::value>> | |||||||
void | gather (const MT *mem, IT &&indexes, MaskArgument mask) | ||||||
Masked gather function. | |||||||
template<typename S1 , typename IT > | |||||||
SimdArray (const S1 *array, const EntryType S1::*member1, const IT indexes) | |||||||
template<typename S1 , typename IT > | |||||||
SimdArray (const S1 *array, const EntryType S1::*member1, const IT indexes, MaskArgument mask) | |||||||
template<typename S1 , typename S2 , typename IT > | |||||||
SimdArray (const S1 *array, const S2 S1::*member1, const EntryType S2::*member2, const IT indexes) | |||||||
template<typename S1 , typename S2 , typename IT > | |||||||
SimdArray (const S1 *array, const S2 S1::*member1, const EntryType S2::*member2, const IT indexes, MaskArgument mask) | |||||||
template<typename S1 , typename IT1 , typename IT2 > | |||||||
SimdArray (const S1 *array, const EntryType *const S1::*ptrMember1, const IT1 outerIndexes, const IT2 innerIndexes) | |||||||
template<typename S1 , typename IT1 , typename IT2 > | |||||||
SimdArray (const S1 *array, const EntryType *const S1::*ptrMember1, const IT1 outerIndexes, const IT2 innerIndexes, MaskArgument mask) | |||||||
template<typename S1 , typename IT > | |||||||
void | gather (const S1 *array, const EntryType S1::*member1, const IT indexes) | ||||||
template<typename S1 , typename IT > | |||||||
void | gather (const S1 *array, const EntryType S1::*member1, const IT indexes, MaskArgument mask) | ||||||
template<typename S1 , typename S2 , typename IT > | |||||||
void | gather (const S1 *array, const S2 S1::*member1, const EntryType S2::*member2, const IT indexes) | ||||||
template<typename S1 , typename S2 , typename IT > | |||||||
void | gather (const S1 *array, const S2 S1::*member1, const EntryType S2::*member2, const IT indexes, MaskArgument mask) | ||||||
template<typename S1 , typename IT1 , typename IT2 > | |||||||
void | gather (const S1 *array, const EntryType *const S1::*ptrMember1, const IT1 outerIndexes, const IT2 innerIndexes) | ||||||
template<typename S1 , typename IT1 , typename IT2 > | |||||||
void | gather (const S1 *array, const EntryType *const S1::*ptrMember1, const IT1 outerIndexes, const IT2 innerIndexes, MaskArgument mask) | ||||||
Static Public Member Functions | |
static SimdArray | Zero () |
Returns a vector with the entries initialized to zero. More... | |
static SimdArray | One () |
Returns a vector with the entries initialized to one. More... | |
static SimdArray | IndexesFromZero () |
Returns a vector with the entries initialized to 0, 1, 2, 3, 4, 5, ... More... | |
static SimdArray | Random () |
Returns a vector with pseudo-random entries. More... | |
|
inline |
Definition at line 222 of file simdarray.h.
|
inline |
Definition at line 232 of file simdarray.h.
|
inline |
Definition at line 243 of file simdarray.h.
|
inline |
Definition at line 254 of file simdarray.h.
|
inline |
Definition at line 266 of file simdarray.h.
|
inline |
Definition at line 277 of file simdarray.h.
|
inline |
Definition at line 289 of file simdarray.h.
|
inline |
Definition at line 300 of file simdarray.h.
|
inline |
Definition at line 313 of file simdarray.h.
|
inline |
Definition at line 324 of file simdarray.h.
|
inline |
Definition at line 337 of file simdarray.h.
|
inline |
Definition at line 349 of file simdarray.h.
|
inlinestatic |
Returns a vector with the entries initialized to zero.
Definition at line 690 of file simdarray.h.
|
inlinestatic |
Returns a vector with the entries initialized to one.
Definition at line 696 of file simdarray.h.
|
inlinestatic |
Returns a vector with the entries initialized to 0, 1, 2, 3, 4, 5, ...
Definition at line 702 of file simdarray.h.
|
inlinestatic |
Returns a vector with pseudo-random entries.
Currently the state of the random number generator cannot be modified and starts off with the same state. Thus you will get the same sequence of numbers for the same sequence of calls.
Definition at line 708 of file simdarray.h.
|
inline |
Definition at line 797 of file simdarray.h.
|
inline |
Returns the exponents of the floating-point values in the vector.
Definition at line 1043 of file simdarray.h.