File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -176,6 +176,24 @@ Ort::SessionOptions GetSessionOptionsImpl(
176176 config.erase (" ProfilingFilePrefix" );
177177 }
178178
179+ if (config.find (" EnableMemPattern" ) != config.end ()) {
180+ int32_t enable_mem_pattern =
181+ ToIntOrDefault (config[" EnableMemPattern" ], 1 );
182+ if (enable_mem_pattern == 0 ) {
183+ sess_opts.DisableMemPattern ();
184+ }
185+ config.erase (" EnableMemPattern" );
186+ }
187+
188+ if (config.find (" EnableCpuMemArena" ) != config.end ()) {
189+ int32_t enable_cpu_mem_arena =
190+ ToIntOrDefault (config[" EnableCpuMemArena" ], 1 );
191+ if (enable_cpu_mem_arena == 0 ) {
192+ sess_opts.DisableCpuMemArena ();
193+ }
194+ config.erase (" EnableCpuMemArena" );
195+ }
196+
179197 // If you want to speed up initialization, please uncomment the following line
180198 // sess_opts.SetGraphOptimizationLevel(GraphOptimizationLevel::ORT_DISABLE_ALL);
181199
You can’t perform that action at this time.
0 commit comments