@@ -66,23 +66,24 @@ def get_user_config(flags_d: str, flags_nstreams: str, flags_nthreads: int)-> Di
66
66
if device == 'CPU' : # CPU supports a few special performance-oriented keys
67
67
# limit threading for CPU portion of inference
68
68
if flags_nthreads :
69
- config [device ][ 'CPU_THREADS_NUM' ] = str (flags_nthreads )
69
+ config ['CPU_THREADS_NUM' ] = str (flags_nthreads )
70
70
71
- config [device ][ 'ENABLE_CPU_PINNING' ] = 'NO'
71
+ config ['ENABLE_CPU_PINNING' ] = 'NO'
72
72
if "CPU_THROUGHPUT_STREAMS" in supported_properties :
73
73
# for CPU execution, more throughput-oriented execution via streams
74
- config [device ][ 'CPU_THROUGHPUT_STREAMS' ] = str (device_nstreams .get (device , 'CPU_THROUGHPUT_AUTO' ))
74
+ config ['CPU_THROUGHPUT_STREAMS' ] = str (device_nstreams .get (device , 'CPU_THROUGHPUT_AUTO' ))
75
75
else :
76
- config [device ][ "NUM_STREAMS" ] = str (device_nstreams .get (device , - 1 ))
76
+ config ["NUM_STREAMS" ] = str (device_nstreams .get (device , - 1 ))
77
77
elif device == 'GPU' :
78
78
if "GPU_THROUGHPUT_STREAMS" in supported_properties :
79
- config [device ][ 'GPU_THROUGHPUT_STREAMS' ] = str (device_nstreams .get (device , 'GPU_THROUGHPUT_AUTO' ))
79
+ config ['GPU_THROUGHPUT_STREAMS' ] = str (device_nstreams .get (device , 'GPU_THROUGHPUT_AUTO' ))
80
80
else :
81
- config [device ][ "NUM_STREAMS" ] = str (device_nstreams .get (device , - 1 ))
82
- if 'MULTI' in flags_d and 'CPU' in devices :
81
+ config ["NUM_STREAMS" ] = str (device_nstreams .get (device , - 1 ))
82
+ if ( 'MULTI' in flags_d or 'HETERO' in flags_d ) and 'CPU' in devices :
83
83
# multi-device execution with the CPU + GPU performs best with GPU throttling hint,
84
84
# which releases another CPU thread (that is otherwise used by the GPU driver for active polling)
85
- config [device ]['GPU_PLUGIN_THROTTLE' ] = '1'
85
+ config ['GPU_PLUGIN_THROTTLE' ] = '1'
86
+
86
87
return config
87
88
88
89
0 commit comments