I implemented a type inference algorithm and ran into some difficulty trying to figure out how to define interfaces outside of the ::mlir parent namespace. I spent some cursory time trying to decide if I was just holding it wrong and thought I’d ask before digging in deeper.
Here are my interfaces:
- Example where I implement the op interface
- Example where I implement the type interface
When I just had a type interface (thanks @River707 – it works beautifully), I could put it in whatever wrapping namespace I wanted and make sure that in the C++ type declaration, I just referenced the right fully qualified name.
However, when I added an op interface and attempted to use it from Tablegen, it blew up in every combination I tried (except for putting it in the outer ::mlir namespace). I couldn’t find a combination of interface
cppClassName that both compiled properly and could be referenced from an
DeclareOpInterfaceMethods template (one or the other was always doing something illegal with a fully-qualified class name).
Am I in uncharted territory here, or has someone managed to make this work?