     int deviceCount = 0;
     cudaGetDeviceCount(&deviceCount); 
     if (deviceCount == 0) { 
-        std::cerr << "There is no device." << std::endl;
+        printf( "There is no device.\n" );
         return false;
     } 
     

    cudaMemcpy(&result, d_jp, sizeof(int), cudaMemcpyDeviceToHost);
    check_cuda_error();
    
    std::cout <<"result " << result << " (should be 666)" << std::endl;


    if ( expected_kernel_result != result ) {

#include <stdlib>


#include "cuda_runtime.h"

