Skip to content

Commit

Permalink
avoid autoblock is 0 when driver fails, close #99
Browse files Browse the repository at this point in the history
  • Loading branch information
fangq committed Jul 31, 2020
1 parent daa9d56 commit d9a5953
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/mcx_core.cu
Original file line number Diff line number Diff line change
Expand Up @@ -1637,6 +1637,10 @@ int mcx_list_gpu(Config *cfg, GPUInfo **info){
(*info)[dev].maxmpthread=dp.maxThreadsPerMultiProcessor;
(*info)[dev].maxgate=cfg->maxgate;
(*info)[dev].autoblock=(*info)[dev].maxmpthread / mcx_smxblock(dp.major,dp.minor);
if((*info)[dev].autoblock){
MCX_FPRINTF(stderr,"WARNING: maxThreadsPerMultiProcessor can not be detected\n");
(*info)[dev].autoblock=64;
}
(*info)[dev].autothread=(*info)[dev].autoblock * mcx_smxblock(dp.major,dp.minor) * (*info)[dev].sm;

if (strncmp(dp.name, "Device Emulation", 16)) {
Expand All @@ -1649,10 +1653,11 @@ int mcx_list_gpu(Config *cfg, GPUInfo **info){
(double)(*info)[dev].globalmem,(double)(*info)[dev].constmem,
(double)(*info)[dev].sharedmem,(unsigned int)(*info)[dev].regcount,(*info)[dev].clock*1e-6f);
#if CUDART_VERSION >= 2000
MCX_FPRINTF(stdout,"Number of MPs:\t\t%u\nNumber of Cores:\t%u\n",
MCX_FPRINTF(stdout,"Number of SMs:\t\t%u\nNumber of Cores:\t%u\n",
(*info)[dev].sm,(*info)[dev].core);
#endif
MCX_FPRINTF(stdout,"SMX count:\t\t%u\n", (*info)[dev].sm);
MCX_FPRINTF(stdout,"Auto-thread:\t\t%d\n",(*info)[dev].autothread);
MCX_FPRINTF(stdout,"Auto-block:\t\t%d\n", (*info)[dev].autoblock);
}
}
}
Expand Down

0 comments on commit d9a5953

Please sign in to comment.