Skip to content

Commit

Permalink
refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
ImmanuelSegol committed Feb 29, 2024
1 parent cbeefcb commit 9487cf8
Showing 1 changed file with 0 additions and 17 deletions.
17 changes: 0 additions & 17 deletions docs/docs/icicle/rust-bindings/vec-ops.md
Original file line number Diff line number Diff line change
Expand Up @@ -155,20 +155,3 @@ pub trait VecOps<F> {
- **`add`**: Computes the element-wise sum of two vectors.
- **`sub`**: Computes the element-wise difference between two vectors.
- **`mul`**: Performs element-wise multiplication of two vectors.

### Argument Validation

Before invoking any of the above vector operations, we always call `check_vec_ops_args`, to make sure that inputs `a` and `b` can be operated on with and that the results pointer can contain the result:

```rust
fn check_vec_ops_args<F>(a: &HostOrDeviceSlice<F>, b: &HostOrDeviceSlice<F>, result: &mut HostOrDeviceSlice<F>) {
if a.len() != b.len() || a.len() != result.len() {
panic!(
"left, right and output lengths {}; {}; {} do not match",
a.len(),
b.len(),
result.len()
);
}
}
```

0 comments on commit 9487cf8

Please sign in to comment.