       s_b = std::complex<ValueType>(creal(g_b),cimag(g_b));
       ASSERT_COMPLEX_ALMOST_EQUAL(b,s_b);
     }
-  }else if(sizeof(ValueType) == 8){
+  }else if(is_same_type<ValueType,double>::result){
     __complex__ double g_a;
     __complex__ double g_b;
     g_a = s_a.real() + s_a.imag()*__I__;

#ifdef __GNUC__  
  /* Use the c99 complex function from gcc to test the
   function not part of the standard */
  if(sizeof(ValueType) == 4){
    __complex__ float g_a;
    __complex__ float g_b;
    g_a = s_a.real() + s_a.imag()*__I__;

  cudaMemcpy(&a,d_a,sizeof(cusp::complex<ValueType>),cudaMemcpyDeviceToHost);
  std::complex<ValueType> b(a.real(),a.imag());
  a = test_complex_compilation_entry<ValueType>();
  // Don't check for equality between host and device code when the 
  // hardware device does not support double precision 
  if(is_same_type<ValueType,double>::result == false|| device_supports_double()){
    ASSERT_COMPLEX_ALMOST_EQUAL(a,b);
  }
  // Test twice the unit circle 
  for(int i = 0;i < 32;i++){
    ValueType theta(ValueType(i*M_PI/8));
    compareWithStd<ValueType>(cusp::polar<ValueType>(ValueType(1),theta));
  }
}


DECLARE_NUMERIC_UNITTEST(TestComplex);


