title: Applying reduction operation using Thrust subject to a boolean condition
body: <p>I want to use  <code>thrust::reduce</code> to find the max value in an array A. However, <code>A[i]</code>should only be chosen as the max if it also satisfies a particular boolean condition in another array B. For example, B[i] should be true. Is their a version of thrust::reduce that does this. I looked at the documentation and found only following API;</p>
  
  <pre><code>thrust::reduce(begin,end, default value, operator)
  </code></pre>
  
  <p>However, i was curious is their a version more suitable to my problem?</p>
  
  <p>EDIT: Compilation fails in last line!</p>
  
  <pre><code>      typedef thrust::device_ptr&lt;int&gt; IntIterator;
        typedef thrust::device_ptr&lt;float&gt; FloatIterator;
        typedef thrust::tuple&lt;IntIterator,FloatIterator&gt; IteratorTuple;
        typedef thrust::zip_iterator&lt;IteratorTuple&gt; myZipIterator;
        thrust::device_ptr&lt;int&gt; deviceNBMInt(gpuNBMInt);
      thrust::device_ptr&lt;int&gt; deviceIsActive(gpuIsActive);
      thrust::device_ptr&lt;float&gt; deviceNBMSim(gpuNBMSim);
  
      myZipIterator iter_begin = thrust::make_zip_iterator(thrust::make_tuple(deviceIsActive,deviceNBMSim));
      myZipIterator iter_end = thrust::make_zip_iterator(thrust::make_tuple(deviceIsActive + numRow,deviceNBMSim + numRow));
      myZipIterator result =  thrust::max_element(iter_begin, iter_end, Predicate());
  </code></pre>