Add files using upload-large-folder tool
Browse filesThis view is limited to 50 files because it contains too many changes. See raw diff
- videochat2/lib/python3.10/site-packages/tensorflow/include/external/local_config_cuda/cuda/cuda/include/thrust/iterator/constant_iterator.h +250 -0
- videochat2/lib/python3.10/site-packages/tensorflow/include/external/local_config_cuda/cuda/cuda/include/thrust/iterator/detail/device_system_tag.h +30 -0
- videochat2/lib/python3.10/site-packages/tensorflow/include/external/local_config_cuda/cuda/cuda/include/thrust/iterator/detail/iterator_category_to_traversal.h +130 -0
- videochat2/lib/python3.10/site-packages/tensorflow/include/external/local_config_cuda/cuda/cuda/include/thrust/iterator/detail/iterator_category_with_system_and_traversal.h +56 -0
- videochat2/lib/python3.10/site-packages/tensorflow/include/external/local_config_cuda/cuda/cuda/include/thrust/iterator/detail/permutation_iterator_base.h +54 -0
- videochat2/lib/python3.10/site-packages/tensorflow/include/external/local_config_cuda/cuda/cuda/include/thrust/iterator/detail/retag.h +147 -0
- videochat2/lib/python3.10/site-packages/tensorflow/include/external/local_config_cuda/cuda/cuda/include/thrust/iterator/detail/reverse_iterator_base.h +43 -0
- videochat2/lib/python3.10/site-packages/tensorflow/include/external/local_config_cuda/cuda/cuda/include/thrust/iterator/detail/transform_iterator.inl +69 -0
- videochat2/lib/python3.10/site-packages/tensorflow/include/external/local_config_cuda/cuda/cuda/include/thrust/iterator/detail/zip_iterator_base.h +353 -0
- videochat2/lib/python3.10/site-packages/tensorflow/include/external/local_config_cuda/cuda/cuda/include/thrust/iterator/iterator_facade.h +542 -0
- videochat2/lib/python3.10/site-packages/tensorflow/include/external/local_config_cuda/cuda/cuda/include/thrust/iterator/transform_iterator.h +355 -0
- videochat2/lib/python3.10/site-packages/tensorflow/include/external/local_config_cuda/cuda/cuda/include/thrust/iterator/transform_output_iterator.h +164 -0
- videochat2/lib/python3.10/site-packages/tensorflow/include/external/local_config_cuda/cuda/cuda/include/thrust/system/detail/generic/advance.inl +68 -0
- videochat2/lib/python3.10/site-packages/tensorflow/include/external/local_config_cuda/cuda/cuda/include/thrust/system/detail/generic/find.inl +151 -0
- videochat2/lib/python3.10/site-packages/tensorflow/include/external/local_config_cuda/cuda/cuda/include/thrust/system/detail/generic/inner_product.h +58 -0
- videochat2/lib/python3.10/site-packages/tensorflow/include/external/local_config_cuda/cuda/cuda/include/thrust/system/detail/generic/partition.h +169 -0
- videochat2/lib/python3.10/site-packages/tensorflow/include/external/local_config_cuda/cuda/cuda/include/thrust/system/detail/generic/scan.inl +127 -0
- videochat2/lib/python3.10/site-packages/tensorflow/include/external/local_config_cuda/cuda/cuda/include/thrust/system/detail/generic/scatter.h +80 -0
- videochat2/lib/python3.10/site-packages/tensorflow/include/external/local_config_cuda/cuda/cuda/include/thrust/system/detail/generic/select_system_exists.h +167 -0
- videochat2/lib/python3.10/site-packages/tensorflow/include/external/local_config_cuda/cuda/cuda/include/thrust/system/detail/generic/shuffle.h +54 -0
- videochat2/lib/python3.10/site-packages/tensorflow/include/external/local_config_cuda/cuda/cuda/include/thrust/system/detail/generic/transform_reduce.h +52 -0
- videochat2/lib/python3.10/site-packages/tensorflow/include/external/local_config_cuda/cuda/cuda/include/thrust/system/omp/detail/adjacent_difference.h +49 -0
- videochat2/lib/python3.10/site-packages/tensorflow/include/external/local_config_cuda/cuda/cuda/include/thrust/system/omp/detail/assign_value.h +23 -0
- videochat2/lib/python3.10/site-packages/tensorflow/include/external/local_config_cuda/cuda/cuda/include/thrust/system/omp/detail/binary_search.h +72 -0
- videochat2/lib/python3.10/site-packages/tensorflow/include/external/local_config_cuda/cuda/cuda/include/thrust/system/omp/detail/copy.h +56 -0
- videochat2/lib/python3.10/site-packages/tensorflow/include/external/local_config_cuda/cuda/cuda/include/thrust/system/omp/detail/copy.inl +136 -0
- videochat2/lib/python3.10/site-packages/tensorflow/include/external/local_config_cuda/cuda/cuda/include/thrust/system/omp/detail/copy_if.inl +53 -0
- videochat2/lib/python3.10/site-packages/tensorflow/include/external/local_config_cuda/cuda/cuda/include/thrust/system/omp/detail/default_decomposition.h +44 -0
- videochat2/lib/python3.10/site-packages/tensorflow/include/external/local_config_cuda/cuda/cuda/include/thrust/system/omp/detail/default_decomposition.inl +61 -0
- videochat2/lib/python3.10/site-packages/tensorflow/include/external/local_config_cuda/cuda/cuda/include/thrust/system/omp/detail/equal.h +23 -0
- videochat2/lib/python3.10/site-packages/tensorflow/include/external/local_config_cuda/cuda/cuda/include/thrust/system/omp/detail/execution_policy.h +106 -0
- videochat2/lib/python3.10/site-packages/tensorflow/include/external/local_config_cuda/cuda/cuda/include/thrust/system/omp/detail/extrema.h +66 -0
- videochat2/lib/python3.10/site-packages/tensorflow/include/external/local_config_cuda/cuda/cuda/include/thrust/system/omp/detail/fill.h +23 -0
- videochat2/lib/python3.10/site-packages/tensorflow/include/external/local_config_cuda/cuda/cuda/include/thrust/system/omp/detail/find.h +50 -0
- videochat2/lib/python3.10/site-packages/tensorflow/include/external/local_config_cuda/cuda/cuda/include/thrust/system/omp/detail/for_each.h +59 -0
- videochat2/lib/python3.10/site-packages/tensorflow/include/external/local_config_cuda/cuda/cuda/include/thrust/system/omp/detail/for_each.inl +92 -0
- videochat2/lib/python3.10/site-packages/tensorflow/include/external/local_config_cuda/cuda/cuda/include/thrust/system/omp/detail/generate.h +23 -0
- videochat2/lib/python3.10/site-packages/tensorflow/include/external/local_config_cuda/cuda/cuda/include/thrust/system/omp/detail/get_value.h +23 -0
- videochat2/lib/python3.10/site-packages/tensorflow/include/external/local_config_cuda/cuda/cuda/include/thrust/system/omp/detail/inner_product.h +23 -0
- videochat2/lib/python3.10/site-packages/tensorflow/include/external/local_config_cuda/cuda/cuda/include/thrust/system/omp/detail/iter_swap.h +23 -0
- videochat2/lib/python3.10/site-packages/tensorflow/include/external/local_config_cuda/cuda/cuda/include/thrust/system/omp/detail/logical.h +23 -0
- videochat2/lib/python3.10/site-packages/tensorflow/include/external/local_config_cuda/cuda/cuda/include/thrust/system/omp/detail/malloc_and_free.h +23 -0
- videochat2/lib/python3.10/site-packages/tensorflow/include/external/local_config_cuda/cuda/cuda/include/thrust/system/omp/detail/memory.inl +86 -0
- videochat2/lib/python3.10/site-packages/tensorflow/include/external/local_config_cuda/cuda/cuda/include/thrust/system/omp/detail/mismatch.h +23 -0
- videochat2/lib/python3.10/site-packages/tensorflow/include/external/local_config_cuda/cuda/cuda/include/thrust/system/omp/detail/par.h +61 -0
- videochat2/lib/python3.10/site-packages/tensorflow/include/external/local_config_cuda/cuda/cuda/include/thrust/system/omp/detail/partition.h +90 -0
- videochat2/lib/python3.10/site-packages/tensorflow/include/external/local_config_cuda/cuda/cuda/include/thrust/system/omp/detail/partition.inl +107 -0
- videochat2/lib/python3.10/site-packages/tensorflow/include/external/local_config_cuda/cuda/cuda/include/thrust/system/omp/detail/pragma_omp.h +56 -0
- videochat2/lib/python3.10/site-packages/tensorflow/include/external/local_config_cuda/cuda/cuda/include/thrust/system/omp/detail/reduce.inl +73 -0
- videochat2/lib/python3.10/site-packages/tensorflow/include/external/local_config_cuda/cuda/cuda/include/thrust/system/omp/detail/reduce_by_key.h +60 -0
videochat2/lib/python3.10/site-packages/tensorflow/include/external/local_config_cuda/cuda/cuda/include/thrust/iterator/constant_iterator.h
ADDED
|
@@ -0,0 +1,250 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
* Copyright 2008-2013 NVIDIA Corporation
|
| 3 |
+
*
|
| 4 |
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
| 5 |
+
* you may not use this file except in compliance with the License.
|
| 6 |
+
* You may obtain a copy of the License at
|
| 7 |
+
*
|
| 8 |
+
* http://www.apache.org/licenses/LICENSE-2.0
|
| 9 |
+
*
|
| 10 |
+
* Unless required by applicable law or agreed to in writing, software
|
| 11 |
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
| 12 |
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
| 13 |
+
* See the License for the specific language governing permissions and
|
| 14 |
+
* limitations under the License.
|
| 15 |
+
*/
|
| 16 |
+
|
| 17 |
+
|
| 18 |
+
/*! \file thrust/iterator/constant_iterator.h
|
| 19 |
+
* \brief An iterator which returns a constant value when
|
| 20 |
+
* dereferenced
|
| 21 |
+
*/
|
| 22 |
+
|
| 23 |
+
#pragma once
|
| 24 |
+
|
| 25 |
+
#include <thrust/detail/config.h>
|
| 26 |
+
#include <thrust/iterator/detail/constant_iterator_base.h>
|
| 27 |
+
#include <thrust/iterator/iterator_facade.h>
|
| 28 |
+
|
| 29 |
+
THRUST_NAMESPACE_BEGIN
|
| 30 |
+
|
| 31 |
+
/*! \addtogroup iterators
|
| 32 |
+
* \{
|
| 33 |
+
*/
|
| 34 |
+
|
| 35 |
+
/*! \addtogroup fancyiterator Fancy Iterators
|
| 36 |
+
* \ingroup iterators
|
| 37 |
+
* \{
|
| 38 |
+
*/
|
| 39 |
+
|
| 40 |
+
/*! \p constant_iterator is an iterator which represents a pointer into a range
|
| 41 |
+
* of constant values. This iterator is useful for creating a range filled with the same
|
| 42 |
+
* value without explicitly storing it in memory. Using \p constant_iterator saves both
|
| 43 |
+
* memory capacity and bandwidth.
|
| 44 |
+
*
|
| 45 |
+
* The following code snippet demonstrates how to create a \p constant_iterator whose
|
| 46 |
+
* \c value_type is \c int and whose value is \c 10.
|
| 47 |
+
*
|
| 48 |
+
* \code
|
| 49 |
+
* #include <thrust/iterator/constant_iterator.h>
|
| 50 |
+
*
|
| 51 |
+
* thrust::constant_iterator<int> iter(10);
|
| 52 |
+
*
|
| 53 |
+
* *iter; // returns 10
|
| 54 |
+
* iter[0]; // returns 10
|
| 55 |
+
* iter[1]; // returns 10
|
| 56 |
+
* iter[13]; // returns 10
|
| 57 |
+
*
|
| 58 |
+
* // and so on...
|
| 59 |
+
* \endcode
|
| 60 |
+
*
|
| 61 |
+
* This next example demonstrates how to use a \p constant_iterator with the
|
| 62 |
+
* \p thrust::transform function to increment all elements of a sequence by the
|
| 63 |
+
* same value. We will create a temporary \p constant_iterator with the function
|
| 64 |
+
* \p make_constant_iterator function in order to avoid explicitly specifying
|
| 65 |
+
* its type:
|
| 66 |
+
*
|
| 67 |
+
* \code
|
| 68 |
+
* #include <thrust/iterator/constant_iterator.h>
|
| 69 |
+
* #include <thrust/transform.h>
|
| 70 |
+
* #include <thrust/functional.h>
|
| 71 |
+
* #include <thrust/device_vector.h>
|
| 72 |
+
*
|
| 73 |
+
* int main()
|
| 74 |
+
* {
|
| 75 |
+
* thrust::device_vector<int> data(4);
|
| 76 |
+
* data[0] = 3;
|
| 77 |
+
* data[1] = 7;
|
| 78 |
+
* data[2] = 2;
|
| 79 |
+
* data[3] = 5;
|
| 80 |
+
*
|
| 81 |
+
* // add 10 to all values in data
|
| 82 |
+
* thrust::transform(data.begin(), data.end(),
|
| 83 |
+
* thrust::make_constant_iterator(10),
|
| 84 |
+
* data.begin(),
|
| 85 |
+
* thrust::plus<int>());
|
| 86 |
+
*
|
| 87 |
+
* // data is now [13, 17, 12, 15]
|
| 88 |
+
*
|
| 89 |
+
* return 0;
|
| 90 |
+
* }
|
| 91 |
+
* \endcode
|
| 92 |
+
*
|
| 93 |
+
* \see make_constant_iterator
|
| 94 |
+
*/
|
| 95 |
+
template<typename Value,
|
| 96 |
+
typename Incrementable = use_default,
|
| 97 |
+
typename System = use_default>
|
| 98 |
+
class constant_iterator
|
| 99 |
+
: public detail::constant_iterator_base<Value, Incrementable, System>::type
|
| 100 |
+
{
|
| 101 |
+
/*! \cond
|
| 102 |
+
*/
|
| 103 |
+
friend class thrust::iterator_core_access;
|
| 104 |
+
typedef typename detail::constant_iterator_base<Value, Incrementable, System>::type super_t;
|
| 105 |
+
typedef typename detail::constant_iterator_base<Value, Incrementable, System>::incrementable incrementable;
|
| 106 |
+
typedef typename detail::constant_iterator_base<Value, Incrementable, System>::base_iterator base_iterator;
|
| 107 |
+
|
| 108 |
+
public:
|
| 109 |
+
typedef typename super_t::reference reference;
|
| 110 |
+
typedef typename super_t::value_type value_type;
|
| 111 |
+
|
| 112 |
+
/*! \endcond
|
| 113 |
+
*/
|
| 114 |
+
|
| 115 |
+
/*! Null constructor initializes this \p constant_iterator's constant using its
|
| 116 |
+
* null constructor.
|
| 117 |
+
*/
|
| 118 |
+
__host__ __device__
|
| 119 |
+
constant_iterator()
|
| 120 |
+
: super_t(), m_value() {}
|
| 121 |
+
|
| 122 |
+
/*! Copy constructor copies the value of another \p constant_iterator into this
|
| 123 |
+
* \p constant_iterator.
|
| 124 |
+
*
|
| 125 |
+
* \p rhs The constant_iterator to copy.
|
| 126 |
+
*/
|
| 127 |
+
__host__ __device__
|
| 128 |
+
constant_iterator(constant_iterator const &rhs)
|
| 129 |
+
: super_t(rhs.base()), m_value(rhs.m_value) {}
|
| 130 |
+
|
| 131 |
+
/*! Copy constructor copies the value of another \p constant_iterator with related
|
| 132 |
+
* System type.
|
| 133 |
+
*
|
| 134 |
+
* \param rhs The \p constant_iterator to copy.
|
| 135 |
+
*/
|
| 136 |
+
template<typename OtherSystem>
|
| 137 |
+
__host__ __device__
|
| 138 |
+
constant_iterator(constant_iterator<Value,Incrementable,OtherSystem> const &rhs,
|
| 139 |
+
typename thrust::detail::enable_if_convertible<
|
| 140 |
+
typename thrust::iterator_system<constant_iterator<Value,Incrementable,OtherSystem> >::type,
|
| 141 |
+
typename thrust::iterator_system<super_t>::type
|
| 142 |
+
>::type * = 0)
|
| 143 |
+
: super_t(rhs.base()), m_value(rhs.value()) {}
|
| 144 |
+
|
| 145 |
+
/*! This constructor receives a value to use as the constant value of this
|
| 146 |
+
* \p constant_iterator and an index specifying the location of this
|
| 147 |
+
* \p constant_iterator in a sequence.
|
| 148 |
+
*
|
| 149 |
+
* \p v The value of this \p constant_iterator's constant value.
|
| 150 |
+
* \p i The index of this \p constant_iterator in a sequence. Defaults to the
|
| 151 |
+
* value returned by \c Incrementable's null constructor. For example,
|
| 152 |
+
* when <tt>Incrementable == int</tt>, \c 0.
|
| 153 |
+
*/
|
| 154 |
+
__host__ __device__
|
| 155 |
+
constant_iterator(value_type const& v, incrementable const &i = incrementable())
|
| 156 |
+
: super_t(base_iterator(i)), m_value(v) {}
|
| 157 |
+
|
| 158 |
+
/*! This constructor is templated to allow construction from a value type and
|
| 159 |
+
* incrementable type related this this \p constant_iterator's respective types.
|
| 160 |
+
*
|
| 161 |
+
* \p v The value of this \p constant_iterator's constant value.
|
| 162 |
+
* \p i The index of this \p constant_iterator in a sequence. Defaults to the
|
| 163 |
+
* value returned by \c Incrementable's null constructor. For example,
|
| 164 |
+
* when <tt>Incrementable == int</tt>, \c 0.
|
| 165 |
+
*/
|
| 166 |
+
template<typename OtherValue, typename OtherIncrementable>
|
| 167 |
+
__host__ __device__
|
| 168 |
+
constant_iterator(OtherValue const& v, OtherIncrementable const& i = incrementable())
|
| 169 |
+
: super_t(base_iterator(i)), m_value(v) {}
|
| 170 |
+
|
| 171 |
+
/*! This method returns the value of this \p constant_iterator's constant value.
|
| 172 |
+
* \return A \c const reference to this \p constant_iterator's constant value.
|
| 173 |
+
*/
|
| 174 |
+
__host__ __device__
|
| 175 |
+
Value const& value() const
|
| 176 |
+
{ return m_value; }
|
| 177 |
+
|
| 178 |
+
/*! \cond
|
| 179 |
+
*/
|
| 180 |
+
|
| 181 |
+
protected:
|
| 182 |
+
__host__ __device__
|
| 183 |
+
Value const& value_reference() const
|
| 184 |
+
{ return m_value; }
|
| 185 |
+
|
| 186 |
+
__host__ __device__
|
| 187 |
+
Value & value_reference()
|
| 188 |
+
{ return m_value; }
|
| 189 |
+
|
| 190 |
+
private: // Core iterator interface
|
| 191 |
+
__host__ __device__
|
| 192 |
+
reference dereference() const
|
| 193 |
+
{
|
| 194 |
+
return m_value;
|
| 195 |
+
}
|
| 196 |
+
|
| 197 |
+
private:
|
| 198 |
+
Value m_value;
|
| 199 |
+
|
| 200 |
+
/*! \endcond
|
| 201 |
+
*/
|
| 202 |
+
}; // end constant_iterator
|
| 203 |
+
|
| 204 |
+
|
| 205 |
+
/*! This version of \p make_constant_iterator creates a \p constant_iterator
|
| 206 |
+
* from values given for both value and index. The type of \p constant_iterator
|
| 207 |
+
* may be inferred by the compiler from the types of its parameters.
|
| 208 |
+
*
|
| 209 |
+
* \param x The value of the returned \p constant_iterator's constant value.
|
| 210 |
+
* \param i The index of the returned \p constant_iterator within a sequence.
|
| 211 |
+
* The type of this parameter defaults to \c int. In the default case,
|
| 212 |
+
* the value of this parameter is \c 0.
|
| 213 |
+
*
|
| 214 |
+
* \return A new \p constant_iterator with constant value & index as given
|
| 215 |
+
* by \p x & \p i.
|
| 216 |
+
*
|
| 217 |
+
* \see constant_iterator
|
| 218 |
+
*/
|
| 219 |
+
template<typename ValueT, typename IndexT>
|
| 220 |
+
inline __host__ __device__
|
| 221 |
+
constant_iterator<ValueT, IndexT> make_constant_iterator(ValueT x, IndexT i = int())
|
| 222 |
+
{
|
| 223 |
+
return constant_iterator<ValueT, IndexT>(x, i);
|
| 224 |
+
} // end make_constant_iterator()
|
| 225 |
+
|
| 226 |
+
|
| 227 |
+
/*! This version of \p make_constant_iterator creates a \p constant_iterator
|
| 228 |
+
* using only a parameter for the desired constant value. The value of the
|
| 229 |
+
* returned \p constant_iterator's index is set to \c 0.
|
| 230 |
+
*
|
| 231 |
+
* \param x The value of the returned \p constant_iterator's constant value.
|
| 232 |
+
* \return A new \p constant_iterator with constant value equal to \p x and
|
| 233 |
+
* index equal to \c 0.
|
| 234 |
+
* \see constant_iterator
|
| 235 |
+
*/
|
| 236 |
+
template<typename V>
|
| 237 |
+
inline __host__ __device__
|
| 238 |
+
constant_iterator<V> make_constant_iterator(V x)
|
| 239 |
+
{
|
| 240 |
+
return constant_iterator<V>(x, 0);
|
| 241 |
+
} // end make_constant_iterator()
|
| 242 |
+
|
| 243 |
+
/*! \} // end fancyiterators
|
| 244 |
+
*/
|
| 245 |
+
|
| 246 |
+
/*! \} // end iterators
|
| 247 |
+
*/
|
| 248 |
+
|
| 249 |
+
THRUST_NAMESPACE_END
|
| 250 |
+
|
videochat2/lib/python3.10/site-packages/tensorflow/include/external/local_config_cuda/cuda/cuda/include/thrust/iterator/detail/device_system_tag.h
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
* Copyright 2008-2013 NVIDIA Corporation
|
| 3 |
+
*
|
| 4 |
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
| 5 |
+
* you may not use this file except in compliance with the License.
|
| 6 |
+
* You may obtain a copy of the License at
|
| 7 |
+
*
|
| 8 |
+
* http://www.apache.org/licenses/LICENSE-2.0
|
| 9 |
+
*
|
| 10 |
+
* Unless required by applicable law or agreed to in writing, software
|
| 11 |
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
| 12 |
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
| 13 |
+
* See the License for the specific language governing permissions and
|
| 14 |
+
* limitations under the License.
|
| 15 |
+
*/
|
| 16 |
+
|
| 17 |
+
#pragma once
|
| 18 |
+
|
| 19 |
+
#include <thrust/detail/config.h>
|
| 20 |
+
|
| 21 |
+
// #include the device system's execution_policy header
|
| 22 |
+
#define __THRUST_DEVICE_SYSTEM_TAG_HEADER <__THRUST_DEVICE_SYSTEM_ROOT/detail/execution_policy.h>
|
| 23 |
+
#include __THRUST_DEVICE_SYSTEM_TAG_HEADER
|
| 24 |
+
#undef __THRUST_DEVICE_SYSTEM_TAG_HEADER
|
| 25 |
+
|
| 26 |
+
THRUST_NAMESPACE_BEGIN
|
| 27 |
+
|
| 28 |
+
typedef thrust::system::__THRUST_DEVICE_SYSTEM_NAMESPACE::tag device_system_tag;
|
| 29 |
+
|
| 30 |
+
THRUST_NAMESPACE_END
|
videochat2/lib/python3.10/site-packages/tensorflow/include/external/local_config_cuda/cuda/cuda/include/thrust/iterator/detail/iterator_category_to_traversal.h
ADDED
|
@@ -0,0 +1,130 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
* Copyright 2008-2013 NVIDIA Corporation
|
| 3 |
+
*
|
| 4 |
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
| 5 |
+
* you may not use this file except in compliance with the License.
|
| 6 |
+
* You may obtain a copy of the License at
|
| 7 |
+
*
|
| 8 |
+
* http://www.apache.org/licenses/LICENSE-2.0
|
| 9 |
+
*
|
| 10 |
+
* Unless required by applicable law or agreed to in writing, software
|
| 11 |
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
| 12 |
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
| 13 |
+
* See the License for the specific language governing permissions and
|
| 14 |
+
* limitations under the License.
|
| 15 |
+
*/
|
| 16 |
+
|
| 17 |
+
#pragma once
|
| 18 |
+
|
| 19 |
+
#include <thrust/detail/config.h>
|
| 20 |
+
#include <thrust/iterator/iterator_categories.h>
|
| 21 |
+
#include <thrust/iterator/detail/iterator_traversal_tags.h>
|
| 22 |
+
#include <thrust/iterator/detail/iterator_category_to_system.h>
|
| 23 |
+
#include <thrust/detail/type_traits.h>
|
| 24 |
+
|
| 25 |
+
THRUST_NAMESPACE_BEGIN
|
| 26 |
+
|
| 27 |
+
namespace detail
|
| 28 |
+
{
|
| 29 |
+
|
| 30 |
+
// forward declarations
|
| 31 |
+
template <typename> struct is_iterator_system;
|
| 32 |
+
template <typename> struct is_iterator_traversal;
|
| 33 |
+
|
| 34 |
+
template <typename Category>
|
| 35 |
+
struct host_system_category_to_traversal
|
| 36 |
+
: eval_if<
|
| 37 |
+
is_convertible<Category, random_access_host_iterator_tag>::value,
|
| 38 |
+
detail::identity_<random_access_traversal_tag>,
|
| 39 |
+
eval_if<
|
| 40 |
+
is_convertible<Category, bidirectional_host_iterator_tag>::value,
|
| 41 |
+
detail::identity_<bidirectional_traversal_tag>,
|
| 42 |
+
eval_if<
|
| 43 |
+
is_convertible<Category, forward_host_iterator_tag>::value,
|
| 44 |
+
detail::identity_<forward_traversal_tag>,
|
| 45 |
+
eval_if<
|
| 46 |
+
is_convertible<Category, input_host_iterator_tag>::value,
|
| 47 |
+
detail::identity_<single_pass_traversal_tag>,
|
| 48 |
+
eval_if<
|
| 49 |
+
is_convertible<Category, output_host_iterator_tag>::value,
|
| 50 |
+
detail::identity_<incrementable_traversal_tag>,
|
| 51 |
+
detail::identity_<void>
|
| 52 |
+
>
|
| 53 |
+
>
|
| 54 |
+
>
|
| 55 |
+
>
|
| 56 |
+
>
|
| 57 |
+
{
|
| 58 |
+
}; // end host_system_category_to_traversal
|
| 59 |
+
|
| 60 |
+
|
| 61 |
+
|
| 62 |
+
template <typename Category>
|
| 63 |
+
struct device_system_category_to_traversal
|
| 64 |
+
: eval_if<
|
| 65 |
+
is_convertible<Category, random_access_device_iterator_tag>::value,
|
| 66 |
+
detail::identity_<random_access_traversal_tag>,
|
| 67 |
+
eval_if<
|
| 68 |
+
is_convertible<Category, bidirectional_device_iterator_tag>::value,
|
| 69 |
+
detail::identity_<bidirectional_traversal_tag>,
|
| 70 |
+
eval_if<
|
| 71 |
+
is_convertible<Category, forward_device_iterator_tag>::value,
|
| 72 |
+
detail::identity_<forward_traversal_tag>,
|
| 73 |
+
eval_if<
|
| 74 |
+
is_convertible<Category, input_device_iterator_tag>::value,
|
| 75 |
+
detail::identity_<single_pass_traversal_tag>,
|
| 76 |
+
eval_if<
|
| 77 |
+
is_convertible<Category, output_device_iterator_tag>::value,
|
| 78 |
+
detail::identity_<incrementable_traversal_tag>,
|
| 79 |
+
detail::identity_<void>
|
| 80 |
+
>
|
| 81 |
+
>
|
| 82 |
+
>
|
| 83 |
+
>
|
| 84 |
+
>
|
| 85 |
+
{
|
| 86 |
+
}; // end device_system_category_to_traversal
|
| 87 |
+
|
| 88 |
+
|
| 89 |
+
template<typename Category>
|
| 90 |
+
struct category_to_traversal
|
| 91 |
+
// check for host system
|
| 92 |
+
: eval_if<
|
| 93 |
+
or_<
|
| 94 |
+
is_convertible<Category, thrust::input_host_iterator_tag>,
|
| 95 |
+
is_convertible<Category, thrust::output_host_iterator_tag>
|
| 96 |
+
>::value,
|
| 97 |
+
|
| 98 |
+
host_system_category_to_traversal<Category>,
|
| 99 |
+
|
| 100 |
+
// check for device system
|
| 101 |
+
eval_if<
|
| 102 |
+
or_<
|
| 103 |
+
is_convertible<Category, thrust::input_device_iterator_tag>,
|
| 104 |
+
is_convertible<Category, thrust::output_device_iterator_tag>
|
| 105 |
+
>::value,
|
| 106 |
+
|
| 107 |
+
device_system_category_to_traversal<Category>,
|
| 108 |
+
|
| 109 |
+
// unknown category
|
| 110 |
+
detail::identity_<void>
|
| 111 |
+
>
|
| 112 |
+
>
|
| 113 |
+
{};
|
| 114 |
+
|
| 115 |
+
|
| 116 |
+
template <typename CategoryOrTraversal>
|
| 117 |
+
struct iterator_category_to_traversal
|
| 118 |
+
: eval_if<
|
| 119 |
+
is_iterator_traversal<CategoryOrTraversal>::value,
|
| 120 |
+
detail::identity_<CategoryOrTraversal>,
|
| 121 |
+
category_to_traversal<CategoryOrTraversal>
|
| 122 |
+
>
|
| 123 |
+
{
|
| 124 |
+
}; // end iterator_category_to_traversal
|
| 125 |
+
|
| 126 |
+
|
| 127 |
+
} // end detail
|
| 128 |
+
|
| 129 |
+
THRUST_NAMESPACE_END
|
| 130 |
+
|
videochat2/lib/python3.10/site-packages/tensorflow/include/external/local_config_cuda/cuda/cuda/include/thrust/iterator/detail/iterator_category_with_system_and_traversal.h
ADDED
|
@@ -0,0 +1,56 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
* Copyright 2008-2013 NVIDIA Corporation
|
| 3 |
+
*
|
| 4 |
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
| 5 |
+
* you may not use this file except in compliance with the License.
|
| 6 |
+
* You may obtain a copy of the License at
|
| 7 |
+
*
|
| 8 |
+
* http://www.apache.org/licenses/LICENSE-2.0
|
| 9 |
+
*
|
| 10 |
+
* Unless required by applicable law or agreed to in writing, software
|
| 11 |
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
| 12 |
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
| 13 |
+
* See the License for the specific language governing permissions and
|
| 14 |
+
* limitations under the License.
|
| 15 |
+
*/
|
| 16 |
+
|
| 17 |
+
#pragma once
|
| 18 |
+
|
| 19 |
+
#include <thrust/detail/config.h>
|
| 20 |
+
|
| 21 |
+
THRUST_NAMESPACE_BEGIN
|
| 22 |
+
namespace detail
|
| 23 |
+
{
|
| 24 |
+
|
| 25 |
+
|
| 26 |
+
template<typename Category, typename System, typename Traversal>
|
| 27 |
+
struct iterator_category_with_system_and_traversal
|
| 28 |
+
: Category
|
| 29 |
+
{
|
| 30 |
+
}; // end iterator_category_with_system_and_traversal
|
| 31 |
+
|
| 32 |
+
|
| 33 |
+
// specialize iterator_category_to_system for iterator_category_with_system_and_traversal
|
| 34 |
+
template<typename Category> struct iterator_category_to_system;
|
| 35 |
+
|
| 36 |
+
template<typename Category, typename System, typename Traversal>
|
| 37 |
+
struct iterator_category_to_system<iterator_category_with_system_and_traversal<Category,System,Traversal> >
|
| 38 |
+
{
|
| 39 |
+
typedef System type;
|
| 40 |
+
}; // end iterator_category_to_system
|
| 41 |
+
|
| 42 |
+
|
| 43 |
+
// specialize iterator_category_to_traversal for iterator_category_with_system_and_traversal
|
| 44 |
+
template<typename Category> struct iterator_category_to_traversal;
|
| 45 |
+
|
| 46 |
+
template<typename Category, typename System, typename Traversal>
|
| 47 |
+
struct iterator_category_to_traversal<iterator_category_with_system_and_traversal<Category,System,Traversal> >
|
| 48 |
+
{
|
| 49 |
+
typedef Traversal type;
|
| 50 |
+
}; // end iterator_category_to_traversal
|
| 51 |
+
|
| 52 |
+
|
| 53 |
+
|
| 54 |
+
} // end detail
|
| 55 |
+
THRUST_NAMESPACE_END
|
| 56 |
+
|
videochat2/lib/python3.10/site-packages/tensorflow/include/external/local_config_cuda/cuda/cuda/include/thrust/iterator/detail/permutation_iterator_base.h
ADDED
|
@@ -0,0 +1,54 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
* Copyright 2008-2013 NVIDIA Corporation
|
| 3 |
+
*
|
| 4 |
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
| 5 |
+
* you may not use this file except in compliance with the License.
|
| 6 |
+
* You may obtain a copy of the License at
|
| 7 |
+
*
|
| 8 |
+
* http://www.apache.org/licenses/LICENSE-2.0
|
| 9 |
+
*
|
| 10 |
+
* Unless required by applicable law or agreed to in writing, software
|
| 11 |
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
| 12 |
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
| 13 |
+
* See the License for the specific language governing permissions and
|
| 14 |
+
* limitations under the License.
|
| 15 |
+
*/
|
| 16 |
+
|
| 17 |
+
#pragma once
|
| 18 |
+
|
| 19 |
+
#include <thrust/detail/config.h>
|
| 20 |
+
|
| 21 |
+
#include <thrust/iterator/iterator_adaptor.h>
|
| 22 |
+
#include <thrust/iterator/iterator_traits.h>
|
| 23 |
+
#include <thrust/detail/type_traits.h>
|
| 24 |
+
#include <thrust/iterator/detail/minimum_system.h>
|
| 25 |
+
|
| 26 |
+
THRUST_NAMESPACE_BEGIN
|
| 27 |
+
|
| 28 |
+
template<typename,typename> class permutation_iterator;
|
| 29 |
+
|
| 30 |
+
|
| 31 |
+
namespace detail
|
| 32 |
+
{
|
| 33 |
+
|
| 34 |
+
template<typename ElementIterator,
|
| 35 |
+
typename IndexIterator>
|
| 36 |
+
struct permutation_iterator_base
|
| 37 |
+
{
|
| 38 |
+
typedef typename thrust::iterator_system<ElementIterator>::type System1;
|
| 39 |
+
typedef typename thrust::iterator_system<IndexIterator>::type System2;
|
| 40 |
+
|
| 41 |
+
typedef thrust::iterator_adaptor<
|
| 42 |
+
permutation_iterator<ElementIterator,IndexIterator>,
|
| 43 |
+
IndexIterator,
|
| 44 |
+
typename thrust::iterator_value<ElementIterator>::type,
|
| 45 |
+
typename detail::minimum_system<System1,System2>::type,
|
| 46 |
+
thrust::use_default,
|
| 47 |
+
typename thrust::iterator_reference<ElementIterator>::type
|
| 48 |
+
> type;
|
| 49 |
+
}; // end permutation_iterator_base
|
| 50 |
+
|
| 51 |
+
} // end detail
|
| 52 |
+
|
| 53 |
+
THRUST_NAMESPACE_END
|
| 54 |
+
|
videochat2/lib/python3.10/site-packages/tensorflow/include/external/local_config_cuda/cuda/cuda/include/thrust/iterator/detail/retag.h
ADDED
|
@@ -0,0 +1,147 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
* Copyright 2008-2013 NVIDIA Corporation
|
| 3 |
+
*
|
| 4 |
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
| 5 |
+
* you may not use this file except in compliance with the License.
|
| 6 |
+
* You may obtain a copy of the License at
|
| 7 |
+
*
|
| 8 |
+
* http://www.apache.org/licenses/LICENSE-2.0
|
| 9 |
+
*
|
| 10 |
+
* Unless required by applicable law or agreed to in writing, software
|
| 11 |
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
| 12 |
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
| 13 |
+
* See the License for the specific language governing permissions and
|
| 14 |
+
* limitations under the License.
|
| 15 |
+
*/
|
| 16 |
+
|
| 17 |
+
#pragma once
|
| 18 |
+
|
| 19 |
+
#include <thrust/detail/config.h>
|
| 20 |
+
#include <thrust/detail/type_traits.h>
|
| 21 |
+
#include <thrust/iterator/detail/tagged_iterator.h>
|
| 22 |
+
#include <thrust/detail/pointer.h>
|
| 23 |
+
|
| 24 |
+
THRUST_NAMESPACE_BEGIN
|
| 25 |
+
namespace detail
|
| 26 |
+
{
|
| 27 |
+
|
| 28 |
+
|
| 29 |
+
// we can retag an iterator if FromTag converts to ToTag
|
| 30 |
+
// or vice versa
|
| 31 |
+
template<typename FromTag, typename ToTag>
|
| 32 |
+
struct is_retaggable
|
| 33 |
+
: integral_constant<
|
| 34 |
+
bool,
|
| 35 |
+
(is_convertible<FromTag,ToTag>::value || is_convertible<ToTag,FromTag>::value)
|
| 36 |
+
>
|
| 37 |
+
{};
|
| 38 |
+
|
| 39 |
+
|
| 40 |
+
template<typename FromTag, typename ToTag, typename Result>
|
| 41 |
+
struct enable_if_retaggable
|
| 42 |
+
: enable_if<
|
| 43 |
+
is_retaggable<FromTag,ToTag>::value,
|
| 44 |
+
Result
|
| 45 |
+
>
|
| 46 |
+
{}; // end enable_if_retaggable
|
| 47 |
+
|
| 48 |
+
|
| 49 |
+
} // end detail
|
| 50 |
+
|
| 51 |
+
|
| 52 |
+
template<typename Tag, typename Iterator>
|
| 53 |
+
__host__ __device__
|
| 54 |
+
thrust::detail::tagged_iterator<Iterator,Tag>
|
| 55 |
+
reinterpret_tag(Iterator iter)
|
| 56 |
+
{
|
| 57 |
+
return thrust::detail::tagged_iterator<Iterator,Tag>(iter);
|
| 58 |
+
} // end reinterpret_tag()
|
| 59 |
+
|
| 60 |
+
|
| 61 |
+
// specialization for raw pointer
|
| 62 |
+
template<typename Tag, typename T>
|
| 63 |
+
__host__ __device__
|
| 64 |
+
thrust::pointer<T,Tag>
|
| 65 |
+
reinterpret_tag(T *ptr)
|
| 66 |
+
{
|
| 67 |
+
return thrust::pointer<T,Tag>(ptr);
|
| 68 |
+
} // end reinterpret_tag()
|
| 69 |
+
|
| 70 |
+
|
| 71 |
+
// specialization for thrust::pointer
|
| 72 |
+
template<typename Tag, typename T, typename OtherTag, typename Reference, typename Derived>
|
| 73 |
+
__host__ __device__
|
| 74 |
+
thrust::pointer<T,Tag>
|
| 75 |
+
reinterpret_tag(thrust::pointer<T,OtherTag,Reference,Derived> ptr)
|
| 76 |
+
{
|
| 77 |
+
return reinterpret_tag<Tag>(ptr.get());
|
| 78 |
+
} // end reinterpret_tag()
|
| 79 |
+
|
| 80 |
+
|
| 81 |
+
// avoid deeply-nested tagged_iterator
|
| 82 |
+
template<typename Tag, typename BaseIterator, typename OtherTag>
|
| 83 |
+
__host__ __device__
|
| 84 |
+
thrust::detail::tagged_iterator<BaseIterator,Tag>
|
| 85 |
+
reinterpret_tag(thrust::detail::tagged_iterator<BaseIterator,OtherTag> iter)
|
| 86 |
+
{
|
| 87 |
+
return reinterpret_tag<Tag>(iter.base());
|
| 88 |
+
} // end reinterpret_tag()
|
| 89 |
+
|
| 90 |
+
|
| 91 |
+
template<typename Tag, typename Iterator>
|
| 92 |
+
__host__ __device__
|
| 93 |
+
typename thrust::detail::enable_if_retaggable<
|
| 94 |
+
typename thrust::iterator_system<Iterator>::type,
|
| 95 |
+
Tag,
|
| 96 |
+
thrust::detail::tagged_iterator<Iterator,Tag>
|
| 97 |
+
>::type
|
| 98 |
+
retag(Iterator iter)
|
| 99 |
+
{
|
| 100 |
+
return reinterpret_tag<Tag>(iter);
|
| 101 |
+
} // end retag()
|
| 102 |
+
|
| 103 |
+
|
| 104 |
+
// specialization for raw pointer
|
| 105 |
+
template<typename Tag, typename T>
|
| 106 |
+
__host__ __device__
|
| 107 |
+
typename thrust::detail::enable_if_retaggable<
|
| 108 |
+
typename thrust::iterator_system<T*>::type,
|
| 109 |
+
Tag,
|
| 110 |
+
thrust::pointer<T,Tag>
|
| 111 |
+
>::type
|
| 112 |
+
retag(T *ptr)
|
| 113 |
+
{
|
| 114 |
+
return reinterpret_tag<Tag>(ptr);
|
| 115 |
+
} // end retag()
|
| 116 |
+
|
| 117 |
+
|
| 118 |
+
// specialization for thrust::pointer
|
| 119 |
+
template<typename Tag, typename T, typename OtherTag>
|
| 120 |
+
__host__ __device__
|
| 121 |
+
typename thrust::detail::enable_if_retaggable<
|
| 122 |
+
OtherTag,
|
| 123 |
+
Tag,
|
| 124 |
+
thrust::pointer<T,Tag>
|
| 125 |
+
>::type
|
| 126 |
+
retag(thrust::pointer<T,OtherTag> ptr)
|
| 127 |
+
{
|
| 128 |
+
return reinterpret_tag<Tag>(ptr);
|
| 129 |
+
} // end retag()
|
| 130 |
+
|
| 131 |
+
|
| 132 |
+
// avoid deeply-nested tagged_iterator
|
| 133 |
+
template<typename Tag, typename BaseIterator, typename OtherTag>
|
| 134 |
+
__host__ __device__
|
| 135 |
+
typename thrust::detail::enable_if_retaggable<
|
| 136 |
+
OtherTag,
|
| 137 |
+
Tag,
|
| 138 |
+
thrust::detail::tagged_iterator<BaseIterator,Tag>
|
| 139 |
+
>::type
|
| 140 |
+
retag(thrust::detail::tagged_iterator<BaseIterator,OtherTag> iter)
|
| 141 |
+
{
|
| 142 |
+
return reinterpret_tag<Tag>(iter);
|
| 143 |
+
} // end retag()
|
| 144 |
+
|
| 145 |
+
|
| 146 |
+
THRUST_NAMESPACE_END
|
| 147 |
+
|
videochat2/lib/python3.10/site-packages/tensorflow/include/external/local_config_cuda/cuda/cuda/include/thrust/iterator/detail/reverse_iterator_base.h
ADDED
|
@@ -0,0 +1,43 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
* Copyright 2008-2013 NVIDIA Corporation
|
| 3 |
+
*
|
| 4 |
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
| 5 |
+
* you may not use this file except in compliance with the License.
|
| 6 |
+
* You may obtain a copy of the License at
|
| 7 |
+
*
|
| 8 |
+
* http://www.apache.org/licenses/LICENSE-2.0
|
| 9 |
+
*
|
| 10 |
+
* Unless required by applicable law or agreed to in writing, software
|
| 11 |
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
| 12 |
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
| 13 |
+
* See the License for the specific language governing permissions and
|
| 14 |
+
* limitations under the License.
|
| 15 |
+
*/
|
| 16 |
+
|
| 17 |
+
#pragma once
|
| 18 |
+
|
| 19 |
+
#include <thrust/detail/config.h>
|
| 20 |
+
|
| 21 |
+
#include <thrust/iterator/iterator_adaptor.h>
|
| 22 |
+
#include <thrust/iterator/iterator_traits.h>
|
| 23 |
+
|
| 24 |
+
THRUST_NAMESPACE_BEGIN
|
| 25 |
+
|
| 26 |
+
template <typename> class reverse_iterator;
|
| 27 |
+
|
| 28 |
+
namespace detail
|
| 29 |
+
{
|
| 30 |
+
|
| 31 |
+
template<typename BidirectionalIterator>
|
| 32 |
+
struct reverse_iterator_base
|
| 33 |
+
{
|
| 34 |
+
typedef thrust::iterator_adaptor<
|
| 35 |
+
thrust::reverse_iterator<BidirectionalIterator>,
|
| 36 |
+
BidirectionalIterator
|
| 37 |
+
> type;
|
| 38 |
+
}; // end reverse_iterator_base
|
| 39 |
+
|
| 40 |
+
} // end detail
|
| 41 |
+
|
| 42 |
+
THRUST_NAMESPACE_END
|
| 43 |
+
|
videochat2/lib/python3.10/site-packages/tensorflow/include/external/local_config_cuda/cuda/cuda/include/thrust/iterator/detail/transform_iterator.inl
ADDED
|
@@ -0,0 +1,69 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
* Copyright 2008-2021 NVIDIA Corporation
|
| 3 |
+
*
|
| 4 |
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
| 5 |
+
* you may not use this file except in compliance with the License.
|
| 6 |
+
* You may obtain a copy of the License at
|
| 7 |
+
*
|
| 8 |
+
* http://www.apache.org/licenses/LICENSE-2.0
|
| 9 |
+
*
|
| 10 |
+
* Unless required by applicable law or agreed to in writing, software
|
| 11 |
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
| 12 |
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
| 13 |
+
* See the License for the specific language governing permissions and
|
| 14 |
+
* limitations under the License.
|
| 15 |
+
*/
|
| 16 |
+
|
| 17 |
+
#pragma once
|
| 18 |
+
|
| 19 |
+
#include <thrust/detail/config.h>
|
| 20 |
+
#include <thrust/detail/type_traits.h>
|
| 21 |
+
#include <thrust/detail/type_traits/result_of_adaptable_function.h>
|
| 22 |
+
#include <thrust/iterator/iterator_adaptor.h>
|
| 23 |
+
#include <thrust/iterator/iterator_traits.h>
|
| 24 |
+
#include <thrust/iterator/transform_iterator.h>
|
| 25 |
+
#include <thrust/type_traits/remove_cvref.h>
|
| 26 |
+
|
| 27 |
+
THRUST_NAMESPACE_BEGIN
|
| 28 |
+
|
| 29 |
+
template <class UnaryFunction, class Iterator, class Reference, class Value>
|
| 30 |
+
class transform_iterator;
|
| 31 |
+
|
| 32 |
+
namespace detail
|
| 33 |
+
{
|
| 34 |
+
|
| 35 |
+
// Compute the iterator_adaptor instantiation to be used for transform_iterator
|
| 36 |
+
template <class UnaryFunc, class Iterator, class Reference, class Value>
|
| 37 |
+
struct transform_iterator_base
|
| 38 |
+
{
|
| 39 |
+
private:
|
| 40 |
+
// By default, dereferencing the iterator yields the same as the function.
|
| 41 |
+
typedef typename thrust::detail::ia_dflt_help<
|
| 42 |
+
Reference,
|
| 43 |
+
thrust::detail::result_of_adaptable_function<UnaryFunc(typename thrust::iterator_value<Iterator>::type)>
|
| 44 |
+
>::type reference;
|
| 45 |
+
|
| 46 |
+
// To get the default for Value: remove cvref on the result type.
|
| 47 |
+
using value_type =
|
| 48 |
+
typename thrust::detail::ia_dflt_help<Value, thrust::remove_cvref<reference>>::type;
|
| 49 |
+
|
| 50 |
+
public:
|
| 51 |
+
typedef thrust::iterator_adaptor
|
| 52 |
+
<
|
| 53 |
+
transform_iterator<UnaryFunc, Iterator, Reference, Value>
|
| 54 |
+
, Iterator
|
| 55 |
+
, value_type
|
| 56 |
+
, thrust::use_default // Leave the system alone
|
| 57 |
+
//, thrust::use_default // Leave the traversal alone
|
| 58 |
+
// use the Iterator's category to let any system iterators remain random access even though
|
| 59 |
+
// transform_iterator's reference type may not be a reference
|
| 60 |
+
// XXX figure out why only iterators whose reference types are true references are random access
|
| 61 |
+
, typename thrust::iterator_traits<Iterator>::iterator_category
|
| 62 |
+
, reference
|
| 63 |
+
> type;
|
| 64 |
+
};
|
| 65 |
+
|
| 66 |
+
|
| 67 |
+
} // end detail
|
| 68 |
+
THRUST_NAMESPACE_END
|
| 69 |
+
|
videochat2/lib/python3.10/site-packages/tensorflow/include/external/local_config_cuda/cuda/cuda/include/thrust/iterator/detail/zip_iterator_base.h
ADDED
|
@@ -0,0 +1,353 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
* Copyright 2008-2013 NVIDIA Corporation
|
| 3 |
+
*
|
| 4 |
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
| 5 |
+
* you may not use this file except in compliance with the License.
|
| 6 |
+
* You may obtain a copy of the License at
|
| 7 |
+
*
|
| 8 |
+
* http://www.apache.org/licenses/LICENSE-2.0
|
| 9 |
+
*
|
| 10 |
+
* Unless required by applicable law or agreed to in writing, software
|
| 11 |
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
| 12 |
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
| 13 |
+
* See the License for the specific language governing permissions and
|
| 14 |
+
* limitations under the License.
|
| 15 |
+
*/
|
| 16 |
+
|
| 17 |
+
#pragma once
|
| 18 |
+
|
| 19 |
+
#include <thrust/detail/config.h>
|
| 20 |
+
|
| 21 |
+
#include <thrust/advance.h>
|
| 22 |
+
#include <thrust/iterator/iterator_traits.h>
|
| 23 |
+
#include <thrust/iterator/iterator_facade.h>
|
| 24 |
+
#include <thrust/iterator/iterator_categories.h>
|
| 25 |
+
#include <thrust/iterator/detail/minimum_category.h>
|
| 26 |
+
#include <thrust/iterator/detail/minimum_system.h>
|
| 27 |
+
#include <thrust/type_traits/integer_sequence.h>
|
| 28 |
+
#include <thrust/tuple.h>
|
| 29 |
+
#include <thrust/detail/tuple_meta_transform.h>
|
| 30 |
+
#include <thrust/detail/tuple_transform.h>
|
| 31 |
+
#include <thrust/detail/type_traits.h>
|
| 32 |
+
#include <thrust/iterator/detail/tuple_of_iterator_references.h>
|
| 33 |
+
|
| 34 |
+
THRUST_NAMESPACE_BEGIN
|
| 35 |
+
|
| 36 |
+
// forward declare zip_iterator for zip_iterator_base
|
| 37 |
+
template<typename IteratorTuple> class zip_iterator;
|
| 38 |
+
|
| 39 |
+
namespace detail
|
| 40 |
+
{
|
| 41 |
+
|
| 42 |
+
|
| 43 |
+
// Functors to be used with tuple algorithms
|
| 44 |
+
//
|
| 45 |
+
template<typename DiffType>
|
| 46 |
+
class advance_iterator
|
| 47 |
+
{
|
| 48 |
+
public:
|
| 49 |
+
inline __host__ __device__
|
| 50 |
+
advance_iterator(DiffType step) : m_step(step) {}
|
| 51 |
+
|
| 52 |
+
__thrust_exec_check_disable__
|
| 53 |
+
template<typename Iterator>
|
| 54 |
+
inline __host__ __device__
|
| 55 |
+
void operator()(Iterator& it) const
|
| 56 |
+
{ thrust::advance(it, m_step); }
|
| 57 |
+
|
| 58 |
+
private:
|
| 59 |
+
DiffType m_step;
|
| 60 |
+
}; // end advance_iterator
|
| 61 |
+
|
| 62 |
+
|
| 63 |
+
struct increment_iterator
|
| 64 |
+
{
|
| 65 |
+
__thrust_exec_check_disable__
|
| 66 |
+
template<typename Iterator>
|
| 67 |
+
inline __host__ __device__
|
| 68 |
+
void operator()(Iterator& it)
|
| 69 |
+
{ ++it; }
|
| 70 |
+
}; // end increment_iterator
|
| 71 |
+
|
| 72 |
+
|
| 73 |
+
struct decrement_iterator
|
| 74 |
+
{
|
| 75 |
+
__thrust_exec_check_disable__
|
| 76 |
+
template<typename Iterator>
|
| 77 |
+
inline __host__ __device__
|
| 78 |
+
void operator()(Iterator& it)
|
| 79 |
+
{ --it; }
|
| 80 |
+
}; // end decrement_iterator
|
| 81 |
+
|
| 82 |
+
|
| 83 |
+
struct dereference_iterator
|
| 84 |
+
{
|
| 85 |
+
template<typename Iterator>
|
| 86 |
+
struct apply
|
| 87 |
+
{
|
| 88 |
+
typedef typename
|
| 89 |
+
iterator_traits<Iterator>::reference
|
| 90 |
+
type;
|
| 91 |
+
}; // end apply
|
| 92 |
+
|
| 93 |
+
// XXX silence warnings of the form "calling a __host__ function from a __host__ __device__ function is not allowed
|
| 94 |
+
__thrust_exec_check_disable__
|
| 95 |
+
template<typename Iterator>
|
| 96 |
+
__host__ __device__
|
| 97 |
+
typename apply<Iterator>::type operator()(Iterator const& it)
|
| 98 |
+
{
|
| 99 |
+
return *it;
|
| 100 |
+
}
|
| 101 |
+
}; // end dereference_iterator
|
| 102 |
+
|
| 103 |
+
|
| 104 |
+
// The namespace tuple_impl_specific provides two meta-
|
| 105 |
+
// algorithms and two algorithms for tuples.
|
| 106 |
+
namespace tuple_impl_specific
|
| 107 |
+
{
|
| 108 |
+
|
| 109 |
+
// define apply1 for tuple_meta_transform_impl
|
| 110 |
+
template<typename UnaryMetaFunctionClass, class Arg>
|
| 111 |
+
struct apply1
|
| 112 |
+
: UnaryMetaFunctionClass::template apply<Arg>
|
| 113 |
+
{
|
| 114 |
+
}; // end apply1
|
| 115 |
+
|
| 116 |
+
|
| 117 |
+
// define apply2 for tuple_meta_accumulate_impl
|
| 118 |
+
template<typename UnaryMetaFunctionClass, class Arg1, class Arg2>
|
| 119 |
+
struct apply2
|
| 120 |
+
: UnaryMetaFunctionClass::template apply<Arg1,Arg2>
|
| 121 |
+
{
|
| 122 |
+
}; // end apply2
|
| 123 |
+
|
| 124 |
+
|
| 125 |
+
// Meta-accumulate algorithm for tuples. Note: The template
|
| 126 |
+
// parameter StartType corresponds to the initial value in
|
| 127 |
+
// ordinary accumulation.
|
| 128 |
+
//
|
| 129 |
+
template<class Tuple, class BinaryMetaFun, class StartType>
|
| 130 |
+
struct tuple_meta_accumulate;
|
| 131 |
+
|
| 132 |
+
template<
|
| 133 |
+
class BinaryMetaFun
|
| 134 |
+
, typename StartType
|
| 135 |
+
>
|
| 136 |
+
struct tuple_meta_accumulate<thrust::tuple<>,BinaryMetaFun,StartType>
|
| 137 |
+
{
|
| 138 |
+
typedef typename thrust::detail::identity_<StartType>::type type;
|
| 139 |
+
};
|
| 140 |
+
|
| 141 |
+
|
| 142 |
+
template<
|
| 143 |
+
class BinaryMetaFun
|
| 144 |
+
, typename StartType
|
| 145 |
+
, typename T
|
| 146 |
+
, typename... Ts
|
| 147 |
+
>
|
| 148 |
+
struct tuple_meta_accumulate<thrust::tuple<T,Ts...>,BinaryMetaFun,StartType>
|
| 149 |
+
{
|
| 150 |
+
typedef typename apply2<
|
| 151 |
+
BinaryMetaFun
|
| 152 |
+
, T
|
| 153 |
+
, typename tuple_meta_accumulate<
|
| 154 |
+
thrust::tuple<Ts...>
|
| 155 |
+
, BinaryMetaFun
|
| 156 |
+
, StartType
|
| 157 |
+
>::type
|
| 158 |
+
>::type type;
|
| 159 |
+
};
|
| 160 |
+
|
| 161 |
+
|
| 162 |
+
template<typename Fun>
|
| 163 |
+
inline __host__ __device__
|
| 164 |
+
Fun tuple_for_each_helper(Fun f)
|
| 165 |
+
{
|
| 166 |
+
return f;
|
| 167 |
+
}
|
| 168 |
+
|
| 169 |
+
template<typename Fun, typename T, typename... Ts>
|
| 170 |
+
inline __host__ __device__
|
| 171 |
+
Fun tuple_for_each_helper(Fun f, T& t, Ts&... ts)
|
| 172 |
+
{
|
| 173 |
+
f(t);
|
| 174 |
+
return tuple_for_each_helper(f, ts...);
|
| 175 |
+
}
|
| 176 |
+
|
| 177 |
+
// for_each algorithm for tuples.
|
| 178 |
+
|
| 179 |
+
template<typename Fun, typename... Ts, size_t... Is>
|
| 180 |
+
inline __host__ __device__
|
| 181 |
+
Fun tuple_for_each(thrust::tuple<Ts...>& t, Fun f, thrust::index_sequence<Is...>)
|
| 182 |
+
{
|
| 183 |
+
return tuple_for_each_helper(f, thrust::get<Is>(t)...);
|
| 184 |
+
} // end tuple_for_each()
|
| 185 |
+
|
| 186 |
+
// for_each algorithm for tuples.
|
| 187 |
+
template<typename Fun, typename... Ts>
|
| 188 |
+
inline __host__ __device__
|
| 189 |
+
Fun tuple_for_each(thrust::tuple<Ts...>& t, Fun f)
|
| 190 |
+
{
|
| 191 |
+
return tuple_for_each(t, f, thrust::make_index_sequence<thrust::tuple_size<thrust::tuple<Ts...>>::value>{});
|
| 192 |
+
}
|
| 193 |
+
|
| 194 |
+
|
| 195 |
+
} // end tuple_impl_specific
|
| 196 |
+
|
| 197 |
+
|
| 198 |
+
// Metafunction to obtain the type of the tuple whose element types
|
| 199 |
+
// are the value_types of an iterator tupel.
|
| 200 |
+
//
|
| 201 |
+
template<typename IteratorTuple>
|
| 202 |
+
struct tuple_of_value_types
|
| 203 |
+
: tuple_meta_transform<
|
| 204 |
+
IteratorTuple,
|
| 205 |
+
iterator_value
|
| 206 |
+
>
|
| 207 |
+
{
|
| 208 |
+
}; // end tuple_of_value_types
|
| 209 |
+
|
| 210 |
+
|
| 211 |
+
struct minimum_category_lambda
|
| 212 |
+
{
|
| 213 |
+
template<typename T1, typename T2>
|
| 214 |
+
struct apply : minimum_category<T1,T2>
|
| 215 |
+
{};
|
| 216 |
+
};
|
| 217 |
+
|
| 218 |
+
|
| 219 |
+
|
| 220 |
+
// Metafunction to obtain the minimal traversal tag in a tuple
|
| 221 |
+
// of iterators.
|
| 222 |
+
//
|
| 223 |
+
template<typename IteratorTuple>
|
| 224 |
+
struct minimum_traversal_category_in_iterator_tuple
|
| 225 |
+
{
|
| 226 |
+
typedef typename tuple_meta_transform<
|
| 227 |
+
IteratorTuple
|
| 228 |
+
, thrust::iterator_traversal
|
| 229 |
+
>::type tuple_of_traversal_tags;
|
| 230 |
+
|
| 231 |
+
typedef typename tuple_impl_specific::tuple_meta_accumulate<
|
| 232 |
+
tuple_of_traversal_tags
|
| 233 |
+
, minimum_category_lambda
|
| 234 |
+
, thrust::random_access_traversal_tag
|
| 235 |
+
>::type type;
|
| 236 |
+
};
|
| 237 |
+
|
| 238 |
+
|
| 239 |
+
struct minimum_system_lambda
|
| 240 |
+
{
|
| 241 |
+
template<typename T1, typename T2>
|
| 242 |
+
struct apply : minimum_system<T1,T2>
|
| 243 |
+
{};
|
| 244 |
+
};
|
| 245 |
+
|
| 246 |
+
|
| 247 |
+
|
| 248 |
+
// Metafunction to obtain the minimal system tag in a tuple
|
| 249 |
+
// of iterators.
|
| 250 |
+
template<typename IteratorTuple>
|
| 251 |
+
struct minimum_system_in_iterator_tuple
|
| 252 |
+
{
|
| 253 |
+
typedef typename thrust::detail::tuple_meta_transform<
|
| 254 |
+
IteratorTuple,
|
| 255 |
+
thrust::iterator_system
|
| 256 |
+
>::type tuple_of_system_tags;
|
| 257 |
+
|
| 258 |
+
typedef typename tuple_impl_specific::tuple_meta_accumulate<
|
| 259 |
+
tuple_of_system_tags,
|
| 260 |
+
minimum_system_lambda,
|
| 261 |
+
thrust::any_system_tag
|
| 262 |
+
>::type type;
|
| 263 |
+
};
|
| 264 |
+
|
| 265 |
+
namespace zip_iterator_base_ns
|
| 266 |
+
{
|
| 267 |
+
|
| 268 |
+
|
| 269 |
+
template<typename Tuple, typename IndexSequence>
|
| 270 |
+
struct tuple_of_iterator_references_helper;
|
| 271 |
+
|
| 272 |
+
|
| 273 |
+
template<typename Tuple, size_t... Is>
|
| 274 |
+
struct tuple_of_iterator_references_helper<Tuple, thrust::index_sequence<Is...>>
|
| 275 |
+
{
|
| 276 |
+
typedef thrust::detail::tuple_of_iterator_references<
|
| 277 |
+
typename thrust::tuple_element<Is,Tuple>::type...
|
| 278 |
+
> type;
|
| 279 |
+
};
|
| 280 |
+
|
| 281 |
+
|
| 282 |
+
template<typename IteratorTuple>
|
| 283 |
+
struct tuple_of_iterator_references
|
| 284 |
+
{
|
| 285 |
+
// get a thrust::tuple of the iterators' references
|
| 286 |
+
typedef typename tuple_meta_transform<
|
| 287 |
+
IteratorTuple,
|
| 288 |
+
iterator_reference
|
| 289 |
+
>::type tuple_of_references;
|
| 290 |
+
|
| 291 |
+
// map thrust::tuple<T...> to tuple_of_iterator_references<T...>
|
| 292 |
+
typedef typename tuple_of_iterator_references_helper<
|
| 293 |
+
tuple_of_references,
|
| 294 |
+
thrust::make_index_sequence<thrust::tuple_size<tuple_of_references>::value>
|
| 295 |
+
>::type type;
|
| 296 |
+
};
|
| 297 |
+
|
| 298 |
+
|
| 299 |
+
} // end zip_iterator_base_ns
|
| 300 |
+
|
| 301 |
+
///////////////////////////////////////////////////////////////////
|
| 302 |
+
//
|
| 303 |
+
// Class zip_iterator_base
|
| 304 |
+
//
|
| 305 |
+
// Builds and exposes the iterator facade type from which the zip
|
| 306 |
+
// iterator will be derived.
|
| 307 |
+
//
|
| 308 |
+
template<typename IteratorTuple>
|
| 309 |
+
struct zip_iterator_base
|
| 310 |
+
{
|
| 311 |
+
//private:
|
| 312 |
+
// reference type is the type of the tuple obtained from the
|
| 313 |
+
// iterators' reference types.
|
| 314 |
+
typedef typename zip_iterator_base_ns::tuple_of_iterator_references<IteratorTuple>::type reference;
|
| 315 |
+
|
| 316 |
+
// Boost's Value type is the same as reference type.
|
| 317 |
+
//typedef reference value_type;
|
| 318 |
+
typedef typename tuple_of_value_types<IteratorTuple>::type value_type;
|
| 319 |
+
|
| 320 |
+
// Difference type is the first iterator's difference type
|
| 321 |
+
typedef typename thrust::iterator_traits<
|
| 322 |
+
typename thrust::tuple_element<0, IteratorTuple>::type
|
| 323 |
+
>::difference_type difference_type;
|
| 324 |
+
|
| 325 |
+
// Iterator system is the minimum system tag in the
|
| 326 |
+
// iterator tuple
|
| 327 |
+
typedef typename
|
| 328 |
+
minimum_system_in_iterator_tuple<IteratorTuple>::type system;
|
| 329 |
+
|
| 330 |
+
// Traversal category is the minimum traversal category in the
|
| 331 |
+
// iterator tuple
|
| 332 |
+
typedef typename
|
| 333 |
+
minimum_traversal_category_in_iterator_tuple<IteratorTuple>::type traversal_category;
|
| 334 |
+
|
| 335 |
+
public:
|
| 336 |
+
|
| 337 |
+
// The iterator facade type from which the zip iterator will
|
| 338 |
+
// be derived.
|
| 339 |
+
typedef thrust::iterator_facade<
|
| 340 |
+
zip_iterator<IteratorTuple>,
|
| 341 |
+
value_type,
|
| 342 |
+
system,
|
| 343 |
+
traversal_category,
|
| 344 |
+
reference,
|
| 345 |
+
difference_type
|
| 346 |
+
> type;
|
| 347 |
+
}; // end zip_iterator_base
|
| 348 |
+
|
| 349 |
+
} // end detail
|
| 350 |
+
|
| 351 |
+
THRUST_NAMESPACE_END
|
| 352 |
+
|
| 353 |
+
|
videochat2/lib/python3.10/site-packages/tensorflow/include/external/local_config_cuda/cuda/cuda/include/thrust/iterator/iterator_facade.h
ADDED
|
@@ -0,0 +1,542 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
* Copyright 2008-2013 NVIDIA Corporation
|
| 3 |
+
*
|
| 4 |
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
| 5 |
+
* you may not use this file except in compliance with the License.
|
| 6 |
+
* You may obtain a copy of the License at
|
| 7 |
+
*
|
| 8 |
+
* http://www.apache.org/licenses/LICENSE-2.0
|
| 9 |
+
*
|
| 10 |
+
* Unless required by applicable law or agreed to in writing, software
|
| 11 |
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
| 12 |
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
| 13 |
+
* See the License for the specific language governing permissions and
|
| 14 |
+
* limitations under the License.
|
| 15 |
+
*/
|
| 16 |
+
|
| 17 |
+
/*! \file thrust/iterator/iterator_facade.h
|
| 18 |
+
* \brief A class which exposes a public interface for iterators
|
| 19 |
+
*/
|
| 20 |
+
|
| 21 |
+
/*
|
| 22 |
+
* (C) Copyright David Abrahams 2002.
|
| 23 |
+
* (C) Copyright Jeremy Siek 2002.
|
| 24 |
+
* (C) Copyright Thomas Witt 2002.
|
| 25 |
+
*
|
| 26 |
+
* Distributed under the Boost Software License, Version 1.0.
|
| 27 |
+
* (See accompanying NOTICE file for the complete license)
|
| 28 |
+
*
|
| 29 |
+
* For more information, see http://www.boost.org
|
| 30 |
+
*/
|
| 31 |
+
|
| 32 |
+
|
| 33 |
+
#pragma once
|
| 34 |
+
|
| 35 |
+
#include <thrust/detail/config.h>
|
| 36 |
+
#include <thrust/detail/type_traits.h>
|
| 37 |
+
#include <thrust/iterator/detail/iterator_facade_category.h>
|
| 38 |
+
#include <thrust/iterator/detail/distance_from_result.h>
|
| 39 |
+
|
| 40 |
+
THRUST_NAMESPACE_BEGIN
|
| 41 |
+
|
| 42 |
+
/*! \addtogroup iterators
|
| 43 |
+
* \{
|
| 44 |
+
*/
|
| 45 |
+
|
| 46 |
+
/*! \addtogroup fancyiterator Fancy Iterators
|
| 47 |
+
* \ingroup iterators
|
| 48 |
+
* \{
|
| 49 |
+
*/
|
| 50 |
+
|
| 51 |
+
|
| 52 |
+
// This forward declaration is required for the friend declaration
|
| 53 |
+
// in iterator_core_access
|
| 54 |
+
template<typename Derived, typename Value, typename System, typename Traversal, typename Reference, typename Difference> class iterator_facade;
|
| 55 |
+
|
| 56 |
+
|
| 57 |
+
/*! \p iterator_core_access is the class which user iterator types derived from \p thrust::iterator_adaptor
|
| 58 |
+
* or \p thrust::iterator_facade must befriend to allow it to access their private interface.
|
| 59 |
+
*/
|
| 60 |
+
class iterator_core_access
|
| 61 |
+
{
|
| 62 |
+
/*! \cond
|
| 63 |
+
*/
|
| 64 |
+
|
| 65 |
+
// declare our friends
|
| 66 |
+
template<typename Derived, typename Value, typename System, typename Traversal, typename Reference, typename Difference> friend class iterator_facade;
|
| 67 |
+
|
| 68 |
+
// iterator comparisons are our friends
|
| 69 |
+
template <typename Derived1, typename Value1, typename System1, typename Traversal1, typename Reference1, typename Difference1,
|
| 70 |
+
typename Derived2, typename Value2, typename System2, typename Traversal2, typename Reference2, typename Difference2>
|
| 71 |
+
inline __host__ __device__
|
| 72 |
+
friend bool
|
| 73 |
+
operator ==(iterator_facade<Derived1,Value1,System1,Traversal1,Reference1,Difference1> const& lhs,
|
| 74 |
+
iterator_facade<Derived2,Value2,System2,Traversal2,Reference2,Difference2> const& rhs);
|
| 75 |
+
|
| 76 |
+
template <typename Derived1, typename Value1, typename System1, typename Traversal1, typename Reference1, typename Difference1,
|
| 77 |
+
typename Derived2, typename Value2, typename System2, typename Traversal2, typename Reference2, typename Difference2>
|
| 78 |
+
inline __host__ __device__
|
| 79 |
+
friend bool
|
| 80 |
+
operator !=(iterator_facade<Derived1,Value1,System1,Traversal1,Reference1,Difference1> const& lhs,
|
| 81 |
+
iterator_facade<Derived2,Value2,System2,Traversal2,Reference2,Difference2> const& rhs);
|
| 82 |
+
|
| 83 |
+
template <typename Derived1, typename Value1, typename System1, typename Traversal1, typename Reference1, typename Difference1,
|
| 84 |
+
typename Derived2, typename Value2, typename System2, typename Traversal2, typename Reference2, typename Difference2>
|
| 85 |
+
inline __host__ __device__
|
| 86 |
+
friend bool
|
| 87 |
+
operator <(iterator_facade<Derived1,Value1,System1,Traversal1,Reference1,Difference1> const& lhs,
|
| 88 |
+
iterator_facade<Derived2,Value2,System2,Traversal2,Reference2,Difference2> const& rhs);
|
| 89 |
+
|
| 90 |
+
template <typename Derived1, typename Value1, typename System1, typename Traversal1, typename Reference1, typename Difference1,
|
| 91 |
+
typename Derived2, typename Value2, typename System2, typename Traversal2, typename Reference2, typename Difference2>
|
| 92 |
+
inline __host__ __device__
|
| 93 |
+
friend bool
|
| 94 |
+
operator >(iterator_facade<Derived1,Value1,System1,Traversal1,Reference1,Difference1> const& lhs,
|
| 95 |
+
iterator_facade<Derived2,Value2,System2,Traversal2,Reference2,Difference2> const& rhs);
|
| 96 |
+
|
| 97 |
+
template <typename Derived1, typename Value1, typename System1, typename Traversal1, typename Reference1, typename Difference1,
|
| 98 |
+
typename Derived2, typename Value2, typename System2, typename Traversal2, typename Reference2, typename Difference2>
|
| 99 |
+
inline __host__ __device__
|
| 100 |
+
friend bool
|
| 101 |
+
operator <=(iterator_facade<Derived1,Value1,System1,Traversal1,Reference1,Difference1> const& lhs,
|
| 102 |
+
iterator_facade<Derived2,Value2,System2,Traversal2,Reference2,Difference2> const& rhs);
|
| 103 |
+
|
| 104 |
+
template <typename Derived1, typename Value1, typename System1, typename Traversal1, typename Reference1, typename Difference1,
|
| 105 |
+
typename Derived2, typename Value2, typename System2, typename Traversal2, typename Reference2, typename Difference2>
|
| 106 |
+
inline __host__ __device__
|
| 107 |
+
friend bool
|
| 108 |
+
operator >=(iterator_facade<Derived1,Value1,System1,Traversal1,Reference1,Difference1> const& lhs,
|
| 109 |
+
iterator_facade<Derived2,Value2,System2,Traversal2,Reference2,Difference2> const& rhs);
|
| 110 |
+
|
| 111 |
+
// iterator difference is our friend
|
| 112 |
+
template <typename Derived1, typename Value1, typename System1, typename Traversal1, typename Reference1, typename Difference1,
|
| 113 |
+
typename Derived2, typename Value2, typename System2, typename Traversal2, typename Reference2, typename Difference2>
|
| 114 |
+
inline __host__ __device__
|
| 115 |
+
friend
|
| 116 |
+
typename thrust::detail::distance_from_result<
|
| 117 |
+
iterator_facade<Derived1,Value1,System1,Traversal1,Reference1,Difference1>,
|
| 118 |
+
iterator_facade<Derived2,Value2,System2,Traversal2,Reference2,Difference2>
|
| 119 |
+
>::type
|
| 120 |
+
operator-(iterator_facade<Derived1,Value1,System1,Traversal1,Reference1,Difference1> const& lhs,
|
| 121 |
+
iterator_facade<Derived2,Value2,System2,Traversal2,Reference2,Difference2> const& rhs);
|
| 122 |
+
|
| 123 |
+
template<typename Facade>
|
| 124 |
+
__host__ __device__
|
| 125 |
+
static typename Facade::reference dereference(Facade const& f)
|
| 126 |
+
{
|
| 127 |
+
return f.dereference();
|
| 128 |
+
}
|
| 129 |
+
|
| 130 |
+
template<typename Facade>
|
| 131 |
+
__host__ __device__
|
| 132 |
+
static void increment(Facade& f)
|
| 133 |
+
{
|
| 134 |
+
f.increment();
|
| 135 |
+
}
|
| 136 |
+
|
| 137 |
+
template<typename Facade>
|
| 138 |
+
__host__ __device__
|
| 139 |
+
static void decrement(Facade& f)
|
| 140 |
+
{
|
| 141 |
+
f.decrement();
|
| 142 |
+
}
|
| 143 |
+
|
| 144 |
+
template <class Facade1, class Facade2>
|
| 145 |
+
__host__ __device__
|
| 146 |
+
static bool equal(Facade1 const& f1, Facade2 const& f2)
|
| 147 |
+
{
|
| 148 |
+
return f1.equal(f2);
|
| 149 |
+
}
|
| 150 |
+
|
| 151 |
+
// XXX TODO: Investigate whether we need both of these cases
|
| 152 |
+
//template <class Facade1, class Facade2>
|
| 153 |
+
//__host__ __device__
|
| 154 |
+
//static bool equal(Facade1 const& f1, Facade2 const& f2, mpl::true_)
|
| 155 |
+
//{
|
| 156 |
+
// return f1.equal(f2);
|
| 157 |
+
//}
|
| 158 |
+
|
| 159 |
+
//template <class Facade1, class Facade2>
|
| 160 |
+
//__host__ __device__
|
| 161 |
+
//static bool equal(Facade1 const& f1, Facade2 const& f2, mpl::false_)
|
| 162 |
+
//{
|
| 163 |
+
// return f2.equal(f1);
|
| 164 |
+
//}
|
| 165 |
+
|
| 166 |
+
template <class Facade>
|
| 167 |
+
__host__ __device__
|
| 168 |
+
static void advance(Facade& f, typename Facade::difference_type n)
|
| 169 |
+
{
|
| 170 |
+
f.advance(n);
|
| 171 |
+
}
|
| 172 |
+
|
| 173 |
+
// Facade2 is convertible to Facade1,
|
| 174 |
+
// so return Facade1's difference_type
|
| 175 |
+
template <class Facade1, class Facade2>
|
| 176 |
+
__host__ __device__
|
| 177 |
+
static typename Facade1::difference_type
|
| 178 |
+
distance_from(Facade1 const& f1, Facade2 const& f2, thrust::detail::true_type)
|
| 179 |
+
{
|
| 180 |
+
return -f1.distance_to(f2);
|
| 181 |
+
}
|
| 182 |
+
|
| 183 |
+
// Facade2 is not convertible to Facade1,
|
| 184 |
+
// so return Facade2's difference_type
|
| 185 |
+
template <class Facade1, class Facade2>
|
| 186 |
+
__host__ __device__
|
| 187 |
+
static typename Facade2::difference_type
|
| 188 |
+
distance_from(Facade1 const& f1, Facade2 const& f2, thrust::detail::false_type)
|
| 189 |
+
{
|
| 190 |
+
return f2.distance_to(f1);
|
| 191 |
+
}
|
| 192 |
+
|
| 193 |
+
template <class Facade1, class Facade2>
|
| 194 |
+
__host__ __device__
|
| 195 |
+
static typename thrust::detail::distance_from_result<Facade1,Facade2>::type
|
| 196 |
+
distance_from(Facade1 const& f1, Facade2 const& f2)
|
| 197 |
+
{
|
| 198 |
+
// dispatch the implementation of this method upon whether or not
|
| 199 |
+
// Facade2 is convertible to Facade1
|
| 200 |
+
return distance_from(f1, f2,
|
| 201 |
+
typename thrust::detail::is_convertible<Facade2,Facade1>::type());
|
| 202 |
+
}
|
| 203 |
+
|
| 204 |
+
//
|
| 205 |
+
// Curiously Recurring Template interface.
|
| 206 |
+
//
|
| 207 |
+
template <typename Derived, typename Value, typename System, typename Traversal, typename Reference, typename Difference>
|
| 208 |
+
__host__ __device__
|
| 209 |
+
static Derived& derived(iterator_facade<Derived,Value,System,Traversal,Reference,Difference>& facade)
|
| 210 |
+
{
|
| 211 |
+
return *static_cast<Derived*>(&facade);
|
| 212 |
+
}
|
| 213 |
+
|
| 214 |
+
template <typename Derived, typename Value, typename System, typename Traversal, typename Reference, typename Difference>
|
| 215 |
+
__host__ __device__
|
| 216 |
+
static Derived const& derived(iterator_facade<Derived,Value,System,Traversal,Reference,Difference> const& facade)
|
| 217 |
+
{
|
| 218 |
+
return *static_cast<Derived const*>(&facade);
|
| 219 |
+
}
|
| 220 |
+
|
| 221 |
+
/*! \endcond
|
| 222 |
+
*/
|
| 223 |
+
}; // end iterator_core_access
|
| 224 |
+
|
| 225 |
+
|
| 226 |
+
/*! \p iterator_facade is a template which allows the programmer to define a novel iterator with a standards-conforming interface
|
| 227 |
+
* which Thrust can use to reason about algorithm acceleration opportunities.
|
| 228 |
+
*
|
| 229 |
+
* Because most of a standard iterator's interface is defined in terms of a small set of core primitives, \p iterator_facade
|
| 230 |
+
* defines the non-primitive portion mechanically. In principle a novel iterator could explicitly provide the entire interface in
|
| 231 |
+
* an ad hoc fashion but doing so might be tedious and prone to subtle errors.
|
| 232 |
+
*
|
| 233 |
+
* Often \p iterator_facade is too primitive a tool to use for defining novel iterators. In these cases, \p iterator_adaptor
|
| 234 |
+
* or a specific fancy iterator should be used instead.
|
| 235 |
+
*
|
| 236 |
+
* \p iterator_facade's functionality is derived from and generally equivalent to \p boost::iterator_facade.
|
| 237 |
+
* The exception is Thrust's addition of the template parameter \p System, which is necessary to allow Thrust
|
| 238 |
+
* to dispatch an algorithm to one of several parallel backend systems. An additional exception is Thrust's omission
|
| 239 |
+
* of the \c operator-> member function.
|
| 240 |
+
*
|
| 241 |
+
* Interested users may refer to <tt>boost::iterator_facade</tt>'s documentation for usage examples.
|
| 242 |
+
*
|
| 243 |
+
* \note \p iterator_facade's arithmetic operator free functions exist with the usual meanings but are omitted here for brevity.
|
| 244 |
+
*/
|
| 245 |
+
template<typename Derived,
|
| 246 |
+
typename Value,
|
| 247 |
+
typename System,
|
| 248 |
+
typename Traversal,
|
| 249 |
+
typename Reference,
|
| 250 |
+
typename Difference = std::ptrdiff_t>
|
| 251 |
+
class iterator_facade
|
| 252 |
+
{
|
| 253 |
+
private:
|
| 254 |
+
/*! \cond
|
| 255 |
+
*/
|
| 256 |
+
|
| 257 |
+
//
|
| 258 |
+
// Curiously Recurring Template interface.
|
| 259 |
+
//
|
| 260 |
+
__host__ __device__
|
| 261 |
+
Derived& derived()
|
| 262 |
+
{
|
| 263 |
+
return *static_cast<Derived*>(this);
|
| 264 |
+
}
|
| 265 |
+
|
| 266 |
+
__host__ __device__
|
| 267 |
+
Derived const& derived() const
|
| 268 |
+
{
|
| 269 |
+
return *static_cast<Derived const*>(this);
|
| 270 |
+
}
|
| 271 |
+
/*! \endcond
|
| 272 |
+
*/
|
| 273 |
+
|
| 274 |
+
public:
|
| 275 |
+
/*! The type of element pointed to by \p iterator_facade.
|
| 276 |
+
*/
|
| 277 |
+
typedef typename thrust::detail::remove_const<Value>::type value_type;
|
| 278 |
+
|
| 279 |
+
/*! The return type of \p iterator_facade::operator*().
|
| 280 |
+
*/
|
| 281 |
+
typedef Reference reference;
|
| 282 |
+
|
| 283 |
+
/*! The return type of \p iterator_facade's non-existent \c operator->()
|
| 284 |
+
* member function. Unlike \c boost::iterator_facade, \p iterator_facade
|
| 285 |
+
* disallows access to the \p value_type's members through expressions of the
|
| 286 |
+
* form <tt>iter->member</tt>. \p pointer is defined to \c void to indicate
|
| 287 |
+
* that these expressions are not allowed. This limitation may be relaxed in a
|
| 288 |
+
* future version of Thrust.
|
| 289 |
+
*/
|
| 290 |
+
typedef void pointer;
|
| 291 |
+
|
| 292 |
+
/*! The type of expressions of the form <tt>x - y</tt> where <tt>x</tt> and <tt>y</tt>
|
| 293 |
+
* are of type \p iterator_facade.
|
| 294 |
+
*/
|
| 295 |
+
typedef Difference difference_type;
|
| 296 |
+
|
| 297 |
+
/*! The type of iterator category of \p iterator_facade.
|
| 298 |
+
*/
|
| 299 |
+
typedef typename thrust::detail::iterator_facade_category<
|
| 300 |
+
System, Traversal, Value, Reference
|
| 301 |
+
>::type iterator_category;
|
| 302 |
+
|
| 303 |
+
/*! \p operator*() dereferences this \p iterator_facade.
|
| 304 |
+
* \return A reference to the element pointed to by this \p iterator_facade.
|
| 305 |
+
*/
|
| 306 |
+
__host__ __device__
|
| 307 |
+
reference operator*() const
|
| 308 |
+
{
|
| 309 |
+
return iterator_core_access::dereference(this->derived());
|
| 310 |
+
}
|
| 311 |
+
|
| 312 |
+
// XXX unimplemented for now, consider implementing it later
|
| 313 |
+
//pointer operator->() const
|
| 314 |
+
//{
|
| 315 |
+
// return;
|
| 316 |
+
//}
|
| 317 |
+
|
| 318 |
+
// XXX investigate whether or not we need to go to the lengths
|
| 319 |
+
// boost does to determine the return type
|
| 320 |
+
|
| 321 |
+
/*! \p operator[] performs indexed dereference.
|
| 322 |
+
* \return A reference to the element \p n distance away from this \p iterator_facade.
|
| 323 |
+
*/
|
| 324 |
+
__host__ __device__
|
| 325 |
+
reference operator[](difference_type n) const
|
| 326 |
+
{
|
| 327 |
+
return *(this->derived() + n);
|
| 328 |
+
}
|
| 329 |
+
|
| 330 |
+
/*! \p operator++ pre-increments this \p iterator_facade to refer to the element in the next position.
|
| 331 |
+
* \return <tt>*this</tt>
|
| 332 |
+
*/
|
| 333 |
+
__host__ __device__
|
| 334 |
+
Derived& operator++()
|
| 335 |
+
{
|
| 336 |
+
iterator_core_access::increment(this->derived());
|
| 337 |
+
return this->derived();
|
| 338 |
+
}
|
| 339 |
+
|
| 340 |
+
/*! \p operator++ post-increments this \p iterator_facade and returns a new \p iterator_facade referring to the element in the next position.
|
| 341 |
+
* \return A copy of <tt>*this</tt> before increment.
|
| 342 |
+
*/
|
| 343 |
+
__host__ __device__
|
| 344 |
+
Derived operator++(int)
|
| 345 |
+
{
|
| 346 |
+
Derived tmp(this->derived());
|
| 347 |
+
++*this;
|
| 348 |
+
return tmp;
|
| 349 |
+
}
|
| 350 |
+
|
| 351 |
+
/*! \p operator-- pre-decrements this \p iterator_facade to refer to the element in the previous position.
|
| 352 |
+
* \return <tt>*this</tt>
|
| 353 |
+
*/
|
| 354 |
+
__host__ __device__
|
| 355 |
+
Derived& operator--()
|
| 356 |
+
{
|
| 357 |
+
iterator_core_access::decrement(this->derived());
|
| 358 |
+
return this->derived();
|
| 359 |
+
}
|
| 360 |
+
|
| 361 |
+
/*! \p operator-- post-decrements this \p iterator_facade and returns a new \p iterator_facade referring to the element in the previous position.
|
| 362 |
+
* \return A copy of <tt>*this</tt> before decrement.
|
| 363 |
+
*/
|
| 364 |
+
__host__ __device__
|
| 365 |
+
Derived operator--(int)
|
| 366 |
+
{
|
| 367 |
+
Derived tmp(this->derived());
|
| 368 |
+
--*this;
|
| 369 |
+
return tmp;
|
| 370 |
+
}
|
| 371 |
+
|
| 372 |
+
/*! \p operator+= increments this \p iterator_facade to refer to an element a given distance after its current position.
|
| 373 |
+
* \param n The quantity to increment.
|
| 374 |
+
* \return <tt>*this</tt>
|
| 375 |
+
*/
|
| 376 |
+
__host__ __device__
|
| 377 |
+
Derived& operator+=(difference_type n)
|
| 378 |
+
{
|
| 379 |
+
iterator_core_access::advance(this->derived(), n);
|
| 380 |
+
return this->derived();
|
| 381 |
+
}
|
| 382 |
+
|
| 383 |
+
/*! \p operator-= decrements this \p iterator_facade to refer to an element a given distance before its current postition.
|
| 384 |
+
* \param n The quantity to decrement.
|
| 385 |
+
* \return <tt>*this</tt>
|
| 386 |
+
*/
|
| 387 |
+
__host__ __device__
|
| 388 |
+
Derived& operator-=(difference_type n)
|
| 389 |
+
{
|
| 390 |
+
iterator_core_access::advance(this->derived(), -n);
|
| 391 |
+
return this->derived();
|
| 392 |
+
}
|
| 393 |
+
|
| 394 |
+
/*! \p operator- subtracts a given quantity from this \p iterator_facade and returns a new \p iterator_facade referring to the element at the given position before this \p iterator_facade.
|
| 395 |
+
* \param n The quantity to decrement
|
| 396 |
+
* \return An \p iterator_facade pointing \p n elements before this \p iterator_facade.
|
| 397 |
+
*/
|
| 398 |
+
__host__ __device__
|
| 399 |
+
Derived operator-(difference_type n) const
|
| 400 |
+
{
|
| 401 |
+
Derived result(this->derived());
|
| 402 |
+
return result -= n;
|
| 403 |
+
}
|
| 404 |
+
}; // end iterator_facade
|
| 405 |
+
|
| 406 |
+
/*! \cond
|
| 407 |
+
*/
|
| 408 |
+
|
| 409 |
+
// Comparison operators
|
| 410 |
+
template <typename Derived1, typename Value1, typename System1, typename Traversal1, typename Reference1, typename Difference1,
|
| 411 |
+
typename Derived2, typename Value2, typename System2, typename Traversal2, typename Reference2, typename Difference2>
|
| 412 |
+
inline __host__ __device__
|
| 413 |
+
// XXX it might be nice to implement this at some point
|
| 414 |
+
//typename enable_if_interoperable<Dr1,Dr2,bool>::type // exposition
|
| 415 |
+
bool
|
| 416 |
+
operator ==(iterator_facade<Derived1,Value1,System1,Traversal1,Reference1,Difference1> const& lhs,
|
| 417 |
+
iterator_facade<Derived2,Value2,System2,Traversal2,Reference2,Difference2> const& rhs)
|
| 418 |
+
{
|
| 419 |
+
return iterator_core_access
|
| 420 |
+
::equal(*static_cast<Derived1 const*>(&lhs),
|
| 421 |
+
*static_cast<Derived2 const*>(&rhs));
|
| 422 |
+
}
|
| 423 |
+
|
| 424 |
+
template <typename Derived1, typename Value1, typename System1, typename Traversal1, typename Reference1, typename Difference1,
|
| 425 |
+
typename Derived2, typename Value2, typename System2, typename Traversal2, typename Reference2, typename Difference2>
|
| 426 |
+
inline __host__ __device__
|
| 427 |
+
// XXX it might be nice to implement this at some point
|
| 428 |
+
//typename enable_if_interoperable<Dr1,Dr2,bool>::type // exposition
|
| 429 |
+
bool
|
| 430 |
+
operator !=(iterator_facade<Derived1,Value1,System1,Traversal1,Reference1,Difference1> const& lhs,
|
| 431 |
+
iterator_facade<Derived2,Value2,System2,Traversal2,Reference2,Difference2> const& rhs)
|
| 432 |
+
{
|
| 433 |
+
return !iterator_core_access
|
| 434 |
+
::equal(*static_cast<Derived1 const*>(&lhs),
|
| 435 |
+
*static_cast<Derived2 const*>(&rhs));
|
| 436 |
+
}
|
| 437 |
+
|
| 438 |
+
template <typename Derived1, typename Value1, typename System1, typename Traversal1, typename Reference1, typename Difference1,
|
| 439 |
+
typename Derived2, typename Value2, typename System2, typename Traversal2, typename Reference2, typename Difference2>
|
| 440 |
+
inline __host__ __device__
|
| 441 |
+
// XXX it might be nice to implement this at some point
|
| 442 |
+
//typename enable_if_interoperable<Dr1,Dr2,bool>::type // exposition
|
| 443 |
+
bool
|
| 444 |
+
operator <(iterator_facade<Derived1,Value1,System1,Traversal1,Reference1,Difference1> const& lhs,
|
| 445 |
+
iterator_facade<Derived2,Value2,System2,Traversal2,Reference2,Difference2> const& rhs)
|
| 446 |
+
{
|
| 447 |
+
return 0 > iterator_core_access
|
| 448 |
+
::distance_from(*static_cast<Derived1 const*>(&lhs),
|
| 449 |
+
*static_cast<Derived2 const*>(&rhs));
|
| 450 |
+
}
|
| 451 |
+
|
| 452 |
+
template <typename Derived1, typename Value1, typename System1, typename Traversal1, typename Reference1, typename Difference1,
|
| 453 |
+
typename Derived2, typename Value2, typename System2, typename Traversal2, typename Reference2, typename Difference2>
|
| 454 |
+
inline __host__ __device__
|
| 455 |
+
// XXX it might be nice to implement this at some point
|
| 456 |
+
//typename enable_if_interoperable<Dr1,Dr2,bool>::type // exposition
|
| 457 |
+
bool
|
| 458 |
+
operator >(iterator_facade<Derived1,Value1,System1,Traversal1,Reference1,Difference1> const& lhs,
|
| 459 |
+
iterator_facade<Derived2,Value2,System2,Traversal2,Reference2,Difference2> const& rhs)
|
| 460 |
+
{
|
| 461 |
+
return 0 < iterator_core_access
|
| 462 |
+
::distance_from(*static_cast<Derived1 const*>(&lhs),
|
| 463 |
+
*static_cast<Derived2 const*>(&rhs));
|
| 464 |
+
}
|
| 465 |
+
|
| 466 |
+
template <typename Derived1, typename Value1, typename System1, typename Traversal1, typename Reference1, typename Difference1,
|
| 467 |
+
typename Derived2, typename Value2, typename System2, typename Traversal2, typename Reference2, typename Difference2>
|
| 468 |
+
inline __host__ __device__
|
| 469 |
+
// XXX it might be nice to implement this at some point
|
| 470 |
+
//typename enable_if_interoperable<Dr1,Dr2,bool>::type // exposition
|
| 471 |
+
bool
|
| 472 |
+
operator <=(iterator_facade<Derived1,Value1,System1,Traversal1,Reference1,Difference1> const& lhs,
|
| 473 |
+
iterator_facade<Derived2,Value2,System2,Traversal2,Reference2,Difference2> const& rhs)
|
| 474 |
+
{
|
| 475 |
+
return 0 >= iterator_core_access
|
| 476 |
+
::distance_from(*static_cast<Derived1 const*>(&lhs),
|
| 477 |
+
*static_cast<Derived2 const*>(&rhs));
|
| 478 |
+
}
|
| 479 |
+
|
| 480 |
+
template <typename Derived1, typename Value1, typename System1, typename Traversal1, typename Reference1, typename Difference1,
|
| 481 |
+
typename Derived2, typename Value2, typename System2, typename Traversal2, typename Reference2, typename Difference2>
|
| 482 |
+
inline __host__ __device__
|
| 483 |
+
// XXX it might be nice to implement this at some point
|
| 484 |
+
//typename enable_if_interoperable<Dr1,Dr2,bool>::type // exposition
|
| 485 |
+
bool
|
| 486 |
+
operator >=(iterator_facade<Derived1,Value1,System1,Traversal1,Reference1,Difference1> const& lhs,
|
| 487 |
+
iterator_facade<Derived2,Value2,System2,Traversal2,Reference2,Difference2> const& rhs)
|
| 488 |
+
{
|
| 489 |
+
return 0 <= iterator_core_access
|
| 490 |
+
::distance_from(*static_cast<Derived1 const*>(&lhs),
|
| 491 |
+
*static_cast<Derived2 const*>(&rhs));
|
| 492 |
+
}
|
| 493 |
+
|
| 494 |
+
// Iterator difference
|
| 495 |
+
template <typename Derived1, typename Value1, typename System1, typename Traversal1, typename Reference1, typename Difference1,
|
| 496 |
+
typename Derived2, typename Value2, typename System2, typename Traversal2, typename Reference2, typename Difference2>
|
| 497 |
+
inline __host__ __device__
|
| 498 |
+
|
| 499 |
+
// divine the type this operator returns
|
| 500 |
+
typename thrust::detail::distance_from_result<
|
| 501 |
+
iterator_facade<Derived1,Value1,System1,Traversal1,Reference1,Difference1>,
|
| 502 |
+
iterator_facade<Derived2,Value2,System2,Traversal2,Reference2,Difference2>
|
| 503 |
+
>::type
|
| 504 |
+
|
| 505 |
+
operator-(iterator_facade<Derived1,Value1,System1,Traversal1,Reference1,Difference1> const& lhs,
|
| 506 |
+
iterator_facade<Derived2,Value2,System2,Traversal2,Reference2,Difference2> const& rhs)
|
| 507 |
+
{
|
| 508 |
+
return iterator_core_access
|
| 509 |
+
::distance_from(*static_cast<Derived1 const*>(&lhs),
|
| 510 |
+
*static_cast<Derived2 const*>(&rhs));
|
| 511 |
+
}
|
| 512 |
+
|
| 513 |
+
// Iterator addition
|
| 514 |
+
template <typename Derived, typename Value, typename System, typename Traversal, typename Reference, typename Difference>
|
| 515 |
+
inline __host__ __device__
|
| 516 |
+
Derived operator+ (iterator_facade<Derived,Value,System,Traversal,Reference,Difference> const& i,
|
| 517 |
+
typename Derived::difference_type n)
|
| 518 |
+
{
|
| 519 |
+
Derived tmp(static_cast<Derived const&>(i));
|
| 520 |
+
return tmp += n;
|
| 521 |
+
}
|
| 522 |
+
|
| 523 |
+
template <typename Derived, typename Value, typename System, typename Traversal, typename Reference, typename Difference>
|
| 524 |
+
inline __host__ __device__
|
| 525 |
+
Derived operator+ (typename Derived::difference_type n,
|
| 526 |
+
iterator_facade<Derived,Value,System,Traversal,Reference,Difference> const& i)
|
| 527 |
+
{
|
| 528 |
+
Derived tmp(static_cast<Derived const&>(i));
|
| 529 |
+
return tmp += n;
|
| 530 |
+
}
|
| 531 |
+
|
| 532 |
+
/*! \endcond
|
| 533 |
+
*/
|
| 534 |
+
|
| 535 |
+
/*! \} // end fancyiterators
|
| 536 |
+
*/
|
| 537 |
+
|
| 538 |
+
/*! \} // end iterators
|
| 539 |
+
*/
|
| 540 |
+
|
| 541 |
+
THRUST_NAMESPACE_END
|
| 542 |
+
|
videochat2/lib/python3.10/site-packages/tensorflow/include/external/local_config_cuda/cuda/cuda/include/thrust/iterator/transform_iterator.h
ADDED
|
@@ -0,0 +1,355 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
* Copyright 2008-2013 NVIDIA Corporation
|
| 3 |
+
*
|
| 4 |
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
| 5 |
+
* you may not use this file except in compliance with the License.
|
| 6 |
+
* You may obtain a copy of the License at
|
| 7 |
+
*
|
| 8 |
+
* http://www.apache.org/licenses/LICENSE-2.0
|
| 9 |
+
*
|
| 10 |
+
* Unless required by applicable law or agreed to in writing, software
|
| 11 |
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
| 12 |
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
| 13 |
+
* See the License for the specific language governing permissions and
|
| 14 |
+
* limitations under the License.
|
| 15 |
+
*/
|
| 16 |
+
|
| 17 |
+
|
| 18 |
+
/*! \file thrust/iterator/transform_iterator.h
|
| 19 |
+
* \brief An iterator which adapts another iterator by applying a function to the result of its dereference
|
| 20 |
+
*/
|
| 21 |
+
|
| 22 |
+
/*
|
| 23 |
+
* (C) Copyright David Abrahams 2002.
|
| 24 |
+
* (C) Copyright Jeremy Siek 2002.
|
| 25 |
+
* (C) Copyright Thomas Witt 2002.
|
| 26 |
+
*
|
| 27 |
+
* Distributed under the Boost Software License, Version 1.0.
|
| 28 |
+
* (See accompanying NOTICE file for the complete license)
|
| 29 |
+
*
|
| 30 |
+
* For more information, see http://www.boost.org
|
| 31 |
+
*/
|
| 32 |
+
|
| 33 |
+
#pragma once
|
| 34 |
+
|
| 35 |
+
#include <thrust/detail/config.h>
|
| 36 |
+
|
| 37 |
+
// #include the details first
|
| 38 |
+
#include <thrust/iterator/detail/transform_iterator.inl>
|
| 39 |
+
#include <thrust/iterator/iterator_facade.h>
|
| 40 |
+
#include <thrust/iterator/iterator_traits.h>
|
| 41 |
+
#include <thrust/detail/type_traits.h>
|
| 42 |
+
|
| 43 |
+
THRUST_NAMESPACE_BEGIN
|
| 44 |
+
|
| 45 |
+
/*! \addtogroup iterators
|
| 46 |
+
* \{
|
| 47 |
+
*/
|
| 48 |
+
|
| 49 |
+
/*! \addtogroup fancyiterator Fancy Iterators
|
| 50 |
+
* \ingroup iterators
|
| 51 |
+
* \{
|
| 52 |
+
*/
|
| 53 |
+
|
| 54 |
+
/*! \p transform_iterator is an iterator which represents a pointer into a range
|
| 55 |
+
* of values after transformation by a function. This iterator is useful for
|
| 56 |
+
* creating a range filled with the result of applying an operation to another range
|
| 57 |
+
* without either explicitly storing it in memory, or explicitly executing the transformation.
|
| 58 |
+
* Using \p transform_iterator facilitates kernel fusion by deferring the execution
|
| 59 |
+
* of a transformation until the value is needed while saving both memory capacity
|
| 60 |
+
* and bandwidth.
|
| 61 |
+
*
|
| 62 |
+
* The following code snippet demonstrates how to create a \p transform_iterator
|
| 63 |
+
* which represents the result of \c sqrtf applied to the contents of a \p device_vector.
|
| 64 |
+
*
|
| 65 |
+
* \code
|
| 66 |
+
* #include <thrust/iterator/transform_iterator.h>
|
| 67 |
+
* #include <thrust/device_vector.h>
|
| 68 |
+
*
|
| 69 |
+
* // note: functor inherits from unary_function
|
| 70 |
+
* struct square_root : public thrust::unary_function<float,float>
|
| 71 |
+
* {
|
| 72 |
+
* __host__ __device__
|
| 73 |
+
* float operator()(float x) const
|
| 74 |
+
* {
|
| 75 |
+
* return sqrtf(x);
|
| 76 |
+
* }
|
| 77 |
+
* };
|
| 78 |
+
*
|
| 79 |
+
* int main()
|
| 80 |
+
* {
|
| 81 |
+
* thrust::device_vector<float> v(4);
|
| 82 |
+
* v[0] = 1.0f;
|
| 83 |
+
* v[1] = 4.0f;
|
| 84 |
+
* v[2] = 9.0f;
|
| 85 |
+
* v[3] = 16.0f;
|
| 86 |
+
*
|
| 87 |
+
* typedef thrust::device_vector<float>::iterator FloatIterator;
|
| 88 |
+
*
|
| 89 |
+
* thrust::transform_iterator<square_root, FloatIterator> iter(v.begin(), square_root());
|
| 90 |
+
*
|
| 91 |
+
* *iter; // returns 1.0f
|
| 92 |
+
* iter[0]; // returns 1.0f;
|
| 93 |
+
* iter[1]; // returns 2.0f;
|
| 94 |
+
* iter[2]; // returns 3.0f;
|
| 95 |
+
* iter[3]; // returns 4.0f;
|
| 96 |
+
*
|
| 97 |
+
* // iter[4] is an out-of-bounds error
|
| 98 |
+
* }
|
| 99 |
+
* \endcode
|
| 100 |
+
*
|
| 101 |
+
* This next example demonstrates how to use a \p transform_iterator with the
|
| 102 |
+
* \p thrust::reduce function to compute the sum of squares of a sequence.
|
| 103 |
+
* We will create temporary \p transform_iterators with the
|
| 104 |
+
* \p make_transform_iterator function in order to avoid explicitly specifying their type:
|
| 105 |
+
*
|
| 106 |
+
* \code
|
| 107 |
+
* #include <thrust/iterator/transform_iterator.h>
|
| 108 |
+
* #include <thrust/device_vector.h>
|
| 109 |
+
* #include <thrust/reduce.h>
|
| 110 |
+
* #include <iostream>
|
| 111 |
+
*
|
| 112 |
+
* // note: functor inherits from unary_function
|
| 113 |
+
* struct square : public thrust::unary_function<float,float>
|
| 114 |
+
* {
|
| 115 |
+
* __host__ __device__
|
| 116 |
+
* float operator()(float x) const
|
| 117 |
+
* {
|
| 118 |
+
* return x * x;
|
| 119 |
+
* }
|
| 120 |
+
* };
|
| 121 |
+
*
|
| 122 |
+
* int main()
|
| 123 |
+
* {
|
| 124 |
+
* // initialize a device array
|
| 125 |
+
* thrust::device_vector<float> v(4);
|
| 126 |
+
* v[0] = 1.0f;
|
| 127 |
+
* v[1] = 2.0f;
|
| 128 |
+
* v[2] = 3.0f;
|
| 129 |
+
* v[3] = 4.0f;
|
| 130 |
+
*
|
| 131 |
+
* float sum_of_squares =
|
| 132 |
+
* thrust::reduce(thrust::make_transform_iterator(v.begin(), square()),
|
| 133 |
+
* thrust::make_transform_iterator(v.end(), square()));
|
| 134 |
+
*
|
| 135 |
+
* std::cout << "sum of squares: " << sum_of_squares << std::endl;
|
| 136 |
+
* return 0;
|
| 137 |
+
* }
|
| 138 |
+
* \endcode
|
| 139 |
+
*
|
| 140 |
+
* Note that in the previous two examples the transform functor (namely \c square_root
|
| 141 |
+
* and \c square) inherits from \c thrust::unary_function. Inheriting from
|
| 142 |
+
* \c thrust::unary_function ensures that a functor is a valid \c AdaptableUnaryFunction
|
| 143 |
+
* and provides all the necessary \c typedef declarations. The \p transform_iterator
|
| 144 |
+
* can also be applied to a \c UnaryFunction that does not inherit from
|
| 145 |
+
* \c thrust::unary_function using an optional template argument. The following example
|
| 146 |
+
* illustrates how to use the third template argument to specify the \c result_type of
|
| 147 |
+
* the function.
|
| 148 |
+
*
|
| 149 |
+
* \code
|
| 150 |
+
* #include <thrust/iterator/transform_iterator.h>
|
| 151 |
+
* #include <thrust/device_vector.h>
|
| 152 |
+
*
|
| 153 |
+
* // note: functor *does not* inherit from unary_function
|
| 154 |
+
* struct square_root
|
| 155 |
+
* {
|
| 156 |
+
* __host__ __device__
|
| 157 |
+
* float operator()(float x) const
|
| 158 |
+
* {
|
| 159 |
+
* return sqrtf(x);
|
| 160 |
+
* }
|
| 161 |
+
* };
|
| 162 |
+
*
|
| 163 |
+
* int main()
|
| 164 |
+
* {
|
| 165 |
+
* thrust::device_vector<float> v(4);
|
| 166 |
+
* v[0] = 1.0f;
|
| 167 |
+
* v[1] = 4.0f;
|
| 168 |
+
* v[2] = 9.0f;
|
| 169 |
+
* v[3] = 16.0f;
|
| 170 |
+
*
|
| 171 |
+
* typedef thrust::device_vector<float>::iterator FloatIterator;
|
| 172 |
+
*
|
| 173 |
+
* // note: float result_type is specified explicitly
|
| 174 |
+
* thrust::transform_iterator<square_root, FloatIterator, float> iter(v.begin(), square_root());
|
| 175 |
+
*
|
| 176 |
+
* *iter; // returns 1.0f
|
| 177 |
+
* iter[0]; // returns 1.0f;
|
| 178 |
+
* iter[1]; // returns 2.0f;
|
| 179 |
+
* iter[2]; // returns 3.0f;
|
| 180 |
+
* iter[3]; // returns 4.0f;
|
| 181 |
+
*
|
| 182 |
+
* // iter[4] is an out-of-bounds error
|
| 183 |
+
* }
|
| 184 |
+
* \endcode
|
| 185 |
+
*
|
| 186 |
+
* \see make_transform_iterator
|
| 187 |
+
*/
|
| 188 |
+
template <class AdaptableUnaryFunction, class Iterator, class Reference = use_default, class Value = use_default>
|
| 189 |
+
class transform_iterator
|
| 190 |
+
: public detail::transform_iterator_base<AdaptableUnaryFunction, Iterator, Reference, Value>::type
|
| 191 |
+
{
|
| 192 |
+
/*! \cond
|
| 193 |
+
*/
|
| 194 |
+
public:
|
| 195 |
+
typedef typename
|
| 196 |
+
detail::transform_iterator_base<AdaptableUnaryFunction, Iterator, Reference, Value>::type
|
| 197 |
+
super_t;
|
| 198 |
+
|
| 199 |
+
friend class thrust::iterator_core_access;
|
| 200 |
+
/*! \endcond
|
| 201 |
+
*/
|
| 202 |
+
|
| 203 |
+
public:
|
| 204 |
+
/*! Null constructor does nothing.
|
| 205 |
+
*/
|
| 206 |
+
__host__ __device__
|
| 207 |
+
transform_iterator() {}
|
| 208 |
+
|
| 209 |
+
#if THRUST_CPP_DIALECT >= 2011
|
| 210 |
+
transform_iterator(transform_iterator const&) = default;
|
| 211 |
+
#endif
|
| 212 |
+
|
| 213 |
+
/*! This constructor takes as arguments an \c Iterator and an \c AdaptableUnaryFunction
|
| 214 |
+
* and copies them to a new \p transform_iterator.
|
| 215 |
+
*
|
| 216 |
+
* \param x An \c Iterator pointing to the input to this \p transform_iterator's \c AdaptableUnaryFunction.
|
| 217 |
+
* \param f An \c AdaptableUnaryFunction used to transform the objects pointed to by \p x.
|
| 218 |
+
*/
|
| 219 |
+
__host__ __device__
|
| 220 |
+
transform_iterator(Iterator const& x, AdaptableUnaryFunction f)
|
| 221 |
+
: super_t(x), m_f(f) {
|
| 222 |
+
}
|
| 223 |
+
|
| 224 |
+
/*! This explicit constructor copies the value of a given \c Iterator and creates
|
| 225 |
+
* this \p transform_iterator's \c AdaptableUnaryFunction using its null constructor.
|
| 226 |
+
*
|
| 227 |
+
* \param x An \c Iterator to copy.
|
| 228 |
+
*/
|
| 229 |
+
__host__ __device__
|
| 230 |
+
explicit transform_iterator(Iterator const& x)
|
| 231 |
+
: super_t(x) { }
|
| 232 |
+
|
| 233 |
+
/*! This copy constructor creates a new \p transform_iterator from another
|
| 234 |
+
* \p transform_iterator.
|
| 235 |
+
*
|
| 236 |
+
* \param other The \p transform_iterator to copy.
|
| 237 |
+
*/
|
| 238 |
+
template<typename OtherAdaptableUnaryFunction,
|
| 239 |
+
typename OtherIterator,
|
| 240 |
+
typename OtherReference,
|
| 241 |
+
typename OtherValue>
|
| 242 |
+
__host__ __device__
|
| 243 |
+
transform_iterator(const transform_iterator<OtherAdaptableUnaryFunction, OtherIterator, OtherReference, OtherValue> &other,
|
| 244 |
+
typename thrust::detail::enable_if_convertible<OtherIterator, Iterator>::type* = 0,
|
| 245 |
+
typename thrust::detail::enable_if_convertible<OtherAdaptableUnaryFunction, AdaptableUnaryFunction>::type* = 0)
|
| 246 |
+
: super_t(other.base()), m_f(other.functor()) {}
|
| 247 |
+
|
| 248 |
+
/*! Copy assignment operator copies from another \p transform_iterator.
|
| 249 |
+
* \p other The other \p transform_iterator to copy
|
| 250 |
+
* \return <tt>*this</tt>
|
| 251 |
+
*
|
| 252 |
+
* \note If the type of this \p transform_iterator's functor is not copy assignable
|
| 253 |
+
* (for example, if it is a lambda) it is not an error to call this function.
|
| 254 |
+
* In this case, however, the functor will not be modified.
|
| 255 |
+
*
|
| 256 |
+
* In any case, this \p transform_iterator's underlying iterator will be copy assigned.
|
| 257 |
+
*/
|
| 258 |
+
__host__ __device__
|
| 259 |
+
transform_iterator &operator=(const transform_iterator &other)
|
| 260 |
+
{
|
| 261 |
+
return do_assign(other,
|
| 262 |
+
// XXX gcc 4.2.1 crashes on is_copy_assignable; just assume the functor is assignable as a WAR
|
| 263 |
+
#if (THRUST_HOST_COMPILER == THRUST_HOST_COMPILER_GCC) && (THRUST_GCC_VERSION <= 40201)
|
| 264 |
+
thrust::detail::true_type()
|
| 265 |
+
#else
|
| 266 |
+
typename thrust::detail::is_copy_assignable<AdaptableUnaryFunction>::type()
|
| 267 |
+
#endif // THRUST_HOST_COMPILER
|
| 268 |
+
);
|
| 269 |
+
}
|
| 270 |
+
|
| 271 |
+
/*! This method returns a copy of this \p transform_iterator's \c AdaptableUnaryFunction.
|
| 272 |
+
* \return A copy of this \p transform_iterator's \c AdaptableUnaryFunction.
|
| 273 |
+
*/
|
| 274 |
+
__host__ __device__
|
| 275 |
+
AdaptableUnaryFunction functor() const
|
| 276 |
+
{ return m_f; }
|
| 277 |
+
|
| 278 |
+
/*! \cond
|
| 279 |
+
*/
|
| 280 |
+
private:
|
| 281 |
+
__host__ __device__
|
| 282 |
+
transform_iterator &do_assign(const transform_iterator &other, thrust::detail::true_type)
|
| 283 |
+
{
|
| 284 |
+
super_t::operator=(other);
|
| 285 |
+
|
| 286 |
+
// do assign to m_f
|
| 287 |
+
m_f = other.functor();
|
| 288 |
+
|
| 289 |
+
return *this;
|
| 290 |
+
}
|
| 291 |
+
|
| 292 |
+
__host__ __device__
|
| 293 |
+
transform_iterator &do_assign(const transform_iterator &other, thrust::detail::false_type)
|
| 294 |
+
{
|
| 295 |
+
super_t::operator=(other);
|
| 296 |
+
|
| 297 |
+
// don't assign to m_f
|
| 298 |
+
|
| 299 |
+
return *this;
|
| 300 |
+
}
|
| 301 |
+
|
| 302 |
+
// MSVC 2013 and 2015 incorrectly warning about returning a reference to
|
| 303 |
+
// a local/temporary here.
|
| 304 |
+
// See goo.gl/LELTNp
|
| 305 |
+
THRUST_DISABLE_MSVC_WARNING_BEGIN(4172)
|
| 306 |
+
|
| 307 |
+
__thrust_exec_check_disable__
|
| 308 |
+
__host__ __device__
|
| 309 |
+
typename super_t::reference dereference() const
|
| 310 |
+
{
|
| 311 |
+
// Create a temporary to allow iterators with wrapped references to
|
| 312 |
+
// convert to their value type before calling m_f. Note that this
|
| 313 |
+
// disallows non-constant operations through m_f.
|
| 314 |
+
typename thrust::iterator_value<Iterator>::type const& x = *this->base();
|
| 315 |
+
return m_f(x);
|
| 316 |
+
}
|
| 317 |
+
|
| 318 |
+
THRUST_DISABLE_MSVC_WARNING_END(4172)
|
| 319 |
+
|
| 320 |
+
// tag this as mutable per Dave Abrahams in this thread:
|
| 321 |
+
// http://lists.boost.org/Archives/boost/2004/05/65332.php
|
| 322 |
+
mutable AdaptableUnaryFunction m_f;
|
| 323 |
+
|
| 324 |
+
/*! \endcond
|
| 325 |
+
*/
|
| 326 |
+
}; // end transform_iterator
|
| 327 |
+
|
| 328 |
+
|
| 329 |
+
/*! \p make_transform_iterator creates a \p transform_iterator
|
| 330 |
+
* from an \c Iterator and \c AdaptableUnaryFunction.
|
| 331 |
+
*
|
| 332 |
+
* \param it The \c Iterator pointing to the input range of the
|
| 333 |
+
* newly created \p transform_iterator.
|
| 334 |
+
* \param fun The \c AdaptableUnaryFunction used to transform the range pointed
|
| 335 |
+
* to by \p it in the newly created \p transform_iterator.
|
| 336 |
+
* \return A new \p transform_iterator which transforms the range at
|
| 337 |
+
* \p it by \p fun.
|
| 338 |
+
* \see transform_iterator
|
| 339 |
+
*/
|
| 340 |
+
template <class AdaptableUnaryFunction, class Iterator>
|
| 341 |
+
inline __host__ __device__
|
| 342 |
+
transform_iterator<AdaptableUnaryFunction, Iterator>
|
| 343 |
+
make_transform_iterator(Iterator it, AdaptableUnaryFunction fun)
|
| 344 |
+
{
|
| 345 |
+
return transform_iterator<AdaptableUnaryFunction, Iterator>(it, fun);
|
| 346 |
+
} // end make_transform_iterator
|
| 347 |
+
|
| 348 |
+
/*! \} // end fancyiterators
|
| 349 |
+
*/
|
| 350 |
+
|
| 351 |
+
/*! \} // end iterators
|
| 352 |
+
*/
|
| 353 |
+
|
| 354 |
+
THRUST_NAMESPACE_END
|
| 355 |
+
|
videochat2/lib/python3.10/site-packages/tensorflow/include/external/local_config_cuda/cuda/cuda/include/thrust/iterator/transform_output_iterator.h
ADDED
|
@@ -0,0 +1,164 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
* Copyright 2008-2018 NVIDIA Corporation
|
| 3 |
+
*
|
| 4 |
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
| 5 |
+
* you may not use this file except in compliance with the License.
|
| 6 |
+
* You may obtain a copy of the License at
|
| 7 |
+
*
|
| 8 |
+
* http://www.apache.org/licenses/LICENSE-2.0
|
| 9 |
+
*
|
| 10 |
+
* Unless required by applicable law or agreed to in writing, software
|
| 11 |
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
| 12 |
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
| 13 |
+
* See the License for the specific language governing permissions and
|
| 14 |
+
* limitations under the License.
|
| 15 |
+
*/
|
| 16 |
+
|
| 17 |
+
/*! \file thrust/iterator/transform_output_iterator.h
|
| 18 |
+
* \brief An output iterator which adapts another output iterator by applying a
|
| 19 |
+
* function to the result of its dereference before writing it.
|
| 20 |
+
*/
|
| 21 |
+
|
| 22 |
+
#pragma once
|
| 23 |
+
|
| 24 |
+
#include <thrust/detail/config.h>
|
| 25 |
+
#include <thrust/iterator/detail/transform_output_iterator.inl>
|
| 26 |
+
|
| 27 |
+
THRUST_NAMESPACE_BEGIN
|
| 28 |
+
|
| 29 |
+
/*! \addtogroup iterators
|
| 30 |
+
* \{
|
| 31 |
+
*/
|
| 32 |
+
|
| 33 |
+
/*! \addtogroup fancyiterator Fancy Iterators
|
| 34 |
+
* \ingroup iterators
|
| 35 |
+
* \{
|
| 36 |
+
*/
|
| 37 |
+
|
| 38 |
+
/*! \p transform_output_iterator is a special kind of output iterator which
|
| 39 |
+
* transforms a value written upon dereference. This iterator is useful
|
| 40 |
+
* for transforming an output from algorithms without explicitly storing the
|
| 41 |
+
* intermediate result in the memory and applying subsequent transformation,
|
| 42 |
+
* thereby avoiding wasting memory capacity and bandwidth.
|
| 43 |
+
* Using \p transform_iterator facilitates kernel fusion by deferring execution
|
| 44 |
+
* of transformation until the value is written while saving both memory
|
| 45 |
+
* capacity and bandwidth.
|
| 46 |
+
*
|
| 47 |
+
* The following code snippet demonstrated how to create a
|
| 48 |
+
* \p transform_output_iterator which applies \c sqrtf to the assigning value.
|
| 49 |
+
*
|
| 50 |
+
* \code
|
| 51 |
+
* #include <thrust/iterator/transform_output_iterator.h>
|
| 52 |
+
* #include <thrust/device_vector.h>
|
| 53 |
+
*
|
| 54 |
+
* // note: functor inherits form unary function
|
| 55 |
+
* // note: functor inherits from unary_function
|
| 56 |
+
* struct square_root : public thrust::unary_function<float,float>
|
| 57 |
+
* {
|
| 58 |
+
* __host__ __device__
|
| 59 |
+
* float operator()(float x) const
|
| 60 |
+
* {
|
| 61 |
+
* return sqrtf(x);
|
| 62 |
+
* }
|
| 63 |
+
* };
|
| 64 |
+
*
|
| 65 |
+
* int main()
|
| 66 |
+
* {
|
| 67 |
+
* thrust::device_vector<float> v(4);
|
| 68 |
+
*
|
| 69 |
+
* typedef thrust::device_vector<float>::iterator FloatIterator;
|
| 70 |
+
* thrust::transform_output_iterator<square_root, FloatIterator> iter(v.begin(), square_root());
|
| 71 |
+
*
|
| 72 |
+
* iter[0] = 1.0f; // stores sqrtf( 1.0f)
|
| 73 |
+
* iter[1] = 4.0f; // stores sqrtf( 4.0f)
|
| 74 |
+
* iter[2] = 9.0f; // stores sqrtf( 9.0f)
|
| 75 |
+
* iter[3] = 16.0f; // stores sqrtf(16.0f)
|
| 76 |
+
* // iter[4] is an out-of-bounds error
|
| 77 |
+
*
|
| 78 |
+
* v[0]; // returns 1.0f;
|
| 79 |
+
* v[1]; // returns 2.0f;
|
| 80 |
+
* v[2]; // returns 3.0f;
|
| 81 |
+
* v[3]; // returns 4.0f;
|
| 82 |
+
*
|
| 83 |
+
* }
|
| 84 |
+
* \endcode
|
| 85 |
+
*
|
| 86 |
+
* \see make_transform_output_iterator
|
| 87 |
+
*/
|
| 88 |
+
|
| 89 |
+
template <typename UnaryFunction, typename OutputIterator>
|
| 90 |
+
class transform_output_iterator
|
| 91 |
+
: public detail::transform_output_iterator_base<UnaryFunction, OutputIterator>::type
|
| 92 |
+
{
|
| 93 |
+
|
| 94 |
+
/*! \cond
|
| 95 |
+
*/
|
| 96 |
+
|
| 97 |
+
public:
|
| 98 |
+
|
| 99 |
+
typedef typename
|
| 100 |
+
detail::transform_output_iterator_base<UnaryFunction, OutputIterator>::type
|
| 101 |
+
super_t;
|
| 102 |
+
|
| 103 |
+
friend class thrust::iterator_core_access;
|
| 104 |
+
/*! \endcond
|
| 105 |
+
*/
|
| 106 |
+
|
| 107 |
+
transform_output_iterator() = default;
|
| 108 |
+
|
| 109 |
+
/*! This constructor takes as argument an \c OutputIterator and an \c
|
| 110 |
+
* UnaryFunction and copies them to a new \p transform_output_iterator
|
| 111 |
+
*
|
| 112 |
+
* \param out An \c OutputIterator pointing to the output range whereto the result of
|
| 113 |
+
* \p transform_output_iterator's \c UnaryFunction will be written.
|
| 114 |
+
* \param fun An \c UnaryFunction used to transform the objects assigned to
|
| 115 |
+
* this \p transform_output_iterator.
|
| 116 |
+
*/
|
| 117 |
+
__host__ __device__
|
| 118 |
+
transform_output_iterator(OutputIterator const& out, UnaryFunction fun) : super_t(out), fun(fun)
|
| 119 |
+
{
|
| 120 |
+
}
|
| 121 |
+
|
| 122 |
+
/*! \cond
|
| 123 |
+
*/
|
| 124 |
+
private:
|
| 125 |
+
|
| 126 |
+
__host__ __device__
|
| 127 |
+
typename super_t::reference dereference() const
|
| 128 |
+
{
|
| 129 |
+
return detail::transform_output_iterator_proxy<
|
| 130 |
+
UnaryFunction, OutputIterator
|
| 131 |
+
>(this->base_reference(), fun);
|
| 132 |
+
}
|
| 133 |
+
|
| 134 |
+
UnaryFunction fun;
|
| 135 |
+
|
| 136 |
+
/*! \endcond
|
| 137 |
+
*/
|
| 138 |
+
}; // end transform_output_iterator
|
| 139 |
+
|
| 140 |
+
/*! \p make_transform_output_iterator creates a \p transform_output_iterator from
|
| 141 |
+
* an \c OutputIterator and \c UnaryFunction.
|
| 142 |
+
*
|
| 143 |
+
* \param out The \c OutputIterator pointing to the output range of the newly
|
| 144 |
+
* created \p transform_output_iterator
|
| 145 |
+
* \param fun The \c UnaryFunction transform the object before assigning it to
|
| 146 |
+
* \c out by the newly created \p transform_output_iterator
|
| 147 |
+
* \see transform_output_iterator
|
| 148 |
+
*/
|
| 149 |
+
template <typename UnaryFunction, typename OutputIterator>
|
| 150 |
+
transform_output_iterator<UnaryFunction, OutputIterator>
|
| 151 |
+
__host__ __device__
|
| 152 |
+
make_transform_output_iterator(OutputIterator out, UnaryFunction fun)
|
| 153 |
+
{
|
| 154 |
+
return transform_output_iterator<UnaryFunction, OutputIterator>(out, fun);
|
| 155 |
+
} // end make_transform_output_iterator
|
| 156 |
+
|
| 157 |
+
/*! \} // end fancyiterators
|
| 158 |
+
*/
|
| 159 |
+
|
| 160 |
+
/*! \} // end iterators
|
| 161 |
+
*/
|
| 162 |
+
|
| 163 |
+
THRUST_NAMESPACE_END
|
| 164 |
+
|
videochat2/lib/python3.10/site-packages/tensorflow/include/external/local_config_cuda/cuda/cuda/include/thrust/system/detail/generic/advance.inl
ADDED
|
@@ -0,0 +1,68 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
* Copyright 2008-2013 NVIDIA Corporation
|
| 3 |
+
*
|
| 4 |
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
| 5 |
+
* you may not use this file except in compliance with the License.
|
| 6 |
+
* You may obtain a copy of the License at
|
| 7 |
+
*
|
| 8 |
+
* http://www.apache.org/licenses/LICENSE-2.0
|
| 9 |
+
*
|
| 10 |
+
* Unless required by applicable law or agreed to in writing, software
|
| 11 |
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
| 12 |
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
| 13 |
+
* See the License for the specific language governing permissions and
|
| 14 |
+
* limitations under the License.
|
| 15 |
+
*/
|
| 16 |
+
|
| 17 |
+
#pragma once
|
| 18 |
+
|
| 19 |
+
#include <thrust/detail/config.h>
|
| 20 |
+
#include <thrust/system/detail/generic/advance.h>
|
| 21 |
+
#include <thrust/iterator/iterator_traits.h>
|
| 22 |
+
|
| 23 |
+
THRUST_NAMESPACE_BEGIN
|
| 24 |
+
namespace system
|
| 25 |
+
{
|
| 26 |
+
namespace detail
|
| 27 |
+
{
|
| 28 |
+
namespace generic
|
| 29 |
+
{
|
| 30 |
+
namespace detail
|
| 31 |
+
{
|
| 32 |
+
|
| 33 |
+
__thrust_exec_check_disable__
|
| 34 |
+
template<typename InputIterator, typename Distance>
|
| 35 |
+
__host__ __device__
|
| 36 |
+
void advance(InputIterator& i, Distance n, thrust::incrementable_traversal_tag)
|
| 37 |
+
{
|
| 38 |
+
while(n)
|
| 39 |
+
{
|
| 40 |
+
++i;
|
| 41 |
+
--n;
|
| 42 |
+
} // end while
|
| 43 |
+
} // end advance()
|
| 44 |
+
|
| 45 |
+
__thrust_exec_check_disable__
|
| 46 |
+
template<typename InputIterator, typename Distance>
|
| 47 |
+
__host__ __device__
|
| 48 |
+
void advance(InputIterator& i, Distance n, thrust::random_access_traversal_tag)
|
| 49 |
+
{
|
| 50 |
+
i += n;
|
| 51 |
+
} // end advance()
|
| 52 |
+
|
| 53 |
+
} // end detail
|
| 54 |
+
|
| 55 |
+
template<typename InputIterator, typename Distance>
|
| 56 |
+
__host__ __device__
|
| 57 |
+
void advance(InputIterator& i, Distance n)
|
| 58 |
+
{
|
| 59 |
+
// dispatch on iterator traversal
|
| 60 |
+
thrust::system::detail::generic::detail::advance(i, n,
|
| 61 |
+
typename thrust::iterator_traversal<InputIterator>::type());
|
| 62 |
+
} // end advance()
|
| 63 |
+
|
| 64 |
+
} // end namespace detail
|
| 65 |
+
} // end namespace generic
|
| 66 |
+
} // end namespace system
|
| 67 |
+
THRUST_NAMESPACE_END
|
| 68 |
+
|
videochat2/lib/python3.10/site-packages/tensorflow/include/external/local_config_cuda/cuda/cuda/include/thrust/system/detail/generic/find.inl
ADDED
|
@@ -0,0 +1,151 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
* Copyright 2008-2013 NVIDIA Corporation
|
| 3 |
+
*
|
| 4 |
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
| 5 |
+
* you may not use this file except in compliance with the License.
|
| 6 |
+
* You may obtain a copy of the License at
|
| 7 |
+
*
|
| 8 |
+
* http://www.apache.org/licenses/LICENSE-2.0
|
| 9 |
+
*
|
| 10 |
+
* Unless required by applicable law or agreed to in writing, software
|
| 11 |
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
| 12 |
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
| 13 |
+
* See the License for the specific language governing permissions and
|
| 14 |
+
* limitations under the License.
|
| 15 |
+
*/
|
| 16 |
+
|
| 17 |
+
#pragma once
|
| 18 |
+
|
| 19 |
+
#include <thrust/detail/config.h>
|
| 20 |
+
#include <thrust/find.h>
|
| 21 |
+
#include <thrust/reduce.h>
|
| 22 |
+
|
| 23 |
+
#include <thrust/tuple.h>
|
| 24 |
+
#include <thrust/detail/minmax.h>
|
| 25 |
+
#include <thrust/iterator/counting_iterator.h>
|
| 26 |
+
#include <thrust/iterator/transform_iterator.h>
|
| 27 |
+
#include <thrust/iterator/zip_iterator.h>
|
| 28 |
+
#include <thrust/detail/internal_functional.h>
|
| 29 |
+
|
| 30 |
+
|
| 31 |
+
// Contributed by Erich Elsen
|
| 32 |
+
|
| 33 |
+
THRUST_NAMESPACE_BEGIN
|
| 34 |
+
namespace system
|
| 35 |
+
{
|
| 36 |
+
namespace detail
|
| 37 |
+
{
|
| 38 |
+
namespace generic
|
| 39 |
+
{
|
| 40 |
+
|
| 41 |
+
|
| 42 |
+
template<typename DerivedPolicy, typename InputIterator, typename T>
|
| 43 |
+
__host__ __device__
|
| 44 |
+
InputIterator find(thrust::execution_policy<DerivedPolicy> &exec,
|
| 45 |
+
InputIterator first,
|
| 46 |
+
InputIterator last,
|
| 47 |
+
const T& value)
|
| 48 |
+
{
|
| 49 |
+
using thrust::placeholders::_1;
|
| 50 |
+
|
| 51 |
+
return thrust::find_if(exec, first, last, _1 == value);
|
| 52 |
+
} // end find()
|
| 53 |
+
|
| 54 |
+
|
| 55 |
+
template<typename TupleType>
|
| 56 |
+
struct find_if_functor
|
| 57 |
+
{
|
| 58 |
+
__host__ __device__
|
| 59 |
+
TupleType operator()(const TupleType& lhs, const TupleType& rhs) const
|
| 60 |
+
{
|
| 61 |
+
// select the smallest index among true results
|
| 62 |
+
if(thrust::get<0>(lhs) && thrust::get<0>(rhs))
|
| 63 |
+
{
|
| 64 |
+
return TupleType(true, (thrust::min)(thrust::get<1>(lhs), thrust::get<1>(rhs)));
|
| 65 |
+
}
|
| 66 |
+
else if(thrust::get<0>(lhs))
|
| 67 |
+
{
|
| 68 |
+
return lhs;
|
| 69 |
+
}
|
| 70 |
+
else
|
| 71 |
+
{
|
| 72 |
+
return rhs;
|
| 73 |
+
}
|
| 74 |
+
}
|
| 75 |
+
};
|
| 76 |
+
|
| 77 |
+
|
| 78 |
+
template<typename DerivedPolicy, typename InputIterator, typename Predicate>
|
| 79 |
+
__host__ __device__
|
| 80 |
+
InputIterator find_if(thrust::execution_policy<DerivedPolicy> &exec,
|
| 81 |
+
InputIterator first,
|
| 82 |
+
InputIterator last,
|
| 83 |
+
Predicate pred)
|
| 84 |
+
{
|
| 85 |
+
typedef typename thrust::iterator_traits<InputIterator>::difference_type difference_type;
|
| 86 |
+
typedef typename thrust::tuple<bool,difference_type> result_type;
|
| 87 |
+
|
| 88 |
+
// empty sequence
|
| 89 |
+
if(first == last) return last;
|
| 90 |
+
|
| 91 |
+
const difference_type n = thrust::distance(first, last);
|
| 92 |
+
|
| 93 |
+
// this implementation breaks up the sequence into separate intervals
|
| 94 |
+
// in an attempt to early-out as soon as a value is found
|
| 95 |
+
|
| 96 |
+
// TODO incorporate sizeof(InputType) into interval_threshold and round to multiple of 32
|
| 97 |
+
const difference_type interval_threshold = 1 << 20;
|
| 98 |
+
const difference_type interval_size = (thrust::min)(interval_threshold, n);
|
| 99 |
+
|
| 100 |
+
// force transform_iterator output to bool
|
| 101 |
+
typedef thrust::transform_iterator<Predicate, InputIterator, bool> XfrmIterator;
|
| 102 |
+
typedef thrust::tuple<XfrmIterator, thrust::counting_iterator<difference_type> > IteratorTuple;
|
| 103 |
+
typedef thrust::zip_iterator<IteratorTuple> ZipIterator;
|
| 104 |
+
|
| 105 |
+
IteratorTuple iter_tuple = thrust::make_tuple(XfrmIterator(first, pred),
|
| 106 |
+
thrust::counting_iterator<difference_type>(0));
|
| 107 |
+
|
| 108 |
+
ZipIterator begin = thrust::make_zip_iterator(iter_tuple);
|
| 109 |
+
ZipIterator end = begin + n;
|
| 110 |
+
|
| 111 |
+
for(ZipIterator interval_begin = begin; interval_begin < end; interval_begin += interval_size)
|
| 112 |
+
{
|
| 113 |
+
ZipIterator interval_end = interval_begin + interval_size;
|
| 114 |
+
if(end < interval_end)
|
| 115 |
+
{
|
| 116 |
+
interval_end = end;
|
| 117 |
+
} // end if
|
| 118 |
+
|
| 119 |
+
result_type result = thrust::reduce(exec,
|
| 120 |
+
interval_begin, interval_end,
|
| 121 |
+
result_type(false,interval_end - begin),
|
| 122 |
+
find_if_functor<result_type>());
|
| 123 |
+
|
| 124 |
+
// see if we found something
|
| 125 |
+
if(thrust::get<0>(result))
|
| 126 |
+
{
|
| 127 |
+
return first + thrust::get<1>(result);
|
| 128 |
+
}
|
| 129 |
+
}
|
| 130 |
+
|
| 131 |
+
//nothing was found if we reach here...
|
| 132 |
+
return first + n;
|
| 133 |
+
}
|
| 134 |
+
|
| 135 |
+
|
| 136 |
+
template<typename DerivedPolicy, typename InputIterator, typename Predicate>
|
| 137 |
+
__host__ __device__
|
| 138 |
+
InputIterator find_if_not(thrust::execution_policy<DerivedPolicy> &exec,
|
| 139 |
+
InputIterator first,
|
| 140 |
+
InputIterator last,
|
| 141 |
+
Predicate pred)
|
| 142 |
+
{
|
| 143 |
+
return thrust::find_if(exec, first, last, thrust::detail::not1(pred));
|
| 144 |
+
} // end find()
|
| 145 |
+
|
| 146 |
+
|
| 147 |
+
} // end namespace generic
|
| 148 |
+
} // end namespace detail
|
| 149 |
+
} // end namespace system
|
| 150 |
+
THRUST_NAMESPACE_END
|
| 151 |
+
|
videochat2/lib/python3.10/site-packages/tensorflow/include/external/local_config_cuda/cuda/cuda/include/thrust/system/detail/generic/inner_product.h
ADDED
|
@@ -0,0 +1,58 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
* Copyright 2008-2013 NVIDIA Corporation
|
| 3 |
+
*
|
| 4 |
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
| 5 |
+
* you may not use this file except in compliance with the License.
|
| 6 |
+
* You may obtain a copy of the License at
|
| 7 |
+
*
|
| 8 |
+
* http://www.apache.org/licenses/LICENSE-2.0
|
| 9 |
+
*
|
| 10 |
+
* Unless required by applicable law or agreed to in writing, software
|
| 11 |
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
| 12 |
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
| 13 |
+
* See the License for the specific language governing permissions and
|
| 14 |
+
* limitations under the License.
|
| 15 |
+
*/
|
| 16 |
+
|
| 17 |
+
|
| 18 |
+
#pragma once
|
| 19 |
+
|
| 20 |
+
#include <thrust/detail/config.h>
|
| 21 |
+
#include <thrust/system/detail/generic/tag.h>
|
| 22 |
+
|
| 23 |
+
THRUST_NAMESPACE_BEGIN
|
| 24 |
+
namespace system
|
| 25 |
+
{
|
| 26 |
+
namespace detail
|
| 27 |
+
{
|
| 28 |
+
namespace generic
|
| 29 |
+
{
|
| 30 |
+
|
| 31 |
+
|
| 32 |
+
template<typename DerivedPolicy, typename InputIterator1, typename InputIterator2, typename OutputType>
|
| 33 |
+
__host__ __device__
|
| 34 |
+
OutputType inner_product(thrust::execution_policy<DerivedPolicy> &exec,
|
| 35 |
+
InputIterator1 first1,
|
| 36 |
+
InputIterator1 last1,
|
| 37 |
+
InputIterator2 first2,
|
| 38 |
+
OutputType init);
|
| 39 |
+
|
| 40 |
+
|
| 41 |
+
template<typename DerivedPolicy, typename InputIterator1, typename InputIterator2, typename OutputType, typename BinaryFunction1, typename BinaryFunction2>
|
| 42 |
+
__host__ __device__
|
| 43 |
+
OutputType inner_product(thrust::execution_policy<DerivedPolicy> &exec,
|
| 44 |
+
InputIterator1 first1,
|
| 45 |
+
InputIterator1 last1,
|
| 46 |
+
InputIterator2 first2,
|
| 47 |
+
OutputType init,
|
| 48 |
+
BinaryFunction1 binary_op1,
|
| 49 |
+
BinaryFunction2 binary_op2);
|
| 50 |
+
|
| 51 |
+
|
| 52 |
+
} // end namespace generic
|
| 53 |
+
} // end namespace detail
|
| 54 |
+
} // end namespace system
|
| 55 |
+
THRUST_NAMESPACE_END
|
| 56 |
+
|
| 57 |
+
#include <thrust/system/detail/generic/inner_product.inl>
|
| 58 |
+
|
videochat2/lib/python3.10/site-packages/tensorflow/include/external/local_config_cuda/cuda/cuda/include/thrust/system/detail/generic/partition.h
ADDED
|
@@ -0,0 +1,169 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
* Copyright 2008-2013 NVIDIA Corporation
|
| 3 |
+
*
|
| 4 |
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
| 5 |
+
* you may not use this file except in compliance with the License.
|
| 6 |
+
* You may obtain a copy of the License at
|
| 7 |
+
*
|
| 8 |
+
* http://www.apache.org/licenses/LICENSE-2.0
|
| 9 |
+
*
|
| 10 |
+
* Unless required by applicable law or agreed to in writing, software
|
| 11 |
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
| 12 |
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
| 13 |
+
* See the License for the specific language governing permissions and
|
| 14 |
+
* limitations under the License.
|
| 15 |
+
*/
|
| 16 |
+
|
| 17 |
+
|
| 18 |
+
/*! \file partition.h
|
| 19 |
+
* \brief Generic implementations of partition functions.
|
| 20 |
+
*/
|
| 21 |
+
|
| 22 |
+
#pragma once
|
| 23 |
+
|
| 24 |
+
#include <thrust/detail/config.h>
|
| 25 |
+
#include <thrust/system/detail/generic/tag.h>
|
| 26 |
+
|
| 27 |
+
THRUST_NAMESPACE_BEGIN
|
| 28 |
+
namespace system
|
| 29 |
+
{
|
| 30 |
+
namespace detail
|
| 31 |
+
{
|
| 32 |
+
namespace generic
|
| 33 |
+
{
|
| 34 |
+
|
| 35 |
+
|
| 36 |
+
template<typename ExecutionPolicy,
|
| 37 |
+
typename ForwardIterator,
|
| 38 |
+
typename Predicate>
|
| 39 |
+
__host__ __device__
|
| 40 |
+
ForwardIterator stable_partition(thrust::execution_policy<ExecutionPolicy> &exec,
|
| 41 |
+
ForwardIterator first,
|
| 42 |
+
ForwardIterator last,
|
| 43 |
+
Predicate pred);
|
| 44 |
+
|
| 45 |
+
template<typename ExecutionPolicy,
|
| 46 |
+
typename ForwardIterator,
|
| 47 |
+
typename InputIterator,
|
| 48 |
+
typename Predicate>
|
| 49 |
+
__host__ __device__
|
| 50 |
+
ForwardIterator stable_partition(thrust::execution_policy<ExecutionPolicy> &exec,
|
| 51 |
+
ForwardIterator first,
|
| 52 |
+
ForwardIterator last,
|
| 53 |
+
InputIterator stencil,
|
| 54 |
+
Predicate pred);
|
| 55 |
+
|
| 56 |
+
|
| 57 |
+
template<typename ExecutionPolicy,
|
| 58 |
+
typename InputIterator,
|
| 59 |
+
typename OutputIterator1,
|
| 60 |
+
typename OutputIterator2,
|
| 61 |
+
typename Predicate>
|
| 62 |
+
__host__ __device__
|
| 63 |
+
thrust::pair<OutputIterator1,OutputIterator2>
|
| 64 |
+
stable_partition_copy(thrust::execution_policy<ExecutionPolicy> &exec,
|
| 65 |
+
InputIterator first,
|
| 66 |
+
InputIterator last,
|
| 67 |
+
OutputIterator1 out_true,
|
| 68 |
+
OutputIterator2 out_false,
|
| 69 |
+
Predicate pred);
|
| 70 |
+
|
| 71 |
+
|
| 72 |
+
template<typename ExecutionPolicy,
|
| 73 |
+
typename InputIterator1,
|
| 74 |
+
typename InputIterator2,
|
| 75 |
+
typename OutputIterator1,
|
| 76 |
+
typename OutputIterator2,
|
| 77 |
+
typename Predicate>
|
| 78 |
+
__host__ __device__
|
| 79 |
+
thrust::pair<OutputIterator1,OutputIterator2>
|
| 80 |
+
stable_partition_copy(thrust::execution_policy<ExecutionPolicy> &exec,
|
| 81 |
+
InputIterator1 first,
|
| 82 |
+
InputIterator1 last,
|
| 83 |
+
InputIterator2 stencil,
|
| 84 |
+
OutputIterator1 out_true,
|
| 85 |
+
OutputIterator2 out_false,
|
| 86 |
+
Predicate pred);
|
| 87 |
+
|
| 88 |
+
|
| 89 |
+
template<typename ExecutionPolicy,
|
| 90 |
+
typename ForwardIterator,
|
| 91 |
+
typename Predicate>
|
| 92 |
+
__host__ __device__
|
| 93 |
+
ForwardIterator partition(thrust::execution_policy<ExecutionPolicy> &exec,
|
| 94 |
+
ForwardIterator first,
|
| 95 |
+
ForwardIterator last,
|
| 96 |
+
Predicate pred);
|
| 97 |
+
|
| 98 |
+
|
| 99 |
+
template<typename ExecutionPolicy,
|
| 100 |
+
typename ForwardIterator,
|
| 101 |
+
typename InputIterator,
|
| 102 |
+
typename Predicate>
|
| 103 |
+
__host__ __device__
|
| 104 |
+
ForwardIterator partition(thrust::execution_policy<ExecutionPolicy> &exec,
|
| 105 |
+
ForwardIterator first,
|
| 106 |
+
ForwardIterator last,
|
| 107 |
+
InputIterator stencil,
|
| 108 |
+
Predicate pred);
|
| 109 |
+
|
| 110 |
+
|
| 111 |
+
template<typename ExecutionPolicy,
|
| 112 |
+
typename InputIterator,
|
| 113 |
+
typename OutputIterator1,
|
| 114 |
+
typename OutputIterator2,
|
| 115 |
+
typename Predicate>
|
| 116 |
+
__host__ __device__
|
| 117 |
+
thrust::pair<OutputIterator1,OutputIterator2>
|
| 118 |
+
partition_copy(thrust::execution_policy<ExecutionPolicy> &exec,
|
| 119 |
+
InputIterator first,
|
| 120 |
+
InputIterator last,
|
| 121 |
+
OutputIterator1 out_true,
|
| 122 |
+
OutputIterator2 out_false,
|
| 123 |
+
Predicate pred);
|
| 124 |
+
|
| 125 |
+
|
| 126 |
+
template<typename ExecutionPolicy,
|
| 127 |
+
typename InputIterator1,
|
| 128 |
+
typename InputIterator2,
|
| 129 |
+
typename OutputIterator1,
|
| 130 |
+
typename OutputIterator2,
|
| 131 |
+
typename Predicate>
|
| 132 |
+
__host__ __device__
|
| 133 |
+
thrust::pair<OutputIterator1,OutputIterator2>
|
| 134 |
+
partition_copy(thrust::execution_policy<ExecutionPolicy> &exec,
|
| 135 |
+
InputIterator1 first,
|
| 136 |
+
InputIterator1 last,
|
| 137 |
+
InputIterator2 stencil,
|
| 138 |
+
OutputIterator1 out_true,
|
| 139 |
+
OutputIterator2 out_false,
|
| 140 |
+
Predicate pred);
|
| 141 |
+
|
| 142 |
+
|
| 143 |
+
template<typename ExecutionPolicy,
|
| 144 |
+
typename ForwardIterator,
|
| 145 |
+
typename Predicate>
|
| 146 |
+
__host__ __device__
|
| 147 |
+
ForwardIterator partition_point(thrust::execution_policy<ExecutionPolicy> &exec,
|
| 148 |
+
ForwardIterator first,
|
| 149 |
+
ForwardIterator last,
|
| 150 |
+
Predicate pred);
|
| 151 |
+
|
| 152 |
+
|
| 153 |
+
template<typename ExecutionPolicy,
|
| 154 |
+
typename InputIterator,
|
| 155 |
+
typename Predicate>
|
| 156 |
+
__host__ __device__
|
| 157 |
+
bool is_partitioned(thrust::execution_policy<ExecutionPolicy> &exec,
|
| 158 |
+
InputIterator first,
|
| 159 |
+
InputIterator last,
|
| 160 |
+
Predicate pred);
|
| 161 |
+
|
| 162 |
+
|
| 163 |
+
} // end namespace generic
|
| 164 |
+
} // end namespace detail
|
| 165 |
+
} // end namespace system
|
| 166 |
+
THRUST_NAMESPACE_END
|
| 167 |
+
|
| 168 |
+
#include <thrust/system/detail/generic/partition.inl>
|
| 169 |
+
|
videochat2/lib/python3.10/site-packages/tensorflow/include/external/local_config_cuda/cuda/cuda/include/thrust/system/detail/generic/scan.inl
ADDED
|
@@ -0,0 +1,127 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
* Copyright 2008-2013 NVIDIA Corporation
|
| 3 |
+
*
|
| 4 |
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
| 5 |
+
* you may not use this file except in compliance with the License.
|
| 6 |
+
* You may obtain a copy of the License at
|
| 7 |
+
*
|
| 8 |
+
* http://www.apache.org/licenses/LICENSE-2.0
|
| 9 |
+
*
|
| 10 |
+
* Unless required by applicable law or agreed to in writing, software
|
| 11 |
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
| 12 |
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
| 13 |
+
* See the License for the specific language governing permissions and
|
| 14 |
+
* limitations under the License.
|
| 15 |
+
*/
|
| 16 |
+
|
| 17 |
+
|
| 18 |
+
#pragma once
|
| 19 |
+
|
| 20 |
+
#include <thrust/detail/config.h>
|
| 21 |
+
#include <thrust/detail/static_assert.h>
|
| 22 |
+
#include <thrust/system/detail/generic/scan.h>
|
| 23 |
+
#include <thrust/iterator/iterator_traits.h>
|
| 24 |
+
#include <thrust/scan.h>
|
| 25 |
+
#include <thrust/detail/type_traits.h>
|
| 26 |
+
#include <thrust/detail/type_traits/iterator/is_output_iterator.h>
|
| 27 |
+
#include <thrust/functional.h>
|
| 28 |
+
|
| 29 |
+
THRUST_NAMESPACE_BEGIN
|
| 30 |
+
namespace system
|
| 31 |
+
{
|
| 32 |
+
namespace detail
|
| 33 |
+
{
|
| 34 |
+
namespace generic
|
| 35 |
+
{
|
| 36 |
+
|
| 37 |
+
|
| 38 |
+
template<typename ExecutionPolicy,
|
| 39 |
+
typename InputIterator,
|
| 40 |
+
typename OutputIterator>
|
| 41 |
+
__host__ __device__
|
| 42 |
+
OutputIterator inclusive_scan(thrust::execution_policy<ExecutionPolicy> &exec,
|
| 43 |
+
InputIterator first,
|
| 44 |
+
InputIterator last,
|
| 45 |
+
OutputIterator result)
|
| 46 |
+
{
|
| 47 |
+
// assume plus as the associative operator
|
| 48 |
+
return thrust::inclusive_scan(exec, first, last, result, thrust::plus<>());
|
| 49 |
+
} // end inclusive_scan()
|
| 50 |
+
|
| 51 |
+
|
| 52 |
+
template<typename ExecutionPolicy,
|
| 53 |
+
typename InputIterator,
|
| 54 |
+
typename OutputIterator>
|
| 55 |
+
__host__ __device__
|
| 56 |
+
OutputIterator exclusive_scan(thrust::execution_policy<ExecutionPolicy> &exec,
|
| 57 |
+
InputIterator first,
|
| 58 |
+
InputIterator last,
|
| 59 |
+
OutputIterator result)
|
| 60 |
+
{
|
| 61 |
+
// Use the input iterator's value type per https://wg21.link/P0571
|
| 62 |
+
using ValueType = typename thrust::iterator_value<InputIterator>::type;
|
| 63 |
+
return thrust::exclusive_scan(exec, first, last, result, ValueType{});
|
| 64 |
+
} // end exclusive_scan()
|
| 65 |
+
|
| 66 |
+
|
| 67 |
+
template<typename ExecutionPolicy,
|
| 68 |
+
typename InputIterator,
|
| 69 |
+
typename OutputIterator,
|
| 70 |
+
typename T>
|
| 71 |
+
__host__ __device__
|
| 72 |
+
OutputIterator exclusive_scan(thrust::execution_policy<ExecutionPolicy> &exec,
|
| 73 |
+
InputIterator first,
|
| 74 |
+
InputIterator last,
|
| 75 |
+
OutputIterator result,
|
| 76 |
+
T init)
|
| 77 |
+
{
|
| 78 |
+
// assume plus as the associative operator
|
| 79 |
+
return thrust::exclusive_scan(exec, first, last, result, init, thrust::plus<>());
|
| 80 |
+
} // end exclusive_scan()
|
| 81 |
+
|
| 82 |
+
|
| 83 |
+
template<typename ExecutionPolicy,
|
| 84 |
+
typename InputIterator,
|
| 85 |
+
typename OutputIterator,
|
| 86 |
+
typename BinaryFunction>
|
| 87 |
+
__host__ __device__
|
| 88 |
+
OutputIterator inclusive_scan(thrust::execution_policy<ExecutionPolicy> &,
|
| 89 |
+
InputIterator,
|
| 90 |
+
InputIterator,
|
| 91 |
+
OutputIterator result,
|
| 92 |
+
BinaryFunction)
|
| 93 |
+
{
|
| 94 |
+
THRUST_STATIC_ASSERT_MSG(
|
| 95 |
+
(thrust::detail::depend_on_instantiation<InputIterator, false>::value)
|
| 96 |
+
, "unimplemented for this system"
|
| 97 |
+
);
|
| 98 |
+
return result;
|
| 99 |
+
} // end inclusive_scan
|
| 100 |
+
|
| 101 |
+
|
| 102 |
+
template<typename ExecutionPolicy,
|
| 103 |
+
typename InputIterator,
|
| 104 |
+
typename OutputIterator,
|
| 105 |
+
typename T,
|
| 106 |
+
typename BinaryFunction>
|
| 107 |
+
__host__ __device__
|
| 108 |
+
OutputIterator exclusive_scan(thrust::execution_policy<ExecutionPolicy> &,
|
| 109 |
+
InputIterator,
|
| 110 |
+
InputIterator,
|
| 111 |
+
OutputIterator result,
|
| 112 |
+
T,
|
| 113 |
+
BinaryFunction)
|
| 114 |
+
{
|
| 115 |
+
THRUST_STATIC_ASSERT_MSG(
|
| 116 |
+
(thrust::detail::depend_on_instantiation<InputIterator, false>::value)
|
| 117 |
+
, "unimplemented for this system"
|
| 118 |
+
);
|
| 119 |
+
return result;
|
| 120 |
+
} // end exclusive_scan()
|
| 121 |
+
|
| 122 |
+
|
| 123 |
+
} // end namespace generic
|
| 124 |
+
} // end namespace detail
|
| 125 |
+
} // end namespace system
|
| 126 |
+
THRUST_NAMESPACE_END
|
| 127 |
+
|
videochat2/lib/python3.10/site-packages/tensorflow/include/external/local_config_cuda/cuda/cuda/include/thrust/system/detail/generic/scatter.h
ADDED
|
@@ -0,0 +1,80 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
* Copyright 2008-2013 NVIDIA Corporation
|
| 3 |
+
*
|
| 4 |
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
| 5 |
+
* you may not use this file except in compliance with the License.
|
| 6 |
+
* You may obtain a copy of the License at
|
| 7 |
+
*
|
| 8 |
+
* http://www.apache.org/licenses/LICENSE-2.0
|
| 9 |
+
*
|
| 10 |
+
* Unless required by applicable law or agreed to in writing, software
|
| 11 |
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
| 12 |
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
| 13 |
+
* See the License for the specific language governing permissions and
|
| 14 |
+
* limitations under the License.
|
| 15 |
+
*/
|
| 16 |
+
|
| 17 |
+
|
| 18 |
+
#pragma once
|
| 19 |
+
|
| 20 |
+
#include <thrust/detail/config.h>
|
| 21 |
+
#include <thrust/system/detail/generic/tag.h>
|
| 22 |
+
|
| 23 |
+
THRUST_NAMESPACE_BEGIN
|
| 24 |
+
namespace system
|
| 25 |
+
{
|
| 26 |
+
namespace detail
|
| 27 |
+
{
|
| 28 |
+
namespace generic
|
| 29 |
+
{
|
| 30 |
+
|
| 31 |
+
|
| 32 |
+
template<typename DerivedPolicy,
|
| 33 |
+
typename InputIterator1,
|
| 34 |
+
typename InputIterator2,
|
| 35 |
+
typename RandomAccessIterator>
|
| 36 |
+
__host__ __device__
|
| 37 |
+
void scatter(thrust::execution_policy<DerivedPolicy> &exec,
|
| 38 |
+
InputIterator1 first,
|
| 39 |
+
InputIterator1 last,
|
| 40 |
+
InputIterator2 map,
|
| 41 |
+
RandomAccessIterator output);
|
| 42 |
+
|
| 43 |
+
|
| 44 |
+
template<typename DerivedPolicy,
|
| 45 |
+
typename InputIterator1,
|
| 46 |
+
typename InputIterator2,
|
| 47 |
+
typename InputIterator3,
|
| 48 |
+
typename RandomAccessIterator>
|
| 49 |
+
__host__ __device__
|
| 50 |
+
void scatter_if(thrust::execution_policy<DerivedPolicy> &exec,
|
| 51 |
+
InputIterator1 first,
|
| 52 |
+
InputIterator1 last,
|
| 53 |
+
InputIterator2 map,
|
| 54 |
+
InputIterator3 stencil,
|
| 55 |
+
RandomAccessIterator output);
|
| 56 |
+
|
| 57 |
+
|
| 58 |
+
template<typename DerivedPolicy,
|
| 59 |
+
typename InputIterator1,
|
| 60 |
+
typename InputIterator2,
|
| 61 |
+
typename InputIterator3,
|
| 62 |
+
typename RandomAccessIterator,
|
| 63 |
+
typename Predicate>
|
| 64 |
+
__host__ __device__
|
| 65 |
+
void scatter_if(thrust::execution_policy<DerivedPolicy> &exec,
|
| 66 |
+
InputIterator1 first,
|
| 67 |
+
InputIterator1 last,
|
| 68 |
+
InputIterator2 map,
|
| 69 |
+
InputIterator3 stencil,
|
| 70 |
+
RandomAccessIterator output,
|
| 71 |
+
Predicate pred);
|
| 72 |
+
|
| 73 |
+
|
| 74 |
+
} // end namespace generic
|
| 75 |
+
} // end namespace detail
|
| 76 |
+
} // end namespace system
|
| 77 |
+
THRUST_NAMESPACE_END
|
| 78 |
+
|
| 79 |
+
#include <thrust/system/detail/generic/scatter.inl>
|
| 80 |
+
|
videochat2/lib/python3.10/site-packages/tensorflow/include/external/local_config_cuda/cuda/cuda/include/thrust/system/detail/generic/select_system_exists.h
ADDED
|
@@ -0,0 +1,167 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
* Copyright 2008-2013 NVIDIA Corporation
|
| 3 |
+
*
|
| 4 |
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
| 5 |
+
* you may not use this file except in compliance with the License.
|
| 6 |
+
* You may obtain a copy of the License at
|
| 7 |
+
*
|
| 8 |
+
* http://www.apache.org/licenses/LICENSE-2.0
|
| 9 |
+
*
|
| 10 |
+
* Unless required by applicable law or agreed to in writing, software
|
| 11 |
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
| 12 |
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
| 13 |
+
* See the License for the specific language governing permissions and
|
| 14 |
+
* limitations under the License.
|
| 15 |
+
*/
|
| 16 |
+
|
| 17 |
+
|
| 18 |
+
/*! \file generic/type_traits.h
|
| 19 |
+
* \brief Introspection for free functions defined in generic.
|
| 20 |
+
*/
|
| 21 |
+
|
| 22 |
+
#pragma once
|
| 23 |
+
|
| 24 |
+
#include <thrust/detail/config.h>
|
| 25 |
+
|
| 26 |
+
THRUST_NAMESPACE_BEGIN
|
| 27 |
+
|
| 28 |
+
// forward declaration of any_system_tag for any_conversion below
|
| 29 |
+
struct any_system_tag;
|
| 30 |
+
|
| 31 |
+
namespace system
|
| 32 |
+
{
|
| 33 |
+
namespace detail
|
| 34 |
+
{
|
| 35 |
+
|
| 36 |
+
// we must define these traits outside of generic's namespace
|
| 37 |
+
namespace generic_type_traits_ns
|
| 38 |
+
{
|
| 39 |
+
|
| 40 |
+
typedef char yes;
|
| 41 |
+
typedef char (&no)[2];
|
| 42 |
+
|
| 43 |
+
struct any_conversion
|
| 44 |
+
{
|
| 45 |
+
template<typename T> any_conversion(const T &);
|
| 46 |
+
|
| 47 |
+
// add this extra constructor to disambiguate conversion from any_system_tag
|
| 48 |
+
any_conversion(const any_system_tag &);
|
| 49 |
+
};
|
| 50 |
+
|
| 51 |
+
namespace select_system_exists_ns
|
| 52 |
+
{
|
| 53 |
+
no select_system(const any_conversion &);
|
| 54 |
+
no select_system(const any_conversion &, const any_conversion &);
|
| 55 |
+
no select_system(const any_conversion &, const any_conversion &, const any_conversion &);
|
| 56 |
+
no select_system(const any_conversion &, const any_conversion &, const any_conversion &, const any_conversion &);
|
| 57 |
+
no select_system(const any_conversion &, const any_conversion &, const any_conversion &, const any_conversion &, const any_conversion &);
|
| 58 |
+
no select_system(const any_conversion &, const any_conversion &, const any_conversion &, const any_conversion &, const any_conversion &, const any_conversion &);
|
| 59 |
+
|
| 60 |
+
template<typename T> yes check(const T &);
|
| 61 |
+
|
| 62 |
+
no check(no);
|
| 63 |
+
|
| 64 |
+
template<typename Tag>
|
| 65 |
+
struct select_system1_exists
|
| 66 |
+
{
|
| 67 |
+
static Tag &tag;
|
| 68 |
+
|
| 69 |
+
static const bool value = sizeof(check(select_system(tag))) == sizeof(yes);
|
| 70 |
+
};
|
| 71 |
+
|
| 72 |
+
template<typename Tag1, typename Tag2>
|
| 73 |
+
struct select_system2_exists
|
| 74 |
+
{
|
| 75 |
+
static Tag1 &tag1;
|
| 76 |
+
static Tag2 &tag2;
|
| 77 |
+
|
| 78 |
+
static const bool value = sizeof(check(select_system(tag1,tag2))) == sizeof(yes);
|
| 79 |
+
};
|
| 80 |
+
|
| 81 |
+
template<typename Tag1, typename Tag2, typename Tag3>
|
| 82 |
+
struct select_system3_exists
|
| 83 |
+
{
|
| 84 |
+
static Tag1 &tag1;
|
| 85 |
+
static Tag2 &tag2;
|
| 86 |
+
static Tag3 &tag3;
|
| 87 |
+
|
| 88 |
+
static const bool value = sizeof(check(select_system(tag1,tag2,tag3))) == sizeof(yes);
|
| 89 |
+
};
|
| 90 |
+
|
| 91 |
+
template<typename Tag1, typename Tag2, typename Tag3, typename Tag4>
|
| 92 |
+
struct select_system4_exists
|
| 93 |
+
{
|
| 94 |
+
static Tag1 &tag1;
|
| 95 |
+
static Tag2 &tag2;
|
| 96 |
+
static Tag3 &tag3;
|
| 97 |
+
static Tag4 &tag4;
|
| 98 |
+
|
| 99 |
+
static const bool value = sizeof(check(select_system(tag1,tag2,tag3,tag4))) == sizeof(yes);
|
| 100 |
+
};
|
| 101 |
+
|
| 102 |
+
template<typename Tag1, typename Tag2, typename Tag3, typename Tag4, typename Tag5>
|
| 103 |
+
struct select_system5_exists
|
| 104 |
+
{
|
| 105 |
+
static Tag1 &tag1;
|
| 106 |
+
static Tag2 &tag2;
|
| 107 |
+
static Tag3 &tag3;
|
| 108 |
+
static Tag4 &tag4;
|
| 109 |
+
static Tag5 &tag5;
|
| 110 |
+
|
| 111 |
+
static const bool value = sizeof(check(select_system(tag1,tag2,tag3,tag4,tag5))) == sizeof(yes);
|
| 112 |
+
};
|
| 113 |
+
|
| 114 |
+
template<typename Tag1, typename Tag2, typename Tag3, typename Tag4, typename Tag5, typename Tag6>
|
| 115 |
+
struct select_system6_exists
|
| 116 |
+
{
|
| 117 |
+
static Tag1 &tag1;
|
| 118 |
+
static Tag2 &tag2;
|
| 119 |
+
static Tag3 &tag3;
|
| 120 |
+
static Tag4 &tag4;
|
| 121 |
+
static Tag5 &tag5;
|
| 122 |
+
static Tag6 &tag6;
|
| 123 |
+
|
| 124 |
+
static const bool value = sizeof(check(select_system(tag1,tag2,tag3,tag4,tag5,tag6))) == sizeof(yes);
|
| 125 |
+
};
|
| 126 |
+
} // end select_system_exists_ns
|
| 127 |
+
|
| 128 |
+
} // end generic_type_traits_ns
|
| 129 |
+
|
| 130 |
+
namespace generic
|
| 131 |
+
{
|
| 132 |
+
|
| 133 |
+
template<typename Tag>
|
| 134 |
+
struct select_system1_exists
|
| 135 |
+
: generic_type_traits_ns::select_system_exists_ns::select_system1_exists<Tag>
|
| 136 |
+
{};
|
| 137 |
+
|
| 138 |
+
template<typename Tag1, typename Tag2>
|
| 139 |
+
struct select_system2_exists
|
| 140 |
+
: generic_type_traits_ns::select_system_exists_ns::select_system2_exists<Tag1,Tag2>
|
| 141 |
+
{};
|
| 142 |
+
|
| 143 |
+
template<typename Tag1, typename Tag2, typename Tag3>
|
| 144 |
+
struct select_system3_exists
|
| 145 |
+
: generic_type_traits_ns::select_system_exists_ns::select_system3_exists<Tag1,Tag2,Tag3>
|
| 146 |
+
{};
|
| 147 |
+
|
| 148 |
+
template<typename Tag1, typename Tag2, typename Tag3, typename Tag4>
|
| 149 |
+
struct select_system4_exists
|
| 150 |
+
: generic_type_traits_ns::select_system_exists_ns::select_system4_exists<Tag1,Tag2,Tag3,Tag4>
|
| 151 |
+
{};
|
| 152 |
+
|
| 153 |
+
template<typename Tag1, typename Tag2, typename Tag3, typename Tag4, typename Tag5>
|
| 154 |
+
struct select_system5_exists
|
| 155 |
+
: generic_type_traits_ns::select_system_exists_ns::select_system5_exists<Tag1,Tag2,Tag3,Tag4,Tag5>
|
| 156 |
+
{};
|
| 157 |
+
|
| 158 |
+
template<typename Tag1, typename Tag2, typename Tag3, typename Tag4, typename Tag5, typename Tag6>
|
| 159 |
+
struct select_system6_exists
|
| 160 |
+
: generic_type_traits_ns::select_system_exists_ns::select_system6_exists<Tag1,Tag2,Tag3,Tag4,Tag5,Tag6>
|
| 161 |
+
{};
|
| 162 |
+
|
| 163 |
+
} // end generic
|
| 164 |
+
} // end detail
|
| 165 |
+
} // end system
|
| 166 |
+
THRUST_NAMESPACE_END
|
| 167 |
+
|
videochat2/lib/python3.10/site-packages/tensorflow/include/external/local_config_cuda/cuda/cuda/include/thrust/system/detail/generic/shuffle.h
ADDED
|
@@ -0,0 +1,54 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
* Copyright 2008-2020 NVIDIA Corporation
|
| 3 |
+
*
|
| 4 |
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
| 5 |
+
* you may not use this file except in compliance with the License.
|
| 6 |
+
* You may obtain a copy of the License at
|
| 7 |
+
*
|
| 8 |
+
* http://www.apache.org/licenses/LICENSE-2.0
|
| 9 |
+
*
|
| 10 |
+
* Unless required by applicable law or agreed to in writing, software
|
| 11 |
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
| 12 |
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
| 13 |
+
* See the License for the specific language governing permissions and
|
| 14 |
+
* limitations under the License.
|
| 15 |
+
*/
|
| 16 |
+
|
| 17 |
+
/*! \file shuffle.h
|
| 18 |
+
* \brief Generic implementations of shuffle functions.
|
| 19 |
+
*/
|
| 20 |
+
|
| 21 |
+
#pragma once
|
| 22 |
+
|
| 23 |
+
|
| 24 |
+
#include <thrust/detail/config.h>
|
| 25 |
+
#include <thrust/detail/cpp11_required.h>
|
| 26 |
+
|
| 27 |
+
#if THRUST_CPP_DIALECT >= 2011
|
| 28 |
+
|
| 29 |
+
#include <thrust/system/detail/generic/tag.h>
|
| 30 |
+
|
| 31 |
+
THRUST_NAMESPACE_BEGIN
|
| 32 |
+
namespace system {
|
| 33 |
+
namespace detail {
|
| 34 |
+
namespace generic {
|
| 35 |
+
|
| 36 |
+
template <typename ExecutionPolicy, typename RandomIterator, typename URBG>
|
| 37 |
+
__host__ __device__ void shuffle(
|
| 38 |
+
thrust::execution_policy<ExecutionPolicy>& exec, RandomIterator first,
|
| 39 |
+
RandomIterator last, URBG&& g);
|
| 40 |
+
|
| 41 |
+
template <typename ExecutionPolicy, typename RandomIterator,
|
| 42 |
+
typename OutputIterator, typename URBG>
|
| 43 |
+
__host__ __device__ void shuffle_copy(
|
| 44 |
+
thrust::execution_policy<ExecutionPolicy>& exec, RandomIterator first,
|
| 45 |
+
RandomIterator last, OutputIterator result, URBG&& g);
|
| 46 |
+
|
| 47 |
+
} // end namespace generic
|
| 48 |
+
} // end namespace detail
|
| 49 |
+
} // end namespace system
|
| 50 |
+
THRUST_NAMESPACE_END
|
| 51 |
+
|
| 52 |
+
#include <thrust/system/detail/generic/shuffle.inl>
|
| 53 |
+
|
| 54 |
+
#endif
|
videochat2/lib/python3.10/site-packages/tensorflow/include/external/local_config_cuda/cuda/cuda/include/thrust/system/detail/generic/transform_reduce.h
ADDED
|
@@ -0,0 +1,52 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
* Copyright 2008-2013 NVIDIA Corporation
|
| 3 |
+
*
|
| 4 |
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
| 5 |
+
* you may not use this file except in compliance with the License.
|
| 6 |
+
* You may obtain a copy of the License at
|
| 7 |
+
*
|
| 8 |
+
* http://www.apache.org/licenses/LICENSE-2.0
|
| 9 |
+
*
|
| 10 |
+
* Unless required by applicable law or agreed to in writing, software
|
| 11 |
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
| 12 |
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
| 13 |
+
* See the License for the specific language governing permissions and
|
| 14 |
+
* limitations under the License.
|
| 15 |
+
*/
|
| 16 |
+
|
| 17 |
+
|
| 18 |
+
#pragma once
|
| 19 |
+
|
| 20 |
+
#include <thrust/detail/config.h>
|
| 21 |
+
#include <thrust/system/detail/generic/tag.h>
|
| 22 |
+
|
| 23 |
+
THRUST_NAMESPACE_BEGIN
|
| 24 |
+
namespace system
|
| 25 |
+
{
|
| 26 |
+
namespace detail
|
| 27 |
+
{
|
| 28 |
+
namespace generic
|
| 29 |
+
{
|
| 30 |
+
|
| 31 |
+
|
| 32 |
+
template<typename ExecutionPolicy,
|
| 33 |
+
typename InputIterator,
|
| 34 |
+
typename UnaryFunction,
|
| 35 |
+
typename OutputType,
|
| 36 |
+
typename BinaryFunction>
|
| 37 |
+
__host__ __device__
|
| 38 |
+
OutputType transform_reduce(thrust::execution_policy<ExecutionPolicy> &exec,
|
| 39 |
+
InputIterator first,
|
| 40 |
+
InputIterator last,
|
| 41 |
+
UnaryFunction unary_op,
|
| 42 |
+
OutputType init,
|
| 43 |
+
BinaryFunction binary_op);
|
| 44 |
+
|
| 45 |
+
|
| 46 |
+
} // end namespace generic
|
| 47 |
+
} // end namespace detail
|
| 48 |
+
} // end namespace system
|
| 49 |
+
THRUST_NAMESPACE_END
|
| 50 |
+
|
| 51 |
+
#include <thrust/system/detail/generic/transform_reduce.inl>
|
| 52 |
+
|
videochat2/lib/python3.10/site-packages/tensorflow/include/external/local_config_cuda/cuda/cuda/include/thrust/system/omp/detail/adjacent_difference.h
ADDED
|
@@ -0,0 +1,49 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
* Copyright 2008-2013 NVIDIA Corporation
|
| 3 |
+
*
|
| 4 |
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
| 5 |
+
* you may not use this file except in compliance with the License.
|
| 6 |
+
* You may obtain a copy of the License at
|
| 7 |
+
*
|
| 8 |
+
* http://www.apache.org/licenses/LICENSE-2.0
|
| 9 |
+
*
|
| 10 |
+
* Unless required by applicable law or agreed to in writing, software
|
| 11 |
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
| 12 |
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
| 13 |
+
* See the License for the specific language governing permissions and
|
| 14 |
+
* limitations under the License.
|
| 15 |
+
*/
|
| 16 |
+
|
| 17 |
+
#pragma once
|
| 18 |
+
|
| 19 |
+
#include <thrust/detail/config.h>
|
| 20 |
+
#include <thrust/system/omp/detail/execution_policy.h>
|
| 21 |
+
#include <thrust/system/detail/generic/adjacent_difference.h>
|
| 22 |
+
|
| 23 |
+
THRUST_NAMESPACE_BEGIN
|
| 24 |
+
namespace system
|
| 25 |
+
{
|
| 26 |
+
namespace omp
|
| 27 |
+
{
|
| 28 |
+
namespace detail
|
| 29 |
+
{
|
| 30 |
+
|
| 31 |
+
template<typename DerivedPolicy,
|
| 32 |
+
typename InputIterator,
|
| 33 |
+
typename OutputIterator,
|
| 34 |
+
typename BinaryFunction>
|
| 35 |
+
OutputIterator adjacent_difference(execution_policy<DerivedPolicy> &exec,
|
| 36 |
+
InputIterator first,
|
| 37 |
+
InputIterator last,
|
| 38 |
+
OutputIterator result,
|
| 39 |
+
BinaryFunction binary_op)
|
| 40 |
+
{
|
| 41 |
+
// omp prefers generic::adjacent_difference to cpp::adjacent_difference
|
| 42 |
+
return thrust::system::detail::generic::adjacent_difference(exec, first, last, result, binary_op);
|
| 43 |
+
} // end adjacent_difference()
|
| 44 |
+
|
| 45 |
+
} // end detail
|
| 46 |
+
} // end omp
|
| 47 |
+
} // end system
|
| 48 |
+
THRUST_NAMESPACE_END
|
| 49 |
+
|
videochat2/lib/python3.10/site-packages/tensorflow/include/external/local_config_cuda/cuda/cuda/include/thrust/system/omp/detail/assign_value.h
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
* Copyright 2008-2013 NVIDIA Corporation
|
| 3 |
+
*
|
| 4 |
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
| 5 |
+
* you may not use this file except in compliance with the License.
|
| 6 |
+
* You may obtain a copy of the License at
|
| 7 |
+
*
|
| 8 |
+
* http://www.apache.org/licenses/LICENSE-2.0
|
| 9 |
+
*
|
| 10 |
+
* Unless required by applicable law or agreed to in writing, software
|
| 11 |
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
| 12 |
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
| 13 |
+
* See the License for the specific language governing permissions and
|
| 14 |
+
* limitations under the License.
|
| 15 |
+
*/
|
| 16 |
+
|
| 17 |
+
#pragma once
|
| 18 |
+
|
| 19 |
+
#include <thrust/detail/config.h>
|
| 20 |
+
|
| 21 |
+
// this system inherits assign_value
|
| 22 |
+
#include <thrust/system/cpp/detail/assign_value.h>
|
| 23 |
+
|
videochat2/lib/python3.10/site-packages/tensorflow/include/external/local_config_cuda/cuda/cuda/include/thrust/system/omp/detail/binary_search.h
ADDED
|
@@ -0,0 +1,72 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
* Copyright 2008-2013 NVIDIA Corporation
|
| 3 |
+
*
|
| 4 |
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
| 5 |
+
* you may not use this file except in compliance with the License.
|
| 6 |
+
* You may obtain a copy of the License at
|
| 7 |
+
*
|
| 8 |
+
* http://www.apache.org/licenses/LICENSE-2.0
|
| 9 |
+
*
|
| 10 |
+
* Unless required by applicable law or agreed to in writing, software
|
| 11 |
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
| 12 |
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
| 13 |
+
* See the License for the specific language governing permissions and
|
| 14 |
+
* limitations under the License.
|
| 15 |
+
*/
|
| 16 |
+
|
| 17 |
+
#pragma once
|
| 18 |
+
|
| 19 |
+
#include <thrust/detail/config.h>
|
| 20 |
+
#include <thrust/system/omp/detail/execution_policy.h>
|
| 21 |
+
#include <thrust/system/detail/generic/binary_search.h>
|
| 22 |
+
|
| 23 |
+
THRUST_NAMESPACE_BEGIN
|
| 24 |
+
namespace system
|
| 25 |
+
{
|
| 26 |
+
namespace omp
|
| 27 |
+
{
|
| 28 |
+
namespace detail
|
| 29 |
+
{
|
| 30 |
+
|
| 31 |
+
|
| 32 |
+
template <typename DerivedPolicy, typename ForwardIterator, typename T, typename StrictWeakOrdering>
|
| 33 |
+
ForwardIterator lower_bound(execution_policy<DerivedPolicy> &exec,
|
| 34 |
+
ForwardIterator begin,
|
| 35 |
+
ForwardIterator end,
|
| 36 |
+
const T& value,
|
| 37 |
+
StrictWeakOrdering comp)
|
| 38 |
+
{
|
| 39 |
+
// omp prefers generic::lower_bound to cpp::lower_bound
|
| 40 |
+
return thrust::system::detail::generic::lower_bound(exec, begin, end, value, comp);
|
| 41 |
+
}
|
| 42 |
+
|
| 43 |
+
|
| 44 |
+
template <typename DerivedPolicy, typename ForwardIterator, typename T, typename StrictWeakOrdering, typename Backend>
|
| 45 |
+
ForwardIterator upper_bound(execution_policy<DerivedPolicy> &exec,
|
| 46 |
+
ForwardIterator begin,
|
| 47 |
+
ForwardIterator end,
|
| 48 |
+
const T& value,
|
| 49 |
+
StrictWeakOrdering comp)
|
| 50 |
+
{
|
| 51 |
+
// omp prefers generic::upper_bound to cpp::upper_bound
|
| 52 |
+
return thrust::system::detail::generic::upper_bound(exec, begin, end, value, comp);
|
| 53 |
+
}
|
| 54 |
+
|
| 55 |
+
|
| 56 |
+
template <typename DerivedPolicy, typename ForwardIterator, typename T, typename StrictWeakOrdering>
|
| 57 |
+
bool binary_search(execution_policy<DerivedPolicy> &exec,
|
| 58 |
+
ForwardIterator begin,
|
| 59 |
+
ForwardIterator end,
|
| 60 |
+
const T& value,
|
| 61 |
+
StrictWeakOrdering comp)
|
| 62 |
+
{
|
| 63 |
+
// omp prefers generic::binary_search to cpp::binary_search
|
| 64 |
+
return thrust::system::detail::generic::binary_search(exec, begin, end, value, comp);
|
| 65 |
+
}
|
| 66 |
+
|
| 67 |
+
|
| 68 |
+
} // end detail
|
| 69 |
+
} // end omp
|
| 70 |
+
} // end system
|
| 71 |
+
THRUST_NAMESPACE_END
|
| 72 |
+
|
videochat2/lib/python3.10/site-packages/tensorflow/include/external/local_config_cuda/cuda/cuda/include/thrust/system/omp/detail/copy.h
ADDED
|
@@ -0,0 +1,56 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
* Copyright 2008-2013 NVIDIA Corporation
|
| 3 |
+
*
|
| 4 |
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
| 5 |
+
* you may not use this file except in compliance with the License.
|
| 6 |
+
* You may obtain a copy of the License at
|
| 7 |
+
*
|
| 8 |
+
* http://www.apache.org/licenses/LICENSE-2.0
|
| 9 |
+
*
|
| 10 |
+
* Unless required by applicable law or agreed to in writing, software
|
| 11 |
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
| 12 |
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
| 13 |
+
* See the License for the specific language governing permissions and
|
| 14 |
+
* limitations under the License.
|
| 15 |
+
*/
|
| 16 |
+
|
| 17 |
+
#pragma once
|
| 18 |
+
|
| 19 |
+
#include <thrust/detail/config.h>
|
| 20 |
+
#include <thrust/system/omp/detail/execution_policy.h>
|
| 21 |
+
|
| 22 |
+
THRUST_NAMESPACE_BEGIN
|
| 23 |
+
namespace system
|
| 24 |
+
{
|
| 25 |
+
namespace omp
|
| 26 |
+
{
|
| 27 |
+
namespace detail
|
| 28 |
+
{
|
| 29 |
+
|
| 30 |
+
|
| 31 |
+
template<typename DerivedPolicy,
|
| 32 |
+
typename InputIterator,
|
| 33 |
+
typename OutputIterator>
|
| 34 |
+
OutputIterator copy(execution_policy<DerivedPolicy> &exec,
|
| 35 |
+
InputIterator first,
|
| 36 |
+
InputIterator last,
|
| 37 |
+
OutputIterator result);
|
| 38 |
+
|
| 39 |
+
|
| 40 |
+
template<typename DerivedPolicy,
|
| 41 |
+
typename InputIterator,
|
| 42 |
+
typename Size,
|
| 43 |
+
typename OutputIterator>
|
| 44 |
+
OutputIterator copy_n(execution_policy<DerivedPolicy> &exec,
|
| 45 |
+
InputIterator first,
|
| 46 |
+
Size n,
|
| 47 |
+
OutputIterator result);
|
| 48 |
+
|
| 49 |
+
|
| 50 |
+
} // end namespace detail
|
| 51 |
+
} // end namespace omp
|
| 52 |
+
} // end namespace system
|
| 53 |
+
THRUST_NAMESPACE_END
|
| 54 |
+
|
| 55 |
+
#include <thrust/system/omp/detail/copy.inl>
|
| 56 |
+
|
videochat2/lib/python3.10/site-packages/tensorflow/include/external/local_config_cuda/cuda/cuda/include/thrust/system/omp/detail/copy.inl
ADDED
|
@@ -0,0 +1,136 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
* Copyright 2008-2013 NVIDIA Corporation
|
| 3 |
+
*
|
| 4 |
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
| 5 |
+
* you may not use this file except in compliance with the License.
|
| 6 |
+
* You may obtain a copy of the License at
|
| 7 |
+
*
|
| 8 |
+
* http://www.apache.org/licenses/LICENSE-2.0
|
| 9 |
+
*
|
| 10 |
+
* Unless required by applicable law or agreed to in writing, software
|
| 11 |
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
| 12 |
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
| 13 |
+
* See the License for the specific language governing permissions and
|
| 14 |
+
* limitations under the License.
|
| 15 |
+
*/
|
| 16 |
+
|
| 17 |
+
#pragma once
|
| 18 |
+
|
| 19 |
+
#include <thrust/detail/config.h>
|
| 20 |
+
#include <thrust/system/omp/detail/copy.h>
|
| 21 |
+
#include <thrust/system/detail/generic/copy.h>
|
| 22 |
+
#include <thrust/system/detail/sequential/copy.h>
|
| 23 |
+
#include <thrust/detail/type_traits/minimum_type.h>
|
| 24 |
+
|
| 25 |
+
|
| 26 |
+
THRUST_NAMESPACE_BEGIN
|
| 27 |
+
namespace system
|
| 28 |
+
{
|
| 29 |
+
namespace omp
|
| 30 |
+
{
|
| 31 |
+
namespace detail
|
| 32 |
+
{
|
| 33 |
+
namespace dispatch
|
| 34 |
+
{
|
| 35 |
+
|
| 36 |
+
|
| 37 |
+
template<typename DerivedPolicy,
|
| 38 |
+
typename InputIterator,
|
| 39 |
+
typename OutputIterator>
|
| 40 |
+
OutputIterator copy(execution_policy<DerivedPolicy> &exec,
|
| 41 |
+
InputIterator first,
|
| 42 |
+
InputIterator last,
|
| 43 |
+
OutputIterator result,
|
| 44 |
+
thrust::incrementable_traversal_tag)
|
| 45 |
+
{
|
| 46 |
+
return thrust::system::detail::sequential::copy(exec, first, last, result);
|
| 47 |
+
} // end copy()
|
| 48 |
+
|
| 49 |
+
|
| 50 |
+
template<typename DerivedPolicy,
|
| 51 |
+
typename InputIterator,
|
| 52 |
+
typename OutputIterator>
|
| 53 |
+
OutputIterator copy(execution_policy<DerivedPolicy> &exec,
|
| 54 |
+
InputIterator first,
|
| 55 |
+
InputIterator last,
|
| 56 |
+
OutputIterator result,
|
| 57 |
+
thrust::random_access_traversal_tag)
|
| 58 |
+
{
|
| 59 |
+
return thrust::system::detail::generic::copy(exec, first, last, result);
|
| 60 |
+
} // end copy()
|
| 61 |
+
|
| 62 |
+
|
| 63 |
+
template<typename DerivedPolicy,
|
| 64 |
+
typename InputIterator,
|
| 65 |
+
typename Size,
|
| 66 |
+
typename OutputIterator>
|
| 67 |
+
OutputIterator copy_n(execution_policy<DerivedPolicy> &exec,
|
| 68 |
+
InputIterator first,
|
| 69 |
+
Size n,
|
| 70 |
+
OutputIterator result,
|
| 71 |
+
thrust::incrementable_traversal_tag)
|
| 72 |
+
{
|
| 73 |
+
return thrust::system::detail::sequential::copy_n(exec, first, n, result);
|
| 74 |
+
} // end copy_n()
|
| 75 |
+
|
| 76 |
+
|
| 77 |
+
template<typename DerivedPolicy,
|
| 78 |
+
typename InputIterator,
|
| 79 |
+
typename Size,
|
| 80 |
+
typename OutputIterator>
|
| 81 |
+
OutputIterator copy_n(execution_policy<DerivedPolicy> &exec,
|
| 82 |
+
InputIterator first,
|
| 83 |
+
Size n,
|
| 84 |
+
OutputIterator result,
|
| 85 |
+
thrust::random_access_traversal_tag)
|
| 86 |
+
{
|
| 87 |
+
return thrust::system::detail::generic::copy_n(exec, first, n, result);
|
| 88 |
+
} // end copy_n()
|
| 89 |
+
|
| 90 |
+
|
| 91 |
+
} // end dispatch
|
| 92 |
+
|
| 93 |
+
|
| 94 |
+
template<typename DerivedPolicy,
|
| 95 |
+
typename InputIterator,
|
| 96 |
+
typename OutputIterator>
|
| 97 |
+
OutputIterator copy(execution_policy<DerivedPolicy> &exec,
|
| 98 |
+
InputIterator first,
|
| 99 |
+
InputIterator last,
|
| 100 |
+
OutputIterator result)
|
| 101 |
+
{
|
| 102 |
+
typedef typename thrust::iterator_traversal<InputIterator>::type traversal1;
|
| 103 |
+
typedef typename thrust::iterator_traversal<OutputIterator>::type traversal2;
|
| 104 |
+
|
| 105 |
+
typedef typename thrust::detail::minimum_type<traversal1,traversal2>::type traversal;
|
| 106 |
+
|
| 107 |
+
// dispatch on minimum traversal
|
| 108 |
+
return thrust::system::omp::detail::dispatch::copy(exec, first, last, result, traversal());
|
| 109 |
+
} // end copy()
|
| 110 |
+
|
| 111 |
+
|
| 112 |
+
|
| 113 |
+
template<typename DerivedPolicy,
|
| 114 |
+
typename InputIterator,
|
| 115 |
+
typename Size,
|
| 116 |
+
typename OutputIterator>
|
| 117 |
+
OutputIterator copy_n(execution_policy<DerivedPolicy> &exec,
|
| 118 |
+
InputIterator first,
|
| 119 |
+
Size n,
|
| 120 |
+
OutputIterator result)
|
| 121 |
+
{
|
| 122 |
+
typedef typename thrust::iterator_traversal<InputIterator>::type traversal1;
|
| 123 |
+
typedef typename thrust::iterator_traversal<OutputIterator>::type traversal2;
|
| 124 |
+
|
| 125 |
+
typedef typename thrust::detail::minimum_type<traversal1,traversal2>::type traversal;
|
| 126 |
+
|
| 127 |
+
// dispatch on minimum traversal
|
| 128 |
+
return thrust::system::omp::detail::dispatch::copy_n(exec, first, n, result, traversal());
|
| 129 |
+
} // end copy_n()
|
| 130 |
+
|
| 131 |
+
|
| 132 |
+
} // end namespace detail
|
| 133 |
+
} // end namespace omp
|
| 134 |
+
} // end namespace system
|
| 135 |
+
THRUST_NAMESPACE_END
|
| 136 |
+
|
videochat2/lib/python3.10/site-packages/tensorflow/include/external/local_config_cuda/cuda/cuda/include/thrust/system/omp/detail/copy_if.inl
ADDED
|
@@ -0,0 +1,53 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
* Copyright 2008-2013 NVIDIA Corporation
|
| 3 |
+
*
|
| 4 |
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
| 5 |
+
* you may not use this file except in compliance with the License.
|
| 6 |
+
* You may obtain a copy of the License at
|
| 7 |
+
*
|
| 8 |
+
* http://www.apache.org/licenses/LICENSE-2.0
|
| 9 |
+
*
|
| 10 |
+
* Unless required by applicable law or agreed to in writing, software
|
| 11 |
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
| 12 |
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
| 13 |
+
* See the License for the specific language governing permissions and
|
| 14 |
+
* limitations under the License.
|
| 15 |
+
*/
|
| 16 |
+
|
| 17 |
+
#pragma once
|
| 18 |
+
|
| 19 |
+
#include <thrust/detail/config.h>
|
| 20 |
+
#include <thrust/system/omp/detail/copy_if.h>
|
| 21 |
+
#include <thrust/system/detail/generic/copy_if.h>
|
| 22 |
+
|
| 23 |
+
THRUST_NAMESPACE_BEGIN
|
| 24 |
+
namespace system
|
| 25 |
+
{
|
| 26 |
+
namespace omp
|
| 27 |
+
{
|
| 28 |
+
namespace detail
|
| 29 |
+
{
|
| 30 |
+
|
| 31 |
+
|
| 32 |
+
template<typename DerivedPolicy,
|
| 33 |
+
typename InputIterator1,
|
| 34 |
+
typename InputIterator2,
|
| 35 |
+
typename OutputIterator,
|
| 36 |
+
typename Predicate>
|
| 37 |
+
OutputIterator copy_if(execution_policy<DerivedPolicy> &exec,
|
| 38 |
+
InputIterator1 first,
|
| 39 |
+
InputIterator1 last,
|
| 40 |
+
InputIterator2 stencil,
|
| 41 |
+
OutputIterator result,
|
| 42 |
+
Predicate pred)
|
| 43 |
+
{
|
| 44 |
+
// omp prefers generic::copy_if to cpp::copy_if
|
| 45 |
+
return thrust::system::detail::generic::copy_if(exec, first, last, stencil, result, pred);
|
| 46 |
+
} // end copy_if()
|
| 47 |
+
|
| 48 |
+
|
| 49 |
+
} // end detail
|
| 50 |
+
} // end omp
|
| 51 |
+
} // end system
|
| 52 |
+
THRUST_NAMESPACE_END
|
| 53 |
+
|
videochat2/lib/python3.10/site-packages/tensorflow/include/external/local_config_cuda/cuda/cuda/include/thrust/system/omp/detail/default_decomposition.h
ADDED
|
@@ -0,0 +1,44 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
* Copyright 2008-2013 NVIDIA Corporation
|
| 3 |
+
*
|
| 4 |
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
| 5 |
+
* you may not use this file except in compliance with the License.
|
| 6 |
+
* You may obtain a copy of the License at
|
| 7 |
+
*
|
| 8 |
+
* http://www.apache.org/licenses/LICENSE-2.0
|
| 9 |
+
*
|
| 10 |
+
* Unless required by applicable law or agreed to in writing, software
|
| 11 |
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
| 12 |
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
| 13 |
+
* See the License for the specific language governing permissions and
|
| 14 |
+
* limitations under the License.
|
| 15 |
+
*/
|
| 16 |
+
|
| 17 |
+
|
| 18 |
+
/*! \file default_decomposition.h
|
| 19 |
+
* \brief Return a decomposition that is appropriate for the OpenMP backend.
|
| 20 |
+
*/
|
| 21 |
+
|
| 22 |
+
#pragma once
|
| 23 |
+
|
| 24 |
+
#include <thrust/detail/config.h>
|
| 25 |
+
#include <thrust/system/detail/internal/decompose.h>
|
| 26 |
+
|
| 27 |
+
THRUST_NAMESPACE_BEGIN
|
| 28 |
+
namespace system
|
| 29 |
+
{
|
| 30 |
+
namespace omp
|
| 31 |
+
{
|
| 32 |
+
namespace detail
|
| 33 |
+
{
|
| 34 |
+
|
| 35 |
+
template <typename IndexType>
|
| 36 |
+
thrust::system::detail::internal::uniform_decomposition<IndexType> default_decomposition(IndexType n);
|
| 37 |
+
|
| 38 |
+
} // end namespace detail
|
| 39 |
+
} // end namespace omp
|
| 40 |
+
} // end namespace system
|
| 41 |
+
THRUST_NAMESPACE_END
|
| 42 |
+
|
| 43 |
+
#include <thrust/system/omp/detail/default_decomposition.inl>
|
| 44 |
+
|
videochat2/lib/python3.10/site-packages/tensorflow/include/external/local_config_cuda/cuda/cuda/include/thrust/system/omp/detail/default_decomposition.inl
ADDED
|
@@ -0,0 +1,61 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
* Copyright 2008-2013 NVIDIA Corporation
|
| 3 |
+
*
|
| 4 |
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
| 5 |
+
* you may not use this file except in compliance with the License.
|
| 6 |
+
* You may obtain a copy of the License at
|
| 7 |
+
*
|
| 8 |
+
* http://www.apache.org/licenses/LICENSE-2.0
|
| 9 |
+
*
|
| 10 |
+
* Unless required by applicable law or agreed to in writing, software
|
| 11 |
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
| 12 |
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
| 13 |
+
* See the License for the specific language governing permissions and
|
| 14 |
+
* limitations under the License.
|
| 15 |
+
*/
|
| 16 |
+
|
| 17 |
+
#pragma once
|
| 18 |
+
|
| 19 |
+
#include <thrust/detail/config.h>
|
| 20 |
+
#include <thrust/system/omp/detail/default_decomposition.h>
|
| 21 |
+
|
| 22 |
+
// don't attempt to #include this file without omp support
|
| 23 |
+
#if (THRUST_DEVICE_COMPILER_IS_OMP_CAPABLE == THRUST_TRUE)
|
| 24 |
+
#include <omp.h>
|
| 25 |
+
#endif // omp support
|
| 26 |
+
|
| 27 |
+
THRUST_NAMESPACE_BEGIN
|
| 28 |
+
namespace system
|
| 29 |
+
{
|
| 30 |
+
namespace omp
|
| 31 |
+
{
|
| 32 |
+
namespace detail
|
| 33 |
+
{
|
| 34 |
+
|
| 35 |
+
template <typename IndexType>
|
| 36 |
+
thrust::system::detail::internal::uniform_decomposition<IndexType> default_decomposition(IndexType n)
|
| 37 |
+
{
|
| 38 |
+
// we're attempting to launch an omp kernel, assert we're compiling with omp support
|
| 39 |
+
// ========================================================================
|
| 40 |
+
// X Note to the user: If you've found this line due to a compiler error, X
|
| 41 |
+
// X you need to OpenMP support in your compiler. X
|
| 42 |
+
// ========================================================================
|
| 43 |
+
THRUST_STATIC_ASSERT_MSG(
|
| 44 |
+
(thrust::detail::depend_on_instantiation<
|
| 45 |
+
IndexType, (THRUST_DEVICE_COMPILER_IS_OMP_CAPABLE == THRUST_TRUE)
|
| 46 |
+
>::value)
|
| 47 |
+
, "OpenMP compiler support is not enabled"
|
| 48 |
+
);
|
| 49 |
+
|
| 50 |
+
#if (THRUST_DEVICE_COMPILER_IS_OMP_CAPABLE == THRUST_TRUE)
|
| 51 |
+
return thrust::system::detail::internal::uniform_decomposition<IndexType>(n, 1, omp_get_num_procs());
|
| 52 |
+
#else
|
| 53 |
+
return thrust::system::detail::internal::uniform_decomposition<IndexType>(n, 1, 1);
|
| 54 |
+
#endif
|
| 55 |
+
}
|
| 56 |
+
|
| 57 |
+
} // end namespace detail
|
| 58 |
+
} // end namespace omp
|
| 59 |
+
} // end namespace system
|
| 60 |
+
THRUST_NAMESPACE_END
|
| 61 |
+
|
videochat2/lib/python3.10/site-packages/tensorflow/include/external/local_config_cuda/cuda/cuda/include/thrust/system/omp/detail/equal.h
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
* Copyright 2008-2013 NVIDIA Corporation
|
| 3 |
+
*
|
| 4 |
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
| 5 |
+
* you may not use this file except in compliance with the License.
|
| 6 |
+
* You may obtain a copy of the License at
|
| 7 |
+
*
|
| 8 |
+
* http://www.apache.org/licenses/LICENSE-2.0
|
| 9 |
+
*
|
| 10 |
+
* Unless required by applicable law or agreed to in writing, software
|
| 11 |
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
| 12 |
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
| 13 |
+
* See the License for the specific language governing permissions and
|
| 14 |
+
* limitations under the License.
|
| 15 |
+
*/
|
| 16 |
+
|
| 17 |
+
#pragma once
|
| 18 |
+
|
| 19 |
+
#include <thrust/detail/config.h>
|
| 20 |
+
|
| 21 |
+
// this system inherits equal
|
| 22 |
+
#include <thrust/system/cpp/detail/equal.h>
|
| 23 |
+
|
videochat2/lib/python3.10/site-packages/tensorflow/include/external/local_config_cuda/cuda/cuda/include/thrust/system/omp/detail/execution_policy.h
ADDED
|
@@ -0,0 +1,106 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
* Copyright 2008-2013 NVIDIA Corporation
|
| 3 |
+
*
|
| 4 |
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
| 5 |
+
* you may not use this file except in compliance with the License.
|
| 6 |
+
* You may obtain a copy of the License at
|
| 7 |
+
*
|
| 8 |
+
* http://www.apache.org/licenses/LICENSE-2.0
|
| 9 |
+
*
|
| 10 |
+
* Unless required by applicable law or agreed to in writing, software
|
| 11 |
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
| 12 |
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
| 13 |
+
* See the License for the specific language governing permissions and
|
| 14 |
+
* limitations under the License.
|
| 15 |
+
*/
|
| 16 |
+
|
| 17 |
+
#pragma once
|
| 18 |
+
|
| 19 |
+
#include <thrust/detail/config.h>
|
| 20 |
+
#include <thrust/system/cpp/detail/execution_policy.h>
|
| 21 |
+
#include <thrust/system/tbb/detail/execution_policy.h>
|
| 22 |
+
#include <thrust/iterator/detail/any_system_tag.h>
|
| 23 |
+
#include <thrust/detail/type_traits.h>
|
| 24 |
+
|
| 25 |
+
THRUST_NAMESPACE_BEGIN
|
| 26 |
+
namespace system
|
| 27 |
+
{
|
| 28 |
+
// put the canonical tag in the same ns as the backend's entry points
|
| 29 |
+
namespace omp
|
| 30 |
+
{
|
| 31 |
+
namespace detail
|
| 32 |
+
{
|
| 33 |
+
|
| 34 |
+
// this awkward sequence of definitions arise
|
| 35 |
+
// from the desire both for tag to derive
|
| 36 |
+
// from execution_policy and for execution_policy
|
| 37 |
+
// to convert to tag (when execution_policy is not
|
| 38 |
+
// an ancestor of tag)
|
| 39 |
+
|
| 40 |
+
// forward declaration of tag
|
| 41 |
+
struct tag;
|
| 42 |
+
|
| 43 |
+
// forward declaration of execution_policy
|
| 44 |
+
template<typename> struct execution_policy;
|
| 45 |
+
|
| 46 |
+
// specialize execution_policy for tag
|
| 47 |
+
template<>
|
| 48 |
+
struct execution_policy<tag>
|
| 49 |
+
: thrust::system::cpp::detail::execution_policy<tag>
|
| 50 |
+
{};
|
| 51 |
+
|
| 52 |
+
// tag's definition comes before the
|
| 53 |
+
// generic definition of execution_policy
|
| 54 |
+
struct tag : execution_policy<tag> {};
|
| 55 |
+
|
| 56 |
+
// allow conversion to tag when it is not a successor
|
| 57 |
+
template<typename Derived>
|
| 58 |
+
struct execution_policy
|
| 59 |
+
: thrust::system::cpp::detail::execution_policy<Derived>
|
| 60 |
+
{
|
| 61 |
+
typedef tag tag_type;
|
| 62 |
+
operator tag() const { return tag(); }
|
| 63 |
+
};
|
| 64 |
+
|
| 65 |
+
|
| 66 |
+
// overloads of select_system
|
| 67 |
+
|
| 68 |
+
// XXX select_system(tbb, omp) & select_system(omp, tbb) are ambiguous
|
| 69 |
+
// because both convert to cpp without these overloads, which we
|
| 70 |
+
// arbitrarily define in the omp backend
|
| 71 |
+
|
| 72 |
+
template<typename System1, typename System2>
|
| 73 |
+
inline __host__ __device__
|
| 74 |
+
System1 select_system(execution_policy<System1> s, thrust::system::tbb::detail::execution_policy<System2>)
|
| 75 |
+
{
|
| 76 |
+
return thrust::detail::derived_cast(s);
|
| 77 |
+
} // end select_system()
|
| 78 |
+
|
| 79 |
+
|
| 80 |
+
template<typename System1, typename System2>
|
| 81 |
+
inline __host__ __device__
|
| 82 |
+
System2 select_system(thrust::system::tbb::detail::execution_policy<System1>, execution_policy<System2> s)
|
| 83 |
+
{
|
| 84 |
+
return thrust::detail::derived_cast(s);
|
| 85 |
+
} // end select_system()
|
| 86 |
+
|
| 87 |
+
|
| 88 |
+
} // end detail
|
| 89 |
+
|
| 90 |
+
// alias execution_policy and tag here
|
| 91 |
+
using thrust::system::omp::detail::execution_policy;
|
| 92 |
+
using thrust::system::omp::detail::tag;
|
| 93 |
+
|
| 94 |
+
} // end omp
|
| 95 |
+
} // end system
|
| 96 |
+
|
| 97 |
+
// alias items at top-level
|
| 98 |
+
namespace omp
|
| 99 |
+
{
|
| 100 |
+
|
| 101 |
+
using thrust::system::omp::execution_policy;
|
| 102 |
+
using thrust::system::omp::tag;
|
| 103 |
+
|
| 104 |
+
} // end omp
|
| 105 |
+
THRUST_NAMESPACE_END
|
| 106 |
+
|
videochat2/lib/python3.10/site-packages/tensorflow/include/external/local_config_cuda/cuda/cuda/include/thrust/system/omp/detail/extrema.h
ADDED
|
@@ -0,0 +1,66 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
* Copyright 2008-2013 NVIDIA Corporation
|
| 3 |
+
*
|
| 4 |
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
| 5 |
+
* you may not use this file except in compliance with the License.
|
| 6 |
+
* You may obtain a copy of the License at
|
| 7 |
+
*
|
| 8 |
+
* http://www.apache.org/licenses/LICENSE-2.0
|
| 9 |
+
*
|
| 10 |
+
* Unless required by applicable law or agreed to in writing, software
|
| 11 |
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
| 12 |
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
| 13 |
+
* See the License for the specific language governing permissions and
|
| 14 |
+
* limitations under the License.
|
| 15 |
+
*/
|
| 16 |
+
|
| 17 |
+
#pragma once
|
| 18 |
+
|
| 19 |
+
#include <thrust/detail/config.h>
|
| 20 |
+
#include <thrust/system/omp/detail/execution_policy.h>
|
| 21 |
+
#include <thrust/system/detail/generic/extrema.h>
|
| 22 |
+
|
| 23 |
+
THRUST_NAMESPACE_BEGIN
|
| 24 |
+
namespace system
|
| 25 |
+
{
|
| 26 |
+
namespace omp
|
| 27 |
+
{
|
| 28 |
+
namespace detail
|
| 29 |
+
{
|
| 30 |
+
|
| 31 |
+
template <typename DerivedPolicy, typename ForwardIterator, typename BinaryPredicate>
|
| 32 |
+
ForwardIterator max_element(execution_policy<DerivedPolicy> &exec,
|
| 33 |
+
ForwardIterator first,
|
| 34 |
+
ForwardIterator last,
|
| 35 |
+
BinaryPredicate comp)
|
| 36 |
+
{
|
| 37 |
+
// omp prefers generic::max_element to cpp::max_element
|
| 38 |
+
return thrust::system::detail::generic::max_element(exec, first, last, comp);
|
| 39 |
+
} // end max_element()
|
| 40 |
+
|
| 41 |
+
template <typename DerivedPolicy, typename ForwardIterator, typename BinaryPredicate>
|
| 42 |
+
ForwardIterator min_element(execution_policy<DerivedPolicy> &exec,
|
| 43 |
+
ForwardIterator first,
|
| 44 |
+
ForwardIterator last,
|
| 45 |
+
BinaryPredicate comp)
|
| 46 |
+
{
|
| 47 |
+
// omp prefers generic::min_element to cpp::min_element
|
| 48 |
+
return thrust::system::detail::generic::min_element(exec, first, last, comp);
|
| 49 |
+
} // end min_element()
|
| 50 |
+
|
| 51 |
+
template <typename DerivedPolicy, typename ForwardIterator, typename BinaryPredicate>
|
| 52 |
+
thrust::pair<ForwardIterator,ForwardIterator> minmax_element(execution_policy<DerivedPolicy> &exec,
|
| 53 |
+
ForwardIterator first,
|
| 54 |
+
ForwardIterator last,
|
| 55 |
+
BinaryPredicate comp)
|
| 56 |
+
{
|
| 57 |
+
// omp prefers generic::minmax_element to cpp::minmax_element
|
| 58 |
+
return thrust::system::detail::generic::minmax_element(exec, first, last, comp);
|
| 59 |
+
} // end minmax_element()
|
| 60 |
+
|
| 61 |
+
} // end detail
|
| 62 |
+
} // end omp
|
| 63 |
+
} // end system
|
| 64 |
+
THRUST_NAMESPACE_END
|
| 65 |
+
|
| 66 |
+
|
videochat2/lib/python3.10/site-packages/tensorflow/include/external/local_config_cuda/cuda/cuda/include/thrust/system/omp/detail/fill.h
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
* Copyright 2008-2013 NVIDIA Corporation
|
| 3 |
+
*
|
| 4 |
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
| 5 |
+
* you may not use this file except in compliance with the License.
|
| 6 |
+
* You may obtain a copy of the License at
|
| 7 |
+
*
|
| 8 |
+
* http://www.apache.org/licenses/LICENSE-2.0
|
| 9 |
+
*
|
| 10 |
+
* Unless required by applicable law or agreed to in writing, software
|
| 11 |
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
| 12 |
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
| 13 |
+
* See the License for the specific language governing permissions and
|
| 14 |
+
* limitations under the License.
|
| 15 |
+
*/
|
| 16 |
+
|
| 17 |
+
#pragma once
|
| 18 |
+
|
| 19 |
+
#include <thrust/detail/config.h>
|
| 20 |
+
|
| 21 |
+
// this system inherits fill
|
| 22 |
+
#include <thrust/system/cpp/detail/fill.h>
|
| 23 |
+
|
videochat2/lib/python3.10/site-packages/tensorflow/include/external/local_config_cuda/cuda/cuda/include/thrust/system/omp/detail/find.h
ADDED
|
@@ -0,0 +1,50 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
* Copyright 2008-2013 NVIDIA Corporation
|
| 3 |
+
*
|
| 4 |
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
| 5 |
+
* you may not use this file except in compliance with the License.
|
| 6 |
+
* You may obtain a copy of the License at
|
| 7 |
+
*
|
| 8 |
+
* http://www.apache.org/licenses/LICENSE-2.0
|
| 9 |
+
*
|
| 10 |
+
* Unless required by applicable law or agreed to in writing, software
|
| 11 |
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
| 12 |
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
| 13 |
+
* See the License for the specific language governing permissions and
|
| 14 |
+
* limitations under the License.
|
| 15 |
+
*/
|
| 16 |
+
|
| 17 |
+
|
| 18 |
+
/*! \file find.h
|
| 19 |
+
* \brief OpenMP implementation of find_if.
|
| 20 |
+
*/
|
| 21 |
+
|
| 22 |
+
#pragma once
|
| 23 |
+
|
| 24 |
+
#include <thrust/detail/config.h>
|
| 25 |
+
#include <thrust/system/detail/generic/find.h>
|
| 26 |
+
#include <thrust/system/omp/detail/execution_policy.h>
|
| 27 |
+
|
| 28 |
+
THRUST_NAMESPACE_BEGIN
|
| 29 |
+
namespace system
|
| 30 |
+
{
|
| 31 |
+
namespace omp
|
| 32 |
+
{
|
| 33 |
+
namespace detail
|
| 34 |
+
{
|
| 35 |
+
|
| 36 |
+
template <typename DerivedPolicy, typename InputIterator, typename Predicate>
|
| 37 |
+
InputIterator find_if(execution_policy<DerivedPolicy> &exec,
|
| 38 |
+
InputIterator first,
|
| 39 |
+
InputIterator last,
|
| 40 |
+
Predicate pred)
|
| 41 |
+
{
|
| 42 |
+
// omp prefers generic::find_if to cpp::find_if
|
| 43 |
+
return thrust::system::detail::generic::find_if(exec, first, last, pred);
|
| 44 |
+
}
|
| 45 |
+
|
| 46 |
+
} // end namespace detail
|
| 47 |
+
} // end namespace omp
|
| 48 |
+
} // end namespace system
|
| 49 |
+
THRUST_NAMESPACE_END
|
| 50 |
+
|
videochat2/lib/python3.10/site-packages/tensorflow/include/external/local_config_cuda/cuda/cuda/include/thrust/system/omp/detail/for_each.h
ADDED
|
@@ -0,0 +1,59 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
* Copyright 2008-2013 NVIDIA Corporation
|
| 3 |
+
*
|
| 4 |
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
| 5 |
+
* you may not use this file except in compliance with the License.
|
| 6 |
+
* You may obtain a copy of the License at
|
| 7 |
+
*
|
| 8 |
+
* http://www.apache.org/licenses/LICENSE-2.0
|
| 9 |
+
*
|
| 10 |
+
* Unless required by applicable law or agreed to in writing, software
|
| 11 |
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
| 12 |
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
| 13 |
+
* See the License for the specific language governing permissions and
|
| 14 |
+
* limitations under the License.
|
| 15 |
+
*/
|
| 16 |
+
|
| 17 |
+
|
| 18 |
+
/*! \file for_each.h
|
| 19 |
+
* \brief Defines the interface for a function that executes a
|
| 20 |
+
* function or functional for each value in a given range.
|
| 21 |
+
*/
|
| 22 |
+
|
| 23 |
+
#pragma once
|
| 24 |
+
|
| 25 |
+
#include <thrust/detail/config.h>
|
| 26 |
+
#include <thrust/system/omp/detail/execution_policy.h>
|
| 27 |
+
|
| 28 |
+
THRUST_NAMESPACE_BEGIN
|
| 29 |
+
namespace system
|
| 30 |
+
{
|
| 31 |
+
namespace omp
|
| 32 |
+
{
|
| 33 |
+
namespace detail
|
| 34 |
+
{
|
| 35 |
+
|
| 36 |
+
template<typename DerivedPolicy,
|
| 37 |
+
typename RandomAccessIterator,
|
| 38 |
+
typename UnaryFunction>
|
| 39 |
+
RandomAccessIterator for_each(execution_policy<DerivedPolicy> &exec,
|
| 40 |
+
RandomAccessIterator first,
|
| 41 |
+
RandomAccessIterator last,
|
| 42 |
+
UnaryFunction f);
|
| 43 |
+
|
| 44 |
+
template<typename DerivedPolicy,
|
| 45 |
+
typename RandomAccessIterator,
|
| 46 |
+
typename Size,
|
| 47 |
+
typename UnaryFunction>
|
| 48 |
+
RandomAccessIterator for_each_n(execution_policy<DerivedPolicy> &exec,
|
| 49 |
+
RandomAccessIterator first,
|
| 50 |
+
Size n,
|
| 51 |
+
UnaryFunction f);
|
| 52 |
+
|
| 53 |
+
} // end namespace detail
|
| 54 |
+
} // end namespace omp
|
| 55 |
+
} // end namespace system
|
| 56 |
+
THRUST_NAMESPACE_END
|
| 57 |
+
|
| 58 |
+
#include <thrust/system/omp/detail/for_each.inl>
|
| 59 |
+
|
videochat2/lib/python3.10/site-packages/tensorflow/include/external/local_config_cuda/cuda/cuda/include/thrust/system/omp/detail/for_each.inl
ADDED
|
@@ -0,0 +1,92 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
* Copyright 2008-2013 NVIDIA Corporation
|
| 3 |
+
*
|
| 4 |
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
| 5 |
+
* you may not use this file except in compliance with the License.
|
| 6 |
+
* You may obtain a copy of the License at
|
| 7 |
+
*
|
| 8 |
+
* http://www.apache.org/licenses/LICENSE-2.0
|
| 9 |
+
*
|
| 10 |
+
* Unless required by applicable law or agreed to in writing, software
|
| 11 |
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
| 12 |
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
| 13 |
+
* See the License for the specific language governing permissions and
|
| 14 |
+
* limitations under the License.
|
| 15 |
+
*/
|
| 16 |
+
|
| 17 |
+
#pragma once
|
| 18 |
+
|
| 19 |
+
#include <thrust/detail/config.h>
|
| 20 |
+
#include <thrust/detail/function.h>
|
| 21 |
+
#include <thrust/detail/static_assert.h>
|
| 22 |
+
#include <thrust/distance.h>
|
| 23 |
+
#include <thrust/for_each.h>
|
| 24 |
+
#include <thrust/iterator/iterator_traits.h>
|
| 25 |
+
#include <thrust/system/omp/detail/pragma_omp.h>
|
| 26 |
+
|
| 27 |
+
THRUST_NAMESPACE_BEGIN
|
| 28 |
+
namespace system
|
| 29 |
+
{
|
| 30 |
+
namespace omp
|
| 31 |
+
{
|
| 32 |
+
namespace detail
|
| 33 |
+
{
|
| 34 |
+
|
| 35 |
+
template<typename DerivedPolicy,
|
| 36 |
+
typename RandomAccessIterator,
|
| 37 |
+
typename Size,
|
| 38 |
+
typename UnaryFunction>
|
| 39 |
+
RandomAccessIterator for_each_n(execution_policy<DerivedPolicy> &,
|
| 40 |
+
RandomAccessIterator first,
|
| 41 |
+
Size n,
|
| 42 |
+
UnaryFunction f)
|
| 43 |
+
{
|
| 44 |
+
// we're attempting to launch an omp kernel, assert we're compiling with omp support
|
| 45 |
+
// ========================================================================
|
| 46 |
+
// X Note to the user: If you've found this line due to a compiler error, X
|
| 47 |
+
// X you need to enable OpenMP support in your compiler. X
|
| 48 |
+
// ========================================================================
|
| 49 |
+
THRUST_STATIC_ASSERT_MSG(
|
| 50 |
+
(thrust::detail::depend_on_instantiation<
|
| 51 |
+
RandomAccessIterator, (THRUST_DEVICE_COMPILER_IS_OMP_CAPABLE == THRUST_TRUE)
|
| 52 |
+
>::value)
|
| 53 |
+
, "OpenMP compiler support is not enabled"
|
| 54 |
+
);
|
| 55 |
+
|
| 56 |
+
if (n <= 0) return first; //empty range
|
| 57 |
+
|
| 58 |
+
// create a wrapped function for f
|
| 59 |
+
thrust::detail::wrapped_function<UnaryFunction,void> wrapped_f(f);
|
| 60 |
+
|
| 61 |
+
// use a signed type for the iteration variable or suffer the consequences of warnings
|
| 62 |
+
typedef typename thrust::iterator_difference<RandomAccessIterator>::type DifferenceType;
|
| 63 |
+
DifferenceType signed_n = n;
|
| 64 |
+
|
| 65 |
+
THRUST_PRAGMA_OMP(parallel for)
|
| 66 |
+
for(DifferenceType i = 0;
|
| 67 |
+
i < signed_n;
|
| 68 |
+
++i)
|
| 69 |
+
{
|
| 70 |
+
RandomAccessIterator temp = first + i;
|
| 71 |
+
wrapped_f(*temp);
|
| 72 |
+
}
|
| 73 |
+
|
| 74 |
+
return first + n;
|
| 75 |
+
} // end for_each_n()
|
| 76 |
+
|
| 77 |
+
template<typename DerivedPolicy,
|
| 78 |
+
typename RandomAccessIterator,
|
| 79 |
+
typename UnaryFunction>
|
| 80 |
+
RandomAccessIterator for_each(execution_policy<DerivedPolicy> &s,
|
| 81 |
+
RandomAccessIterator first,
|
| 82 |
+
RandomAccessIterator last,
|
| 83 |
+
UnaryFunction f)
|
| 84 |
+
{
|
| 85 |
+
return omp::detail::for_each_n(s, first, thrust::distance(first,last), f);
|
| 86 |
+
} // end for_each()
|
| 87 |
+
|
| 88 |
+
} // end namespace detail
|
| 89 |
+
} // end namespace omp
|
| 90 |
+
} // end namespace system
|
| 91 |
+
THRUST_NAMESPACE_END
|
| 92 |
+
|
videochat2/lib/python3.10/site-packages/tensorflow/include/external/local_config_cuda/cuda/cuda/include/thrust/system/omp/detail/generate.h
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
* Copyright 2008-2013 NVIDIA Corporation
|
| 3 |
+
*
|
| 4 |
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
| 5 |
+
* you may not use this file except in compliance with the License.
|
| 6 |
+
* You may obtain a copy of the License at
|
| 7 |
+
*
|
| 8 |
+
* http://www.apache.org/licenses/LICENSE-2.0
|
| 9 |
+
*
|
| 10 |
+
* Unless required by applicable law or agreed to in writing, software
|
| 11 |
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
| 12 |
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
| 13 |
+
* See the License for the specific language governing permissions and
|
| 14 |
+
* limitations under the License.
|
| 15 |
+
*/
|
| 16 |
+
|
| 17 |
+
#pragma once
|
| 18 |
+
|
| 19 |
+
#include <thrust/detail/config.h>
|
| 20 |
+
|
| 21 |
+
// this system inherits generate
|
| 22 |
+
#include <thrust/system/cpp/detail/generate.h>
|
| 23 |
+
|
videochat2/lib/python3.10/site-packages/tensorflow/include/external/local_config_cuda/cuda/cuda/include/thrust/system/omp/detail/get_value.h
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
* Copyright 2008-2013 NVIDIA Corporation
|
| 3 |
+
*
|
| 4 |
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
| 5 |
+
* you may not use this file except in compliance with the License.
|
| 6 |
+
* You may obtain a copy of the License at
|
| 7 |
+
*
|
| 8 |
+
* http://www.apache.org/licenses/LICENSE-2.0
|
| 9 |
+
*
|
| 10 |
+
* Unless required by applicable law or agreed to in writing, software
|
| 11 |
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
| 12 |
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
| 13 |
+
* See the License for the specific language governing permissions and
|
| 14 |
+
* limitations under the License.
|
| 15 |
+
*/
|
| 16 |
+
|
| 17 |
+
#pragma once
|
| 18 |
+
|
| 19 |
+
#include <thrust/detail/config.h>
|
| 20 |
+
|
| 21 |
+
// this system inherits get_value
|
| 22 |
+
#include <thrust/system/cpp/detail/get_value.h>
|
| 23 |
+
|
videochat2/lib/python3.10/site-packages/tensorflow/include/external/local_config_cuda/cuda/cuda/include/thrust/system/omp/detail/inner_product.h
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
* Copyright 2008-2013 NVIDIA Corporation
|
| 3 |
+
*
|
| 4 |
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
| 5 |
+
* you may not use this file except in compliance with the License.
|
| 6 |
+
* You may obtain a copy of the License at
|
| 7 |
+
*
|
| 8 |
+
* http://www.apache.org/licenses/LICENSE-2.0
|
| 9 |
+
*
|
| 10 |
+
* Unless required by applicable law or agreed to in writing, software
|
| 11 |
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
| 12 |
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
| 13 |
+
* See the License for the specific language governing permissions and
|
| 14 |
+
* limitations under the License.
|
| 15 |
+
*/
|
| 16 |
+
|
| 17 |
+
#pragma once
|
| 18 |
+
|
| 19 |
+
#include <thrust/detail/config.h>
|
| 20 |
+
|
| 21 |
+
// this system inherits inner_product
|
| 22 |
+
#include <thrust/system/cpp/detail/inner_product.h>
|
| 23 |
+
|
videochat2/lib/python3.10/site-packages/tensorflow/include/external/local_config_cuda/cuda/cuda/include/thrust/system/omp/detail/iter_swap.h
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
* Copyright 2008-2013 NVIDIA Corporation
|
| 3 |
+
*
|
| 4 |
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
| 5 |
+
* you may not use this file except in compliance with the License.
|
| 6 |
+
* You may obtain a copy of the License at
|
| 7 |
+
*
|
| 8 |
+
* http://www.apache.org/licenses/LICENSE-2.0
|
| 9 |
+
*
|
| 10 |
+
* Unless required by applicable law or agreed to in writing, software
|
| 11 |
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
| 12 |
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
| 13 |
+
* See the License for the specific language governing permissions and
|
| 14 |
+
* limitations under the License.
|
| 15 |
+
*/
|
| 16 |
+
|
| 17 |
+
#pragma once
|
| 18 |
+
|
| 19 |
+
#include <thrust/detail/config.h>
|
| 20 |
+
|
| 21 |
+
// this system inherits iter_swap
|
| 22 |
+
#include <thrust/system/cpp/detail/iter_swap.h>
|
| 23 |
+
|
videochat2/lib/python3.10/site-packages/tensorflow/include/external/local_config_cuda/cuda/cuda/include/thrust/system/omp/detail/logical.h
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
* Copyright 2008-2013 NVIDIA Corporation
|
| 3 |
+
*
|
| 4 |
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
| 5 |
+
* you may not use this file except in compliance with the License.
|
| 6 |
+
* You may obtain a copy of the License at
|
| 7 |
+
*
|
| 8 |
+
* http://www.apache.org/licenses/LICENSE-2.0
|
| 9 |
+
*
|
| 10 |
+
* Unless required by applicable law or agreed to in writing, software
|
| 11 |
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
| 12 |
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
| 13 |
+
* See the License for the specific language governing permissions and
|
| 14 |
+
* limitations under the License.
|
| 15 |
+
*/
|
| 16 |
+
|
| 17 |
+
#pragma once
|
| 18 |
+
|
| 19 |
+
#include <thrust/detail/config.h>
|
| 20 |
+
|
| 21 |
+
// this system inherits logical
|
| 22 |
+
#include <thrust/system/cpp/detail/logical.h>
|
| 23 |
+
|
videochat2/lib/python3.10/site-packages/tensorflow/include/external/local_config_cuda/cuda/cuda/include/thrust/system/omp/detail/malloc_and_free.h
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
* Copyright 2008-2013 NVIDIA Corporation
|
| 3 |
+
*
|
| 4 |
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
| 5 |
+
* you may not use this file except in compliance with the License.
|
| 6 |
+
* You may obtain a copy of the License at
|
| 7 |
+
*
|
| 8 |
+
* http://www.apache.org/licenses/LICENSE-2.0
|
| 9 |
+
*
|
| 10 |
+
* Unless required by applicable law or agreed to in writing, software
|
| 11 |
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
| 12 |
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
| 13 |
+
* See the License for the specific language governing permissions and
|
| 14 |
+
* limitations under the License.
|
| 15 |
+
*/
|
| 16 |
+
|
| 17 |
+
#pragma once
|
| 18 |
+
|
| 19 |
+
#include <thrust/detail/config.h>
|
| 20 |
+
|
| 21 |
+
// this system inherits malloc and free
|
| 22 |
+
#include <thrust/system/cpp/detail/malloc_and_free.h>
|
| 23 |
+
|
videochat2/lib/python3.10/site-packages/tensorflow/include/external/local_config_cuda/cuda/cuda/include/thrust/system/omp/detail/memory.inl
ADDED
|
@@ -0,0 +1,86 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
* Copyright 2008-2018 NVIDIA Corporation
|
| 3 |
+
*
|
| 4 |
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
| 5 |
+
* you may not use this file except in compliance with the License.
|
| 6 |
+
* You may obtain a copy of the License at
|
| 7 |
+
*
|
| 8 |
+
* http://www.apache.org/licenses/LICENSE-2.0
|
| 9 |
+
*
|
| 10 |
+
* Unless required by applicable law or agreed to in writing, software
|
| 11 |
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
| 12 |
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
| 13 |
+
* See the License for the specific language governing permissions and
|
| 14 |
+
* limitations under the License.
|
| 15 |
+
*/
|
| 16 |
+
|
| 17 |
+
#pragma once
|
| 18 |
+
|
| 19 |
+
#include <thrust/detail/config.h>
|
| 20 |
+
#include <thrust/system/cpp/detail/execution_policy.h>
|
| 21 |
+
#include <thrust/system/omp/memory.h>
|
| 22 |
+
#include <thrust/system/cpp/memory.h>
|
| 23 |
+
|
| 24 |
+
#include <limits>
|
| 25 |
+
|
| 26 |
+
THRUST_NAMESPACE_BEGIN
|
| 27 |
+
namespace system
|
| 28 |
+
{
|
| 29 |
+
namespace omp
|
| 30 |
+
{
|
| 31 |
+
namespace detail
|
| 32 |
+
{
|
| 33 |
+
|
| 34 |
+
// XXX circular #inclusion problems cause the compiler to believe that cpp::malloc
|
| 35 |
+
// is not defined
|
| 36 |
+
// WAR the problem by using adl to call cpp::malloc, which requires it to depend
|
| 37 |
+
// on a template parameter
|
| 38 |
+
template<typename Tag>
|
| 39 |
+
pointer<void> malloc_workaround(Tag t, std::size_t n)
|
| 40 |
+
{
|
| 41 |
+
return pointer<void>(malloc(t, n));
|
| 42 |
+
} // end malloc_workaround()
|
| 43 |
+
|
| 44 |
+
// XXX circular #inclusion problems cause the compiler to believe that cpp::free
|
| 45 |
+
// is not defined
|
| 46 |
+
// WAR the problem by using adl to call cpp::free, which requires it to depend
|
| 47 |
+
// on a template parameter
|
| 48 |
+
template<typename Tag>
|
| 49 |
+
void free_workaround(Tag t, pointer<void> ptr)
|
| 50 |
+
{
|
| 51 |
+
free(t, ptr.get());
|
| 52 |
+
} // end free_workaround()
|
| 53 |
+
|
| 54 |
+
} // end detail
|
| 55 |
+
|
| 56 |
+
inline pointer<void> malloc(std::size_t n)
|
| 57 |
+
{
|
| 58 |
+
// XXX this is how we'd like to implement this function,
|
| 59 |
+
// if not for circular #inclusion problems:
|
| 60 |
+
//
|
| 61 |
+
// return pointer<void>(thrust::system::cpp::malloc(n))
|
| 62 |
+
//
|
| 63 |
+
return detail::malloc_workaround(cpp::tag(), n);
|
| 64 |
+
} // end malloc()
|
| 65 |
+
|
| 66 |
+
template<typename T>
|
| 67 |
+
pointer<T> malloc(std::size_t n)
|
| 68 |
+
{
|
| 69 |
+
pointer<void> raw_ptr = thrust::system::omp::malloc(sizeof(T) * n);
|
| 70 |
+
return pointer<T>(reinterpret_cast<T*>(raw_ptr.get()));
|
| 71 |
+
} // end malloc()
|
| 72 |
+
|
| 73 |
+
inline void free(pointer<void> ptr)
|
| 74 |
+
{
|
| 75 |
+
// XXX this is how we'd like to implement this function,
|
| 76 |
+
// if not for circular #inclusion problems:
|
| 77 |
+
//
|
| 78 |
+
// thrust::system::cpp::free(ptr)
|
| 79 |
+
//
|
| 80 |
+
detail::free_workaround(cpp::tag(), ptr);
|
| 81 |
+
} // end free()
|
| 82 |
+
|
| 83 |
+
} // end omp
|
| 84 |
+
} // end system
|
| 85 |
+
THRUST_NAMESPACE_END
|
| 86 |
+
|
videochat2/lib/python3.10/site-packages/tensorflow/include/external/local_config_cuda/cuda/cuda/include/thrust/system/omp/detail/mismatch.h
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
* Copyright 2008-2013 NVIDIA Corporation
|
| 3 |
+
*
|
| 4 |
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
| 5 |
+
* you may not use this file except in compliance with the License.
|
| 6 |
+
* You may obtain a copy of the License at
|
| 7 |
+
*
|
| 8 |
+
* http://www.apache.org/licenses/LICENSE-2.0
|
| 9 |
+
*
|
| 10 |
+
* Unless required by applicable law or agreed to in writing, software
|
| 11 |
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
| 12 |
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
| 13 |
+
* See the License for the specific language governing permissions and
|
| 14 |
+
* limitations under the License.
|
| 15 |
+
*/
|
| 16 |
+
|
| 17 |
+
#pragma once
|
| 18 |
+
|
| 19 |
+
#include <thrust/detail/config.h>
|
| 20 |
+
|
| 21 |
+
// this system inherits mismatch
|
| 22 |
+
#include <thrust/system/cpp/detail/mismatch.h>
|
| 23 |
+
|
videochat2/lib/python3.10/site-packages/tensorflow/include/external/local_config_cuda/cuda/cuda/include/thrust/system/omp/detail/par.h
ADDED
|
@@ -0,0 +1,61 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
* Copyright 2008-2018 NVIDIA Corporation
|
| 3 |
+
*
|
| 4 |
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
| 5 |
+
* you may not use this file except in compliance with the License.
|
| 6 |
+
* You may obtain a copy of the License at
|
| 7 |
+
*
|
| 8 |
+
* http://www.apache.org/licenses/LICENSE-2.0
|
| 9 |
+
*
|
| 10 |
+
* Unless required by applicable law or agreed to in writing, software
|
| 11 |
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
| 12 |
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
| 13 |
+
* See the License for the specific language governing permissions and
|
| 14 |
+
* limitations under the License.
|
| 15 |
+
*/
|
| 16 |
+
|
| 17 |
+
#pragma once
|
| 18 |
+
|
| 19 |
+
#include <thrust/detail/config.h>
|
| 20 |
+
#include <thrust/detail/allocator_aware_execution_policy.h>
|
| 21 |
+
#include <thrust/system/omp/detail/execution_policy.h>
|
| 22 |
+
|
| 23 |
+
THRUST_NAMESPACE_BEGIN
|
| 24 |
+
namespace system
|
| 25 |
+
{
|
| 26 |
+
namespace omp
|
| 27 |
+
{
|
| 28 |
+
namespace detail
|
| 29 |
+
{
|
| 30 |
+
|
| 31 |
+
|
| 32 |
+
struct par_t : thrust::system::omp::detail::execution_policy<par_t>,
|
| 33 |
+
thrust::detail::allocator_aware_execution_policy<
|
| 34 |
+
thrust::system::omp::detail::execution_policy>
|
| 35 |
+
{
|
| 36 |
+
__host__ __device__
|
| 37 |
+
constexpr par_t() : thrust::system::omp::detail::execution_policy<par_t>() {}
|
| 38 |
+
};
|
| 39 |
+
|
| 40 |
+
|
| 41 |
+
} // end detail
|
| 42 |
+
|
| 43 |
+
|
| 44 |
+
static const detail::par_t par;
|
| 45 |
+
|
| 46 |
+
|
| 47 |
+
} // end omp
|
| 48 |
+
} // end system
|
| 49 |
+
|
| 50 |
+
|
| 51 |
+
// alias par here
|
| 52 |
+
namespace omp
|
| 53 |
+
{
|
| 54 |
+
|
| 55 |
+
|
| 56 |
+
using thrust::system::omp::par;
|
| 57 |
+
|
| 58 |
+
|
| 59 |
+
} // end omp
|
| 60 |
+
THRUST_NAMESPACE_END
|
| 61 |
+
|
videochat2/lib/python3.10/site-packages/tensorflow/include/external/local_config_cuda/cuda/cuda/include/thrust/system/omp/detail/partition.h
ADDED
|
@@ -0,0 +1,90 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
* Copyright 2008-2013 NVIDIA Corporation
|
| 3 |
+
*
|
| 4 |
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
| 5 |
+
* you may not use this file except in compliance with the License.
|
| 6 |
+
* You may obtain a copy of the License at
|
| 7 |
+
*
|
| 8 |
+
* http://www.apache.org/licenses/LICENSE-2.0
|
| 9 |
+
*
|
| 10 |
+
* Unless required by applicable law or agreed to in writing, software
|
| 11 |
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
| 12 |
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
| 13 |
+
* See the License for the specific language governing permissions and
|
| 14 |
+
* limitations under the License.
|
| 15 |
+
*/
|
| 16 |
+
|
| 17 |
+
|
| 18 |
+
/*! \file reduce.h
|
| 19 |
+
* \brief OpenMP implementation of reduce algorithms.
|
| 20 |
+
*/
|
| 21 |
+
|
| 22 |
+
#pragma once
|
| 23 |
+
|
| 24 |
+
#include <thrust/detail/config.h>
|
| 25 |
+
#include <thrust/system/omp/detail/execution_policy.h>
|
| 26 |
+
#include <thrust/pair.h>
|
| 27 |
+
|
| 28 |
+
THRUST_NAMESPACE_BEGIN
|
| 29 |
+
namespace system
|
| 30 |
+
{
|
| 31 |
+
namespace omp
|
| 32 |
+
{
|
| 33 |
+
namespace detail
|
| 34 |
+
{
|
| 35 |
+
|
| 36 |
+
|
| 37 |
+
template<typename DerivedPolicy,
|
| 38 |
+
typename ForwardIterator,
|
| 39 |
+
typename Predicate>
|
| 40 |
+
ForwardIterator stable_partition(execution_policy<DerivedPolicy> &exec,
|
| 41 |
+
ForwardIterator first,
|
| 42 |
+
ForwardIterator last,
|
| 43 |
+
Predicate pred);
|
| 44 |
+
|
| 45 |
+
template<typename DerivedPolicy,
|
| 46 |
+
typename ForwardIterator,
|
| 47 |
+
typename InputIterator,
|
| 48 |
+
typename Predicate>
|
| 49 |
+
ForwardIterator stable_partition(execution_policy<DerivedPolicy> &exec,
|
| 50 |
+
ForwardIterator first,
|
| 51 |
+
ForwardIterator last,
|
| 52 |
+
InputIterator stencil,
|
| 53 |
+
Predicate pred);
|
| 54 |
+
|
| 55 |
+
template<typename DerivedPolicy,
|
| 56 |
+
typename InputIterator,
|
| 57 |
+
typename OutputIterator1,
|
| 58 |
+
typename OutputIterator2,
|
| 59 |
+
typename Predicate>
|
| 60 |
+
thrust::pair<OutputIterator1,OutputIterator2>
|
| 61 |
+
stable_partition_copy(execution_policy<DerivedPolicy> &exec,
|
| 62 |
+
InputIterator first,
|
| 63 |
+
InputIterator last,
|
| 64 |
+
OutputIterator1 out_true,
|
| 65 |
+
OutputIterator2 out_false,
|
| 66 |
+
Predicate pred);
|
| 67 |
+
|
| 68 |
+
template<typename DerivedPolicy,
|
| 69 |
+
typename InputIterator1,
|
| 70 |
+
typename InputIterator2,
|
| 71 |
+
typename OutputIterator1,
|
| 72 |
+
typename OutputIterator2,
|
| 73 |
+
typename Predicate>
|
| 74 |
+
thrust::pair<OutputIterator1,OutputIterator2>
|
| 75 |
+
stable_partition_copy(execution_policy<DerivedPolicy> &exec,
|
| 76 |
+
InputIterator1 first,
|
| 77 |
+
InputIterator1 last,
|
| 78 |
+
InputIterator2 stencil,
|
| 79 |
+
OutputIterator1 out_true,
|
| 80 |
+
OutputIterator2 out_false,
|
| 81 |
+
Predicate pred);
|
| 82 |
+
|
| 83 |
+
|
| 84 |
+
} // end namespace detail
|
| 85 |
+
} // end namespace omp
|
| 86 |
+
} // end namespace system
|
| 87 |
+
THRUST_NAMESPACE_END
|
| 88 |
+
|
| 89 |
+
#include <thrust/system/omp/detail/partition.inl>
|
| 90 |
+
|
videochat2/lib/python3.10/site-packages/tensorflow/include/external/local_config_cuda/cuda/cuda/include/thrust/system/omp/detail/partition.inl
ADDED
|
@@ -0,0 +1,107 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
* Copyright 2008-2013 NVIDIA Corporation
|
| 3 |
+
*
|
| 4 |
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
| 5 |
+
* you may not use this file except in compliance with the License.
|
| 6 |
+
* You may obtain a copy of the License at
|
| 7 |
+
*
|
| 8 |
+
* http://www.apache.org/licenses/LICENSE-2.0
|
| 9 |
+
*
|
| 10 |
+
* Unless required by applicable law or agreed to in writing, software
|
| 11 |
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
| 12 |
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
| 13 |
+
* See the License for the specific language governing permissions and
|
| 14 |
+
* limitations under the License.
|
| 15 |
+
*/
|
| 16 |
+
|
| 17 |
+
|
| 18 |
+
/*! \file reduce.h
|
| 19 |
+
* \brief OpenMP implementation of reduce algorithms.
|
| 20 |
+
*/
|
| 21 |
+
|
| 22 |
+
#pragma once
|
| 23 |
+
|
| 24 |
+
#include <thrust/detail/config.h>
|
| 25 |
+
#include <thrust/system/omp/detail/partition.h>
|
| 26 |
+
#include <thrust/system/detail/generic/partition.h>
|
| 27 |
+
|
| 28 |
+
THRUST_NAMESPACE_BEGIN
|
| 29 |
+
namespace system
|
| 30 |
+
{
|
| 31 |
+
namespace omp
|
| 32 |
+
{
|
| 33 |
+
namespace detail
|
| 34 |
+
{
|
| 35 |
+
|
| 36 |
+
|
| 37 |
+
template<typename DerivedPolicy,
|
| 38 |
+
typename ForwardIterator,
|
| 39 |
+
typename Predicate>
|
| 40 |
+
ForwardIterator stable_partition(execution_policy<DerivedPolicy> &exec,
|
| 41 |
+
ForwardIterator first,
|
| 42 |
+
ForwardIterator last,
|
| 43 |
+
Predicate pred)
|
| 44 |
+
{
|
| 45 |
+
// omp prefers generic::stable_partition to cpp::stable_partition
|
| 46 |
+
return thrust::system::detail::generic::stable_partition(exec, first, last, pred);
|
| 47 |
+
} // end stable_partition()
|
| 48 |
+
|
| 49 |
+
|
| 50 |
+
template<typename DerivedPolicy,
|
| 51 |
+
typename ForwardIterator,
|
| 52 |
+
typename InputIterator,
|
| 53 |
+
typename Predicate>
|
| 54 |
+
ForwardIterator stable_partition(execution_policy<DerivedPolicy> &exec,
|
| 55 |
+
ForwardIterator first,
|
| 56 |
+
ForwardIterator last,
|
| 57 |
+
InputIterator stencil,
|
| 58 |
+
Predicate pred)
|
| 59 |
+
{
|
| 60 |
+
// omp prefers generic::stable_partition to cpp::stable_partition
|
| 61 |
+
return thrust::system::detail::generic::stable_partition(exec, first, last, stencil, pred);
|
| 62 |
+
} // end stable_partition()
|
| 63 |
+
|
| 64 |
+
|
| 65 |
+
template<typename DerivedPolicy,
|
| 66 |
+
typename InputIterator,
|
| 67 |
+
typename OutputIterator1,
|
| 68 |
+
typename OutputIterator2,
|
| 69 |
+
typename Predicate>
|
| 70 |
+
thrust::pair<OutputIterator1,OutputIterator2>
|
| 71 |
+
stable_partition_copy(execution_policy<DerivedPolicy> &exec,
|
| 72 |
+
InputIterator first,
|
| 73 |
+
InputIterator last,
|
| 74 |
+
OutputIterator1 out_true,
|
| 75 |
+
OutputIterator2 out_false,
|
| 76 |
+
Predicate pred)
|
| 77 |
+
{
|
| 78 |
+
// omp prefers generic::stable_partition_copy to cpp::stable_partition_copy
|
| 79 |
+
return thrust::system::detail::generic::stable_partition_copy(exec, first, last, out_true, out_false, pred);
|
| 80 |
+
} // end stable_partition_copy()
|
| 81 |
+
|
| 82 |
+
|
| 83 |
+
template<typename DerivedPolicy,
|
| 84 |
+
typename InputIterator1,
|
| 85 |
+
typename InputIterator2,
|
| 86 |
+
typename OutputIterator1,
|
| 87 |
+
typename OutputIterator2,
|
| 88 |
+
typename Predicate>
|
| 89 |
+
thrust::pair<OutputIterator1,OutputIterator2>
|
| 90 |
+
stable_partition_copy(execution_policy<DerivedPolicy> &exec,
|
| 91 |
+
InputIterator1 first,
|
| 92 |
+
InputIterator1 last,
|
| 93 |
+
InputIterator2 stencil,
|
| 94 |
+
OutputIterator1 out_true,
|
| 95 |
+
OutputIterator2 out_false,
|
| 96 |
+
Predicate pred)
|
| 97 |
+
{
|
| 98 |
+
// omp prefers generic::stable_partition_copy to cpp::stable_partition_copy
|
| 99 |
+
return thrust::system::detail::generic::stable_partition_copy(exec, first, last, stencil, out_true, out_false, pred);
|
| 100 |
+
} // end stable_partition_copy()
|
| 101 |
+
|
| 102 |
+
|
| 103 |
+
} // end namespace detail
|
| 104 |
+
} // end namespace omp
|
| 105 |
+
} // end namespace system
|
| 106 |
+
THRUST_NAMESPACE_END
|
| 107 |
+
|
videochat2/lib/python3.10/site-packages/tensorflow/include/external/local_config_cuda/cuda/cuda/include/thrust/system/omp/detail/pragma_omp.h
ADDED
|
@@ -0,0 +1,56 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/******************************************************************************
|
| 2 |
+
* Copyright (c) 2021, NVIDIA CORPORATION. All rights reserved.
|
| 3 |
+
*
|
| 4 |
+
* Redistribution and use in source and binary forms, with or without
|
| 5 |
+
* modification, are permitted provided that the following conditions are met:
|
| 6 |
+
* * Redistributions of source code must retain the above copyright
|
| 7 |
+
* notice, this list of conditions and the following disclaimer.
|
| 8 |
+
* * Redistributions in binary form must reproduce the above copyright
|
| 9 |
+
* notice, this list of conditions and the following disclaimer in the
|
| 10 |
+
* documentation and/or other materials provided with the distribution.
|
| 11 |
+
* * Neither the name of the NVIDIA CORPORATION nor the
|
| 12 |
+
* names of its contributors may be used to endorse or promote products
|
| 13 |
+
* derived from this software without specific prior written permission.
|
| 14 |
+
*
|
| 15 |
+
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
| 16 |
+
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
| 17 |
+
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
| 18 |
+
* ARE DISCLAIMED. IN NO EVENT SHALL NVIDIA CORPORATION BE LIABLE FOR ANY
|
| 19 |
+
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
| 20 |
+
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
| 21 |
+
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
| 22 |
+
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
| 23 |
+
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
| 24 |
+
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
| 25 |
+
*
|
| 26 |
+
******************************************************************************/
|
| 27 |
+
|
| 28 |
+
#pragma once
|
| 29 |
+
|
| 30 |
+
#include <thrust/detail/config.h>
|
| 31 |
+
|
| 32 |
+
#if THRUST_HOST_COMPILER == THRUST_HOST_COMPILER_MSVC
|
| 33 |
+
// MSVC ICEs when using the standard C++11 `_Pragma` operator with OpenMP
|
| 34 |
+
// directives.
|
| 35 |
+
// WAR this by using the MSVC-extension `__pragma`. See this link for more info:
|
| 36 |
+
// https://developercommunity.visualstudio.com/t/Using-C11s-_Pragma-with-OpenMP-dire/1590628
|
| 37 |
+
#define THRUST_PRAGMA_OMP_IMPL(directive) __pragma(directive)
|
| 38 |
+
#else // Not MSVC:
|
| 39 |
+
#define THRUST_PRAGMA_OMP_IMPL(directive) _Pragma(#directive)
|
| 40 |
+
#endif
|
| 41 |
+
|
| 42 |
+
// For internal use only -- THRUST_PRAGMA_OMP is used to switch between
|
| 43 |
+
// different flavors of openmp pragmas. Pragmas are not emitted when OpenMP is
|
| 44 |
+
// not available.
|
| 45 |
+
//
|
| 46 |
+
// Usage:
|
| 47 |
+
// Replace: #pragma omp parallel for
|
| 48 |
+
// With : THRUST_PRAGMA_OMP(parallel for)
|
| 49 |
+
//
|
| 50 |
+
#if defined(_NVHPC_STDPAR_OPENMP) && _NVHPC_STDPAR_OPENMP == 1
|
| 51 |
+
#define THRUST_PRAGMA_OMP(directive) THRUST_PRAGMA_OMP_IMPL(omp_stdpar directive)
|
| 52 |
+
#elif defined(_OPENMP)
|
| 53 |
+
#define THRUST_PRAGMA_OMP(directive) THRUST_PRAGMA_OMP_IMPL(omp directive)
|
| 54 |
+
#else
|
| 55 |
+
#define THRUST_PRAGMA_OMP(directive)
|
| 56 |
+
#endif
|
videochat2/lib/python3.10/site-packages/tensorflow/include/external/local_config_cuda/cuda/cuda/include/thrust/system/omp/detail/reduce.inl
ADDED
|
@@ -0,0 +1,73 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
* Copyright 2008-2013 NVIDIA Corporation
|
| 3 |
+
*
|
| 4 |
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
| 5 |
+
* you may not use this file except in compliance with the License.
|
| 6 |
+
* You may obtain a copy of the License at
|
| 7 |
+
*
|
| 8 |
+
* http://www.apache.org/licenses/LICENSE-2.0
|
| 9 |
+
*
|
| 10 |
+
* Unless required by applicable law or agreed to in writing, software
|
| 11 |
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
| 12 |
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
| 13 |
+
* See the License for the specific language governing permissions and
|
| 14 |
+
* limitations under the License.
|
| 15 |
+
*/
|
| 16 |
+
|
| 17 |
+
#pragma once
|
| 18 |
+
|
| 19 |
+
#include <thrust/detail/config.h>
|
| 20 |
+
#include <thrust/iterator/iterator_traits.h>
|
| 21 |
+
#include <thrust/system/omp/detail/reduce.h>
|
| 22 |
+
#include <thrust/system/omp/detail/default_decomposition.h>
|
| 23 |
+
#include <thrust/system/omp/detail/reduce_intervals.h>
|
| 24 |
+
|
| 25 |
+
THRUST_NAMESPACE_BEGIN
|
| 26 |
+
namespace system
|
| 27 |
+
{
|
| 28 |
+
namespace omp
|
| 29 |
+
{
|
| 30 |
+
namespace detail
|
| 31 |
+
{
|
| 32 |
+
|
| 33 |
+
|
| 34 |
+
template<typename DerivedPolicy,
|
| 35 |
+
typename InputIterator,
|
| 36 |
+
typename OutputType,
|
| 37 |
+
typename BinaryFunction>
|
| 38 |
+
OutputType reduce(execution_policy<DerivedPolicy> &exec,
|
| 39 |
+
InputIterator first,
|
| 40 |
+
InputIterator last,
|
| 41 |
+
OutputType init,
|
| 42 |
+
BinaryFunction binary_op)
|
| 43 |
+
{
|
| 44 |
+
typedef typename thrust::iterator_difference<InputIterator>::type difference_type;
|
| 45 |
+
|
| 46 |
+
const difference_type n = thrust::distance(first,last);
|
| 47 |
+
|
| 48 |
+
// determine first and second level decomposition
|
| 49 |
+
thrust::system::detail::internal::uniform_decomposition<difference_type> decomp1 = thrust::system::omp::detail::default_decomposition(n);
|
| 50 |
+
thrust::system::detail::internal::uniform_decomposition<difference_type> decomp2(decomp1.size() + 1, 1, 1);
|
| 51 |
+
|
| 52 |
+
// allocate storage for the initializer and partial sums
|
| 53 |
+
// XXX use select_system for Tag
|
| 54 |
+
thrust::detail::temporary_array<OutputType,DerivedPolicy> partial_sums(exec, decomp1.size() + 1);
|
| 55 |
+
|
| 56 |
+
// set first element of temp array to init
|
| 57 |
+
partial_sums[0] = init;
|
| 58 |
+
|
| 59 |
+
// accumulate partial sums (first level reduction)
|
| 60 |
+
thrust::system::omp::detail::reduce_intervals(exec, first, partial_sums.begin() + 1, binary_op, decomp1);
|
| 61 |
+
|
| 62 |
+
// reduce partial sums (second level reduction)
|
| 63 |
+
thrust::system::omp::detail::reduce_intervals(exec, partial_sums.begin(), partial_sums.begin(), binary_op, decomp2);
|
| 64 |
+
|
| 65 |
+
return partial_sums[0];
|
| 66 |
+
} // end reduce()
|
| 67 |
+
|
| 68 |
+
|
| 69 |
+
} // end detail
|
| 70 |
+
} // end omp
|
| 71 |
+
} // end system
|
| 72 |
+
THRUST_NAMESPACE_END
|
| 73 |
+
|
videochat2/lib/python3.10/site-packages/tensorflow/include/external/local_config_cuda/cuda/cuda/include/thrust/system/omp/detail/reduce_by_key.h
ADDED
|
@@ -0,0 +1,60 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
* Copyright 2008-2013 NVIDIA Corporation
|
| 3 |
+
*
|
| 4 |
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
| 5 |
+
* you may not use this file except in compliance with the License.
|
| 6 |
+
* You may obtain a copy of the License at
|
| 7 |
+
*
|
| 8 |
+
* http://www.apache.org/licenses/LICENSE-2.0
|
| 9 |
+
*
|
| 10 |
+
* Unless required by applicable law or agreed to in writing, software
|
| 11 |
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
| 12 |
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
| 13 |
+
* See the License for the specific language governing permissions and
|
| 14 |
+
* limitations under the License.
|
| 15 |
+
*/
|
| 16 |
+
|
| 17 |
+
|
| 18 |
+
/*! \file reduce.h
|
| 19 |
+
* \brief OpenMP implementation of reduce algorithms.
|
| 20 |
+
*/
|
| 21 |
+
|
| 22 |
+
#pragma once
|
| 23 |
+
|
| 24 |
+
#include <thrust/detail/config.h>
|
| 25 |
+
#include <thrust/system/omp/detail/execution_policy.h>
|
| 26 |
+
|
| 27 |
+
THRUST_NAMESPACE_BEGIN
|
| 28 |
+
namespace system
|
| 29 |
+
{
|
| 30 |
+
namespace omp
|
| 31 |
+
{
|
| 32 |
+
namespace detail
|
| 33 |
+
{
|
| 34 |
+
|
| 35 |
+
|
| 36 |
+
template <typename DerivedPolicy,
|
| 37 |
+
typename InputIterator1,
|
| 38 |
+
typename InputIterator2,
|
| 39 |
+
typename OutputIterator1,
|
| 40 |
+
typename OutputIterator2,
|
| 41 |
+
typename BinaryPredicate,
|
| 42 |
+
typename BinaryFunction>
|
| 43 |
+
thrust::pair<OutputIterator1,OutputIterator2>
|
| 44 |
+
reduce_by_key(execution_policy<DerivedPolicy> &exec,
|
| 45 |
+
InputIterator1 keys_first,
|
| 46 |
+
InputIterator1 keys_last,
|
| 47 |
+
InputIterator2 values_first,
|
| 48 |
+
OutputIterator1 keys_output,
|
| 49 |
+
OutputIterator2 values_output,
|
| 50 |
+
BinaryPredicate binary_pred,
|
| 51 |
+
BinaryFunction binary_op);
|
| 52 |
+
|
| 53 |
+
|
| 54 |
+
} // end namespace detail
|
| 55 |
+
} // end namespace omp
|
| 56 |
+
} // end namespace system
|
| 57 |
+
THRUST_NAMESPACE_END
|
| 58 |
+
|
| 59 |
+
#include <thrust/system/omp/detail/reduce_by_key.inl>
|
| 60 |
+
|