core-framework icon indicating copy to clipboard operation
core-framework copied to clipboard

C++ Device_impl::updateUsageState() should be virtual

Open jirwin-geon opened this issue 6 years ago • 0 comments

Generated C++ devices have an updateUsageState() method that is meant to be called after an allocation or deallocation. The default Device_impl::updateUsageState() is not declared as virtual (Device_impl.h#149), so allocateCapacity() and deallocateCapacity() only call the empty base version, not the derived class implementation. As a result, custom non-FEI devices have to either override allocateCapacity() and deallocateCapacity() or otherwise change the device state.

This does not affect C++ FEI devices, which have a different, non-empty (and virtual) updateUsageState().

jirwin-geon avatar Nov 26 '19 22:11 jirwin-geon