Skip to content

Commit

Permalink
Merge pull request NVIDIA#1694 from NVIDIA/revert-1687-constrain-any-…
Browse files Browse the repository at this point in the history
…system-tag

Revert "Make any_system_tag only convertible to other system tags (NVIDIA#1687)"
  • Loading branch information
ericniebler authored May 19, 2022
2 parents 63a0504 + 4bb1334 commit d261949
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 39 deletions.
6 changes: 0 additions & 6 deletions thrust/detail/execution_policy.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
#pragma once

#include <thrust/detail/config.h>
#include <thrust/detail/type_traits.h>

THRUST_NAMESPACE_BEGIN

Expand Down Expand Up @@ -67,11 +66,6 @@ const DerivedPolicy &derived_cast(const execution_policy_base<DerivedPolicy> &x)
return static_cast<const DerivedPolicy&>(x);
}

template <class>
struct is_system_tag
: false_type
{};

} // end detail

template<typename DerivedPolicy>
Expand Down
18 changes: 3 additions & 15 deletions thrust/iterator/detail/any_system_tag.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,28 +18,16 @@

#include <thrust/detail/config.h>
#include <thrust/detail/execution_policy.h>
#include <thrust/detail/type_traits.h>

THRUST_NAMESPACE_BEGIN

struct any_system_tag
: thrust::execution_policy<any_system_tag>
{
// allow any_system_tag to convert to any system tag type
template<typename T,
typename detail::enable_if<detail::is_system_tag<T>::value, int>::type = 0>
operator T () const {return T();}
// allow any_system_tag to convert to any type at all
// XXX make this safer using enable_if<is_tag<T>> upon c++11
template<typename T> operator T () const {return T();}
};

namespace detail {

template <>
struct is_system_tag<any_system_tag>
: true_type
{};

}


THRUST_NAMESPACE_END

9 changes: 0 additions & 9 deletions thrust/iterator/detail/device_system_tag.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,4 @@ THRUST_NAMESPACE_BEGIN

typedef thrust::system::__THRUST_DEVICE_SYSTEM_NAMESPACE::tag device_system_tag;

namespace detail {

template <>
struct is_system_tag<device_system_tag>
: true_type
{};

}

THRUST_NAMESPACE_END
9 changes: 0 additions & 9 deletions thrust/iterator/detail/host_system_tag.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,4 @@ THRUST_NAMESPACE_BEGIN

typedef thrust::system::__THRUST_HOST_SYSTEM_NAMESPACE::tag host_system_tag;

namespace detail {

template <>
struct is_system_tag<host_system_tag>
: true_type
{};

}

THRUST_NAMESPACE_END

0 comments on commit d261949

Please sign in to comment.