/* * Copyright 2008-2012 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 detail { template class tagged_allocator; template class tagged_allocator { public: typedef void value_type; typedef typename thrust::detail::pointer_traits::template rebind::other pointer; typedef typename thrust::detail::pointer_traits::template rebind::other const_pointer; typedef std::size_t size_type; typedef typename thrust::detail::pointer_traits::difference_type difference_type; typedef Tag system_type; template struct rebind { typedef tagged_allocator other; }; // end rebind }; template class tagged_allocator { public: typedef T value_type; typedef typename thrust::detail::pointer_traits::template rebind::other pointer; typedef typename thrust::detail::pointer_traits::template rebind::other const_pointer; typedef typename thrust::iterator_reference::type reference; typedef typename thrust::iterator_reference::type const_reference; typedef std::size_t size_type; typedef typename thrust::detail::pointer_traits::difference_type difference_type; typedef Tag system_type; template struct rebind { typedef tagged_allocator other; }; // end rebind __host__ __device__ inline tagged_allocator(); __host__ __device__ inline tagged_allocator(const tagged_allocator &); template __host__ __device__ inline tagged_allocator(const tagged_allocator &); __host__ __device__ inline ~tagged_allocator(); __host__ __device__ pointer address(reference x) const; __host__ __device__ const_pointer address(const_reference x) const; size_type max_size() const; }; template __host__ __device__ bool operator==(const tagged_allocator &, const tagged_allocator &); template __host__ __device__ bool operator!=(const tagged_allocator &, const tagged_allocator &); } // end detail } // end thrust #include