Conversation
c3f7888 to
3586dd0
Compare
|
|
||
| pub mod raw { | ||
| // 1. pull in the bindgen output that build.rs dropped in OUT_DIR | ||
| include!(concat!(env!("OUT_DIR"), "/common.rs")); |
There was a problem hiding this comment.
what does the common.rs looks like? with this, can we read, encode, or parse these data in between CPU/GPU more smoothly?
fyi, in current code, we do
read data from GPU as Vec<u32>:
gpu-acceleration/mopro-msm/src/msm/metal_msm/metal_msm.rs
Lines 505 to 507 in d0320d5
encoding data in CPU:
gpu-acceleration/mopro-msm/src/msm/metal_msm/metal_msm.rs
Lines 448 to 455 in d0320d5
parse Vec to bigint or ec types:
gpu-acceleration/mopro-msm/src/msm/metal_msm/metal_msm.rs
Lines 224 to 241 in d0320d5
|
The goal of this PR was to test the boundaries of c++<-> metal interoperability. In short the conclusion if the following: sharing header files is the best that we can get so far, no implementation can be shared between gpu and cpu as for the time being by the compiler. I pretty much sure that this goal can be achieved by a third party tools though, but this topic is out of the box of this research. Why goal matters:
|
This is POC of sharing data structs across Rust and Metal codebase.
Such sharing allows 1on1 mapping of data from CPU side to Metal side through both of them have exact same layout and alignment (bc of they're the very same structs after all).
Moving all but final msm shaders to C++ implementation allows:
clangd.cargo testpipeline.PS: this PR isn't supposed to be ever merged.