@@ -190,12 +190,15 @@ void DeviceAgentVector_impl::_insert(size_type pos, size_type count) {
190
190
h_ptr[i] = cuda_agent.nextID ();
191
191
}
192
192
}
193
- _changedAfter (ID_VARIABLE_NAME, pos);
194
193
} else {
195
194
THROW exception::InvalidOperation (" Internal agent ID variable was not found, "
196
195
" in DeviceAgentVector_impl._insert()." );
197
196
}
198
197
}
198
+ // Update change detail for all variables
199
+ for (const auto & [v, _] : agent->variables ) {
200
+ _changedAfter (v, pos);
201
+ }
199
202
// No unbound buffers, return
200
203
if (unbound_buffers.empty ())
201
204
return ;
@@ -239,19 +242,6 @@ void DeviceAgentVector_impl::_insert(size_type pos, size_type count) {
239
242
if (unbound_host_buffer_size != _size) {
240
243
THROW exception::InvalidOperation (" Unbound buffers have gone out of sync, in DeviceAgentVector::_insert().\n " );
241
244
}
242
- // Update change detail for all variables
243
- for (const auto & v : agent->variables ) {
244
- // Does it exist in change map
245
- auto change = change_detail.find (v.first );
246
- if (change == change_detail.end ()) {
247
- change_detail.emplace (v.first , std::pair<size_type, size_type>{pos, _size});
248
- } else {
249
- // Inclusive min bound
250
- change->second .first = change->second .first > pos ? pos : change->second .first ;
251
- // Exclusive max bound
252
- change->second .second = _size;
253
- }
254
- }
255
245
}
256
246
void DeviceAgentVector_impl::_erase (size_type pos, size_type count) {
257
247
// No unbound buffers, return
0 commit comments