Skip to content
This repository has been archived by the owner on Mar 21, 2024. It is now read-only.

Commit

Permalink
Fix compilation of async algorithms when RDC is enabled.
Browse files Browse the repository at this point in the history
THRUST_RUNTIME_FUNCTION includes `__device__` when RDC is enabled. Since
the async algorithms use host-only futures and events, this causes builds
to fail. Making the async entry points regular `__host__` functions fixes
this.

This fixes #1050.
  • Loading branch information
alliepiper committed May 25, 2020
1 parent 1b00acb commit aaa6fb7
Show file tree
Hide file tree
Showing 5 changed files with 0 additions and 23 deletions.
9 changes: 0 additions & 9 deletions thrust/system/cuda/detail/async/copy.h
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,6 @@ template <
typename FromPolicy, typename ToPolicy
, typename ForwardIt, typename OutputIt, typename Size
>
THRUST_RUNTIME_FUNCTION
auto async_copy_n(
FromPolicy& from_exec
, ToPolicy& to_exec
Expand Down Expand Up @@ -150,7 +149,6 @@ template <
typename FromPolicy, typename ToPolicy
, typename ForwardIt, typename OutputIt, typename Size
>
THRUST_RUNTIME_FUNCTION
auto async_copy_n(
thrust::cuda::execution_policy<FromPolicy>& from_exec
, thrust::cuda::execution_policy<ToPolicy>& to_exec
Expand Down Expand Up @@ -194,7 +192,6 @@ template <
typename FromPolicy, typename ToPolicy
, typename ForwardIt, typename OutputIt, typename Size
>
THRUST_RUNTIME_FUNCTION
auto async_copy_n(
FromPolicy& from_exec
, ToPolicy& to_exec
Expand Down Expand Up @@ -254,7 +251,6 @@ template <
typename FromPolicy, typename ToPolicy
, typename ForwardIt, typename OutputIt, typename Size
>
THRUST_RUNTIME_FUNCTION
auto async_copy_n(
FromPolicy& from_exec
, thrust::cuda::execution_policy<ToPolicy>& to_exec
Expand Down Expand Up @@ -358,7 +354,6 @@ template <
typename FromPolicy, typename ToPolicy
, typename ForwardIt, typename OutputIt, typename Size
>
THRUST_RUNTIME_FUNCTION
auto async_copy_n(
thrust::cuda::execution_policy<FromPolicy>& from_exec
, ToPolicy& to_exec
Expand Down Expand Up @@ -440,7 +435,6 @@ template <
typename FromPolicy, typename ToPolicy
, typename ForwardIt, typename OutputIt, typename Size
>
THRUST_RUNTIME_FUNCTION
auto async_copy_n(
FromPolicy& from_exec
, ToPolicy& to_exec
Expand Down Expand Up @@ -486,7 +480,6 @@ template <
typename FromPolicy, typename ToPolicy
, typename ForwardIt, typename Sentinel, typename OutputIt
>
THRUST_RUNTIME_FUNCTION
auto async_copy(
thrust::cuda::execution_policy<FromPolicy>& from_exec
, thrust::cpp::execution_policy<ToPolicy>& to_exec
Expand All @@ -505,7 +498,6 @@ template <
typename FromPolicy, typename ToPolicy
, typename ForwardIt, typename Sentinel, typename OutputIt
>
THRUST_RUNTIME_FUNCTION
auto async_copy(
thrust::cpp::execution_policy<FromPolicy>& from_exec
, thrust::cuda::execution_policy<ToPolicy>& to_exec
Expand All @@ -524,7 +516,6 @@ template <
typename FromPolicy, typename ToPolicy
, typename ForwardIt, typename Sentinel, typename OutputIt
>
THRUST_RUNTIME_FUNCTION
auto async_copy(
thrust::cuda::execution_policy<FromPolicy>& from_exec
, thrust::cuda::execution_policy<ToPolicy>& to_exec
Expand Down
2 changes: 0 additions & 2 deletions thrust/system/cuda/detail/async/for_each.h
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,6 @@ template <
typename DerivedPolicy
, typename ForwardIt, typename Size, typename UnaryFunction
>
THRUST_RUNTIME_FUNCTION
auto async_for_each_n(
execution_policy<DerivedPolicy>& policy,
ForwardIt first,
Expand Down Expand Up @@ -139,7 +138,6 @@ template <
typename DerivedPolicy
, typename ForwardIt, typename Sentinel, typename UnaryFunction
>
THRUST_RUNTIME_FUNCTION
auto async_for_each(
execution_policy<DerivedPolicy>& policy,
ForwardIt first,
Expand Down
4 changes: 0 additions & 4 deletions thrust/system/cuda/detail/async/reduce.h
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@ template <
typename DerivedPolicy
, typename ForwardIt, typename Size, typename T, typename BinaryOp
>
THRUST_RUNTIME_FUNCTION
auto async_reduce_n(
execution_policy<DerivedPolicy>& policy
, ForwardIt first
Expand Down Expand Up @@ -192,7 +191,6 @@ template <
typename DerivedPolicy
, typename ForwardIt, typename Sentinel, typename T, typename BinaryOp
>
THRUST_RUNTIME_FUNCTION
auto async_reduce(
execution_policy<DerivedPolicy>& policy
, ForwardIt first
Expand All @@ -218,7 +216,6 @@ template <
, typename ForwardIt, typename Size, typename OutputIt
, typename T, typename BinaryOp
>
THRUST_RUNTIME_FUNCTION
auto async_reduce_into_n(
execution_policy<DerivedPolicy>& policy
, ForwardIt first
Expand Down Expand Up @@ -330,7 +327,6 @@ template <
, typename ForwardIt, typename Sentinel, typename OutputIt
, typename T, typename BinaryOp
>
THRUST_RUNTIME_FUNCTION
auto async_reduce_into(
execution_policy<DerivedPolicy>& policy
, ForwardIt first
Expand Down
6 changes: 0 additions & 6 deletions thrust/system/cuda/detail/async/sort.h
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,6 @@ template <
typename DerivedPolicy
, typename ForwardIt, typename Size, typename StrictWeakOrdering
>
THRUST_RUNTIME_FUNCTION
auto async_stable_sort_n(
execution_policy<DerivedPolicy>& policy,
ForwardIt first,
Expand Down Expand Up @@ -173,7 +172,6 @@ template <
typename DerivedPolicy
, typename ForwardIt, typename Size, typename StrictWeakOrdering
>
THRUST_RUNTIME_FUNCTION
auto async_stable_sort_n(
execution_policy<DerivedPolicy>& policy,
ForwardIt first,
Expand Down Expand Up @@ -289,7 +287,6 @@ auto async_stable_sort_n(
}

template <typename T, typename Size, typename StrictWeakOrdering>
THRUST_RUNTIME_FUNCTION
typename std::enable_if<
is_operator_less_function_object<StrictWeakOrdering>::value
, cudaError_t
Expand All @@ -316,7 +313,6 @@ invoke_radix_sort(
}

template <typename T, typename Size, typename StrictWeakOrdering>
THRUST_RUNTIME_FUNCTION
typename std::enable_if<
is_operator_greater_function_object<StrictWeakOrdering>::value
, cudaError_t
Expand Down Expand Up @@ -349,7 +345,6 @@ template <
typename DerivedPolicy
, typename ForwardIt, typename Size, typename StrictWeakOrdering
>
THRUST_RUNTIME_FUNCTION
auto async_stable_sort_n(
execution_policy<DerivedPolicy>& policy
, ForwardIt first
Expand Down Expand Up @@ -504,7 +499,6 @@ template <
typename DerivedPolicy
, typename ForwardIt, typename Sentinel, typename StrictWeakOrdering
>
THRUST_RUNTIME_FUNCTION
auto async_stable_sort(
execution_policy<DerivedPolicy>& policy,
ForwardIt first,
Expand Down
2 changes: 0 additions & 2 deletions thrust/system/cuda/detail/async/transform.h
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,6 @@ template <
typename DerivedPolicy
, typename ForwardIt, typename Size, typename OutputIt, typename UnaryOperation
>
THRUST_RUNTIME_FUNCTION
auto async_transform_n(
execution_policy<DerivedPolicy>& policy,
ForwardIt first,
Expand Down Expand Up @@ -142,7 +141,6 @@ template <
, typename ForwardIt, typename Sentinel, typename OutputIt
, typename UnaryOperation
>
THRUST_RUNTIME_FUNCTION
auto async_transform(
execution_policy<DerivedPolicy>& policy,
ForwardIt first,
Expand Down

0 comments on commit aaa6fb7

Please sign in to comment.