Skip to content

Use autocxx bindings for NetworkDefinition, CudaEngine, EngineInspector#16

Closed
theHamsta wants to merge 39 commits intorustnn:mainfrom
theHamsta:network-pin
Closed

Use autocxx bindings for NetworkDefinition, CudaEngine, EngineInspector#16
theHamsta wants to merge 39 commits intorustnn:mainfrom
theHamsta:network-pin

Conversation

@theHamsta
Copy link
Contributor

@theHamsta theHamsta commented Feb 19, 2026

As with #15 , try to use more generated bindings from autocxx. I would recommend to merged #15 first, since same approach but smaller.

Specifically, expose all methods of CudaEngine, and add EngineInspector.

IRuntime, IBuilder are still with the old logic, and should be tackled next.

@theHamsta theHamsta marked this pull request as draft February 19, 2026 13:15
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
#[repr(i32)]
pub enum LayerTypeKind {
Convolution = 0,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we extract those constants automatically through autocxx?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, the project kind of stalled. They do not expose the capability to automatically derive Debug, also autocxx does not support the parse hooks in their fork of bindgen.

The most straight forward way would be to add a proc_macro to add Debug to the autocxx types (It would go through the token tree generated by autocxx and add derivce(Debug) where autocxx already has derivce(Eq,PartialEq, Copy, Clone) for generate_pod.

Or fork autocxx. I would try to make this work for all enums. I put this manual enum here as a placeholder

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I understand. Crubit seems to be the new Vehicle by the devs and it not designed to be used outside of the google monoproject ecosystem yet.

#[derive(Debug, Clone, Copy, PartialEq, Eq)]
#[repr(i32)]
pub enum LayerTypeKind {
Convolution = 0,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I understand. Crubit seems to be the new Vehicle by the devs and it not designed to be used outside of the google monoproject ecosystem yet.

@theHamsta theHamsta force-pushed the network-pin branch 3 times, most recently from 420b143 to 2f3a9cc Compare February 27, 2026 20:25
Everything is real now
It's not additive to mock and can't really be relied on. Real
should just be the absence of mock.
@theHamsta
Copy link
Contributor Author

Superseeded by #28

@theHamsta theHamsta closed this Mar 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants