@@ -135,23 +135,24 @@ USMAllocatorConfig::USMAllocatorConfig() {
135
135
136
136
bool More = ParamParser (Params, Configs[LM].MaxPoolableSize , ParamWasSet);
137
137
if (ParamWasSet && M == MemType::All) {
138
- Configs[MemType::Shared]. MaxPoolableSize =
139
- Configs[MemType::Device ].MaxPoolableSize =
140
- Configs[MemType::Host]. MaxPoolableSize ;
138
+ for ( auto &Config : Configs) {
139
+ Config. MaxPoolableSize = Configs[LM ].MaxPoolableSize ;
140
+ }
141
141
}
142
142
if (More) {
143
143
More = ParamParser (Params, Configs[LM].Capacity , ParamWasSet);
144
144
if (ParamWasSet && M == MemType::All) {
145
- Configs[MemType::Shared].Capacity = Configs[MemType::Device].Capacity =
146
- Configs[MemType::Host].Capacity ;
145
+ for (auto &Config : Configs) {
146
+ Config.Capacity = Configs[LM].Capacity ;
147
+ }
147
148
}
148
149
}
149
150
if (More) {
150
151
ParamParser (Params, Configs[LM].SlabMinSize , ParamWasSet);
151
152
if (ParamWasSet && M == MemType::All) {
152
- Configs[MemType::Shared]. SlabMinSize =
153
- Configs[MemType::Device ].SlabMinSize =
154
- Configs[MemType::Host]. SlabMinSize ;
153
+ for ( auto &Config : Configs) {
154
+ Config. SlabMinSize = Configs[LM ].SlabMinSize ;
155
+ }
155
156
}
156
157
}
157
158
};
@@ -225,14 +226,10 @@ USMAllocatorConfig::USMAllocatorConfig() {
225
226
PoolTrace = std::atoi (PoolTraceVal);
226
227
}
227
228
228
- Configs[MemType::SharedReadOnly].limits = limits;
229
- Configs[MemType::Shared].limits = limits;
230
- Configs[MemType::Device].limits = limits;
231
- Configs[MemType::Host].limits = limits;
232
-
233
- Configs[MemType::Shared].PoolTrace = Configs[MemType::Device].PoolTrace =
234
- Configs[MemType::Host].PoolTrace =
235
- Configs[MemType::SharedReadOnly].PoolTrace = PoolTrace;
229
+ for (auto &Config : Configs) {
230
+ Config.limits = limits;
231
+ Config.PoolTrace = PoolTrace;
232
+ }
236
233
237
234
if (PoolTrace < 1 )
238
235
return ;
0 commit comments