 #include <ostream>
 #include <iomanip>
 
+#include <thrust/reduce.h>
+
+#if REDUCE_ON_DEVICE<1
 #include <thrust/host_vector.h>
-#include <thrust/reduce.h>
+#endif
 
 // *** HyperCube ***
 

    static thrust::device_vector<unsigned int> rayOwners(rayRange); rayOwners.resize(rayRange);
    DacrtNodes::CalcOwners(rayPartitions, rayOwners);

#if 1
    // Reduce on the GPU
    Iterator valuesBegin = 
        thrust::make_zip_iterator(thrust::make_tuple(A.begin(), X.begin(), Y.begin(), 

// This program is open source and distributed under the New BSD License. See
// license for more detail.
// -----------------------------------------------------------------------------

#define REDUCE_ON_DEVICE 1

#include <HyperCube.h>

