You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In an iree project we are using functions like XAie_DmaGetMaxQueueSize in a C++ class for modeling AIE devices. The class stores a XAie_DevInst * as a class member which is used in class getter 'methods' to, for example, get the maximum queue size. The should ideally be const member functions.
As the functions in xaie_dma.h do not ever take const pointers as arguments, we have a problem: we either have to make our class getters non-const, or use a C++ const_cast under the hood before calling the aie-rt API. We don't like either of these options -- the first means we have to pass the model class by non-const reference even though it is never mutated, and the second means that we implicitly rely on aie_rt not to change the value pointed to.
So request: use const correctness where possible. I'll make a PR demonstrating this soon
The text was updated successfully, but these errors were encountered:
In an iree project we are using functions like XAie_DmaGetMaxQueueSize in a C++ class for modeling AIE devices. The class stores a
XAie_DevInst *
as a class member which is used in class getter 'methods' to, for example, get the maximum queue size. The should ideally be const member functions.As the functions in xaie_dma.h do not ever take const pointers as arguments, we have a problem: we either have to make our class getters non-const, or use a C++ const_cast under the hood before calling the aie-rt API. We don't like either of these options -- the first means we have to pass the model class by non-const reference even though it is never mutated, and the second means that we implicitly rely on aie_rt not to change the value pointed to.
So request: use const correctness where possible. I'll make a PR demonstrating this soon
The text was updated successfully, but these errors were encountered: