Blaze 3.9
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
45#include <blaze/system/Inline.h>
46#include <blaze/system/SMP.h>
48#include <blaze/util/Types.h>
49
50
51namespace blaze {
52
53//=================================================================================================
54//
55// SMP UTILITY FUNCTIONS
56//
57//=================================================================================================
58
59//*************************************************************************************************
69{
71}
73//*************************************************************************************************
74
75
76//*************************************************************************************************
89BLAZE_ALWAYS_INLINE void setNumThreads( size_t number )
90{
91 if( number == 0UL ) {
92 BLAZE_THROW_INVALID_ARGUMENT( "Invalid number of threads" );
93 }
94
96}
98//*************************************************************************************************
99
100
101//*************************************************************************************************
127{
128#if (defined _MSC_VER)
129 TheThreadBackend::resize( 0UL, true );
130#endif
131}
133//*************************************************************************************************
134
135
136
137
138//=================================================================================================
139//
140// COMPILE TIME CONSTRAINTS
141//
142//=================================================================================================
143
144//*************************************************************************************************
146namespace {
147
149
150}
152//*************************************************************************************************
153
154} // namespace blaze
155
156#endif
Compile time assertion.
Header file for the C++11 and Boost thread backend.
void resize(Matrix< MT, SO > &matrix, size_t rows, size_t columns, bool preserve=true)
Changing the size of the matrix.
Definition: Matrix.h:1108
constexpr size_t size(const Matrix< MT, SO > &matrix) noexcept
Returns the total number of elements of the matrix.
Definition: Matrix.h:676
BLAZE_ALWAYS_INLINE size_t getNumThreads()
Returns the number of threads used for thread parallel operations.
Definition: Functions.h:77
BLAZE_ALWAYS_INLINE void setNumThreads(size_t number)
Sets the number of threads to be used for thread parallel operations.
Definition: Functions.h:97
BLAZE_ALWAYS_INLINE void shutDownThreads()
Provides a reliable shutdown of C++11 threads for Visual Studio compilers.
Definition: Functions.h:128
#define BLAZE_STATIC_ASSERT(expr)
Compile time assertion macro.
Definition: StaticAssert.h:112
#define BLAZE_ALWAYS_INLINE
Platform dependent setup of an enforced inline keyword.
Definition: Inline.h:85
#define BLAZE_CPP_THREADS_PARALLEL_MODE
Compilation switch for the C++11 parallelization.
Definition: SMP.h:124
#define BLAZE_BOOST_THREADS_PARALLEL_MODE
Compilation switch for the Boost parallelization.
Definition: SMP.h:152
#define BLAZE_THROW_INVALID_ARGUMENT(MESSAGE)
Macro for the emission of a std::invalid_argument exception.
Definition: Exception.h:235
Header file for the exception macros of the math module.
System settings for the inline keywords.
System settings for the shared-memory parallelization.
Header file for basic type definitions.