10#ifndef MPL_SEQUENCE_HPP
11#define MPL_SEQUENCE_HPP
13#include <boost/mpl/int.hpp>
14#include <boost/mpl/reverse.hpp>
27template<
int c,
int end>
28struct exit_impl_sq : boost::mpl::equal_to<boost::mpl::int_<c>,boost::mpl::int_<end>>
39template<
int c ,
int end,
bool exit,
int ... vars>
43 typedef typename to_variadic_impl<c+1,end,exit_::value,vars ..., c>::type type;
48template<
int c,
int end,
int ... vars>
68template<
unsigned int N,
unsigned int M>
75 typedef typename to_variadic_impl<N+1,M,exit_::value,N>::type
type;
89template<
int c ,
int end,
int ele,
bool exit,
int ... vars>
98template<
int c,
int end,
int ele,
int ... vars>
101 typedef boost::mpl::vector<boost::mpl::int_<vars> ...> type;
117template<
unsigned int N,
unsigned int M>
124 typedef typename to_variadic_const_impl<1,N,M,exit_::value,M>::type
type;
129template<
typename b
int,
unsigned int ele>
134template<
int op1,
unsigned int ele>
137 typedef boost::mpl::int_<op1+ele> type;
140template<
unsigned int ele>
143 typedef boost::mpl::na type;
147template <
unsigned int ele,
typename ... vmpl>
151 typedef boost::mpl::vector<typename sum_ele<vmpl,ele>::type ...>
type;
154template <
unsigned int ele,
typename vmpl>
170template <
unsigned int ele,
typename ... vars>
174 typedef boost::mpl::vector<typename sum_ele<vars,ele>::type ...>
type;
181template<
int c,
int accu,
int stop,
typename vmpl,
bool exit>
185 typedef typename boost::mpl::at<vmpl,boost::mpl::int_<c>>::type
ele;
186 typedef typename vmpl_reduce_prod_impl<c+1,accu*ele::value,stop,vmpl,exit_::value>::type type;
191template<
int c,
int accu,
int stop,
typename vmpl>
194 typedef boost::mpl::int_<accu> type;
198template<
typename vmpl>
204template<
typename vmpl,
int stop>
207 typedef typename vmpl_reduce_prod_impl<0,1,stop,vmpl,false>::type type;
210template<
typename vmpl>
213 typedef typename boost::mpl::int_<1> type;
217template<
typename vmpl,
typename a> __device__ __host__
inline unsigned int Lin_vmpl(a v)
227template<
typename vmpl,
typename a,
typename ...lT>
228__device__ __host__
inline unsigned int Lin_vmpl(a v,lT...t)
230 return v*
vmpl_reduce_prod_stop<vmpl,(
int)vmpl::size::value - (
int)
sizeof...(t) - 2>::type::value + Lin_vmpl<vmpl>(t...);
234template<
typename vmpl,
typename vmpl_off,
typename a> __device__ __host__
inline unsigned int Lin_vmpl_off(a v)
236 return (v + boost::mpl::at<vmpl_off,boost::mpl::int_< ((
int)vmpl::size::value) - 1 > >::type::value )*
vmpl_reduce_prod_stop<vmpl,(
int)vmpl::size::value - 2>::type::value;
244template<
typename vmpl,
typename vmpl_off,
typename a,
typename ...lT>
245__device__ __host__
inline unsigned int Lin_vmpl_off(a v,lT...t)
247 return (v + boost::mpl::at<vmpl_off,boost::mpl::int_<((
int)vmpl::size::value) - (
int)
sizeof...(t) - 1> >::type::value)*
vmpl_reduce_prod_stop<vmpl,(
int)((
int)vmpl::size::value -
sizeof...(t) - 2)>::type::value + Lin_vmpl_off<vmpl,vmpl_off>(t...);
KeyT const ValueT ValueT OffsetIteratorT OffsetIteratorT int
[in] The number of segments that comprise the sorting data
exit_impl_sq< N, M >::type exit_
end condition
to_variadic_impl< N+1, M, exit_::value, N >::type type
generate the boost::fusion::vector apply H on each term
Recursive specialization of to_variadic.
Recursive specialization of to_variadic.
to_variadic_const_impl< 1, N, M, exit_::value, M >::type type
generate the boost::fusion::vector apply H on each term
exit_impl_sq< N, M >::type exit_
end condition
boost::mpl::vector< typename sum_ele< vars, ele >::type ... > type
construct an mpl vector from the variadic
boost::mpl::vector< typename sum_ele< vmpl, ele >::type ... > type
construct an mpl vector from the variadic