Crates.io | xrt |
lib.rs | xrt |
version | 0.3.0 |
source | src |
created_at | 2024-06-13 15:06:48.746884 |
updated_at | 2024-06-22 09:35:17.270062 |
description | Wrapper for the Xilinx Runtime Library (XRT) |
homepage | |
repository | https://github.com/papeg/xrt-rs |
max_upload_size | |
id | 1270737 |
size | 477,845 |
xrt-rs provides a wrapper around the C-API of the Xilinx Runtime (XRT) used for communication between AMD FPGAs / AI Engines and their host. The library offers a thin wrapper (called native), that simply translates the C API into safe Rust, as well as a more abstract layer (called simple), that automatically takes care of the details to provide an easier to use interface for simpler applications. The intermediate goal is to read the xclbin file at compile time to leverage rust type checking for using the API.
To install simply add this repository or crate as a dependency to your Cargo.toml
.
In case linking fails, add the XRT libs to your library path:
export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:/opt/xilinx/xrt/lib"
or
export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$XILINX_XRT"
The native API can be used from xrt::native::*
. There is a wrapper for all the relevant objects: Device, Kernel, Run, Buffer. The simpler API can be used from xrt::managed::*
. Take a look at the tests to get an example how to use it.
Currently the tests can not be run in parallel.
If you want to run them in software emulation, you need to set the regular env flag.
XCL_EMULATION_MODE=sw_emu cargo test -- --test-threads=1