tvm-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <...@apache.org>
Subject [GitHub] [incubator-tvm] jroesch commented on pull request #5830: Rust Refactor Stage 4: Rewrite Rust graph runtime to use new APIs
Date Tue, 23 Jun 2020 00:21:20 GMT

jroesch commented on pull request #5830:
URL: https://github.com/apache/incubator-tvm/pull/5830#issuecomment-647833753


   > @jroesch Can we enable derive_default for bindgen? Otherwise, test_wasm32 fails with
tvm-sys because of the generated padding field.
   > 
   > The following change looks necessary which existed in the previous implementation.
   > 
   > ```diff
   > diff --git a/rust/tvm-graph-rt/src/array.rs b/rust/tvm-graph-rt/src/array.rs
   > index 38519bd..8209b59 100644
   > --- a/rust/tvm-graph-rt/src/array.rs
   > +++ b/rust/tvm-graph-rt/src/array.rs
   > @@ -288,6 +288,7 @@ impl<'a> Tensor<'a> {
   >                  self.strides.as_ref().unwrap().as_ptr()
   >              } as *mut i64,
   >              byte_offset: 0,
   > +            ..Default::default()
   >          }
   >      }
   >  }
   > diff --git a/rust/tvm-sys/build.rs b/rust/tvm-sys/build.rs
   > index 85e16be..01d2934 100644
   > --- a/rust/tvm-sys/build.rs
   > +++ b/rust/tvm-sys/build.rs
   > @@ -54,6 +54,7 @@ fn main() {
   >          .layout_tests(false)
   >          .derive_partialeq(true)
   >          .derive_eq(true)
   > +        .derive_default(true)
   >          .generate()
   >          .expect("unable to generate bindings")
   >          .write_to_file(PathBuf::from("src/c_runtime_api.rs"))
   > diff --git a/rust/tvm-sys/src/array.rs b/rust/tvm-sys/src/array.rs
   > index 1627e9e..5d09d86 100644
   > --- a/rust/tvm-sys/src/array.rs
   > +++ b/rust/tvm-sys/src/array.rs
   > @@ -48,6 +48,7 @@ macro_rules! impl_dltensor_from_ndarray {
   >                      shape: arr.shape().as_ptr() as *const i64 as *mut i64,
   >                      strides: arr.strides().as_ptr() as *const i64 as *mut i64,
   >                      byte_offset: 0,
   > +                    ..Default::default()
   >                  }
   >              }
   >          }
   > ```
   
   Yeah I will turn it back on, there are just so many changes to juggle I was bound to make
a mistake or two.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



Mime
View raw message