     cudaError_t error = cudaGetLastError();
     
     if ( cudaSuccess != error ) {
-        std::cerr << cudaGetErrorString( error ) << std::endl;
+        printf( "%s \n", cudaGetErrorString( error ) );
     }
     
     return error;

    }
    
    if (dev == deviceCount) {
        std::cerr << "There is no device supporting CUDA." << std::endl;
        return false;
    }
    

    int deviceCount = 0;
    cudaGetDeviceCount(&deviceCount); 
    if (deviceCount == 0) { 
        printf( "There is no device.\n" );
        return false;
    } 
    
