diff --git a/stim/envi/bip.h b/stim/envi/bip.h index 8314052..bce3cd5 100644 --- a/stim/envi/bip.h +++ b/stim/envi/bip.h @@ -1001,7 +1001,12 @@ public: bool co_matrix(double* co, double* avg, unsigned char *mask, bool PROGRESS = false){ #ifdef CUDA_FOUND - return co_matrix_cublas(co, avg, mask, PROGRESS); //if CUDA is available, use cuBLAS to calculate the covariance matrix + int dev_count; + cudaGetDeviceCount(&dev_count); //get the number of CUDA devices + cudaDeviceProp prop; + cudaGetDeviceProperties(&prop, 0); //get the property of the first device + if(dev_count > 0 && prop.major != 9999) //if the first device is not an emulator + return co_matrix_cublas(co, avg, mask, PROGRESS); //use cuBLAS to calculate the covariance matrix #endif progress = 0; //memory allocation -- libgit2 0.21.4