mirror of https://github.com/AlexeyAB/darknet.git
Minor fix
This commit is contained in:
parent
74134e5389
commit
0c7305cf63
|
@ -149,6 +149,8 @@ void train_detector(char *datacfg, char *cfgfile, char *weightfile, int *gpus, i
|
|||
args.show_imgs = show_imgs;
|
||||
|
||||
#ifdef OPENCV
|
||||
//int num_threads = get_num_threads();
|
||||
//if(num_threads > 2) args.threads = get_num_threads() - 2;
|
||||
args.threads = 6 * ngpus; // 3 for - Amazon EC2 Tesla V100: p3.2xlarge (8 logical cores) - p3.16xlarge
|
||||
//args.threads = 12 * ngpus; // Ryzen 7 2700X (16 logical cores)
|
||||
mat_cv* img = NULL;
|
||||
|
|
|
@ -718,6 +718,11 @@ void custom_atomic_store_int(volatile int* obj, int desr)
|
|||
std::atomic_store(ptr_a, desr);
|
||||
}
|
||||
|
||||
int get_num_threads()
|
||||
{
|
||||
return std::thread::hardware_concurrency();
|
||||
}
|
||||
|
||||
#if !defined(__MINGW64__)
|
||||
void this_thread_sleep_for(int ms_time)
|
||||
{
|
||||
|
|
|
@ -26,6 +26,7 @@ int custom_join(custom_thread_t thread, void **value_ptr);
|
|||
|
||||
int custom_atomic_load_int(volatile int* obj);
|
||||
void custom_atomic_store_int(volatile int* obj, int desr);
|
||||
int get_num_threads();
|
||||
void this_thread_sleep_for(int ms_time);
|
||||
void this_thread_yield();
|
||||
|
||||
|
|
Loading…
Reference in New Issue