Skip to content

Commit 0e28d38

Browse files
committed
[SYCL] usm_allocator: set properties for pools of
all memory types when MemType::All is specified. Previously, SharedReadyOnly was not updated in MemParser.
1 parent e992d32 commit 0e28d38

File tree

1 file changed

+13
-16
lines changed

1 file changed

+13
-16
lines changed

sycl/plugins/unified_runtime/ur/usm_allocator_config.cpp

Lines changed: 13 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -135,23 +135,24 @@ USMAllocatorConfig::USMAllocatorConfig() {
135135

136136
bool More = ParamParser(Params, Configs[LM].MaxPoolableSize, ParamWasSet);
137137
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+
}
141141
}
142142
if (More) {
143143
More = ParamParser(Params, Configs[LM].Capacity, ParamWasSet);
144144
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+
}
147148
}
148149
}
149150
if (More) {
150151
ParamParser(Params, Configs[LM].SlabMinSize, ParamWasSet);
151152
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+
}
155156
}
156157
}
157158
};
@@ -225,14 +226,10 @@ USMAllocatorConfig::USMAllocatorConfig() {
225226
PoolTrace = std::atoi(PoolTraceVal);
226227
}
227228

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+
}
236233

237234
if (PoolTrace < 1)
238235
return;

0 commit comments

Comments
 (0)