Skip to content
Snippets Groups Projects

Safe rust interface

Merged Aaron Councilman requested to merge safe-rust-interface into main

Resolves #19 (closed).

What's done so far:

  • Implemented a thread-safe HerculesImmBox which provides a standard interface for creating inputs to Hercules functions and handling their outputs in a safe manner.
  • Using HerculesImmBox in cava and edge detection, which significantly cleaned up the code
  • Implemented a HerculesMutBox which provides a standard interface but for mutable references. Not actually sure whether this is ever needed.

ToDo:

  • I think we should generate a safer function for the runner which accepts as inputs HerculesImmBux/HerculesMutBox and returns the same, since these boxes are typed and so it improves type-safety (it also removes most the remaining weirdness of the interface, specifically the .to())

Merge request reports

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
  • added 1 commit

    Compare with previous version

  • rarbore2 added 12 commits

    added 12 commits

    Compare with previous version

  • rarbore2 added 1 commit

    added 1 commit

    • 27ce61d0 - Clarifying comment regarding run() lifetimes

    Compare with previous version

  • rarbore2
  • rarbore2 added 5 commits

    added 5 commits

    Compare with previous version

  • rarbore2 added 1 commit

    added 1 commit

    • 3b1f9e24 - Be more precise about lifetimes in RT backend

    Compare with previous version

  • rarbore2 added 1 commit

    added 1 commit

    • d78c63c3 - edge detection no longer needs longer than lifetime annotations

    Compare with previous version

  • rarbore2 added 1 commit

    added 1 commit

    • 3d6432d7 - edge detection no longer needs longer than lifetime annotations

    Compare with previous version

  • rarbore2 resolved all threads

    resolved all threads

  • So, I'm actually going to merge this in without auto-generating an interface in the RT backend. This is because HerculesBox currently only works for arrays of primitives - it doesn't support Hercules product or summation types. So, we can't auto-generate a safe interface using HerculesBox for all possible Hercules functions. That being said, the safe_run used in cava and edge detection is pretty easy to write, so I think this is fine (since we've addressed the main problem of needing device specific code in cava and edge detection)?

    Edited by rarbore2
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Please register or sign in to reply
    Loading