Blaze 3.9
SIMDPack.h
Go to the documentation of this file.
1//=================================================================================================
33//=================================================================================================
34
35#ifndef _BLAZE_MATH_SIMD_SIMDPACK_H_
36#define _BLAZE_MATH_SIMD_SIMDPACK_H_
37
38
39//*************************************************************************************************
40// Includes
41//*************************************************************************************************
42
43#include <blaze/system/Inline.h>
44
45
46namespace blaze {
47
48//=================================================================================================
49//
50// CLASS DEFINITION
51//
52//=================================================================================================
53
54//*************************************************************************************************
62template< typename T > // Type of the SIMD pack
64{
65 public:
66 //**Conversion operators************************************************************************
69 [[deprecated]] BLAZE_ALWAYS_INLINE constexpr T& operator~() noexcept;
70 [[deprecated]] BLAZE_ALWAYS_INLINE constexpr const T& operator~() const noexcept;
71
72 constexpr T& operator*() noexcept;
73 constexpr const T& operator*() const noexcept;
75 //**********************************************************************************************
76
77 protected:
78 //**Special member functions********************************************************************
81 SIMDPack() = default;
82 SIMDPack( const SIMDPack& ) = default;
83 SIMDPack( SIMDPack&& ) = default;
84 ~SIMDPack() = default;
85 SIMDPack& operator=( const SIMDPack& ) = default;
86 SIMDPack& operator=( SIMDPack&& ) = default;
88 //**********************************************************************************************
89};
90//*************************************************************************************************
91
92
93
94
95//=================================================================================================
96//
97// CONVERSION OPERATIONS
98//
99//=================================================================================================
100
101//*************************************************************************************************
109template< typename T > // Type of the SIMD pack
110[[deprecated]] BLAZE_ALWAYS_INLINE constexpr T& SIMDPack<T>::operator~() noexcept
111{
112 return static_cast<T&>( *this );
113}
114//*************************************************************************************************
115
116//*************************************************************************************************
124template< typename T > // Type of the SIMD pack
125[[deprecated]] BLAZE_ALWAYS_INLINE constexpr const T& SIMDPack<T>::operator~() const noexcept
126{
127 return static_cast<const T&>( *this );
128}
129//*************************************************************************************************
130
131//*************************************************************************************************
139template< typename T > // Type of the SIMD pack
141{
142 return static_cast<T&>( *this );
143}
144//*************************************************************************************************
145
146//*************************************************************************************************
154template< typename T > // Type of the SIMD pack
155BLAZE_ALWAYS_INLINE constexpr const T& SIMDPack<T>::operator*() const noexcept
156{
157 return static_cast<const T&>( *this );
158}
159//*************************************************************************************************
160
161
162
163
164//=================================================================================================
165//
166// GLOBAL FUNCTIONS
167//
168//=================================================================================================
169
170//*************************************************************************************************
173template< typename T >
174T& crtp_cast( SIMDPack<T>& pack );
175
176template< typename T >
177const T& crtp_cast( const SIMDPack<T>& pack );
179//*************************************************************************************************
180
181
182//*************************************************************************************************
191template< typename T > // Type of the SIMD pack
193{
194 return *pack;
195}
196//*************************************************************************************************
197
198
199//*************************************************************************************************
208template< typename T > // Type of the SIMD pack
210{
211 return *pack;
212}
213//*************************************************************************************************
214
215} // namespace blaze
216
217#endif
Base class for all SIMD data types.
Definition: SIMDPack.h:64
BLAZE_ALWAYS_INLINE constexpr T & operator~() noexcept
Conversion operator for non-constant SIMD packs.
Definition: SIMDPack.h:110
constexpr T & operator*() noexcept
Conversion operator for non-constant SIMD packs.
Definition: SIMDPack.h:140
MT & crtp_cast(Matrix< MT, SO > &matrix)
CRTP-based conversion operation for non-constant matrices.
Definition: Matrix.h:479
#define BLAZE_ALWAYS_INLINE
Platform dependent setup of an enforced inline keyword.
Definition: Inline.h:85
System settings for the inline keywords.