31 #include <cugar/basic/types.h> 32 #include <cugar/basic/numbers.h> 34 #include <cugar/basic/vector.h> 36 #include <cugar/basic/cuda/arch.h> 37 #include <cugar/basic/cuda/timer.h> 38 #include <thrust/reduce.h> 39 #include <thrust/scan.h> 40 #include <thrust/copy.h> 41 #include <thrust/sort.h> 42 #include <thrust/binary_search.h> 43 #include <thrust/merge.h> 44 #include <thrust/iterator/constant_iterator.h> 46 #if defined(__CUDACC__) 47 #include <cugar/basic/cuda/primitives.h> 98 template <
typename system_tag,
typename PredicateIterator>
101 const PredicateIterator pred);
105 template <
typename system_tag,
typename PredicateIterator>
108 const PredicateIterator pred);
112 template <
typename system_tag,
typename Iterator>
115 const Iterator values);
120 template <
typename system_tag,
typename Iterator,
typename Headflags>
123 const Iterator values,
124 const Headflags flags);
129 template <
typename system_tag,
typename Iterator,
typename Functor>
137 template <
typename system_tag,
typename Iterator,
typename Output,
typename Functor>
142 const Functor functor);
146 template <
typename system_tag,
typename Iterator1,
typename Iterator2,
typename Output,
typename Functor>
152 const Functor functor);
161 template <
typename system_tag,
typename InputIterator,
typename BinaryOp>
162 typename std::iterator_traits<InputIterator>::value_type
reduce(
176 template <
typename system_tag,
typename InputIterator,
typename OutputIterator,
typename BinaryOp>
193 template <
typename system_tag,
typename InputIterator,
typename OutputIterator,
typename BinaryOp,
typename Identity>
212 template <
typename system_tag,
typename InputIterator,
typename FlagsIterator,
typename OutputIterator>
230 template <
typename system_tag,
typename InputIterator,
typename OutputIterator,
typename Predicate>
235 const Predicate pred,
248 template <
typename system_tag,
typename InputIterator,
typename OutputIterator,
typename CountIterator>
253 CountIterator counts,
268 template <
typename system_tag,
typename KeyIterator,
typename ValueIterator,
typename OutputKeyIterator,
typename OutputValueIterator,
typename ReductionOp>
272 ValueIterator values_in,
273 OutputKeyIterator keys_out,
274 OutputValueIterator values_out,
275 ReductionOp reduction_op,
286 template <
typename system_tag,
typename KeyIterator,
typename ValueIterator,
typename OutputIterator>
289 ValueIterator values,
292 OutputIterator indices);
302 template <
typename system_tag,
typename KeyIterator,
typename ValueIterator,
typename OutputIterator>
305 ValueIterator values,
308 OutputIterator indices);
316 template <
typename system_tag,
typename KeyIterator>
329 template <
typename system_tag,
typename KeyIterator,
typename ValueIterator>
333 ValueIterator values,
350 typename key_iterator1,
351 typename key_iterator2,
352 typename value_iterator1,
353 typename value_iterator2,
355 typename value_output>
359 const key_iterator1 A_keys,
360 const key_iterator2 B_keys,
361 const value_iterator1 A_values,
362 const value_iterator2 B_values,
364 value_output C_values,
370 template <
typename system_tag>
375 template <
typename Iterator,
typename Functor>
381 for_each<system_tag>( n, in, functor );
386 template <
typename Functor>
391 for_each<system_tag>( n, thrust::make_counting_iterator<uint64>(0), functor );
407 m_speed_hi( 0.0f ) {}
411 template <
typename Iterator,
typename Functor>
419 template <
typename Functor>
424 this->
operator()( n, thrust::make_counting_iterator<uint64>(0), functor );
431 template <
typename KernelFunction>
432 uint32 suggested_blocks(KernelFunction kernel,
const uint32 cta_size)
const;
436 void update(
const uint32 n_blocks,
const float speed);
449 #include <cugar/basic/primitives_inl.h> void radix_sort(const uint32 n, KeyIterator keys, cugar::vector< system_tag, uint8 > &temp_storage)
Definition: primitives_inl.h:1194
void transform(const uint32 n, const Iterator in, const Output out, const Functor functor)
Definition: primitives_inl.h:357
CUGAR_FORCEINLINE CUGAR_HOST_DEVICE void merge_by_key(key_iterator1 first1, key_iterator1 end1, key_iterator2 first2, key_iterator2 end2, value_iterator1 values1, value_iterator2 values2, key_iterator output_keys, value_iterator output_values)
Definition: algorithms.h:273
bool any(const uint32 n, const PredicateIterator pred)
Definition: primitives_inl.h:91
bool is_sorted(const uint32 n, const Iterator values)
Definition: primitives_inl.h:234
Define CUDA based sort primitives.
Defines some general purpose functors.
uint32 runlength_encode(const uint32 n, InputIterator in, OutputIterator out, CountIterator counts, cugar::vector< system_tag, uint8 > &temp_storage)
Definition: primitives_inl.h:859
bool all(const uint32 n, const PredicateIterator pred)
Definition: primitives_inl.h:101
CUGAR_FORCEINLINE CUGAR_HOST_DEVICE Iterator upper_bound(const Value x, Iterator begin, const index_type n)
Definition: algorithms.h:138
Defines some general purpose algorithms.
bool is_segment_sorted(const uint32 n, const Iterator values, const Headflags flags)
Definition: primitives_inl.h:245
void exclusive_scan(const uint32 n, InputIterator in, OutputIterator out, BinaryOp op, Identity identity, cugar::vector< system_tag, uint8 > &temp_storage)
Definition: primitives_inl.h:569
uint32 reduce_by_key(const uint32 n, KeyIterator keys_in, ValueIterator values_in, OutputKeyIterator keys_out, OutputValueIterator values_out, ReductionOp reduction_op, cugar::vector< system_tag, uint8 > &temp_storage)
Definition: primitives_inl.h:882
Define a vector_view POD type and plain_view() for std::vector.
Definition: diff.h:38
Definition: primitives.h:371
CUGAR_FORCEINLINE CUGAR_HOST_DEVICE Iterator lower_bound(const Value x, Iterator begin, const index_type n)
Definition: algorithms.h:99
uint32 copy_if(const uint32 n, InputIterator in, OutputIterator out, const Predicate pred, cugar::vector< system_tag, uint8 > &temp_storage)
Definition: primitives_inl.h:838
std::iterator_traits< InputIterator >::value_type reduce(const uint32 n, InputIterator in, BinaryOp op, cugar::vector< system_tag, uint8 > &temp_storage)
Definition: primitives_inl.h:520
void inclusive_scan(const uint32 n, InputIterator in, OutputIterator out, BinaryOp op, cugar::vector< system_tag, uint8 > &temp_storage)
Definition: primitives_inl.h:543
for_each_enactor()
Definition: primitives.h:403
void for_each(const uint64 n, const Iterator in, Functor functor)
Definition: primitives_inl.h:284
uint32 copy_flagged(const uint32 n, InputIterator in, FlagsIterator flags, OutputIterator out, cugar::vector< system_tag, uint8 > &temp_storage)
Definition: primitives_inl.h:817
void operator()(const uint64 n, const Iterator in, Functor functor)
Definition: primitives.h:376