mirror of
https://github.com/pjreddie/darknet.git
synced 2023-08-10 21:13:14 +03:00
Fixed checking CC for enabling Tensor Cores
This commit is contained in:
@ -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;
|
||||
}
|
||||
|
||||
|
@ -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);
|
||||
|
Reference in New Issue
Block a user