Skip to content

Commit

Permalink
cleanup unnecessary code
Browse files Browse the repository at this point in the history
Signed-off-by: Dan Hoeflinger <dan.hoeflinger@intel.com>
  • Loading branch information
danhoeflinger committed Dec 18, 2024
1 parent bae7c6a commit 7a67c0b
Show file tree
Hide file tree
Showing 6 changed files with 0 additions and 161 deletions.
1 change: 0 additions & 1 deletion include/oneapi/dpl/internal/version_impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
# define _ONEDPL_STD_FEATURE_MACROS_PRESENT 1
// Clang 15 and older do not support range adaptors, see https://bugs.llvm.org/show_bug.cgi?id=44833
# define _ONEDPL_CPP20_RANGES_PRESENT ((__cpp_lib_ranges >= 201911L) && !(__clang__ && __clang_major__ < 16))
# define _ONEDPL_CPP20_ATOMIC_REF_PRESENT (__cpp_lib_atomic_ref >= 201806L)
#else
# define _ONEDPL_STD_FEATURE_MACROS_PRESENT 0
# define _ONEDPL_CPP20_RANGES_PRESENT 0
Expand Down
1 change: 0 additions & 1 deletion include/oneapi/dpl/pstl/algorithm_impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
#include <type_traits>
#include <functional>
#include <algorithm>
#include <memory>

#include "algorithm_fwd.h"

Expand Down
109 changes: 0 additions & 109 deletions include/oneapi/dpl/pstl/omp/parallel_histogram.h

This file was deleted.

5 changes: 0 additions & 5 deletions include/oneapi/dpl/pstl/parallel_backend_omp.h
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,4 @@
//------------------------------------------------------------------------
#include "./omp/parallel_merge.h"

//------------------------------------------------------------------------
// parallel_histogram
//------------------------------------------------------------------------
#include "./omp/parallel_histogram.h"

#endif //_ONEDPL_PARALLEL_BACKEND_OMP_H
12 changes: 0 additions & 12 deletions include/oneapi/dpl/pstl/parallel_backend_serial.h
Original file line number Diff line number Diff line change
Expand Up @@ -153,18 +153,6 @@ __parallel_for_each(oneapi::dpl::__internal::__serial_backend_tag, _ExecutionPol
__f(*__iter);
}

template <typename _ExecutionPolicy, typename _RandomAccessIterator1, typename _Size, typename _RandomAccessIterator2,
typename _FpHist, typename _FpInitialize, typename _FpAccum>
void
__parallel_histogram(oneapi::dpl::__internal::__serial_backend_tag, _ExecutionPolicy&& exec,
_RandomAccessIterator1 __first, _RandomAccessIterator1 __last, _Size __num_bins,
_RandomAccessIterator2 __histogram_first, _FpHist __f, _FpInitialize, _FpAccum)
{
using _HistogramValueT = typename ::std::iterator_traits<_RandomAccessIterator2>::value_type;
::std::fill(__histogram_first, __histogram_first + __num_bins, _HistogramValueT{0});
__f(__first, __last, __histogram_first);
}

} // namespace __serial_backend
} // namespace dpl
} // namespace oneapi
Expand Down
33 changes: 0 additions & 33 deletions include/oneapi/dpl/pstl/parallel_backend_tbb.h
Original file line number Diff line number Diff line change
Expand Up @@ -1331,39 +1331,6 @@ struct __thread_enumerable_storage
tbb::enumerable_thread_specific<std::vector<_ValueType>> __thread_specific_storage;
};

//------------------------------------------------------------------------
// parallel_histogram
//------------------------------------------------------------------------
template <class _ExecutionPolicy, typename _RandomAccessIterator1, typename _Size, typename _RandomAccessIterator2,
typename _FpHist, typename _FpInitialize, typename _FpAccum>
void
__parallel_histogram(oneapi::dpl::__internal::__tbb_backend_tag, _ExecutionPolicy&&, _RandomAccessIterator1 __first,
_RandomAccessIterator1 __last, _Size __num_bins, _RandomAccessIterator2 __histogram_first,
_FpHist __f, _FpInitialize __init, _FpAccum __accum)
{
using _HistogramValueT = typename ::std::iterator_traits<_RandomAccessIterator2>::value_type;

tbb::this_task_arena::isolate([&]() {
tbb::enumerable_thread_specific<std::vector<_HistogramValueT>> __thread_local_histogram(__num_bins,
_HistogramValueT{0});
size_t __n = __last - __first;
tbb::parallel_for(tbb::blocked_range<_Size>(0, __n, 1024), [&](const tbb::blocked_range<_Size>& __range) {
std::vector<_HistogramValueT>& __local_histogram = __thread_local_histogram.local();
__f(__first + __range.begin(), __first + __range.end(), __local_histogram.begin());
});

tbb::parallel_for(tbb::blocked_range<_Size>(0, __num_bins), [&](const tbb::blocked_range<_Size>& __range) {
auto __local_histogram = __thread_local_histogram.begin();
__init(__local_histogram->begin() + __range.begin(), __range.size(), __histogram_first + __range.begin());
++__local_histogram;
for (; __local_histogram != __thread_local_histogram.end(); ++__local_histogram)
{
__accum(__local_histogram->begin() + __range.begin(), __range.size(),
__histogram_first + __range.begin());
}
});
});
}

} // namespace __tbb_backend
} // namespace dpl
Expand Down

0 comments on commit 7a67c0b

Please sign in to comment.