vspline 1.1.0
Generic C++11 Code for Uniform B-Splines
Classes | Namespaces | Macros
vc_simd_type.h File Reference

SIMD type derived from Vc::SimdArray. More...

#include <iostream>
#include <Vc/Vc>

Go to the source code of this file.

Classes

struct  vspline::vc_simd_type< _value_type, _vsize >
 class template vc_simd_type provides a fixed-size SIMD type. This implementation of vspline::vc_simd_type uses Vc::SimdArray The 'acrobatics' may seem futile - why inherit privately from Vc::SimdArray, then code a class template which does essentially the same? There are several reasons: first, the wrapper class results in a common interface shared with the other SIMD implementations, second, there are some added members which can't be 'put into' Vc::SimdArray from the outside. And, third, the template signature is uniform, avoiding Vc::SimdArray's two additional template arguments. More...
 
struct  vspline::vc_simd_type< _value_type, _vsize >::masked_type
 
struct  vspline::allocator_traits< vc_simd_type< T, N > >
 

Namespaces

namespace  vspline
 

Macros

#define BUILD_FROM_CONTAINER(SIZE_TYPE, VSZ)
 
#define BROADCAST_STD_FUNC(FUNC)
 
#define BROADCAST_STD_FUNC2(FUNC)
 
#define INTEGRAL_ONLY
 
#define BOOL_ONLY
 
#define OPEQ_FUNC(OPFUNC, OPEQ, CONSTRAINT)
 
#define C_PROMOTE(A, B)
 
#define OP_FUNC(OPFUNC, OP, CONSTRAINT)
 
#define OP_FUNC(OPFUNC, OP, CONSTRAINT)
 
#define COMPARE_FUNC(OP, OPFUNC)
 
#define OPEQ_FUNC(OPFUNC, OPEQ, CONSTRAINT)
 
#define CLAMP(FNAME, REL)
 

Detailed Description

SIMD type derived from Vc::SimdArray.

Initially, vspline used Vc::SimdArray directly, but over time I have written interfaces to several SIMD implementations based on vspline's own simd_type, and I now prefer to introduce SIMD capability to my code through a common interface derived from vspline::simd_type, which allows for simple switching from one SIMD implementation to another.

Definition in file vc_simd_type.h.

Macro Definition Documentation

◆ BOOL_ONLY

#define BOOL_ONLY
Value:
static_assert ( std::is_same < value_type , bool > :: value , \
"this operation is only allowed for booleans" ) ;

Definition at line 456 of file vc_simd_type.h.

◆ BROADCAST_STD_FUNC

#define BROADCAST_STD_FUNC (   FUNC)
Value:
friend vc_simd_type FUNC ( const vc_simd_type & arg ) \
{ \
return FUNC ( arg.to_base() ) ; \
}

Definition at line 392 of file vc_simd_type.h.

◆ BROADCAST_STD_FUNC2

#define BROADCAST_STD_FUNC2 (   FUNC)
Value:
friend vc_simd_type FUNC ( const vc_simd_type & arg1 , \
const vc_simd_type & arg2 ) \
{ \
return FUNC ( arg1.to_base() , arg2.to_base() ) ; \
}

Definition at line 427 of file vc_simd_type.h.

◆ BUILD_FROM_CONTAINER

#define BUILD_FROM_CONTAINER (   SIZE_TYPE,
  VSZ 
)
Value:
template < typename U , template < typename , SIZE_TYPE > class V > \
vc_simd_type & operator= ( const V < U , VSZ > & rhs ) \
{ \
static_assert ( vsize == VSZ , "incompatible vector size" ) ; \
for ( size_type i = 0 ; i < vsize ; i++ ) \
(*this) [ i ] = rhs [ i ] ; \
return *this ; \
} \
template < typename U , template < typename , SIZE_TYPE > class V > \
vc_simd_type ( const V < U , VSZ > & ini ) \
{ \
*this = ini ; \
}
@ vsize
Definition: eval.cc:96
const int VSZ
Definition: mandelbrot.cc:68

Definition at line 258 of file vc_simd_type.h.

◆ C_PROMOTE

#define C_PROMOTE (   A,
 
)
Value:
typename std::conditional \
< std::is_same < A , B > :: value , \
A , \
decltype ( std::declval < A > () \
+ std::declval < B > () ) \
> :: type

Definition at line 501 of file vc_simd_type.h.

◆ CLAMP

#define CLAMP (   FNAME,
  REL 
)
Value:
vc_simd_type FNAME ( const vc_simd_type & threshold ) const \
{ \
return REL ( to_base() , threshold.to_base() ) ; \
} \
vc_simd_type FNAME ( const value_type & threshold ) const \
{ \
return REL ( to_base() , threshold ) ; \
} \

Definition at line 707 of file vc_simd_type.h.

◆ COMPARE_FUNC

#define COMPARE_FUNC (   OP,
  OPFUNC 
)
Value:
friend mask_type OPFUNC ( const vc_simd_type & lhs , \
const vc_simd_type & rhs ) \
{ \
return lhs.to_base() OP rhs.to_base() ; \
} \
friend mask_type OPFUNC ( const vc_simd_type & lhs , \
const value_type & rhs ) \
{ \
return lhs.to_base() OP rhs ; \
} \
friend mask_type OPFUNC ( const value_type & lhs , \
const vc_simd_type & rhs ) \
{ \
return lhs OP rhs.to_base() ; \
}

Definition at line 601 of file vc_simd_type.h.

◆ INTEGRAL_ONLY

#define INTEGRAL_ONLY
Value:
static_assert ( std::is_integral < value_type > :: value , \
"this operation is only allowed for integral types" ) ;

Definition at line 452 of file vc_simd_type.h.

◆ OP_FUNC [1/2]

#define OP_FUNC (   OPFUNC,
  OP,
  CONSTRAINT 
)

Definition at line 586 of file vc_simd_type.h.

◆ OP_FUNC [2/2]

#define OP_FUNC (   OPFUNC,
  OP,
  CONSTRAINT 
)
Value:
vc_simd_type OPFUNC() const \
{ \
return OP to_base() ; \
}

Definition at line 586 of file vc_simd_type.h.

◆ OPEQ_FUNC [1/2]

#define OPEQ_FUNC (   OPFUNC,
  OPEQ,
  CONSTRAINT 
)
Value:
vc_simd_type & OPFUNC ( const value_type & rhs ) \
{ \
CONSTRAINT \
to_base() OPEQ rhs ; \
return *this ; \
} \
vc_simd_type & OPFUNC ( const vc_simd_type & rhs ) \
{ \
CONSTRAINT \
to_base() OPEQ rhs.to_base() ; \
return *this ; \
}

Definition at line 656 of file vc_simd_type.h.

◆ OPEQ_FUNC [2/2]

#define OPEQ_FUNC (   OPFUNC,
  OPEQ,
  CONSTRAINT 
)
Value:
vc_simd_type & OPFUNC ( const value_type & rhs ) \
{ \
CONSTRAINT \
whither.to_base() ( whether ) OPEQ rhs ; \
return whither ; \
} \
vc_simd_type & OPFUNC ( const vc_simd_type & rhs ) \
{ \
CONSTRAINT \
whither.to_base() ( whether ) OPEQ rhs.to_base() ; \
return whither ; \
}

Definition at line 656 of file vc_simd_type.h.