Skip to content

Commit f787167

Browse files
Avoid tuple creation when making zip iterator
1 parent b5ad6c0 commit f787167

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

src/thrust/ThrustStream.cu

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -115,8 +115,8 @@ template <class T>
115115
void ThrustStream<T>::add()
116116
{
117117
thrust::transform(
118-
thrust::make_zip_iterator(thrust::make_tuple(impl->a.begin(), impl->b.begin())),
119-
thrust::make_zip_iterator(thrust::make_tuple(impl->a.end(), impl->b.end())),
118+
thrust::make_zip_iterator(impl->a.begin(), impl->b.begin()),
119+
thrust::make_zip_iterator(impl->a.end(), impl->b.end()),
120120
impl->c.begin(),
121121
thrust::make_zip_function(
122122
[] __device__ __host__ (const T& ai, const T& bi){
@@ -131,8 +131,8 @@ void ThrustStream<T>::triad()
131131
{
132132
const T scalar = startScalar;
133133
thrust::transform(
134-
thrust::make_zip_iterator(thrust::make_tuple(impl->b.begin(), impl->c.begin())),
135-
thrust::make_zip_iterator(thrust::make_tuple(impl->b.end(), impl->c.end())),
134+
thrust::make_zip_iterator(impl->b.begin(), impl->c.begin()),
135+
thrust::make_zip_iterator(impl->b.end(), impl->c.end()),
136136
impl->a.begin(),
137137
thrust::make_zip_function(
138138
[=] __device__ __host__ (const T& bi, const T& ci){
@@ -147,8 +147,8 @@ void ThrustStream<T>::nstream()
147147
{
148148
const T scalar = startScalar;
149149
thrust::transform(
150-
thrust::make_zip_iterator(thrust::make_tuple(impl->a.begin(), impl->b.begin(), impl->c.begin())),
151-
thrust::make_zip_iterator(thrust::make_tuple(impl->a.end(), impl->b.end(), impl->c.end())),
150+
thrust::make_zip_iterator(impl->a.begin(), impl->b.begin(), impl->c.begin()),
151+
thrust::make_zip_iterator(impl->a.end(), impl->b.end(), impl->c.end()),
152152
impl->a.begin(),
153153
thrust::make_zip_function(
154154
[=] __device__ __host__ (const T& ai, const T& bi, const T& ci){

0 commit comments

Comments
 (0)