Skip to content

Commit

Permalink
rust - iterate over qf input/output size exactly
Browse files Browse the repository at this point in the history
  • Loading branch information
jeremylt committed Feb 10, 2024
1 parent 31b0218 commit 58f118f
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions rust/libceed/src/qfunction.rs
Original file line number Diff line number Diff line change
Expand Up @@ -541,6 +541,7 @@ unsafe extern "C" fn trampoline(
let mut inputs_array: [&[crate::Scalar]; MAX_QFUNCTION_FIELDS] = [&[0.0]; MAX_QFUNCTION_FIELDS];
inputs_slice
.iter()
.take(trampoline_data.number_inputs)
.enumerate()
.map(|(i, &x)| {
std::slice::from_raw_parts(x, trampoline_data.input_sizes[i] * q as usize)
Expand All @@ -556,6 +557,7 @@ unsafe extern "C" fn trampoline(
mut_max_fields!(&mut [0.0]);
outputs_slice
.iter()
.take(trampoline_data.number_outputs)
.enumerate()
.map(|(i, &x)| {
std::slice::from_raw_parts_mut(x, trampoline_data.output_sizes[i] * q as usize)
Expand Down

0 comments on commit 58f118f

Please sign in to comment.