 #include <thrust/generate.h>
 #include <sstream>
 
-template<typename Engine, typename Engine::result_type validation>
+template<typename Engine>
   struct ValidateEngine
 {
+  __host__ __device__
+  ValidateEngine(const typename Engine::result_type value_10000)
+    : m_value_10000(value_10000)
+  {}
+
   __host__ __device__
   bool operator()(void) const
   {

    e.discard(9999);

    // get the 10Kth result
    return e() == validation;
  }
}; // end ValidateEngine



{
  // test host
  thrust::host_vector<bool> h(1);
  thrust::generate(h.begin(), h.end(), ValidateEngine<Engine>(value_10000));

  ASSERT_EQUAL(true, h[0]);

  // test device
  thrust::device_vector<bool> d(1);
  thrust::generate(d.begin(), d.end(), ValidateEngine<Engine>(value_10000));

  ASSERT_EQUAL(true, d[0]);
}
