This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// STACK TRACE FUNCTIONS | |
_VCP_STATIC_ASSERT(_STD is_same< | |
decltype(__std_async_capture_stack_trace), | |
decltype(RtlCaptureStackBackTrace) | |
>::value); | |
// THREADPOOL FUNCTIONS | |
struct _Legacy_threadpool_thunk_data | |
{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// TEMPLATE FUNCTION inplace_merge WITH PRED | |
// The "usual invariants" for the inplace_merge helpers below are: | |
// [_First, _Mid) and [_Mid, _Last) are sorted | |
// _Pred(*_Mid, *_First) note: this means *_Mid is the "lowest" element | |
// _Pred(*prev(_Last), *prev(_Mid)) note: this means *prev(_Mid) is the "highest" element | |
// _Count1 == distance(_First, _Mid) | |
// _Count2 == distance(_Mid, _Last) | |
// _Count1 > 1 | |
// _Count2 > 1 | |
template<class _BidIt> inline |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <hpx/hpx.hpp> | |
#include <hpx/hpx_init.hpp> | |
#include <hpx/parallel/algorithms/for_each.hpp> | |
#include <stdio.h> | |
#include <chrono> | |
#include <cstddef> | |
#include <iterator> | |
#include <vector> | |
#include "stopwatch.hpp" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cl /Zi /std:c++latest /MD /EHsc /O2 /openmp .\openmp.cpp | |
cl /Zi /std:c++latest /MD /EHsc /O2 .\parallel_for_each_comparative.cpp | |
cl /D_HAS_AUTO_PTR_ETC=1 /std:c++latest /MD /EHsc /O2 /IC:\Users\bion\Desktop\vcpkg-export-20170608-100432\installed\x86-windows\include .\hpx_for_each.cpp /link /libpath:C:\Users\bion\Desktop\vcpkg-export-20170608-100432\installed\x86-windows\lib hpx.lib hpx_init.lib boost_program_options-vc140-mt-1_64.lib boost_system-vc140-mt-1_64.lib boost_timer-vc140-mt-1_64.lib boost_date_time-vc140-mt-1_64.lib boost_thread-vc140-mt-1_64.lib | |
PS TEST WCFB01 C:\Users\bion\Desktop>.\parallel_for_each_comparative.exe | |
Testing sequential | |
A[70] is 1 | |
Sequential took 2874ms |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <assert.h> | |
#include <stdio.h> | |
#include <algorithm> | |
#include <random> | |
#include <vector> | |
using namespace std; | |
struct kv { | |
unsigned int significant; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <algorithm> | |
#include <chrono> | |
#include <functional> | |
#include <iterator> | |
#include <random> | |
#include <vector> | |
using namespace std; | |
using namespace std::chrono; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// CLASS mutex | |
class mutex | |
{ // class for mutual exclusion | |
public: | |
constexpr mutex() _NOEXCEPT | |
: _Data() | |
{ // construct std::mutex | |
} | |
mutex(const mutex&) = delete; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
template<class _BidIt, | |
class _Diff, | |
class _Ty> inline | |
_BidIt _Buffered_rotate_unchecked(const _BidIt _First, const _BidIt _Mid, const _BidIt _Last, | |
const _Diff _Count1, const _Diff _Count2, _Temporary_buffer<_Ty>& _Temp_buf) | |
{ // rotate [_First, _Last) using temp buffer | |
// precondition: _Count1 == distance(_First, _Mid) | |
// precondition: _Count2 == distance(_Mid, _Last) | |
if (_Count1 == 0) | |
{ // do nothing |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
template <class T> | |
class StdAllocatorSysMem | |
{ | |
public: | |
typedef T value_type; | |
StdAllocatorSysMem() = default; | |
StdAllocatorSysMem(const StdAllocatorSysMem&) = default; | |
template <class Other> | |
StdAllocatorSysMem(const StdAllocatorSysMem<Other>&) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#if _HAS_CXX17 | |
// FUNCTION TEMPLATE clamp | |
template<class _Ty, | |
class _Pr> | |
constexpr const _Ty& clamp(const _Ty& _Val, const _Ty& _Min_val, | |
const _Ty& _Max_val, _Pr _Pred) | |
{ // returns _Val constrained to [_Min_val, _Max_val] ordered by _Pred | |
#if _ITERATOR_DEBUG_LEVEL == 2 | |
return (_DEBUG_LT_PRED(_Pred, _Max_val, _Min_val) | |
? (_DEBUG_ERROR("invalid bounds arguments passed to std::clamp"), _Val) |