Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 26 additions & 10 deletions thrust/thrust/system/detail/generic/scan.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,48 +25,64 @@
#elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_MSVC)
# pragma system_header
#endif // no system header
#include <thrust/system/detail/generic/tag.h>

#include <thrust/iterator/iterator_traits.h>
#include <thrust/scan.h>
#include <thrust/system/detail/generic/scan.h>

#include <cuda/functional>

THRUST_NAMESPACE_BEGIN
namespace system::detail::generic
{

template <typename ExecutionPolicy, typename InputIterator, typename OutputIterator>
_CCCL_HOST_DEVICE OutputIterator inclusive_scan(
thrust::execution_policy<ExecutionPolicy>& exec, InputIterator first, InputIterator last, OutputIterator result);
thrust::execution_policy<ExecutionPolicy>& exec, InputIterator first, InputIterator last, OutputIterator result)
{
// assume plus as the associative operator
return thrust::inclusive_scan(exec, first, last, result, ::cuda::std::plus<>());
} // end inclusive_scan()

// XXX it is an error to call this function; it has no implementation
// Note: it is an error to call this function: this should be provided by a backend system
template <typename ExecutionPolicy, typename InputIterator, typename OutputIterator, typename BinaryFunction>
_CCCL_HOST_DEVICE OutputIterator inclusive_scan(
thrust::execution_policy<ExecutionPolicy>& exec,
InputIterator first,
InputIterator last,
OutputIterator result,
BinaryFunction binary_op);
BinaryFunction binary_op) = delete;

template <typename ExecutionPolicy, typename InputIterator, typename OutputIterator>
_CCCL_HOST_DEVICE OutputIterator exclusive_scan(
thrust::execution_policy<ExecutionPolicy>& exec, InputIterator first, InputIterator last, OutputIterator result);
thrust::execution_policy<ExecutionPolicy>& exec, InputIterator first, InputIterator last, OutputIterator result)
{
// Use the input iterator's value type per https://wg21.link/P0571
using ValueType = thrust::detail::it_value_t<InputIterator>;
return thrust::exclusive_scan(exec, first, last, result, ValueType{});
}

template <typename ExecutionPolicy, typename InputIterator, typename OutputIterator, typename T>
_CCCL_HOST_DEVICE OutputIterator exclusive_scan(
thrust::execution_policy<ExecutionPolicy>& exec,
InputIterator first,
InputIterator last,
OutputIterator result,
T init);
T init)
{
// assume plus as the associative operator
return thrust::exclusive_scan(exec, first, last, result, init, ::cuda::std::plus<>());
}

// XXX it is an error to call this function; it has no implementation
// Note: it is an error to call this function: this should be provided by a backend system
template <typename ExecutionPolicy, typename InputIterator, typename OutputIterator, typename T, typename BinaryFunction>
_CCCL_HOST_DEVICE OutputIterator exclusive_scan(
thrust::execution_policy<ExecutionPolicy>& exec,
InputIterator first,
InputIterator last,
OutputIterator result,
T init,
BinaryFunction binary_op);
BinaryFunction binary_op) = delete;

} // namespace system::detail::generic
THRUST_NAMESPACE_END

#include <thrust/system/detail/generic/scan.inl>
85 changes: 0 additions & 85 deletions thrust/thrust/system/detail/generic/scan.inl

This file was deleted.

Loading