Skip to content

Commit a865f1d

Browse files
committed
Eliminate superfluous iterators specific to CUDA backend
* transform_output_iterator_t * transform_triple_of_input_iterators_t * static_integer_iterator
1 parent 5136357 commit a865f1d

1 file changed

Lines changed: 0 additions & 317 deletions

File tree

  • thrust/system/cuda/detail

thrust/system/cuda/detail/util.h

Lines changed: 0 additions & 317 deletions
Original file line numberDiff line numberDiff line change
@@ -474,121 +474,6 @@ struct transform_pair_of_input_iterators_t
474474

475475
}; // struct transform_pair_of_input_iterators_t
476476

477-
template <class ValueType,
478-
class InputIt1,
479-
class InputIt2,
480-
class InputIt3,
481-
class TransformOp>
482-
struct transform_triple_of_input_iterators_t
483-
{
484-
typedef transform_triple_of_input_iterators_t self_t;
485-
typedef typename iterator_traits<InputIt1>::difference_type difference_type;
486-
typedef ValueType value_type;
487-
typedef value_type * pointer;
488-
typedef value_type reference;
489-
typedef std::random_access_iterator_tag iterator_category;
490-
491-
InputIt1 input1;
492-
InputIt2 input2;
493-
InputIt3 input3;
494-
mutable TransformOp op;
495-
496-
__host__ __device__ __forceinline__
497-
transform_triple_of_input_iterators_t(InputIt1 input1_,
498-
InputIt2 input2_,
499-
InputIt3 input3_,
500-
TransformOp op_)
501-
: input1(input1_), input2(input2_), input3(input3_), op(op_) {}
502-
503-
/// Postfix increment
504-
__host__ __device__ __forceinline__ self_t operator++(int)
505-
{
506-
self_t retval = *this;
507-
++input1;
508-
++input2;
509-
++input3;
510-
return retval;
511-
}
512-
513-
/// Prefix increment
514-
__host__ __device__ __forceinline__ self_t operator++()
515-
{
516-
++input1;
517-
++input2;
518-
++input3;
519-
return *this;
520-
}
521-
522-
/// Indirection
523-
__host__ __device__ __forceinline__ reference operator*() const
524-
{
525-
return op(*input1, *input2, *input3);
526-
}
527-
/// Indirection
528-
__host__ __device__ __forceinline__ reference operator*()
529-
{
530-
return op(*input1, *input2, *input3);
531-
}
532-
533-
/// Addition
534-
__host__ __device__ __forceinline__ self_t operator+(difference_type n) const
535-
{
536-
return self_t(input1 + n, input2 + n, input3 + n, op);
537-
}
538-
539-
/// Addition assignment
540-
__host__ __device__ __forceinline__ self_t &operator+=(difference_type n)
541-
{
542-
input1 += n;
543-
input2 += n;
544-
input3 += n;
545-
return *this;
546-
}
547-
548-
/// Subtraction
549-
__host__ __device__ __forceinline__ self_t operator-(difference_type n) const
550-
{
551-
return self_t(input1 - n, input2 - n, input3 - n, op);
552-
}
553-
554-
/// Subtraction assignment
555-
__host__ __device__ __forceinline__ self_t &operator-=(difference_type n)
556-
{
557-
input1 -= n;
558-
input2 -= n;
559-
input3 -= n;
560-
return *this;
561-
}
562-
563-
/// Distance
564-
__host__ __device__ __forceinline__ difference_type operator-(self_t other) const
565-
{
566-
return input1 - other.input1;
567-
}
568-
569-
/// Array subscript
570-
__host__ __device__ __forceinline__ reference operator[](difference_type n) const
571-
{
572-
return op(input1[n], input2[n], input3[n]);
573-
}
574-
575-
/// Equal to
576-
__host__ __device__ __forceinline__ bool operator==(const self_t &rhs) const
577-
{
578-
return (input1 == rhs.input1) &&
579-
(input2 == rhs.input2) &&
580-
(input3 == rhs.input3);
581-
}
582-
583-
/// Not equal to
584-
__host__ __device__ __forceinline__ bool operator!=(const self_t &rhs) const
585-
{
586-
return (input1 != rhs.input1) ||
587-
(input2 != rhs.input2) ||
588-
(input3 != rhs.input3);
589-
}
590-
591-
}; // struct transform_triple_of_input_iterators_t
592477

593478
struct identity
594479
{
@@ -607,208 +492,6 @@ struct identity
607492
}
608493
};
609494

610-
template <class ValueType,
611-
class OutputIt,
612-
class TransformOp = identity>
613-
struct transform_output_iterator_t
614-
{
615-
struct proxy_reference
616-
{
617-
private:
618-
OutputIt output;
619-
TransformOp op;
620-
621-
public:
622-
__host__ __device__
623-
proxy_reference(OutputIt const &output_, TransformOp op_)
624-
: output(output_), op(op_) {}
625-
626-
proxy_reference __host__ __device__
627-
operator=(ValueType const &x)
628-
{
629-
*output = op(x);
630-
return *this;
631-
}
632-
};
633-
634-
typedef transform_output_iterator_t self_t;
635-
typedef typename iterator_traits<OutputIt>::difference_type difference_type;
636-
typedef void value_type;
637-
typedef proxy_reference reference;
638-
typedef std::output_iterator_tag iterator_category;
639-
640-
OutputIt output;
641-
TransformOp op;
642-
643-
__host__ __device__ __forceinline__
644-
transform_output_iterator_t(OutputIt output)
645-
: output(output) {}
646-
647-
__host__ __device__ __forceinline__
648-
transform_output_iterator_t(OutputIt output, TransformOp op)
649-
: output(output), op(op) {}
650-
651-
/// Postfix increment
652-
__host__ __device__ __forceinline__ self_t operator++(int)
653-
{
654-
self_t retval = *this;
655-
++output;
656-
return retval;
657-
}
658-
659-
/// Prefix increment
660-
__host__ __device__ __forceinline__ self_t operator++()
661-
{
662-
++output;
663-
return *this;
664-
}
665-
666-
/// Indirection
667-
__host__ __device__ __forceinline__ reference operator*() const
668-
{
669-
return proxy_reference(output, op);
670-
}
671-
/// Indirection
672-
__host__ __device__ __forceinline__ reference operator*()
673-
{
674-
return proxy_reference(output, op);
675-
}
676-
677-
/// Addition
678-
__host__ __device__ __forceinline__ self_t operator+(difference_type n) const
679-
{
680-
return self_t(output + n, op);
681-
}
682-
683-
/// Addition assignment
684-
__host__ __device__ __forceinline__ self_t &operator+=(difference_type n)
685-
{
686-
output += n;
687-
return *this;
688-
}
689-
690-
/// Subtraction
691-
__host__ __device__ __forceinline__ self_t operator-(difference_type n) const
692-
{
693-
return self_t(output - n, op);
694-
}
695-
696-
/// Subtraction assignment
697-
__host__ __device__ __forceinline__ self_t &operator-=(difference_type n)
698-
{
699-
output -= n;
700-
return *this;
701-
}
702-
703-
/// Distance
704-
__host__ __device__ __forceinline__ difference_type operator-(self_t other) const
705-
{
706-
return output - other.output;
707-
}
708-
709-
/// Array subscript
710-
__host__ __device__ __forceinline__ reference operator[](difference_type n) const
711-
{
712-
return *(output + n);
713-
}
714-
715-
/// Equal to
716-
__host__ __device__ __forceinline__ bool operator==(const self_t &rhs) const
717-
{
718-
return (output == rhs.output);
719-
}
720-
721-
/// Not equal to
722-
__host__ __device__ __forceinline__ bool operator!=(const self_t &rhs) const
723-
{
724-
return (output != rhs.output);
725-
}
726-
}; // struct transform_output_iterator_
727-
728-
template <class T, T VALUE>
729-
struct static_integer_iterator
730-
{
731-
typedef static_integer_iterator self_t;
732-
typedef int difference_type;
733-
typedef T value_type;
734-
typedef T reference;
735-
typedef std::random_access_iterator_tag iterator_category;
736-
737-
__host__ __device__ __forceinline__
738-
static_integer_iterator() {}
739-
740-
/// Postfix increment
741-
__host__ __device__ __forceinline__ self_t operator++(int)
742-
{
743-
return *this;
744-
}
745-
746-
/// Prefix increment
747-
__host__ __device__ __forceinline__ self_t operator++()
748-
{
749-
return *this;
750-
}
751-
752-
/// Indirection
753-
__host__ __device__ __forceinline__ reference operator*() const
754-
{
755-
return VALUE;
756-
}
757-
/// Indirection
758-
__host__ __device__ __forceinline__ reference operator*()
759-
{
760-
return VALUE;
761-
}
762-
763-
/// Addition
764-
__host__ __device__ __forceinline__ self_t operator+(difference_type ) const
765-
{
766-
return self_t();
767-
}
768-
769-
/// Addition assignment
770-
__host__ __device__ __forceinline__ self_t &operator+=(difference_type )
771-
{
772-
return *this;
773-
}
774-
775-
/// Subtraction
776-
__host__ __device__ __forceinline__ self_t operator-(difference_type ) const
777-
{
778-
return self_t();
779-
}
780-
781-
/// Subtraction assignment
782-
__host__ __device__ __forceinline__ self_t &operator-=(difference_type )
783-
{
784-
return *this;
785-
}
786-
787-
/// Distance
788-
__host__ __device__ __forceinline__ difference_type operator-(self_t ) const
789-
{
790-
return 0;
791-
}
792-
793-
/// Array subscript
794-
__host__ __device__ __forceinline__ reference operator[](difference_type ) const
795-
{
796-
return VALUE;
797-
}
798-
799-
/// Equal to
800-
__host__ __device__ __forceinline__ bool operator==(const self_t &) const
801-
{
802-
return true;
803-
}
804-
805-
/// Not equal to
806-
__host__ __device__ __forceinline__ bool operator!=(const self_t &) const
807-
{
808-
return false;
809-
}
810-
811-
}; // struct static_bool_iterator
812495

813496
template <class T>
814497
struct counting_iterator_t

0 commit comments

Comments
 (0)