       throw cusp::runtime_exception("cublasDestroy failed");
     }
 }
-DECLARE_UNITTEST(TestCUBLASdot);
-
+DECLARE_REAL_UNITTEST(TestCUBLASdot);
+
+template<typename ValueType>
 void TestCUBLASnrm2(void)
 {
-    typedef cusp::device_memory MemorySpace;
-    typedef typename cusp::array1d<float, MemorySpace>       Array;
-    typedef typename cusp::array1d<float, MemorySpace>::view View;
+    typedef cusp::array1d<ValueType, cusp::device_memory>  Array;
+    typedef typename Array::view                           View;
 
     cublasHandle_t handle;
 


    ASSERT_EQUAL(cusp::blas::nrm2(cublas, View(x)), 10.0f);
}
DECLARE_UNITTEST(TestCUBLASnrm2);

void TestCUBLASscal(void)
{
    typedef cusp::device_memory MemorySpace;
    typedef typename cusp::array1d<float, MemorySpace>       Array;
    typedef typename cusp::array1d<float, MemorySpace>::view View;

    cublasHandle_t handle;


    {
        Array y(4, -1);
        cusp::blas::copy(cublas, x, y);
        ASSERT_EQUAL(x==y, true);
    }

    {
