Skip to content

Use const pointers in APIs where appropriate #14

@newling

Description

@newling

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions