~ubuntu-branches/ubuntu/utopic/libthrust/utopic

« back to all changes in this revision

Viewing changes to system/detail/internal/scalar/stable_radix_sort.inl

  • Committer: Package Import Robot
  • Author(s): Andreas Beckmann
  • Date: 2013-07-10 12:57:33 UTC
  • mfrom: (1.1.4)
  • Revision ID: package-import@ubuntu.com-20130710125733-my19jic71sqsabaj
Tags: 1.7.0-1
* New upstream release.  (Closes: #715362)
* Update watch file.

Show diffs side-by-side

added added

removed removed

Lines of Context:
385
385
void stable_radix_sort(RandomAccessIterator first,
386
386
                       RandomAccessIterator last)
387
387
{
388
 
  typedef typename thrust::iterator_system<RandomAccessIterator>::type system;
 
388
  typedef typename thrust::iterator_system<RandomAccessIterator>::type ExecutionPolicy;
389
389
  typedef typename thrust::iterator_value<RandomAccessIterator>::type KeyType;
390
390
 
391
391
  size_t N = last - first;
392
392
  
393
 
  thrust::detail::temporary_array<KeyType, system> temp(N);
 
393
  // XXX assumes ExecutionPolicy is default constructible
 
394
  // XXX consider how to get stateful systems into this function
 
395
  ExecutionPolicy exec;
 
396
  thrust::detail::temporary_array<KeyType, ExecutionPolicy> temp(exec, N);
394
397
  
395
398
  detail::radix_sort(first, temp.begin(), N);
396
399
}
406
409
                              RandomAccessIterator1 last1,
407
410
                              RandomAccessIterator2 first2)
408
411
{
409
 
  // XXX the type of system should be
 
412
  // XXX the type of exec should be
410
413
  //     typedef decltype(select_system(first1,last1,first2)) system;
411
 
  typedef typename thrust::iterator_system<RandomAccessIterator1>::type system;
 
414
  typedef typename thrust::iterator_system<RandomAccessIterator1>::type ExecutionPolicy;
412
415
  typedef typename thrust::iterator_value<RandomAccessIterator1>::type KeyType;
413
416
  typedef typename thrust::iterator_value<RandomAccessIterator2>::type ValueType;
414
417
 
415
418
  size_t N = last1 - first1;
416
419
  
417
 
  thrust::detail::temporary_array<KeyType, system>   temp1(N);
418
 
  thrust::detail::temporary_array<ValueType, system> temp2(N);
 
420
  // XXX assumes ExecutionPolicy is default constructible
 
421
  // XXX consider how to get stateful systems into this function
 
422
  ExecutionPolicy exec;
 
423
  thrust::detail::temporary_array<KeyType, ExecutionPolicy>   temp1(exec, N);
 
424
  thrust::detail::temporary_array<ValueType, ExecutionPolicy> temp2(exec, N);
419
425
 
420
426
  detail::radix_sort(first1, temp1.begin(), first2, temp2.begin(), N);
421
427
}