|
|
@ -91,6 +91,7 @@ def __bootstrap__():
|
|
|
|
"""
|
|
|
|
"""
|
|
|
|
import sys
|
|
|
|
import sys
|
|
|
|
import os
|
|
|
|
import os
|
|
|
|
|
|
|
|
import platform
|
|
|
|
from . import core
|
|
|
|
from . import core
|
|
|
|
|
|
|
|
|
|
|
|
in_test = 'unittest' in sys.modules
|
|
|
|
in_test = 'unittest' in sys.modules
|
|
|
@ -110,14 +111,17 @@ def __bootstrap__():
|
|
|
|
print('PLEASE USE OMP_NUM_THREADS WISELY.', file=sys.stderr)
|
|
|
|
print('PLEASE USE OMP_NUM_THREADS WISELY.', file=sys.stderr)
|
|
|
|
|
|
|
|
|
|
|
|
os.environ['OMP_NUM_THREADS'] = str(num_threads)
|
|
|
|
os.environ['OMP_NUM_THREADS'] = str(num_threads)
|
|
|
|
|
|
|
|
sysstr = platform.system()
|
|
|
|
read_env_flags = [
|
|
|
|
read_env_flags = [
|
|
|
|
'use_pinned_memory', 'check_nan_inf', 'benchmark', 'eager_delete_scope',
|
|
|
|
'check_nan_inf', 'benchmark', 'eager_delete_scope', 'use_mkldnn',
|
|
|
|
'use_mkldnn', 'use_ngraph', 'initial_cpu_memory_in_mb',
|
|
|
|
'use_ngraph', 'initial_cpu_memory_in_mb', 'init_allocated_mem',
|
|
|
|
'init_allocated_mem', 'free_idle_memory', 'paddle_num_threads',
|
|
|
|
'free_idle_memory', 'paddle_num_threads', "dist_threadpool_size",
|
|
|
|
"dist_threadpool_size", 'eager_delete_tensor_gb', 'allocator_strategy',
|
|
|
|
'eager_delete_tensor_gb', 'allocator_strategy',
|
|
|
|
'reader_queue_speed_test_mode', 'print_sub_graph_dir'
|
|
|
|
'reader_queue_speed_test_mode', 'print_sub_graph_dir'
|
|
|
|
]
|
|
|
|
]
|
|
|
|
|
|
|
|
if 'Darwin' not in sysstr:
|
|
|
|
|
|
|
|
read_env_flags.append('use_pinned_memory')
|
|
|
|
|
|
|
|
|
|
|
|
if os.name != 'nt':
|
|
|
|
if os.name != 'nt':
|
|
|
|
read_env_flags.append('warpctc_dir')
|
|
|
|
read_env_flags.append('warpctc_dir')
|
|
|
|
read_env_flags.append('cpu_deterministic')
|
|
|
|
read_env_flags.append('cpu_deterministic')
|
|
|
|