Skip to content

Commit

Permalink
Drop MSVC 2005 workaround
Browse files Browse the repository at this point in the history
  • Loading branch information
bernhardmgruber committed Jan 30, 2025
1 parent a1a73a8 commit 8f457f8
Showing 1 changed file with 8 additions and 35 deletions.
43 changes: 8 additions & 35 deletions thrust/thrust/system/cuda/detail/get_value.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,51 +38,24 @@
THRUST_NAMESPACE_BEGIN
namespace cuda_cub
{

namespace
{

template <typename DerivedPolicy, typename Pointer>
inline _CCCL_HOST_DEVICE typename thrust::iterator_value<Pointer>::type
get_value_msvc2005_war(execution_policy<DerivedPolicy>& exec, Pointer ptr)
get_value(execution_policy<DerivedPolicy>& exec, Pointer ptr)
{
using result_type = typename thrust::iterator_value<Pointer>::type;

// XXX war nvbugs/881631
struct war_nvbugs_881631
{
_CCCL_HOST inline static result_type host_path(execution_policy<DerivedPolicy>& exec, Pointer ptr)
{
NV_IF_TARGET(
NV_IS_HOST,
(
// when called from host code, implement with assign_value
// note that this requires a type with default constructor
result_type result;

thrust::host_system_tag host_tag;
result_type result; thrust::host_system_tag host_tag;
cross_system<thrust::host_system_tag, DerivedPolicy> systems(host_tag, exec);
assign_value(systems, &result, ptr);

return result;
}

_CCCL_DEVICE inline static result_type device_path(execution_policy<DerivedPolicy>&, Pointer ptr)
{
return result;),
(
// when called from device code, just do simple deref
return *thrust::raw_pointer_cast(ptr);
}
};

NV_IF_TARGET(
NV_IS_HOST, (return war_nvbugs_881631::host_path(exec, ptr);), (return war_nvbugs_881631::device_path(exec, ptr);))
} // end get_value_msvc2005_war()
} // namespace

template <typename DerivedPolicy, typename Pointer>
inline _CCCL_HOST_DEVICE typename thrust::iterator_value<Pointer>::type
get_value(execution_policy<DerivedPolicy>& exec, Pointer ptr)
{
return get_value_msvc2005_war(exec, ptr);
return *thrust::raw_pointer_cast(ptr);))
} // end get_value()

} // namespace cuda_cub
THRUST_NAMESPACE_END

Expand Down

0 comments on commit 8f457f8

Please sign in to comment.