mirror of https://github.com/AlexeyAB/darknet.git
Minor fix
This commit is contained in:
parent
1d95870468
commit
1f60ca57ad
|
@ -491,12 +491,13 @@ int get_number_of_blocks(int array_size, int block_size)
|
|||
return array_size / block_size + ((array_size % block_size > 0) ? 1 : 0);
|
||||
}
|
||||
|
||||
int get_gpu_compute_capability(int i)
|
||||
int get_gpu_compute_capability(int i, char *device_name)
|
||||
{
|
||||
typedef struct cudaDeviceProp cudaDeviceProp;
|
||||
cudaDeviceProp prop;
|
||||
cudaError_t status = cudaGetDeviceProperties(&prop, i);
|
||||
CHECK_CUDA(status);
|
||||
if (device_name) strcpy(device_name, prop.name);
|
||||
int cc = prop.major * 100 + prop.minor * 10; // __CUDA_ARCH__ format
|
||||
return cc;
|
||||
}
|
||||
|
|
|
@ -79,7 +79,7 @@ extern "C" {
|
|||
cudaStream_t get_cuda_stream();
|
||||
cudaStream_t get_cuda_memcpy_stream();
|
||||
int get_number_of_blocks(int array_size, int block_size);
|
||||
int get_gpu_compute_capability(int i);
|
||||
int get_gpu_compute_capability(int i, char *device_name);
|
||||
void show_cuda_cudnn_info();
|
||||
|
||||
#ifdef CUDNN
|
||||
|
|
|
@ -1125,12 +1125,13 @@ void parse_net_options(list *options, network *net)
|
|||
net->burn_in = option_find_int_quiet(options, "burn_in", 0);
|
||||
#ifdef GPU
|
||||
if (net->gpu_index >= 0) {
|
||||
int compute_capability = get_gpu_compute_capability(net->gpu_index);
|
||||
char device_name[1024];
|
||||
int compute_capability = get_gpu_compute_capability(net->gpu_index, device_name);
|
||||
#ifdef CUDNN_HALF
|
||||
if (compute_capability >= 700) net->cudnn_half = 1;
|
||||
else net->cudnn_half = 0;
|
||||
#endif// CUDNN_HALF
|
||||
fprintf(stderr, " compute_capability = %d, cudnn_half = %d \n", compute_capability, net->cudnn_half);
|
||||
fprintf(stderr, " %d : compute_capability = %d, cudnn_half = %d, GPU: %s \n", net->gpu_index, compute_capability, net->cudnn_half, device_name);
|
||||
}
|
||||
else fprintf(stderr, " GPU isn't used \n");
|
||||
#endif// GPU
|
||||
|
|
Loading…
Reference in New Issue