okami.mom/strata
git clone https://git.nkp.pet/okami.mom/strata
ad33b8074
main
1//==---- iterator_adaptor.h -----------------------*- C++ -*----------------==// 2// 3// Copyright (C) Intel Corporation 4// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 5// See https://llvm.org/LICENSE.txt for license information. 6// 7//===----------------------------------------------------------------------===// 8 9#ifndef __DPCT_ITERATOR_ADAPTOR_H__ 10#define __DPCT_ITERATOR_ADAPTOR_H__ 11 12#include <boost/iterator_adaptors.hpp> 13 14namespace dpct { 15 16typedef boost ::use_default use_default ; 17 18typedef boost ::iterator_core_access iterator_core_access ; 19 20template < class Derived ,class Base ,class Value = use_default , 21class Traversal = use_default ,class System = use_default , 22class Reference = use_default ,class Difference = use_default > 23class iterator_adaptor 24 :public boost ::iterator_adaptor < Derived ,Base ,Value ,Traversal ,Reference , 25Difference > { 26protected : 27typedef boost ::iterator_adaptor < Derived ,Base ,Value ,Traversal ,Reference , 28Difference > 29base_t ; 30 31// Note: System tag is not used to dispatch to any specific backend, this is 32// controlled explicitly by the user with execution policies. System tag 33// is kept for potential future extension by specialization based on 34// this part of the type definition. 35 36public : 37// It is the user's responsibility to ensure extra data is available on the 38// device if they want to use this iterator with device execution policies 39using is_passed_directly = ::std ::true_type ; 40using iterator_category = ::std ::random_access_iterator_tag ; 41 42iterator_adaptor () {} 43 44explicit iterator_adaptor (Base const & iter ) :base_t (iter ) {} 45 46typename base_t ::reference 47operator [](typename base_t ::difference_type n )const { 48return * (this -> derived ()+ n ); 49 } 50}; 51 52}// end namespace dpct 53 54#endif