All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Functions.h
Go to the documentation of this file.
1 //=================================================================================================
33 //=================================================================================================
34 
35 #ifndef _BLAZE_MATH_SMP_THREADS_FUNCTIONS_H_
36 #define _BLAZE_MATH_SMP_THREADS_FUNCTIONS_H_
37 
38 
39 //*************************************************************************************************
40 // Includes
41 //*************************************************************************************************
42 
43 #include <stdexcept>
45 #include <blaze/system/Inline.h>
46 #include <blaze/system/SMP.h>
48 #include <blaze/util/Types.h>
49 
50 
51 namespace blaze {
52 
53 //=================================================================================================
54 //
55 // SMP UTILITY FUNCTIONS
56 //
57 //=================================================================================================
58 
59 //*************************************************************************************************
69 {
70  return TheThreadBackend::size();
71 }
73 //*************************************************************************************************
74 
75 
76 //*************************************************************************************************
89 BLAZE_ALWAYS_INLINE size_t setNumThreads( size_t number )
90 {
91  if( number == 0UL )
92  throw std::invalid_argument( "Invalid number of threads" );
93 
94  TheThreadBackend::resize( number );
95 }
97 //*************************************************************************************************
98 
99 
100 //*************************************************************************************************
126 {
127 #if (defined _MSC_VER)
128  TheThreadBackend::resize( 0UL, true );
129 #endif
130 }
132 //*************************************************************************************************
133 
134 
135 
136 
137 //=================================================================================================
138 //
139 // COMPILE TIME CONSTRAINTS
140 //
141 //=================================================================================================
142 
143 //*************************************************************************************************
145 namespace {
146 
148 
149 }
151 //*************************************************************************************************
152 
153 } // namespace blaze
154 
155 #endif
BLAZE_ALWAYS_INLINE size_t size(const Vector< VT, TF > &vector)
Returns the current size/dimension of the vector.
Definition: Vector.h:258
#define BLAZE_BOOST_THREADS_PARALLEL_MODE
Compilation switch for the Boost parallelization.This compilation switch enables/disables the paralle...
Definition: SMP.h:122
#define BLAZE_ALWAYS_INLINE
Platform dependent setup of an enforced inline keyword.
Definition: Inline.h:85
Compile time assertion.
System settings for the shared-memory parallelization.
#define BLAZE_CPP_THREADS_PARALLEL_MODE
Compilation switch for the C++11 parallelization.This compilation switch enables/disables the paralle...
Definition: SMP.h:95
BLAZE_ALWAYS_INLINE void resize(Matrix< MT, SO > &matrix, size_t rows, size_t columns, bool preserve=true)
Changing the size of the matrix.
Definition: Matrix.h:535
BLAZE_ALWAYS_INLINE void shutDownThreads()
Provides a reliable shutdown of C++11 threads for Visual Studio compilers.
Definition: Functions.h:128
BLAZE_ALWAYS_INLINE void setNumThreads(size_t number)
Sets the number of threads to be used for thread parallel operations.
Definition: Functions.h:97
Header file for basic type definitions.
Header file for the C++11 and Boost thread backend.
#define BLAZE_STATIC_ASSERT(expr)
Compile time assertion macro.In case of an invalid compile time expression, a compilation error is cr...
Definition: StaticAssert.h:143
System settings for the inline keywords.
BLAZE_ALWAYS_INLINE size_t getNumThreads()
Returns the number of threads used for thread parallel operations.
Definition: Functions.h:77