@@ -507,64 +507,12 @@ struct slicer {
507
507
}
508
508
};
509
509
510
- // / Permutation operator.
511
- struct permutation {
512
- const vector<size_t > &index;
513
-
514
- permutation (const vector<size_t > &index) : index(index) {
515
- assert (index .queue_list ().size () == 1 );
516
- }
517
-
518
- size_t size () const {
519
- return index .size ();
520
- }
521
-
522
- std::string partial_expression (const std::string &prm_name,
523
- const cl::Device&) const
524
- {
525
- std::ostringstream s;
526
- s << prm_name << " _base[" << prm_name << " _index[idx]]" ;
527
-
528
- return s.str ();
529
- }
530
-
531
- std::string indexing_function (const std::string &/* prm_name*/ ,
532
- const cl::Device&) const
533
- {
534
- return " " ;
535
- }
536
-
537
- template <typename T>
538
- std::string parameter_declaration (const std::string &prm_name,
539
- const cl::Device&) const
540
- {
541
- std::ostringstream s;
542
-
543
- s << " ,\n\t global " << type_name<T>() << " * " << prm_name << " _base"
544
- << " , global " << type_name<size_t >() << " * " << prm_name << " _index" ;
545
-
546
- return s.str ();
547
- }
548
-
549
- void setArgs (cl::Kernel &kernel, unsigned device, size_t /* index_offset*/ ,
550
- unsigned &position) const
551
- {
552
- kernel.setArg (position++, index (device));
553
- }
554
-
555
- template <typename T>
556
- vector_view<T, permutation> operator ()(const vector<T> &base) const {
557
- assert (base.queue_list ().size () == 1 );
558
- return vector_view<T, permutation>(base, *this );
559
- }
560
- };
561
-
562
510
// / Expression-based permutation operator.
563
511
template <class Expr >
564
- struct expr_slice {
512
+ struct expr_permutation {
565
513
const Expr expr;
566
514
567
- expr_slice (const Expr &expr) : expr(expr) {}
515
+ expr_permutation (const Expr &expr) : expr(expr) {}
568
516
569
517
size_t size () const {
570
518
detail::get_expression_properties prop;
@@ -618,9 +566,9 @@ struct expr_slice {
618
566
}
619
567
620
568
template <typename T>
621
- vector_view<T, expr_slice > operator ()(const vector<T> &base) const {
569
+ vector_view<T, expr_permutation > operator ()(const vector<T> &base) const {
622
570
assert (base.queue_list ().size () == 1 );
623
- return vector_view<T, expr_slice >(base, *this );
571
+ return vector_view<T, expr_permutation >(base, *this );
624
572
}
625
573
};
626
574
@@ -635,10 +583,10 @@ struct expr_slice {
635
583
template <class Expr >
636
584
typename std::enable_if<
637
585
std::is_integral<typename detail::return_type<Expr>::type>::value,
638
- expr_slice <Expr>
586
+ expr_permutation <Expr>
639
587
>::type
640
- eslice (const Expr &expr) {
641
- return expr_slice <Expr>(expr);
588
+ permutation (const Expr &expr) {
589
+ return expr_permutation <Expr>(expr);
642
590
}
643
591
644
592
// ---------------------------------------------------------------------------
0 commit comments