diff options
Diffstat (limited to 'pstl/include/pstl/internal/parallel_backend_tbb.h')
-rw-r--r-- | pstl/include/pstl/internal/parallel_backend_tbb.h | 51 |
1 files changed, 25 insertions, 26 deletions
diff --git a/pstl/include/pstl/internal/parallel_backend_tbb.h b/pstl/include/pstl/internal/parallel_backend_tbb.h index f1836aace0ae..8f1e39527abf 100644 --- a/pstl/include/pstl/internal/parallel_backend_tbb.h +++ b/pstl/include/pstl/internal/parallel_backend_tbb.h @@ -10,7 +10,6 @@ #ifndef _PSTL_PARALLEL_BACKEND_TBB_H #define _PSTL_PARALLEL_BACKEND_TBB_H -#include <cassert> #include <algorithm> #include <type_traits> @@ -529,7 +528,7 @@ class __task : public tbb::detail::d1::task __task* allocate_func_task(_Fn&& __f) { - assert(_M_execute_data != nullptr); + _PSTL_ASSERT(_M_execute_data != nullptr); tbb::detail::d1::small_object_allocator __alloc{}; auto __t = __alloc.new_object<__func_task<typename std::decay<_Fn>::type>>(*_M_execute_data, std::forward<_Fn>(__f)); @@ -574,7 +573,7 @@ class __task : public tbb::detail::d1::task make_additional_child_of(__task* __parent, _Fn&& __f) { auto __t = make_child_of(__parent, std::forward<_Fn>(__f)); - assert(__parent->_M_refcount.load(std::memory_order_relaxed) > 0); + _PSTL_ASSERT(__parent->_M_refcount.load(std::memory_order_relaxed) > 0); ++__parent->_M_refcount; return __t; } @@ -595,7 +594,7 @@ class __task : public tbb::detail::d1::task inline void spawn(__task* __t) { - assert(_M_execute_data != nullptr); + _PSTL_ASSERT(_M_execute_data != nullptr); tbb::detail::d1::spawn(*__t, *_M_execute_data->context); } @@ -648,11 +647,11 @@ class __func_task : public __task this->~__func_task(); - assert(__parent != nullptr); - assert(__parent->_M_refcount.load(std::memory_order_relaxed) > 0); + _PSTL_ASSERT(__parent != nullptr); + _PSTL_ASSERT(__parent->_M_refcount.load(std::memory_order_relaxed) > 0); if (--__parent->_M_refcount == 0) { - assert(__next == nullptr); + _PSTL_ASSERT(__next == nullptr); __alloc.deallocate(this, *__ed); return __parent; } @@ -864,20 +863,20 @@ class __merge_func { const auto __nx = (_M_xe - _M_xs); const auto __ny = (_M_ye - _M_ys); - assert(__nx > 0 && __ny > 0); + _PSTL_ASSERT(__nx > 0 && __ny > 0); - assert(_x_orig == _y_orig); - assert(!is_partial()); + _PSTL_ASSERT(_x_orig == _y_orig); + _PSTL_ASSERT(!is_partial()); if (_x_orig) { - assert(std::is_sorted(_M_x_beg + _M_xs, _M_x_beg + _M_xe, _M_comp)); - assert(std::is_sorted(_M_x_beg + _M_ys, _M_x_beg + _M_ye, _M_comp)); + _PSTL_ASSERT(std::is_sorted(_M_x_beg + _M_xs, _M_x_beg + _M_xe, _M_comp)); + _PSTL_ASSERT(std::is_sorted(_M_x_beg + _M_ys, _M_x_beg + _M_ye, _M_comp)); return !_M_comp(*(_M_x_beg + _M_ys), *(_M_x_beg + _M_xe - 1)); } - assert(std::is_sorted(_M_z_beg + _M_xs, _M_z_beg + _M_xe, _M_comp)); - assert(std::is_sorted(_M_z_beg + _M_ys, _M_z_beg + _M_ye, _M_comp)); + _PSTL_ASSERT(std::is_sorted(_M_z_beg + _M_xs, _M_z_beg + _M_xe, _M_comp)); + _PSTL_ASSERT(std::is_sorted(_M_z_beg + _M_ys, _M_z_beg + _M_ye, _M_comp)); return !_M_comp(*(_M_z_beg + _M_zs + __nx), *(_M_z_beg + _M_zs + __nx - 1)); } void @@ -885,7 +884,7 @@ class __merge_func { const auto __nx = (_M_xe - _M_xs); const auto __ny = (_M_ye - _M_ys); - assert(__nx > 0 && __ny > 0); + _PSTL_ASSERT(__nx > 0 && __ny > 0); if (_x_orig) __move_range_construct()(_M_x_beg + _M_xs, _M_x_beg + _M_xe, _M_z_beg + _M_zs); @@ -916,7 +915,7 @@ class __merge_func __task* merge_ranges(__task* __self) { - assert(_x_orig == _y_orig); //two merged subrange must be lie into the same buffer + _PSTL_ASSERT(_x_orig == _y_orig); //two merged subrange must be lie into the same buffer const auto __nx = (_M_xe - _M_xs); const auto __ny = (_M_ye - _M_ys); @@ -932,15 +931,15 @@ class __merge_func _M_leaf_merge(_M_x_beg + _M_xs, _M_x_beg + _M_xe, _M_x_beg + _M_ys, _M_x_beg + _M_ye, _M_z_beg + _M_zs, _M_comp, __move_value_construct(), __move_value_construct(), __move_range_construct(), __move_range_construct()); - assert(parent_merge(__self)); //not root merging task + _PSTL_ASSERT(parent_merge(__self)); //not root merging task } //merge to "origin" else { - assert(_x_orig == _y_orig); + _PSTL_ASSERT(_x_orig == _y_orig); - assert(is_partial() || std::is_sorted(_M_z_beg + _M_xs, _M_z_beg + _M_xe, _M_comp)); - assert(is_partial() || std::is_sorted(_M_z_beg + _M_ys, _M_z_beg + _M_ye, _M_comp)); + _PSTL_ASSERT(is_partial() || std::is_sorted(_M_z_beg + _M_xs, _M_z_beg + _M_xe, _M_comp)); + _PSTL_ASSERT(is_partial() || std::is_sorted(_M_z_beg + _M_ys, _M_z_beg + _M_ye, _M_comp)); const auto __nx = (_M_xe - _M_xs); const auto __ny = (_M_ye - _M_ys); @@ -957,8 +956,8 @@ class __merge_func __task* process_ranges(__task* __self) { - assert(_x_orig == _y_orig); - assert(!_split); + _PSTL_ASSERT(_x_orig == _y_orig); + _PSTL_ASSERT(!_split); auto p = parent_merge(__self); @@ -1004,7 +1003,7 @@ class __merge_func __task* split_merging(__task* __self) { - assert(_x_orig == _y_orig); + _PSTL_ASSERT(_x_orig == _y_orig); const auto __nx = (_M_xe - _M_xs); const auto __ny = (_M_ye - _M_ys); @@ -1076,8 +1075,8 @@ operator()(__task* __self) { const _SizeType __nx = (_M_xe - _M_xs); const _SizeType __ny = (_M_ye - _M_ys); - assert(__nx > 0); - assert(__nx > 0); + _PSTL_ASSERT(__nx > 0); + _PSTL_ASSERT(__nx > 0); if (__nx < __ny) move_x_range(); @@ -1133,7 +1132,7 @@ __stable_sort_func<_RandomAccessIterator1, _RandomAccessIterator2, _Compare, _Le if (__n <= __sort_cut_off) { _M_leaf_sort(_M_xs, _M_xe, _M_comp); - assert(!_M_root); + _PSTL_ASSERT(!_M_root); return nullptr; } |