Data transfer

template<class T, class A = default_arch>
batch<T, A> broadcast(T v) noexcept

Creates a batch from the single value v.

Return

a new batch instance

Parameters
  • v: the value used to initialize the batch

template<class To, class A = default_arch, class From>
simd_return_type<From, To> broadcast_as(From v) noexcept

Creates a batch from the single value v and the specified batch value type To.

Return

a new batch instance

Parameters
  • v: the value used to initialize the batch

template<class T, class A, size_t I>
batch<T, A> insert(batch<T, A> const &x, T val, index<I> pos) noexcept

Create a new batch equivalent to x but with element val set at position pos.

Return

copy of x with position pos set to val

Parameters
  • x: batch

  • val: value to set

  • pos: index of the updated slot

template<class To, class A = default_arch, class From>
simd_return_type<From, To> load_as(From const *ptr, aligned_mode) noexcept

Creates a batch from the buffer ptr and the specifed batch value type To.

The memory needs to be aligned.

Return

a new batch instance

Parameters
  • ptr: the memory buffer to read

template<class To, class A = default_arch, class From>
simd_return_type<From, To> load_as(From const *ptr, unaligned_mode) noexcept

Creates a batch from the buffer ptr and the specifed batch value type To.

The memory does not need to be aligned.

Return

a new batch instance

Parameters
  • ptr: the memory buffer to read

template<class A = default_arch, class From>
batch<From, A> load(From const *ptr, aligned_mode = {}) noexcept

Creates a batch from the buffer ptr.

The memory needs to be aligned.

Return

a new batch instance

Parameters
  • ptr: the memory buffer to read

template<class A = default_arch, class From>
batch<From, A> load(From const *ptr, unaligned_mode) noexcept

Creates a batch from the buffer ptr.

The memory does not need to be aligned.

Return

a new batch instance

Parameters
  • ptr: the memory buffer to read

template<class A = default_arch, class From>
batch<From, A> load_aligned(From const *ptr) noexcept

Creates a batch from the buffer ptr.

The memory needs to be aligned.

Return

a new batch instance

Parameters
  • ptr: the memory buffer to read

template<class A = default_arch, class From>
batch<From, A> load_unaligned(From const *ptr) noexcept

Creates a batch from the buffer ptr.

The memory does not need to be aligned.

Return

a new batch instance

Parameters
  • ptr: the memory buffer to read

template<class To, class A = default_arch, class From>
void store_as(To *dst, batch<From, A> const &src, aligned_mode) noexcept

Copy content of batch src to the buffer dst.

The memory needs to be aligned.

Parameters
  • dst: the memory buffer to write to

  • src: the batch to copy

template<class To, class A = default_arch, class From>
void store_as(To *dst, batch<From, A> const &src, unaligned_mode) noexcept

Copy content of batch src to the buffer dst.

The memory does not need to be aligned.

Parameters
  • dst: the memory buffer to write to

  • src: the batch to copy

template<class A, class T>
void store(T *mem, batch<T, A> const &val, aligned_mode = {}) noexcept

Copy content of batch val to the buffer mem.

The memory does not need to be aligned.

Parameters
  • mem: the memory buffer to write to

  • val: the batch to copy from

template<class A, class T>
void store(T *mem, batch<T, A> const &val, unaligned_mode) noexcept

Copy content of batch val to the buffer mem.

The memory does not need to be aligned.

Parameters
  • mem: the memory buffer to write to

  • val: the batch to copy from

template<class A, class T>
void store_aligned(T *mem, batch<T, A> const &val) noexcept

Copy content of batch val to the buffer mem.

The memory needs to be aligned.

Parameters
  • mem: the memory buffer to write to

  • val: the batch to copy from

template<class A, class T>
void store_unaligned(T *mem, batch<T, A> const &val) noexcept

Copy content of batch val to the buffer mem.

The memory does not need to be aligned.

Parameters
  • mem: the memory buffer to write to

  • val: the batch to copy

template<class T, class A, class Vt, Vt... Values>
std::enable_if<std::is_arithmetic<T>::value, batch<T, A>>::type swizzle(batch<T, A> const &x, batch_constant<batch<Vt, A>, Values...> mask) noexcept

Rearrange elements from x according to mask mask.

Return

swizzled batch

Parameters
  • x: batch

  • mask: constant batch mask of integer elements of the same size as element of x

template<class T, class A>
batch<T, A> zip_hi(batch<T, A> const &x, batch<T, A> const &y) noexcept

Unpack and interleave data from the HIGH half of batches x and y.

Store the results in the Return value.

Return

a batch of the high part of shuffled values.

Parameters
  • x: a batch of integer or floating point or double precision values.

  • y: a batch of integer or floating point or double precision values.

template<class T, class A>
batch<T, A> zip_lo(batch<T, A> const &x, batch<T, A> const &y) noexcept

Unpack and interleave data from the LOW half of batches x and y.

Store the results in the Return value.

Return

a batch of the low part of shuffled values.

Parameters
  • x: a batch of integer or floating point or double precision values.

  • y: a batch of integer or floating point or double precision values.

The following empty types are used for tag dispatching:

struct aligned_mode

tag for load and store of aligned memory.

struct unaligned_mode

tag for load and store of unaligned memory.