Skip to content

Commit

Permalink
Fixed iterator diff for thrust iterator adapter
Browse files Browse the repository at this point in the history
  • Loading branch information
JPenuchot committed Nov 18, 2019
1 parent 4618370 commit 35ca5ec
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion blaze_cuda/util/algorithms/CUDATransform.h
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -85,12 +85,16 @@ class ThrustInputIteratorAdapter
BLAZE_ALWAYS_INLINE BLAZE_DEVICE_CALLABLE auto BLAZE_ALWAYS_INLINE BLAZE_DEVICE_CALLABLE auto
operator-( ThrustInputIteratorAdapter const& other ) const noexcept operator-( ThrustInputIteratorAdapter const& other ) const noexcept
{ {
return ThrustInputIteratorAdapter( it - other.it ); return it - other.it;
} }


BLAZE_ALWAYS_INLINE BLAZE_DEVICE_CALLABLE auto operator+( ptrdiff_t inc ) const noexcept { BLAZE_ALWAYS_INLINE BLAZE_DEVICE_CALLABLE auto operator+( ptrdiff_t inc ) const noexcept {
return ThrustInputIteratorAdapter( IteratorType( it + inc ) ); return ThrustInputIteratorAdapter( IteratorType( it + inc ) );
} }

BLAZE_ALWAYS_INLINE BLAZE_DEVICE_CALLABLE auto operator-( ptrdiff_t dec ) const noexcept {
return ThrustInputIteratorAdapter( IteratorType( it - dec ) );
}
}; };


template< typename IteratorType > template< typename IteratorType >
Expand Down

0 comments on commit 35ca5ec

Please sign in to comment.