Skip to content

Commit

Permalink
Change approach to instead comment out upstream PSTL define that has …
Browse files Browse the repository at this point in the history
…changed
  • Loading branch information
adamfidel committed May 6, 2024
1 parent a04cadc commit 57e5129
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 16 deletions.
4 changes: 2 additions & 2 deletions include/oneapi/dpl/pstl/algorithm_impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -3882,7 +3882,7 @@ _RandomAccessIterator
__brick_min_element(_RandomAccessIterator __first, _RandomAccessIterator __last, _Compare __comp,
/* __is_vector = */ ::std::true_type) noexcept
{
#if _ONEDPL_IS_ONE_OR_EMPTY(_PSTL_UDR_PRESENT) || _ONEDPL_UDR_PRESENT
#if /*_PSTL_UDR_PRESENT ||*/ _ONEDPL_UDR_PRESENT
return __unseq_backend::__simd_min_element(__first, __last - __first, __comp);
#else
return ::std::min_element(__first, __last, __comp);
Expand Down Expand Up @@ -3949,7 +3949,7 @@ ::std::pair<_RandomAccessIterator, _RandomAccessIterator>
__brick_minmax_element(_RandomAccessIterator __first, _RandomAccessIterator __last, _Compare __comp,
/* __is_vector = */ ::std::true_type) noexcept
{
#if _ONEDPL_IS_ONE_OR_EMPTY(_PSTL_UDR_PRESENT) || _ONEDPL_UDR_PRESENT
#if /*_PSTL_UDR_PRESENT ||*/ _ONEDPL_UDR_PRESENT
return __unseq_backend::__simd_minmax_element(__first, __last - __first, __comp);
#else
return ::std::minmax_element(__first, __last, __comp);
Expand Down
2 changes: 1 addition & 1 deletion include/oneapi/dpl/pstl/numeric_impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ __brick_transform_scan(_RandomAccessIterator __first, _RandomAccessIterator __la
_UnaryOperation __unary_op, _Tp __init, _BinaryOperation __binary_op, _Inclusive,
/*is_vector=*/::std::true_type) noexcept
{
#if _ONEDPL_IS_ONE_OR_EMPTY(_PSTL_UDS_PRESENT) || _ONEDPL_UDS_PRESENT
#if /*_PSTL_UDS_PRESENT || */ _ONEDPL_UDS_PRESENT
if (_Inclusive() || !oneapi::dpl::__internal::__iterators_possibly_equal(__first, __result))
{
return __unseq_backend::__simd_scan(__first, __last - __first, __result, __unary_op, __init, __binary_op,
Expand Down
13 changes: 0 additions & 13 deletions include/oneapi/dpl/pstl/utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,19 +41,6 @@
# include <cstring> // memcpy
#endif

#define _ONEDPL_IS_EMPTY_STRING(_X) ((0 - _X - 1) == 1 && (_X - 0) != -2)
#define _ONEDPL_IS_ONE(_X) ((_X - 1) == 0)

// This macro is needed because there are two ways that input defines are used:
//
// 1. A feature X is enabled if the macro X is defined as 1 and disabled if
// the macro X is defined as 0
// 2. A feature X is enabled if the macro X is defined with no value (i.e.,
// an empty macro) and disabled if the macro is undefined
//
// We want to catch both cases in a single macro
#define _ONEDPL_IS_ONE_OR_EMPTY(_X) (_ONEDPL_IS_EMPTY_STRING(_X) || _ONEDPL_IS_ONE(_X))

namespace oneapi
{
namespace dpl
Expand Down

0 comments on commit 57e5129

Please sign in to comment.