From d7da208fa34ae3093d3f59a1658a1c0a93b03d24 Mon Sep 17 00:00:00 2001 From: mfrancis95 Date: Sat, 4 Jul 2020 16:56:08 -0400 Subject: [PATCH] Replace allocator and vector classes with alias templates Delete /detail/vector.inl files since they are no longer needed. Files affected: - thrust/system/cpp/memory.h - thrust/system/cpp/vector.h - thrust/system/cuda/memory.h - thrust/system/cuda/vector.h - thrust/system/omp/memory.h - thrust/system/omp/vector.h - thrust/system/tbb/memory.h - thrust/system/tbb/vector.h --- thrust/system/cpp/memory.h | 59 +------------ thrust/system/cpp/vector.h | 103 +--------------------- thrust/system/cuda/detail/vector.inl | 122 -------------------------- thrust/system/cuda/memory.h | 58 +----------- thrust/system/cuda/vector.h | 102 +--------------------- thrust/system/omp/detail/vector.inl | 126 --------------------------- thrust/system/omp/memory.h | 60 +------------ thrust/system/omp/vector.h | 102 +--------------------- thrust/system/tbb/detail/vector.inl | 126 --------------------------- thrust/system/tbb/memory.h | 56 +----------- thrust/system/tbb/vector.h | 102 +--------------------- 11 files changed, 9 insertions(+), 1007 deletions(-) delete mode 100644 thrust/system/cuda/detail/vector.inl delete mode 100644 thrust/system/omp/detail/vector.inl delete mode 100644 thrust/system/tbb/detail/vector.inl diff --git a/thrust/system/cpp/memory.h b/thrust/system/cpp/memory.h index 8f6fa2969..18b31e758 100644 --- a/thrust/system/cpp/memory.h +++ b/thrust/system/cpp/memory.h @@ -66,72 +66,15 @@ inline pointer malloc(std::size_t n); */ inline void free(pointer ptr); -// XXX upon c++11 -// template -// using allocator = thrust::mr::stateless_resource_allocator; - /*! \p cpp::allocator is the default allocator used by the \p cpp system's containers such as * cpp::vector if no user-specified allocator is provided. \p cpp::allocator allocates * (deallocates) storage with \p cpp::malloc (\p cpp::free). */ template - struct allocator - : thrust::mr::stateless_resource_allocator< - T, - memory_resource - > -{ -private: - typedef thrust::mr::stateless_resource_allocator< - T, - memory_resource - > base; - -public: - /*! The \p rebind metafunction provides the type of an \p allocator - * instantiated with another type. - * - * \tparam U The other type to use for instantiation. - */ - template - struct rebind - { - /*! The typedef \p other gives the type of the rebound \p allocator. - */ - typedef allocator other; - }; - - /*! No-argument constructor has no effect. - */ - __host__ __device__ - inline allocator() {} - - /*! Copy constructor has no effect. - */ - __host__ __device__ - inline allocator(const allocator & other) : base(other) {} - - /*! Constructor from other \p allocator has no effect. - */ - template - __host__ __device__ - inline allocator(const allocator & other) : base(other) {} - -#if THRUST_CPP_DIALECT >= 2011 - allocator & operator=(const allocator &) = default; -#endif - - /*! Destructor has no effect. - */ - __host__ __device__ - inline ~allocator() {} -}; // end allocator +using allocator = thrust::mr::stateless_resource_allocator; } // end cpp -/*! \} - */ - } // end system /*! \namespace thrust::cpp diff --git a/thrust/system/cpp/vector.h b/thrust/system/cpp/vector.h index 9aeb7206b..ee5cfce6a 100644 --- a/thrust/system/cpp/vector.h +++ b/thrust/system/cpp/vector.h @@ -37,9 +37,6 @@ namespace system namespace cpp { -// XXX upon c++11 -// template > using vector = thrust::detail::vector_base; - /*! \p cpp::vector is a container that supports random access to elements, * constant time removal of elements at the end, and linear time insertion * and removal of elements at the beginning or in the middle. The number of @@ -56,102 +53,7 @@ namespace cpp * \see device_vector */ template > - class vector - : public thrust::detail::vector_base -{ - /*! \cond - */ - private: - typedef thrust::detail::vector_base super_t; - /*! \endcond - */ - - public: - - /*! \cond - */ - typedef typename super_t::size_type size_type; - typedef typename super_t::value_type value_type; - - /*! \endcond - */ - - /*! This constructor creates an empty \p cpp::vector. - */ - vector(); - - /*! This constructor creates a \p cpp::vector with \p n default-constructed elements. - * \param n The size of the \p cpp::vector to create. - */ - explicit vector(size_type n); - - /*! This constructor creates a \p cpp::vector with \p n copies of \p value. - * \param n The size of the \p cpp::vector to create. - * \param value An element to copy. - */ - explicit vector(size_type n, const value_type &value); - - /*! Copy constructor copies from another \p cpp::vector. - * \param x The other \p cpp::vector to copy. - */ - vector(const vector &x); - - #if THRUST_CPP_DIALECT >= 2011 - /*! Move constructor moves from over another \p cpp::vector. - * \param x The other \p cpp::vector to move from. - */ - vector(vector &&x); - #endif - - /*! This constructor copies from another Thrust vector-like object. - * \param x The other object to copy from. - */ - template - vector(const thrust::detail::vector_base &x); - - /*! This constructor copies from a \c std::vector. - * \param x The \c std::vector to copy from. - */ - template - vector(const std::vector &x); - - /*! This constructor creates a \p cpp::vector by copying from a range. - * \param first The beginning of the range. - * \param last The end of the range. - */ - template - vector(InputIterator first, InputIterator last); - - // XXX vector_base should take a Derived type so we don't have to define these superfluous assigns - - /*! Assignment operator assigns from another \p cpp::vector. - * \param x The other object to assign from. - * \return *this - */ - vector &operator=(const vector &x); - - #if THRUST_CPP_DIALECT >= 2011 - /*! Move assignment operator moves from another \p cpp::vector. - * \param x The other \p cpp::vector to move from. - * \return *this - */ - vector &operator=(vector &&x); - #endif - - /*! Assignment operator assigns from a \c std::vector. - * \param x The \c std::vector to assign from. - * \return *this - */ - template - vector &operator=(const std::vector &x); - - /*! Assignment operator assigns from another Thrust vector-like object. - * \param x The other object to assign from. - * \return *this - */ - template - vector &operator=(const thrust::detail::vector_base &x); -}; // end vector +using vector = thrust::detail::vector_base; } // end cpp } // end system @@ -165,6 +67,3 @@ using thrust::system::cpp::vector; } // end cpp } // end thrust - -#include - diff --git a/thrust/system/cuda/detail/vector.inl b/thrust/system/cuda/detail/vector.inl deleted file mode 100644 index dfd4c89b5..000000000 --- a/thrust/system/cuda/detail/vector.inl +++ /dev/null @@ -1,122 +0,0 @@ -/* - * Copyright 2008-2013 NVIDIA Corporation - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in ccudaliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#pragma once - -#include -#include - -namespace thrust -{ -namespace cuda_cub -{ - -template - vector - ::vector() - : super_t() -{} - -template - vector - ::vector(size_type n) - : super_t(n) -{} - -template - vector - ::vector(size_type n, const value_type &value) - : super_t(n,value) -{} - -template - vector - ::vector(const vector &x) - : super_t(x) -{} - -#if THRUST_CPP_DIALECT >= 2011 - template - vector - ::vector(vector &&x) - : super_t(std::move(x)) - {} -#endif - -template - template - vector - ::vector(const thrust::detail::vector_base &x) - : super_t(x) -{} - -template - template - vector - ::vector(const std::vector &x) - : super_t(x) -{} - -template - template - vector - ::vector(InputIterator first, InputIterator last) - : super_t(first,last) -{} - -template - vector & - vector - ::operator=(const vector &x) -{ - super_t::operator=(x); - return *this; -} - -#if THRUST_CPP_DIALECT >= 2011 - template - vector & - vector - ::operator=(vector &&x) - { - super_t::operator=(std::move(x)); - return *this; - } -#endif - -template - template - vector & - vector - ::operator=(const std::vector &x) -{ - super_t::operator=(x); - return *this; -} - -template - template - vector & - vector - ::operator=(const thrust::detail::vector_base &x) -{ - super_t::operator=(x); - return *this; -} - -} // end cuda_cub -} // end thrust - diff --git a/thrust/system/cuda/memory.h b/thrust/system/cuda/memory.h index cd27e4da6..f20ce352a 100644 --- a/thrust/system/cuda/memory.h +++ b/thrust/system/cuda/memory.h @@ -64,66 +64,12 @@ inline __host__ __device__ pointer malloc(std::size_t n); */ inline __host__ __device__ void free(pointer ptr); -// XXX upon c++11 -// template -// using allocator = thrust::mr::stateless_resource_allocator; - /*! \p cuda::allocator is the default allocator used by the \p cuda system's containers such as * cuda::vector if no user-specified allocator is provided. \p cuda::allocator allocates * (deallocates) storage with \p cuda::malloc (\p cuda::free). */ -template -struct allocator - : thrust::mr::stateless_resource_allocator< - T, - system::cuda::memory_resource - > -{ -private: - typedef thrust::mr::stateless_resource_allocator< - T, - system::cuda::memory_resource - > base; - -public: - /*! The \p rebind metafunction provides the type of an \p allocator - * instantiated with another type. - * - * \tparam U The other type to use for instantiation. - */ - template - struct rebind - { - /*! The typedef \p other gives the type of the rebound \p allocator. - */ - typedef allocator other; - }; - - /*! No-argument constructor has no effect. - */ - __host__ - inline allocator() {} - - /*! Copy constructor has no effect. - */ - __host__ __device__ - inline allocator(const allocator & other) : base(other) {} - - /*! Constructor from other \p allocator has no effect. - */ - template - __host__ __device__ - inline allocator(const allocator & other) : base(other) {} - -#if THRUST_CPP_DIALECT >= 2011 - allocator & operator=(const allocator &) = default; -#endif - - /*! Destructor has no effect. - */ - __host__ __device__ - inline ~allocator() {} -}; // struct allocator +template +using allocator = thrust::mr::stateless_resource_allocator; } // namespace cuda_cub diff --git a/thrust/system/cuda/vector.h b/thrust/system/cuda/vector.h index 707f9ff7f..9348057a7 100644 --- a/thrust/system/cuda/vector.h +++ b/thrust/system/cuda/vector.h @@ -35,9 +35,6 @@ template class host_vector; namespace cuda_cub { -// XXX upon c++11 -// template > using vector = thrust::detail::vector_base; - /*! \p cuda_bulk::vector is a container that supports random access to elements, * constant time removal of elements at the end, and linear time insertion * and removal of elements at the beginning or in the middle. The number of @@ -54,101 +51,7 @@ namespace cuda_cub * \see device_vector */ template > - class vector - : public thrust::detail::vector_base -{ - /*! \cond - */ - private: - typedef thrust::detail::vector_base super_t; - /*! \endcond - */ - - public: - - /*! \cond - */ - typedef typename super_t::size_type size_type; - typedef typename super_t::value_type value_type; - /*! \endcond - */ - - /*! This constructor creates an empty \p cuda_bulk::vector. - */ - vector(); - - /*! This constructor creates a \p cuda_bulk::vector with \p n default-constructed elements. - * \param n The size of the \p cuda_bulk::vector to create. - */ - explicit vector(size_type n); - - /*! This constructor creates a \p cuda_bulk::vector with \p n copies of \p value. - * \param n The size of the \p cuda_bulk::vector to create. - * \param value An element to copy. - */ - explicit vector(size_type n, const value_type &value); - - /*! Copy constructor copies from another \p cuda_bulk::vector. - * \param x The other \p cuda_bulk::vector to copy. - */ - vector(const vector &x); - - #if THRUST_CPP_DIALECT >= 2011 - /*! Move constructor moves from over another \p cuda::vector. - * \param x The other \p cuda::vector to move from. - */ - vector(vector &&x); - #endif - - /*! This constructor copies from another Thrust vector-like object. - * \param x The other object to copy from. - */ - template - vector(const thrust::detail::vector_base &x); - - /*! This constructor copies from a \c std::vector. - * \param x The \c std::vector to copy from. - */ - template - vector(const std::vector &x); - - /*! This constructor creates a \p cuda_bulk::vector by copying from a range. - * \param first The beginning of the range. - * \param last The end of the range. - */ - template - vector(InputIterator first, InputIterator last); - - /*! Assignment operator assigns from another \p cuda::vector. - * \param x The other object to assign from. - * \return *this - */ - vector &operator=(const vector &x); - - #if THRUST_CPP_DIALECT >= 2011 - /*! Move assignment operator moves from another \p cuda::vector. - * \param x The other \p cuda::vector to move from. - * \return *this - */ - vector &operator=(vector &&x); - #endif - - // XXX vector_base should take a Derived type so we don't have to define these superfluous assigns - // - /*! Assignment operator assigns from a \c std::vector. - * \param x The \c std::vector to assign from. - * \return *this - */ - template - vector &operator=(const std::vector &x); - - /*! Assignment operator assigns from another Thrust vector-like object. - * \param x The other object to assign from. - * \return *this - */ - template - vector &operator=(const thrust::detail::vector_base &x); -}; // end vector +using vector = thrust::detail::vector_base; } // end cuda_cub @@ -167,6 +70,3 @@ using thrust::cuda_cub::vector; } } // end thrust - -#include - diff --git a/thrust/system/omp/detail/vector.inl b/thrust/system/omp/detail/vector.inl deleted file mode 100644 index 3e08615f8..000000000 --- a/thrust/system/omp/detail/vector.inl +++ /dev/null @@ -1,126 +0,0 @@ -/* - * Copyright 2008-2013 NVIDIA Corporation - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#pragma once - -#include -#include -#include - -namespace thrust -{ -namespace system -{ -namespace omp -{ - -template - vector - ::vector() - : super_t() -{} - -template - vector - ::vector(size_type n) - : super_t(n) -{} - -template - vector - ::vector(size_type n, const value_type &value) - : super_t(n,value) -{} - -template - vector - ::vector(const vector &x) - : super_t(x) -{} - -#if THRUST_CPP_DIALECT >= 2011 - template - vector - ::vector(vector &&x) - : super_t(std::move(x)) - {} -#endif - -template - template - vector - ::vector(const thrust::detail::vector_base &x) - : super_t(x) -{} - -template - template - vector - ::vector(const std::vector &x) - : super_t(x) -{} - -template - template - vector - ::vector(InputIterator first, InputIterator last) - : super_t(first,last) -{} - -template - vector & - vector - ::operator=(const vector &x) -{ - super_t::operator=(x); - return *this; -} - -#if THRUST_CPP_DIALECT >= 2011 - template - vector & - vector - ::operator=(vector &&x) - { - super_t::operator=(std::move(x)); - return *this; - } -#endif - -template - template - vector & - vector - ::operator=(const std::vector &x) -{ - super_t::operator=(x); - return *this; -} - -template - template - vector & - vector - ::operator=(const thrust::detail::vector_base &x) -{ - super_t::operator=(x); - return *this; -} - -} // end omp -} // end system -} // end thrust - diff --git a/thrust/system/omp/memory.h b/thrust/system/omp/memory.h index aa2bfd20c..9b2f070cc 100644 --- a/thrust/system/omp/memory.h +++ b/thrust/system/omp/memory.h @@ -67,72 +67,14 @@ inline pointer malloc(std::size_t n); */ inline void free(pointer ptr); -// XXX upon c++11 -// template -// using allocator = thrust::mr::stateless_resource_allocator; - /*! \p omp::allocator is the default allocator used by the \p omp system's containers such as * omp::vector if no user-specified allocator is provided. \p omp::allocator allocates * (deallocates) storage with \p omp::malloc (\p omp::free). */ template - struct allocator - : thrust::mr::stateless_resource_allocator< - T, - memory_resource - > -{ -private: - typedef thrust::mr::stateless_resource_allocator< - T, - memory_resource - > base; - -public: - /*! The \p rebind metafunction provides the type of an \p allocator - * instantiated with another type. - * - * \tparam U The other type to use for instantiation. - */ - template - struct rebind - { - /*! The typedef \p other gives the type of the rebound \p allocator. - */ - typedef allocator other; - }; - - /*! No-argument constructor has no effect. - */ - __host__ __device__ - inline allocator() {} - - /*! Copy constructor has no effect. - */ - __host__ __device__ - inline allocator(const allocator & other) : base(other) {} - - /*! Constructor from other \p allocator has no effect. - */ - template - __host__ __device__ - inline allocator(const allocator & other) : base(other) {} - -#if THRUST_CPP_DIALECT >= 2011 - allocator & operator=(const allocator &) = default; -#endif - - /*! Destructor has no effect. - */ - __host__ __device__ - inline ~allocator() {} -}; // end allocator +using allocator = thrust::mr::stateless_resource_allocator; } // end omp - -/*! \} - */ - } // end system /*! \namespace thrust::omp diff --git a/thrust/system/omp/vector.h b/thrust/system/omp/vector.h index 223ce4935..101a22c7b 100644 --- a/thrust/system/omp/vector.h +++ b/thrust/system/omp/vector.h @@ -38,9 +38,6 @@ namespace system namespace omp { -// XXX upon c++11 -// template > using vector = thrust::detail::vector_base; - /*! \p omp::vector is a container that supports random access to elements, * constant time removal of elements at the end, and linear time insertion * and removal of elements at the beginning or in the middle. The number of @@ -57,101 +54,7 @@ namespace omp * \see device_vector */ template > - class vector - : public thrust::detail::vector_base -{ - /*! \cond - */ - private: - typedef thrust::detail::vector_base super_t; - /*! \endcond - */ - - public: - - /*! \cond - */ - typedef typename super_t::size_type size_type; - typedef typename super_t::value_type value_type; - /*! \endcond - */ - - /*! This constructor creates an empty \p omp::vector. - */ - vector(); - - /*! This constructor creates a \p omp::vector with \p n default-constructed elements. - * \param n The size of the \p omp::vector to create. - */ - explicit vector(size_type n); - - /*! This constructor creates a \p omp::vector with \p n copies of \p value. - * \param n The size of the \p omp::vector to create. - * \param value An element to copy. - */ - explicit vector(size_type n, const value_type &value); - - /*! Copy constructor copies from another \p omp::vector. - * \param x The other \p omp::vector to copy. - */ - vector(const vector &x); - - #if THRUST_CPP_DIALECT >= 2011 - /*! Move constructor moves another \p omp::vector. - * \param x The other \p omp::vector to move from. - */ - vector(vector &&x); - #endif - - /*! This constructor copies from another Thrust vector-like object. - * \param x The other object to copy from. - */ - template - vector(const thrust::detail::vector_base &x); - - /*! This constructor copies from a \c std::vector. - * \param x The \c std::vector to copy from. - */ - template - vector(const std::vector &x); - - /*! This constructor creates an \p omp::vector by copying from a range. - * \param first The beginning of the range. - * \param last The end of the range. - */ - template - vector(InputIterator first, InputIterator last); - - // XXX vector_base should take a Derived type so we don't have to define these superfluous assigns - - /*! Copy assignment operator assigns from another \p omp::vector. - * \param x The other object to assign from. - * \return *this - */ - vector &operator=(const vector &x); - - #if THRUST_CPP_DIALECT >= 2011 - /*! Move assignment operator moves another \p omp::vector. - * \param x The other \p omp::vector to move. - * \return *this - */ - vector &operator=(vector &&x); - #endif - - /*! Assignment operator assigns from a \c std::vector. - * \param x The \c std::vector to assign from. - * \return *this - */ - template - vector &operator=(const std::vector &x); - - /*! Assignment operator assigns from another Thrust vector-like object. - * \param x The other object to assign from. - * \return *this - */ - template - vector &operator=(const thrust::detail::vector_base &x); -}; // end vector +using vector = thrust::detail::vector_base; } // end omp } // end system @@ -165,6 +68,3 @@ using thrust::system::omp::vector; } // end omp } // end thrust - -#include - diff --git a/thrust/system/tbb/detail/vector.inl b/thrust/system/tbb/detail/vector.inl deleted file mode 100644 index 5d9cb1c09..000000000 --- a/thrust/system/tbb/detail/vector.inl +++ /dev/null @@ -1,126 +0,0 @@ -/* - * Copyright 2008-2013 NVIDIA Corporation - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#pragma once - -#include -#include -#include - -namespace thrust -{ -namespace system -{ -namespace tbb -{ - -template - vector - ::vector() - : super_t() -{} - -template - vector - ::vector(size_type n) - : super_t(n) -{} - -template - vector - ::vector(size_type n, const value_type &value) - : super_t(n,value) -{} - -template - vector - ::vector(const vector &x) - : super_t(x) - {} - -#if THRUST_CPP_DIALECT >= 2011 - template - vector - ::vector(vector &&x) - : super_t(std::move(x)) - {} -#endif - -template - template - vector - ::vector(const thrust::detail::vector_base &x) - : super_t(x) -{} - -template - template - vector - ::vector(const std::vector &x) - : super_t(x) -{} - -template - template - vector - ::vector(InputIterator first, InputIterator last) - : super_t(first,last) -{} - -template - vector & - vector - ::operator=(const vector &x) -{ - super_t::operator=(x); - return *this; -} - -#if THRUST_CPP_DIALECT >= 2011 - template - vector & - vector - ::operator=(vector &&x) - { - super_t::operator=(std::move(x)); - return *this; - } -#endif - -template - template - vector & - vector - ::operator=(const std::vector &x) -{ - super_t::operator=(x); - return *this; -} - -template - template - vector & - vector - ::operator=(const thrust::detail::vector_base &x) -{ - super_t::operator=(x); - return *this; -} - -} // end tbb -} // end system -} // end thrust - diff --git a/thrust/system/tbb/memory.h b/thrust/system/tbb/memory.h index f110410b2..a68015700 100644 --- a/thrust/system/tbb/memory.h +++ b/thrust/system/tbb/memory.h @@ -67,66 +67,12 @@ inline pointer malloc(std::size_t n); */ inline void free(pointer ptr); -// XXX upon c++11 -// template -// using allocator = thrust::mr::stateless_resource_allocator; - /*! \p tbb::allocator is the default allocator used by the \p tbb system's containers such as * tbb::vector if no user-specified allocator is provided. \p tbb::allocator allocates * (deallocates) storage with \p tbb::malloc (\p tbb::free). */ template - struct allocator - : thrust::mr::stateless_resource_allocator< - T, - memory_resource - > -{ -private: - typedef thrust::mr::stateless_resource_allocator< - T, - memory_resource - > base; - -public: - /*! The \p rebind metafunction provides the type of an \p allocator - * instantiated with another type. - * - * \tparam U The other type to use for instantiation. - */ - template - struct rebind - { - /*! The typedef \p other gives the type of the rebound \p allocator. - */ - typedef allocator other; - }; - - /*! No-argument constructor has no effect. - */ - __host__ __device__ - inline allocator() {} - - /*! Copy constructor has no effect. - */ - __host__ __device__ - inline allocator(const allocator & other) : base(other) {} - - /*! Constructor from other \p allocator has no effect. - */ - template - __host__ __device__ - inline allocator(const allocator & other) : base(other) {} - -#if THRUST_CPP_DIALECT >= 2011 - allocator & operator=(const allocator &) = default; -#endif - - /*! Destructor has no effect. - */ - __host__ __device__ - inline ~allocator() {} -}; // end allocator +using allocator = thrust::mr::stateless_resource_allocator; } // end tbb diff --git a/thrust/system/tbb/vector.h b/thrust/system/tbb/vector.h index 9e12cdc09..0e08c8cf0 100644 --- a/thrust/system/tbb/vector.h +++ b/thrust/system/tbb/vector.h @@ -33,9 +33,6 @@ namespace system namespace tbb { -// XXX upon c++11 -// template > using vector = thrust::detail::vector_base; - /*! \p tbb::vector is a container that supports random access to elements, * constant time removal of elements at the end, and linear time insertion * and removal of elements at the beginning or in the middle. The number of @@ -52,101 +49,7 @@ namespace tbb * \see device_vector */ template > - class vector - : public thrust::detail::vector_base -{ - /*! \cond - */ - private: - typedef thrust::detail::vector_base super_t; - /*! \endcond - */ - - public: - - /*! \cond - */ - typedef typename super_t::size_type size_type; - typedef typename super_t::value_type value_type; - /*! \endcond - */ - - /*! This constructor creates an empty \p tbb::vector. - */ - vector(); - - /*! This constructor creates a \p tbb::vector with \p n default-constructed elements. - * \param n The size of the \p tbb::vector to create. - */ - explicit vector(size_type n); - - /*! This constructor creates a \p tbb::vector with \p n copies of \p value. - * \param n The size of the \p tbb::vector to create. - * \param value An element to copy. - */ - explicit vector(size_type n, const value_type &value); - - /*! Copy constructor copies from another \p tbb::vector. - * \param x The other \p tbb::vector to copy. - */ - vector(const vector &x); - - #if THRUST_CPP_DIALECT >= 2011 - /*! Move constructor use the move semantic over another \p tbb::vector. - * \param x The other \p tbb::vector to move from. - */ - vector(vector &&x); - #endif - - /*! This constructor copies from another Thrust vector-like object. - * \param x The other object to copy from. - */ - template - vector(const thrust::detail::vector_base &x); - - /*! This constructor copies from a \c std::vector. - * \param x The \c std::vector to copy from. - */ - template - vector(const std::vector &x); - - /*! This constructor creates a \p tbb::vector by copying from a range. - * \param first The beginning of the range. - * \param last The end of the range. - */ - template - vector(InputIterator first, InputIterator last); - - // XXX vector_base should take a Derived type so we don't have to define these superfluous assigns - - /*! Assignment operator assigns from another \p tbb::vector. - * \param x The other object to assign from. - * \return *this - */ - vector &operator=(const vector &x); - - #if THRUST_CPP_DIALECT >= 2011 - /*! Move assignment operator use move semantic over another \p tbb::vector. - * \param x The other \p tbb::vector to move from. - * \return *this - */ - vector &operator=(vector &&x); - #endif - - /*! Assignment operator assigns from a \c std::vector. - * \param x The \c std::vector to assign from. - * \return *this - */ - template - vector &operator=(const std::vector &x); - - /*! Assignment operator assigns from another Thrust vector-like object. - * \param x The other object to assign from. - * \return *this - */ - template - vector &operator=(const thrust::detail::vector_base &x); -}; // end vector +using vector = thrust::detail::vector_base; } // end tbb } // end system @@ -160,6 +63,3 @@ using thrust::system::tbb::vector; } // end tbb } // end thrust - -#include -