Fixed checking CC for enabling Tensor Cores

This commit is contained in:
AlexeyAB
2019-02-06 01:55:22 +03:00
parent fa1415e3c2
commit 285088adc4
3 changed files with 9 additions and 7 deletions

View File

@ -309,7 +309,7 @@ int get_gpu_compute_capability(int i)
cudaDeviceProp prop;
cudaError_t status = cudaGetDeviceProperties(&prop, i);
CHECK_CUDA(status);
int cc = prop.major * 10 + prop.minor;
int cc = prop.major * 100 + prop.minor * 10; // __CUDA_ARCH__ format
return cc;
}

View File

@ -671,8 +671,10 @@ void parse_net_options(list *options, network *net)
net->policy = get_policy(policy_s);
net->burn_in = option_find_int_quiet(options, "burn_in", 0);
#ifdef CUDNN_HALF
if(get_gpu_compute_capability(net->gpu_index) >= 7000) net->cudnn_half = 1;
int compute_capability = get_gpu_compute_capability(net->gpu_index);
if(get_gpu_compute_capability(net->gpu_index) >= 700) net->cudnn_half = 1;
else net->cudnn_half = 0;
fprintf(stderr, " compute_capability = %d, cudnn_half = %d \n", compute_capability, net->cudnn_half);
#endif
if(net->policy == STEP){
net->step = option_find_int(options, "step", 1);