Blaze 3.9
Noop.h
Go to the documentation of this file.
1//=================================================================================================
33//=================================================================================================
34
35#ifndef _BLAZE_MATH_FUNCTORS_NOOP_H_
36#define _BLAZE_MATH_FUNCTORS_NOOP_H_
37
38
39//*************************************************************************************************
40// Includes
41//*************************************************************************************************
42
43#include <utility>
46#include <blaze/system/Inline.h>
47
48
49namespace blaze {
50
51//=================================================================================================
52//
53// CLASS DEFINITION
54//
55//=================================================================================================
56
57//*************************************************************************************************
61struct Noop
62{
63 //**********************************************************************************************
69 template< typename T >
70 BLAZE_ALWAYS_INLINE BLAZE_DEVICE_CALLABLE decltype(auto) operator()( T&& a ) const
71 {
72 return std::forward<T>( a );
73 }
74 //**********************************************************************************************
75
76 //**********************************************************************************************
81 template< typename T >
82 static constexpr bool simdEnabled() { return true; }
83 //**********************************************************************************************
84
85 //**********************************************************************************************
90 static constexpr bool paddingEnabled() { return true; }
91 //**********************************************************************************************
92
93 //**********************************************************************************************
99 template< typename T >
100 BLAZE_ALWAYS_INLINE decltype(auto) load( const T& a ) const
101 {
103 return a;
104 }
105 //**********************************************************************************************
106};
107//*************************************************************************************************
108
109} // namespace blaze
110
111#endif
Macro for CUDA compatibility.
Constraint on the data type.
#define BLAZE_CONSTRAINT_MUST_BE_SIMD_PACK(T)
Constraint on the data type.
Definition: SIMDPack.h:60
#define BLAZE_ALWAYS_INLINE
Platform dependent setup of an enforced inline keyword.
Definition: Inline.h:85
#define BLAZE_DEVICE_CALLABLE
Conditional macro that sets host and device attributes when compiled with CUDA.
Definition: HostDevice.h:94
Generic wrapper for the null function.
Definition: Noop.h:62
static constexpr bool paddingEnabled()
Returns whether the operation supports padding, i.e. whether it can deal with zeros.
Definition: Noop.h:90
static constexpr bool simdEnabled()
Returns whether SIMD is enabled for the specified data type T.
Definition: Noop.h:82
BLAZE_ALWAYS_INLINE decltype(auto) load(const T &a) const
Returns the given SIMD vector without modifications.
Definition: Noop.h:100
System settings for the inline keywords.