#include<cuda_runtime.h>#include<iostream>intcuda_devices(void){intresult=0;cudaGetDeviceCount(&result);returnresult;}intmain(void){intn=cuda_devices();if(n==0){std::cout<<"No CUDA hardware found. Exiting.\n";return0;}std::cout<<"Found "<<n<<" CUDA devices.\n";return0;}